can't tell you why it doesn't work. not actual code. you don't specify what hardware you are using.
not sure how you expect us to help you when you leave out really basic stuff like that. The problem you are running into is predominately serial communications in tinyos is packetized. So the serial bytes being sent are first low level packet headers etc. Then payload. For the lowest level of h/w serial port access on the msp430 processors you can look at tos/chips/msp430/usart/Msp430UartP.nc In particular you should try playing with UartByte.send and receive. On Fri, Sep 6, 2013 at 10:23 PM, Andres Mabini <[email protected]>wrote: > Hi all, > > Sorry for asking such a basic question, but I can't find a reference > application code for UART usage in the code base. > > Say I want to send 5 characters to a device which would then respond with > 9 characters. Is the proper sequence: > > Stdcontrol.start > Uartstream.send(sendbuf, 5); > Uartstream.receive(receivebuf, 9); > > Stdcontrol.stop <--inside Uartstream.receivedone > > or > > Stdcontrol.start > Uartstream.receive(receivebuf, 9); > Uartstream.send(sendbuf, 5); > > Stdcontrol.stop <--inside Uartstream.receivedone > > I've tried both and my app still isn't working, so I know it's not the > sequence(that's causing the failure). Still, I would like to know which > version to pursue further. > > Thanks > > _______________________________________________ > Tinyos-help mailing list > [email protected] > https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help > -- Eric B. Decker Senior (over 50 :-) Researcher
_______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
