Stephen isn't off.

Rather I would think you want something more like...

err = call UDP.sendto(&ER_addr, alert, sizeof(Alert_t));


rather than what you had originally:


err = call UDP.sendto(&ER_addr, &alert, sizeof(Alert_t));


alert is...    (Alert_t *) and you malloc a block of memory and remember it
in the var alert.

When you call UDP.sendto this is the block you want the send to come from.
  Not &alert which holds the pointer to the memory block.


On Mon, Oct 7, 2013 at 8:59 AM, Stephen Dawson-Haggerty <
[email protected]> wrote:

> I could be off here but it looks like you define alert as a pointer, and
> then send it's address.  Where is an actual buffer for alert allocated?
>
>
> On Mon, Oct 7, 2013 at 4:05 AM, João Amaral <[email protected]> wrote:
>
>> Hello everyone.
>>
>> I am trying to send an UDP packet back to the base station but I'm not
>> being
>> successful. Here's a snippet of my code:
>>
>>
>>
>> alert variable has been populated before sending. I can see the first
>> printf, but never the second. Here are the variable declarations:
>>
>>
>>
>> I'm using msp430-gcc (GCC) 4.6.3, TinyOS 2.1.2.1 and TelosB motes.
>>
>> Regards.
>> João Amaral.
>>
>>
>>
>> --
>> View this message in context:
>> http://tinyos-help.10906.n7.nabble.com/Problem-with-UDP-sendto-tp23589.html
>> Sent from the TinyOS - Help mailing list archive at Nabble.com.
>>
>> _______________________________________________
>> Tinyos-help mailing list
>> [email protected]
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
>
>
>
> --
> stephen dawson-haggerty
> http://cs.berkeley.edu/~stevedh
> uc berkeley wireless and embedded systems lab
> berkeley, ca 94720
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Eric B. Decker
Senior (over 50 :-) Researcher
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to