nes-proj/lib/include/packet.h

25 lines
678 B
C
Raw Normal View History

2010-03-05 11:59:51 +00:00
#ifndef PACKET_H
#define PACKET_H
2010-03-07 23:48:47 +00:00
/* does not include 2 byte FCS checksum */
#ifndef MAX_PAYLOAD_SIZE
#define MAX_PAYLOAD_SIZE 125
2010-03-05 11:59:51 +00:00
#endif
typedef uint16_t short_addr_t;
struct packet {
short_addr_t addr;
2010-03-07 23:48:47 +00:00
uint8_t length; /* does not include FCS checksum */
2010-03-05 11:59:51 +00:00
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;
2010-03-07 23:48:47 +00:00
uint8_t data[MAX_PAYLOAD_SIZE+2+1]; /* +2 for FCS; + 1 since maca returns the length as the first byte */
2010-03-05 11:59:51 +00:00
};
typedef struct packet packet_t;
#endif