Download Wireless Sensor Networks: Development of an Environmental Data

Transcript
Appendix F
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
PACKET #3 (of 4)
---------------msg->data[0] : sensor id, MDA300 = 0x81
msg->data[1] : packet number = 3
msg->data[2] : node id
msg->data[3] : reserved
msg->data[4,5] : digital data Ch.0
msg->data[6,7] : digital data Ch.1
msg->data[8,9] : digital data Ch.2
msg->data[10,11] : digital data Ch.3
msg->data[12,13] : digital data Ch.4
msg->data[14,15] : digital data Ch.5
PACKET #4 (of 4)
---------------msg->data[0] : sensor id, MDA300 = 0x81
msg->data[1] : packet number = 4
msg->data[2] : node id
msg->data[3] : reserved
msg->data[4,5] : batt
msg->data[6,7] : hum
msg->data[8,9] : temp
msg->data[10,11] : counter
msg->data[14] : msg4_status (debug)
***********************************************************************
****/
// include sensorboard.h definitions from tos/mda300 directory
includes sensorboard;
module XSensorMDA300M
{
provides interface StdControl;
uses {
interface Leds;
//Sampler Communication
interface StdControl as SamplerControl;
interface Sample;
//UART communication
interface StdControl as UARTControl;
interface BareSendMsg as UARTSend;
interface ReceiveMsg as UARTReceive;
//RF communication
interface StdControl as CommControl;
interface BareSendMsg as SendMsg;
interface ReceiveMsg as ReceiveMsg;
//Timer
interface Timer;
105