Hi,
I am currently trying to send data from my PC to a mote. I have a Delphi
program which is building up the data packet, calculating the CRC correctly
and then sending this data to the com port. However, my mote doesn't appear
to be responding at all. The idea is that the data field contains either 1,
2 or 3 which the mote will then respond to by lighting a corresponding LED.
Are there any special considerations that have to be taken into account when
sending data (via serial) to a mote connected to an MIB510 board? I have
included some other, hopefully, relevant data below if anyone feels inclined
to help me troubleshoot! I will keep digging, but any help/guidance would
be greatly appreciated.
Thanks in advance,
Alex.
Message structure:
struct testSendMsg {
uint8_t cmd;
};
enum {
AM_TESTSENDMSG = 170
};
Example data packet (as written to comport): 7E420000AA810101A8107E
On receive code (uses GenericComm):
event TOS_MsgPtr msgIn.receive(TOS_MsgPtr m) {
struct testSendMsg *r;
struct testSendMsg *s;
TOS_MsgPtr tmp;
tmp = pBuffer;
pBuffer = m;
r = (struct testSendMsg*)tmp->data;
s = (struct testSendMsg*)buffer.data;
// put an LED on in response
if (sendBusy == FALSE) {
sendBusy = TRUE;
cmd = r->cmd;
if (cmd == 1) {
call Leds.redOn();
call Leds.greenOff();
call Leds.yellowOff();
}
else if (cmd == 2) {
call Leds.redOff();
call Leds.greenOn();
call Leds.yellowOff();
}
else {
call Leds.redOff();
call Leds.greenOff();
call Leds.yellowOn();
}
s->cmd = 4;
// confirm done
if ((call msgOut.send(0, sizeof(struct testSendMsg), &buffer)) !=
SUCCESS) {
atomic sendBusy = FALSE;
}
}
return m;
}
----------
Alex Mason
Postgraduate Research
RFID & Wireless Sensor Networks
Liverpool John Moores University
Email: [EMAIL PROTECTED]
Phone: +447886389484
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help