Hi,

Cast your double/float variables into nx_uint16_t/nx_uint32_t

Then re-cast it again to double/float when you receive it (actually it's 
not re-cast, but read the integer value using double/float format. Something
that you can done by scanf("%f",value) ).

Regards,

-daniel

-------- Original Message --------
> From: "Federico Fiorentin" <[EMAIL PROTECTED]>
> Sent: Tuesday, September 04, 2007 1:10 AM
> To: [email protected]
> Subject: [Tinyos-help] How send a float number in message_t struct
> 
> Hello, I'm a student and I'm using TinyOs2 in my project.
> I do not know how to send float numbers in the "message_t". I need a
> float field because
> my application has to transmit a precise rational value.
> 
> 
> I couldn't find better way to split the float in 2 int variables,but
> the solution isn't working fine.
> 
> Do you have any solution for this problem?
> 
> I am using the following message payload struct:
> 
> 
> 
>             nx_struct{
>                nx_int8 val;
>                ...
>                // here I want to have a float field
>             }
> 
> I tried to search a solution but I didn't find neither docs or help in
> the mailing list.
> 
> I tried nx_float but that does not exist.
> Do you have suggestions?
> Where could I find a detailed syntax/grammar for nesC?
> 
> 
> Best Regards,
> FF




_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to