Hi Mario, For single byte operation of the serial port you are interested in the interfaces: UartControl, UartByte and UartStream. You'll have to find out which modules in your platform implement them (they are certainly implemented as they are used for SerialAMSenderC and SerialAMReceiverC.
The Receive code is in $TOSROOT/tos/lib/serial, most likely split amongst SerialActiveMessageP and SerialDispatcherP (and similar files). My guess is that the dispatcher does the framing (since the serial port is a stream interface, the stream has to be split into frames, and for some reason TinyOS uses a framing protocol that also supports other protocols), and SerialActiveMessageP does then the actual interpretation of the AM packet (which part of the program should receive the packet). If you don't want to fully understand the code but still debug your framing program, I recommend you copy the files from the lib/serial to your TinyOS test program folder. If you change them locally in your folder, the compiler will take the local version rather than the version in the default installation. That way you can modify TinyOS code without changing the installation. You can then add LED code to stepwise figure out where your message is rejected. Cheers, Urs PS: Yes, I am Swiss. Are you German? On 10/18/10 11:17 PM, Mario Riesner wrote: > Hi Urs, > > I tryed to use the serialsend C code: > => > Sending ff > writing 44 26 ff > encoded 7e 44 26 ff dd 73 7e > noack > > But it doesn't work. And the encoded frame is a bit short, I think the source > and destination address are missing. The second point is I have to explain > some stuff in my Master Theses. > Maybe there is a problem with the implementation of my hardware. I'm using a > Meshbean mote it's similar to the Mica mote. Students of the ETH Zürich > ported TinyOS to the Mesbean board. > You are Swiss? > How can I test the raw UART or to receive all single bytes? > > Cheers, > Mario > > > > > -----Ursprüngliche Nachricht----- > Von: Urs Hunkeler [mailto:[email protected]] > Gesendet: Montag, 18. Oktober 2010 19:38 > An: Mario Riesner > Cc: [email protected] > Betreff: Re: AW: [Tinyos-help] unable to receive UART frame > > Hi Mario, > > Why do you implement the framing protocol yourself? I personally do not > know about the different fields in the message format and would have to > study the source code in detail myself. There are two approaches, try to > understand the source code of the TinyOS nesC code, or try to find out > how the TinyOS message interface tools generate the serial messages. > > There is code available for different platforms. E.g. have a look in the > $TOSROOT/support/sdk/c/sf/ directory. In the readme in there it is > mentioned: > > This serial forwarder implements the standard TinyOS 2.0 serial forwarder > protocol (see comments in > support/sdk/java/net/tinyos/packet/SFProtocol.java > for a brief overview). > > This is where I would start, and then maybe read the source code of the > implementation in the language which was closest to my needs. Or you > could try the message interface generator (mig) utility. I think it > supports other languages besides Java. > > Cheers, > Urs > _______________________________________________ Tinyos-help mailing list [email protected] https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
