Hi All,
i'm trying to use TestSerial on Tossim (compiling with make micaz sim-sf )
I modified the TestSerial.h in this way:
...
typedef nx_struct test_serial_msg {
nx_uint16_t counter;
nx_union {
nx_uint8_t a;
nx_uint32_t b;
} prova_t;
} test_serial_msg_t;
...
I've tried to send messages with the java application TestSerial.java.
I made the interface to the message structure with the mig tool like follow:
mig java -target=null -java-classname=TestSerialMsg TestSerial.h
test_serial_msg -o TestSerialMsg.java
mig java -target=null -java-classname=TestSerialMsg TestSerial.h
test_serial_msg -o TestSerialMsg.py
the first one for java application and the second one for python script for
Tossim.
Sending messages from the TestSerialC.nc to Java application works well, but
i have some problems in receiving messages from Java to TestSerialC.nc:
Always, SerialActiveMessage.nc receives serial messages but the
TestSerialC.nc sometimes signals the Receive. Receive, sometimes no.
For Example:
if Java Application send
Sending packet 0
sent:00 00 00 00 00 06 00 89 00 00 00 00 00 00
the TestSerial.py always receives something (there is debug in
tinyos-2.x/tos/lib/tossim/sf/sim/SerialActiveMessageC.nc, i added just the
dbg of the message)
In this case:
DEBUG (0): Received serial message (0x191ea23c) of type 137 and length 6 @
0:0:4.367578128 //dbg from SerialActiveMessageC.nc
receive:00 00 00 00 00 06 00 89 00 00 00 00 00 00
DEBUG (0): Messaggio Ricevuto : 0:0:4.367578128 //dbg from TestSerialC.nc
In other case:
DEBUG (0): Received serial message (0x191ea23c) of type 97 and length 157 @
0:0:5.390625000
9d 14 61 dc 9d 14 61 00 02 00 00 00 00 d9 00 18 00 00 00 5a 01 00 00 00 00
00 00 e8 a4 f2 7f fe ff ff ff 00 00 00 00 90 bd b8 6c 03 00 00 00 74 a5 d9
00 b0 90 f3 7f 24 38 f6 7f 5c 83 f2 7f 00 00 00 00 78 22 ee 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 0b d9 00 0c 00 00 00
c6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
and it doesn't signal the Receive. Receive. (so message is not received from
my TestSerialC.nc).
Randomly sometimes works like in the first case, sometimes like the second
case.
is there a problem with nx_union..? or in the Tossim?
Can i use nx_union in the message definition like i do?
Thanks in advance.
Ciao
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Federico Porceddu
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help