10 #define START_DELIMITER 0x7E
38 if ( ! cmd )
return 0;
60 for (k = 0; k < 128; k++) temp[k] = rawPacket[k];
62 cmd->
cmd = rawPacket[15];
65 for ( i = 16; i < 15 + cmd->
data_length - 12; i++ ) {
66 cmd->
data[j++] = rawPacket[
i];
75 char packetLength = rawPacket[i++];
77 char packetChecksum = 0;
79 for (i = 3; i < packetLength + 3; i++){
80 checksum += rawPacket[
i];
82 packetChecksum = 0xFF - rawPacket[
i];
83 if (checksum == packetChecksum){
110 unsigned char data = U2RXREG;
List of defines required for XBEE communication and telemetry.
char rawPackets[RAW_PACKET_BUFFER_SIZE][128]
#define RAW_PACKET_BUFFER_SIZE
Settings for UART2 communication used for telemetry link.
unsigned char data_length
#define INBOUND_QUEUE_SIZE
int checkPacket(char *rawPacket)
void __attribute__((__interrupt__, no_auto_psv))
struct command * popCommand()
struct command * inBuffer[INBOUND_QUEUE_SIZE]
void destroyCommand(struct command *cmd)
static int payloadLength[RAW_PACKET_BUFFER_SIZE]
int pushCommand(struct command *cmd)
PacketStatus rawPacketStatus[RAW_PACKET_BUFFER_SIZE]
#define START_DELIMITER
net_inbound.c
struct command * createCommand(char *rawPacket)
void inboundBufferMaintenance(void)