implementation {
components MainC, BaseStationP, LedsC;
components ActiveMessageC as Radio, SerialActiveMessageC as Serial;
+ components CC2420KeysC;
MainC.Boot <- BaseStationP;
BaseStationP.RadioAMPacket -> Radio;
BaseStationP.Leds -> LedsC;
+ BaseStationP.CC2420Keys -> CC2420KeysC;
}
interface Packet as RadioPacket;
interface AMPacket as RadioAMPacket;
+ interface CC2420Keys;
+
interface Leds;
}
}
uint8_t radioIn, radioOut;
bool radioBusy, radioFull;
+ uint8_t key[16] = {0x98,0x67,0x7F,0xAF,0xD6,0xAD,0xB7,0x0C,0x59,0xE8,0xD9,0x47,0xC9,0x71,0x15,0x0F};
+
task void uartSendTask();
task void radioSendTask();
event void RadioControl.startDone(error_t error) {
if (error == SUCCESS) {
radioFull = FALSE;
+ call CC2420Keys.setKey(1, key);
}
}
event void SerialControl.stopDone(error_t error) {}
event void RadioControl.stopDone(error_t error) {}
+ event void CC2420Keys.setKeyDone(uint8_t keyNo, uint8_t* skey) {}
+
uint8_t count = 0;
message_t* ONE receive(message_t* ONE msg, void* payload, uint8_t len);