Hi
I have a problem with transmit float value via radio packet. We know that
nx_float not support in Tinyos 2.x . I transmit my variable as uint32_t. My
code is like this:
typedef nx_struct myMessage{
nx_uint32_t value; //float variable
} myMessage_t;
//sent routine
float* f_buf;
f_buf= &myFloatVariable;
rms->value=(uint32_t)*f_buf;
dbg("debugApp","my orginal value is %f",myFloatVariable);// is my original
value
dbg("debugApp","my message value is %f",rms->value);//is like original value
//recieve routine
uint32_t* I_buf;
I_buf = & rms->value;
myFloatValue_r = (float)*l_buf;
dbg("debugApp","my received message value is %f", myFloatValue_r);//always
is zero???????
What is wrong here?
What is best way to transmit float variable in message_t?
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help