Expected completion time of this lab: 

20 min

.

Enable the D0 GPIO

This step enables the GPIO input pin. It is a required step for reading its value or activating notifications.

The D0 GPIO corresponds to the DP2 pin on the DC9003 SmartMesh Eval/Dev Mote.


To fill in the table below, take a look at the SmartMesh IP Tools Guide, chapter "On-Chip Application Protocol"


field name

length

value

explanation

control byte

1 byte

05

N.A.

id byte

1 byte

00

N.A.

command

1 byte


 look for the "Command field" table in the tools guide


PUT

channel

type

1 byte

ff

type: address

length

1 byte

02

length: 2 bytes

value

2 bytes


 look for the "Addressable Elements and Pinout" list in the tools guide


value: digital_in/D0

variable

ID

1 byte


 look for the "/digital_in" section in the tools guide, variable "enabled"


type: enable

length

1 byte

01

length: 1 byte

value

1 byte


 look for the "/digital_in" section in the tools guide, variable "enabled"


enabled



macAddress

your mote’s MAC address, e.g. 00170D0000600382

priority

Medium

srcPort

61625

dstPort

61625

options

0

data

<see above>


Read the value of the D0 GPIO

To fill in the table below, take a look at the SmartMesh IP Tools Guide, Chapter "On-Chip Application Protocol"



field name

length

value

explanation

control byte

1 byte

05

N.A.

id byte

1 byte

00

N.A.

command

1 byte


 look for the "Command field" table in the tools guide


GET

channel

type

1 byte

ff

type: address

length

1 byte

02

length: 2 bytes

value

2 bytes


 look for the "Addressable Elements and Pinout" list in the tools guide


value: digital_in/D0



macAddress

your mote’s MAC address, e.g. 00170D0000600382

priority

Medium

srcPort

61625

dstPort

61625

options

0

data

<see above>




field name

length

values received

explanation

control byte

1 byte


N.A.

id byte

1 byte


N.A.

command

1 byte



return code

1 byte



channel

type

1 byte



length

1 byte



value

2 bytes



variable

type

1 byte



length

1 byte



value

1 byte



variable

type

1 byte



length

1 byte



value

4 bytes



variable

type

1 byte



length

1 byte



value

2 bytes



variable

type

1 byte



length

1 byte



value

1 byte



variable

type

1 byte



length

1 byte



value

1 byte