Dust Networks Inc. M1030 用户手册

下载
页码 28
 Interfaces
M1030-2 M
OTE
 D
ATASHEET
D
UST
 N
ETWORKS
13
C
ONFIDENTIAL
7.4.2
Mote Command Data Types
Table 14 defines the command data types used in the commands.
7.4.3
Mote Commands
The mote command interface provides a way to send and receive network packets, access local configuration and diagnostics, 
and receive time stamps. All packets between the microprocessor and the mote are encapsulated in the HDLC format 
(RFC 1662) and have the following structure (see Figure 11). 
Figure 11  HDLC Packet Structure
The command type indicates which API message is contained in the message content. The message content for each command 
type is described within the following sections.
FCS is calculated based on 16-bit FCS computation method (RFC 1662). The mote checks the FCS and drops packets that 
have FCS errors. There is no mechanism for the mote to tell the microprocessor that a packet has been discarded, so the 
applications layer must implement reliable delivery, if desired. All numerical fields in a packet are in big endian order (MSB 
first), unless otherwise noted. Section 7.4.5 provides an example of HDLC packet construction and HDLC packet decoding.
Table 15 provides a summary of mote commands, which are described in detail in the following sections. For error handling, 
all other packet types should be ignored. The Destination column indicates whether the packet is sent (or received) through the 
network or processed locally by the mote. 
Table 14  Command Data Types
Data Type
Description
unsigned long
4 bytes
unsigned short
2 bytes
unsigned char
1 byte 
Table 15  Mote Command Summary
Command Type (HEX)
Direction
Destination
Description
0x80
Microprocessor to mote
Network
Packet destined for the network
0x81
Mote to microprocessor
Network
Unacknowledged packet received from the 
network and destined for microprocessor
0x82
Mote to microprocessor
Network
Acknowledged packet received from the 
network and destined for microprocessor
0x83
--
Reserved
0x84
Mote to microprocessor
Local
Time and mote state information
0x85
--
Reserved
0x86
--
Reserved
0x87
Microprocessor to mote
Local
Set Parameter request
0x88
Mote to microprocessor
Local
Set Parameter response
0x89
Microprocessor to mote
Local
Get Parameter request
0x8A
Mote to microprocessor
Local
Get Parameter response
Command
(Byte 1)
(Bytes 2—n)
Command Type
Message Content
Start Delimiter
(Byte 0)
Data Frame
(Bytes 1—n)
Checksum 
(Bytes + 1, n + 2)
End Delimiter
(Byte + 3)
0x7E 
HDLC Packet payload
FCS (2 Bytes)
0x7E