]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Add key support to BaseStation application in CC2420 Security;
authorjgko <jgko>
Fri, 11 Sep 2009 21:20:20 +0000 (21:20 +0000)
committerjgko <jgko>
Fri, 11 Sep 2009 21:20:20 +0000 (21:20 +0000)
apps/tests/cc2420/TestSecurity/BaseStation/BaseStationC.nc
apps/tests/cc2420/TestSecurity/BaseStation/BaseStationP.nc

index 1a08fc768b00c37f65ad6d8bf8a295464d9188db..c14e7277fd004e22ae5a8fbc4840dda7c0acd727 100644 (file)
@@ -69,6 +69,7 @@ configuration BaseStationC {
 implementation {
   components MainC, BaseStationP, LedsC;
   components ActiveMessageC as Radio, SerialActiveMessageC as Serial;
+  components CC2420KeysC;
   
   MainC.Boot <- BaseStationP;
 
@@ -87,4 +88,5 @@ implementation {
   BaseStationP.RadioAMPacket -> Radio;
   
   BaseStationP.Leds -> LedsC;
+  BaseStationP.CC2420Keys -> CC2420KeysC;
 }
index 2e647c7f83c6429b89f9c2ab7de285cc82cd507f..7dfd3ebcf3ea6956db3994a298fcd89fa77c3270 100644 (file)
@@ -63,6 +63,8 @@ module BaseStationP @safe() {
     interface Packet as RadioPacket;
     interface AMPacket as RadioAMPacket;
 
+    interface CC2420Keys;
+
     interface Leds;
   }
 }
@@ -84,6 +86,8 @@ implementation
   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();
 
@@ -117,6 +121,7 @@ implementation
   event void RadioControl.startDone(error_t error) {
     if (error == SUCCESS) {
       radioFull = FALSE;
+      call CC2420Keys.setKey(1, key);
     }
   }
 
@@ -129,6 +134,8 @@ implementation
   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);