Hello;

As part of my work with TinyOS and a TelosB board, I am looking to implement
the AFDX protocol (mainly used in aviation communications).  I have defined
and structured the packet and was hoping I could get some possible pointers
or tips.  I haven't really got down to coding the actual TinyOS application
or implementation yet, but I have started with my AFDXProtocol.h file which
will define the various structures embedded in my packet.  I was wondering
if someone could take a look at my "AFDXMessage" struct and let me know if I
am on the right track.  Also, my question is exactly how a packet like this
would be transferred.  Would the AFDXMessage struct be cast as a message_t
as a whole, or will we only be transmitting the data payload?  Thanks for
the help guys.

/**
 * Header file for the AFDX Protocol under TinyOS
 *
 * @Author Paimon Sorornejad, 2/9/2011
 * @Version 1.0.0
 */

typedef nx_struct preamble{
  uint8_t value;  // 7 preamble + 1 version
} preamble;

typedef nx_struct macDest{
  static const uint32_t start = 0x03000000;
  uint16_t VLI;
} macDest;

typedef nx_struct macSource{
  static const uint16_t constField = 0x0200;
  static const uint8_t  networkStart = 0x00;
  uint8_t networkId;
  uint8_t equipmentId;
  uint8_t interfaceId;
} macSource;

typedef nx_struct macHeader{
  macDest   dest;
  macSource source;
} macHeader;

typedef nx_struct ipSource{
  static const uint8_t = 00001010;
  uint8_t networkid;
  uint8_t equipmentid;
  uint8_t partitionid;
} ipSource;

typedef nx_struct ipDestination{
  uint16_t start = 0xE0C0;
  uint16_t int VLI;
} ipDestination;

typedef nx_struct ipHeader{
  uint8_t  ip_version;
  uint8_t  ip_tos;
  uint16_t ip_len;
  uint16_t ip_id;
  uint16_t ip_off;
  uint8_t  ip_ttl;
  uint8_t  ip_proto;
  uint16_t ip_sum;
  ipSource      ip_src;
  ipDestination ip_dst;
} ipheader;

typedef nx_struct udpHeader{
  uint16_t source;
  uint16_t dest;
  uint16_t udplen;
  uint16_t udpchk;
} udpHeader;

typedef nx_struct sequence{
  uint8_t value;  // 8 bit (1byte)
} sequence;

typedef nx_struct fcs{
  uint32_t value;  // 32 bit (4byte)
} fcs;

typedef nx_struct AFDXMessage {
  preamble  pre;
  macHeader mac;
  ipHeader  ip;
  udpHeader udp;
  uint8_t   data[TOSH_DATA_LENGTH]
  sequence  seq;
  fcs       fc;
} AFDXMessage;


Paimon Sorornejad
Email: [email protected] | Cell: 781-205-9876
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to