sort out the length details.

This commit is contained in:
Mariano Alvira 2010-03-07 18:48:47 -05:00
parent fb922c0ab9
commit d3f6ef07f2
3 changed files with 9 additions and 7 deletions

View file

@ -1,22 +1,23 @@
#ifndef PACKET_H
#define PACKET_H
#ifndef MAX_PACKET_SIZE
#define MAX_PACKET_SIZE 127
/* does not include 2 byte FCS checksum */
#ifndef MAX_PAYLOAD_SIZE
#define MAX_PAYLOAD_SIZE 125
#endif
typedef uint16_t short_addr_t;
struct packet {
short_addr_t addr;
uint8_t length;
uint8_t length; /* does not include FCS checksum */
volatile struct packet * left;
volatile struct packet * right;
/* offset into data for first byte of the packet payload */
/* On TX this should be 0 */
/* On RX this should be 1 since the maca puts the length as the first byte*/
uint8_t offset;
uint8_t data[MAX_PACKET_SIZE+1]; /* + 1 since maca returns the length as the first byte */
uint8_t data[MAX_PAYLOAD_SIZE+2+1]; /* +2 for FCS; + 1 since maca returns the length as the first byte */
};
typedef struct packet packet_t;