Hello. I'm trying to get a port pin to toggle when the device receives a packet. However, it does not appear that the Mac events are firing. As you can see in the below code snippet, all the necessary parts are there, and it does compile without any warnings or errors. dOutput0 is prototyped in the configuration implementation as:
components HplMsp430GeneralIOC as dPins; BaseStationP.dOutput0 -> dPins.Port23; If the while loop in the code below is placed in Boot.booted(), the waveform is generated on my oscilloscope, as expected. However, when I move it to any of the MacLayer events, I get absolutely nothing! The LEDs my telosb mote toggle indicating that packets are being sent and received, so I don't understand what is going on. Any feedback would be greatly appreciated. module BaseStationP { uses interface Boot as Boot; uses interface Transport as TransportLayer; uses interface HplMsp430GeneralIO as dOutput0; uses interface Mac as MacLayer; } implementation { event void Boot.booted() { call dOutput0.selectIOFunc(); call dOutput0.makeOutput(); } event void MacLayer.sendMsgDone( am_id_t msgId, am_addr_t recipientId, message_t *msg, error_t err, bool ackTimeout ) { } event void MacLayer.msgReceived(am_id_t msgId, message_t *msg, void *data, uint8_t len) { atomic { while(1) { call dOutput0.set(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); call dOutput0.clr(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); nop(); } } } event void MacLayer.msgSnoopReceived(am_id_t msgId, message_t *msg, void *data, uint8_t len) { // Do nothing } } Thanks, -Jim
_______________________________________________ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help