[Tinyos-help] Sending characters from Java appln to Mote

Urs Hunkeler urs.hunkeler at epfl.ch
Wed Nov 17 01:23:05 PST 2010


Hi Venkat,

The tutorials explain how to create your own message format in the radio 
communications tutorial:
http://docs.tinyos.net/index.php/Mote-mote_radio_communication

In your own message format you can specify arrays, e.g., as "nx_uint8_t 
myArray[20];". The unsigned 8-bit integer is probably the closest you 
get to a char array (or string). You might have to copy the contents of 
the array to a local structure before you can use it on the mote.

To use this message format with Java, you can (automatically) create a 
Java class handling your message format. This is described in the serial 
communications tutorial (the tool is called "mig"):
http://docs.tinyos.net/index.php/Mote-PC_serial_communication_and_SerialForwarder

There are also other interesting tutorials available. Have a look at the 
tutorials page:
http://docs.tinyos.net/index.php/TinyOS_Tutorials

Cheers,
Urs

On 11/17/10 8:35 AM, Venkat wrote:
> Hi,
> I am running a java GUI application on my pc to send packets ( random
> integer) to the mote via serial port. I was just wondering how to send
> characters over the serial port to the mote? I modified the
> testserial.java application for my GUI. However, the Testserial.java has
> method to send only integers over the serial port. It doesnt have a
> method call for sending arrays. I was thinking if i cud convert the
> characters into hex and send it. but, still, if i want to send a string,
> it will again be an array of integers. I am quite new to tinyos and nesc
> programming. Could some one help me with this ?
>
> Thanks,
> Venkat
>
>
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help



More information about the Tinyos-help mailing list