[ Pobierz całość w formacie PDF ]
End devices and routers send messages to the coordinator using the following
format.
Table 14-1. WSNDemo message format.
Field name Length Description
Message type 1 byte Type of the messages. Must be 0x01 (0x01 is the only
supported message type for the current revision of
WSNDemo)
Node type 1 byte Type of the sending node:
0 coordinator
1 router
2 end device
IEEE address 8 bytes IEEE address of the sending node
Short address 2 bytes Short address of the sending node
Version 4 bytes Version of the WSNDemo application protocol used by
the sending node. Currently set to 0x01010100
Channel mask 4 bytes Channel mask set on the sending node
PANID 2 bytes PAN ID of the network to which the sending node is
attached
Channel 1 byte The channel on which the sending node operates
Parent address 2 bytes Short address of the parent node
LQI 1 byte LQI observed by the node that sends this message
RSSI 1 byte RSSI observed by the node that sends this message
Optional additional fields; see description in Section
14.2, below
14.2 Additional fields
The message may contain zero, one, or more additional fields that follow the
mandatory fixed-width fields described in Table 14-1. The order of the additional fields
is not fixed. The size of the additional fields may vary each field contains a sub-field
defining its size. Below is the description of the general format of an additional field.
65
8200K-AVR-05/11
Table 14-2. Additional field format.
Sub-field name Length Description
Field type 1 byte Type of the additional field. The possible values are
listed below
Field size 1 byte Size of the field data in bytes. Note: this size does not
include the field type and field size sub-fields
Field data The data depend on the field type, the size of the data
is provided by the field size
The following types of additional fields are defined:
Table 14-3. Additional field types.
Field type Description
0x01 Sensor data for board type 1. Used for Atmel ATAVRRZRAVEN kit
boards and MeshBean boards
0x20 Node name
Please note that in the current version of WSNDemo, devices send additional fields of
type 0x01 (sensor readings for boards of type 1) only. Unrecognized additional fields
are discarded by the WSNMonitor application. The field data format for different field
types are described in Table 14-4 and Table 14-5.
Table 14-4. Field data for type 0x01: Sensor data for boards of type 1.
Offset Length Data type Description
0 4 bytes Unsigned int Battery status reading
4 4 bytes Unsigned int Temperature sensor reading
8 4 bytes Unsigned int Light sensor reading
Table 14-5. Field data for type 0x20: Node name.
Offset Length Description
0 Zero-terminated ASCII string
66
Atmel AVR2052
8200K-AVR-05/11
Atmel AVR2052
15 Appendix B-2: Serial protocol
This appendix describes the protocol and message format used over the serial
connection between the network coordinator and the WSNMonitor application running
on the PC. The messages sent on the serial connection are basically the messages
wrapped as defined below:
Table 15-1. Serial message format.
Offset Length Description
0 2 bytes Start sequence: 0x10 0x02
2 N bytes Variable-length payload: the message received from the
end device or router, or generated by the coordinator, in
the format described in Section 14.1.
All 0x10 bytes in this payload are duplicated to avoid
confusion with a start sequence or end sequence
N+2 2 bytes End sequence: 0x10 0x03
N+4 1 byte Checksum: Sum of the bytes [0..N+3] mod 256
67
8200K-AVR-05/11
16 References
[1] BitCloud Stack API Reference
[2] AVR2050: BitCloud Developer s Guide
[3] AVR Studio User Guide. Available in HTML Help within the product
[4] WinAVR User Manual 20100110
[5] Using the GNU Compiler Collection
[6] AVR2015: RZRAVEN Quick Start Guide
http://www.atmel.com/dyn/resources/prod_documents/doc8120.pdf
[8] AT91 USB CDC Driver Implementation
http://www.atmel.com/dyn/resources/prod_documents/doc6269.pdf
[9] ZigBit Development Kit User s Guide
http://www.meshnetics.com/downloads/docs/
[10] AVR205X: SerialNet User Guide. Available in BitCloud SDK
http://www.atmel.com/bitcloud/
[11] AVR2054: Serial Bootloader User Guide. Available in BitCloud SDK
http://www.atmel.com/bitcloud/
[12] Java Runtime Environment
http://java.sun.com/javase/downloads/index.jsp
[13] IAR Embedded Workbench for Atmel AVR
http://www.iar.com/website1/1.0.1.0/107/1/
[14] RCB128RFA1 board
http://www.dresden-elektronik.de/shop/prod128.html?language=en
[15] ATAVR128RFA1-EK1
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4677
[16] ATSTK600 board description
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4254
[17] Radio Extender Board REB231 V4.0.2
http://www.dresden-elektronik.de/shop/prod73.html
[18] ATEVK1105 description
http://www.atmel.com/evk1105
[19] 32-bit AVR UC3 Software Framework 1.5.0
http://www.atmel.com/dyn/resources/prod_documents/AVR32-
SoftwareFramework-AT32UC3-1.5.0.zip
[20] AVR32 GNU Toolchain
http://www.atmel.com/dyn/products/tools_card.asp?tool_id=4118
[21] IAR Embedded Workbench for Atmel 32-bit AVR
http://www.iar.com/website1/1.0.1.0/124/1/
[22] IAR Embedded Workbench for Atmel ARM
http://www.iar.com/website1/1.0.1.0/68/1/
68
Atmel AVR2052
8200K-AVR-05/11
Atmel AVR2052
[ Pobierz całość w formacie PDF ]