packet_api
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
packet_api [2014/01/01 12:37] – external edit 127.0.0.1 | packet_api [2014/07/31 11:18] (current) – [Set message data] breaker27 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Introduction ====== | ====== Introduction ====== | ||
- | The packet and message format is defined in an XML file. Header files with access functions are generated from it. If you write or change a device firmware, use solely these functions to create and interpret the packet data easily. | + | The packet and message format is defined in an XML file. Header files with access functions are generated from it and stored under the " |
Please read about the [[http:// | Please read about the [[http:// | ||
Line 62: | Line 62: | ||
'' | '' | ||
'' | '' | ||
- | '' | + | '' |
These functions are independent on the message type. | These functions are independent on the message type. | ||
Line 91: | Line 91: | ||
Use the packet length (multiple of 16) you get from the rfm12 function. If it is ok, the packet content can assumed to be valid. | Use the packet length (multiple of 16) you get from the rfm12 function. If it is ok, the packet content can assumed to be valid. | ||
+ | |||
+ | ===== Adjust header offset ===== | ||
+ | |||
+ | Before accessing packet data, call the function to adjust the (internal) header offset depending on the MessageType. The data can't be decoded correctly otherwise. | ||
+ | |||
+ | '' | ||
===== Read header ===== | ===== Read header ===== | ||
Line 96: | Line 102: | ||
'' | '' | ||
- | uint32_t packetcounter = pkg_header_get_packetcounter();'' | + | uint32_t packetcounter = pkg_header_get_packetcounter();\\ |
+ | MessageTypeEnum messagetype = pkg_header_get_messagetype();'' | ||
===== Read header extension ===== | ===== Read header extension ===== | ||
packet_api.1388576240.txt.gz · Last modified: 2014/01/01 12:43 (external edit)