Nikos,
Thanks for the mig command! It looks exactly what I needed.
Regarding the UART - let's say I have a struct:
typedef nx_struct MyStruct
{
nx_uint8_t counter;
} MyStruct;
And I want to send every second an incremented counter: 1, 2, 3 ... ,and I
want the BaseStation to forward it to the air.
So the packet flow should be as follows:
1. I send it to the BaseSation via SF
2. The message arrives at UartReceive.receive() and goes to radioQueue
3. radioSendTask sends the message to air.
My initial question was: What exactly to send to Sf? If I send JUST MyStruct
- nothing happens (I added printf in UartReceive.receive() to ensure that ).
But, if counter == 0xFF, UartReceive.receive() is called.
(I hope I was clearer this time :) )
Now it looks to me that I have to send message_t struct, which will be
entirely forwarded to the air...
Arik
On Wed, Dec 2, 2009 at 14:26, Nikos Batalas <[email protected]> wrote:
> Arik Sapojnik wrote:
>
>> Nikos,
>>
>> I don't entirely agree with you:
>>
>> 1. "The BaseStation app will forward anything..." - but with what
>> AM type to what destination address?
>>
>>
> All I'm saying is that the BaseStation app for tinyos is agnostic to AM
> types. if it's an ActiveMessage, it will handle it.
> I'm not sure if it listens in on messages that are not directed to the id
> of the mote it runs on, although the RadioSnoop interface is wired.
>
> Could anyone else shed some light into this?
>
> 1. I added printf in UartReceive.receive, and then sent the following:
>> "0x01" - Nothing happened
>> "0xFF" - the print worked
>>
>> I'm not sure I understand what you mean.
>
>
> 1. I think that the reason is the first byte is the destination
>> address (since the UART works with AM layer).
>> 2. I want to work with C and I couldn't find any examples working
>> with MIG (only Java examples).
>>
>>
>> for a header that looks like this :
>
> ------------------------------------------------- definitions.h
> #ifndef DEFINITIONS_H
> #define DEFINITIONS_H
>
> enum
> {
> AM_MOTE2MOTEMSG=1,
> };
>
> typedef nx_struct Mote2MoteMsg
> {
> nx_uint8_t nodeid;
> nx_uint16_t timestamp;
> } Mote2MoteMsg;
>
> -------------------------------------------------- definitions.h
>
>
>
>
> issuing this command :
>
> $>mig c -c-prefix=MOTE2MOTEMSG_H -target=mica2 definitions.h Mote2MoteMsg
> -o OUTCMoteMSG.h
>
>
> will give you
> OUTCMoteMSG.h and OUTCMoteMSG.c
>
> with C functions to handle your specific message (for the mica2 platform,
> in this case).
>
> Was this what you were looking for?
>
> Best regards,
> Nikos
>
>
>
--
Best Regards,
Arik Sapojnik
[email protected]
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help