+/*----------------- RadioPacket -----------------*/
+
+ async command uint8_t RadioPacket.headerLength(message_t* msg)
+ {
+ return call Config.headerLength(msg) + sizeof(rf230_header_t);
+ }
+
+ async command uint8_t RadioPacket.payloadLength(message_t* msg)
+ {
+ return getHeader(msg)->length - 2;
+ }
+
+ async command void RadioPacket.setPayloadLength(message_t* msg, uint8_t length)
+ {
+ ASSERT( 1 <= length && length <= 125 );
+ ASSERT( call RadioPacket.headerLength(msg) + length + call RadioPacket.metadataLength(msg) <= sizeof(message_t) );
+
+ // we add the length of the CRC, which is automatically generated
+ getHeader(msg)->length = length + 2;
+ }