irmc/src/cwprotocol.h

42 lines
1.1 KiB
C
Raw Normal View History

2015-01-04 14:29:26 +00:00
#define INTERFACE_VERSION "irmc v0.02"
2015-01-04 14:02:03 +00:00
// Structures for the packets: unsigned short command
#define DIS 0x0002 // disconnect
#define DAT 0x0003
#define CON 0x0004 // connect
#define ACK 0x0005
// This structure will be used to (dis-)connect to KOB servers
struct command_packet_format{
unsigned short command; // CON / DIS
unsigned short channel; // Channel number
};
#define SIZE_COMMAND_PACKET 4
// This structure will be used for id, rx and tx packets
2015-01-04 14:26:52 +00:00
#define SIZE_ID 128
#define SIZE_STATUS 128
2015-01-04 14:02:03 +00:00
struct data_packet_format{
unsigned short command;
unsigned short length;
2015-01-04 14:26:52 +00:00
char id[SIZE_ID];
2015-01-04 14:02:03 +00:00
char a1[4];
unsigned int sequence;
unsigned int a21;
unsigned int a22;
unsigned int a23;
signed int code[51];
unsigned int n;
2015-01-04 14:26:52 +00:00
char status[SIZE_STATUS]; /* This is called version in MorseKob */
2015-01-04 14:02:03 +00:00
char a4[8];
};
#define SIZE_DATA_PACKET 496
2015-01-04 14:26:52 +00:00
#define SIZE_DATA_PACKET_PAYLOAD 492 // = SIZE_DATA_PACKET - SIZE_COMMAND_PACKET
2015-01-04 14:02:03 +00:00
// Define the packets used
#define DEFAULT_CHANNEL 103
2015-01-04 14:26:52 +00:00
int prepare_id (struct data_packet_format *id_packet, char *id);
int prepare_tx (struct data_packet_format *tx_packet, char *id);