Hi Lyubomir,
Please, could you explain further what you mean with sending more than
one packet at a time? I am sure to be missing something, otherwise
could it be as simple as to make a for-loop?
For setting the power I am only familiar with the CC2420 radio. In
such a case you only have to load the right module.
In your config file...
// Receiver calibration
typedef nx_struct SerialRxMsg {
nx_uint8_t id;
nx_uint8_t rssi;
} SerialRxMsg;
In your module...
module CalTxC{
uses {
interface SplitControl as RadioSplitControl;
interface SplitControl as SerialSplitControl;
interface CC2420Packet as RadioPacket;
.... etc...
}
implementation {
RadioMsg * pointerRadio;
SerialTxMsg * pointerSerial;
event void RadioSplitControl.startDone(error_t error){
if (error != SUCCESS) {
call Leds.set(6);
call RadioSplitControl.start();
}
else {
call SerialSplitControl.start();
}
}
event void SerialSplitControl.startDone(error_t error){
if (error != SUCCESS) {
call Leds.set(7);
call SerialSplitControl.start();
}
else {
call Leds.set(0);
pointerRadio = call
RadioAMSend.getPayload(&pkt, (uint8_t) NULL);
call Timer.startPeriodic(PERIOD_0);
}
}
event message_t * SerialReceive.receive(message_t *msg, void
*payload, uint8_t len){
call Leds.set(7);
pointerRadio = (RadioMsg*) payload;
call RadioPacket.setPower(&pkt ,pointerSerial->rssi);
return msg;
}
}
In your configuration...
implementation {
components ActiveMessageC;
components new AMSenderC (AM_RADIOMSG);
components CC2420PacketC;
components SerialActiveMessageC;
components new SerialAMReceiverC (AM_SERIALTXMSG);
... etc ....
}
I assume you know the rest :-)
Cheers!!
Sergio
On Sat, May 7, 2011 at 10:34 PM, Lyubomir Ivanov <[email protected]> wrote:
>
> Hi Sergio,
>
> Thank you for your response. I want to broadcast from the pc to other motes.
> Yes I am familiar with the AM sender, and broadcasting, but I can not find
> how to change the code in order to send more than one packet once at a time,
> for example, 20 packets, each time I am transmitting from the pc. I have
> already made the some of the tutorials, like BlinkToRadio, BaseStation,
> and RssiDemo, but I wasn't acquainted with the command send power. If it is
> possible can you send me a link with a proper tutorial or turorials. I will
> be very grateful.
>
> Thanks in advance.
>
> /Lyubomir
>
>
> -------- Оригинално писмо --------
> От: Sergio Valcarcel
> Относно: Re: [Tinyos-help] Injecting packets for tiny OS 2
> До: Lyubomir Ivanov
> Изпратено на: Събота, 2011, Май 7 21:18:47 EEST
>
> Hi Lyubomir
> You mean broadcasting from the PC or from another mote?
> Are you familiar with AM_Sender, the constant AM_BROADCAST, and with the
> module CC2420 and its commands set_power or get_rssi (sorry I am using my
> memory to mention them but the real names should be quite similar)?
> If not, I recommend you start from the beginning with the tutorials till
> being able to transmit between motes and from PC to mote.
> Cheers!
> Sergio
> On Sat, May 7, 2011 at 11:54 AM, Lyubomir Ivanov <[email protected]> wrote:
>>
>> Hello,
>>
>> I'm writing to you because I want to find out how to inject broadcasting
>> packets for tiny OS 2. Also, when broadcasting, for example 20 packets, I
>> want ot be able to change the power transmission. Thank you.
>>
>> Best regards,
>>
>> Lyubomir
>>
>> _______________________________________________
>> Tinyos-help mailing list
>> [email protected]
>> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>
>
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help