uses interface Pool<message_t>;
uses interface CollectionDebug;
uses interface AMPacket;
+ uses interface Packet as RadioPacket;
}
implementation {
task void uartEchoTask();
void sendMessage() {
- TestNetworkMsg* msg = (TestNetworkMsg*)call Send.getPayload(&packet);
+ TestNetworkMsg* msg = (TestNetworkMsg*)call Send.getPayload(&packet, sizeof(TestNetworkMsg));
uint16_t metric;
am_addr_t parent;
dbg("TestNetworkC", "Received packet at %s from node %hhu.\n", sim_time_string(), call CollectionPacket.getOrigin(msg));
call Leds.led1Toggle();
if (!call Pool.size() <= (TEST_NETWORK_QUEUE_SIZE < 4)? 1:3) {
- call CtpCongestion.setClientCongested(TRUE);
+ // call CtpCongestion.setClientCongested(TRUE);
}
if (!call Pool.empty() && call Queue.size() < call Queue.maxSize()) {
message_t* tmp = call Pool.get();
else if (!uartbusy) {
message_t* msg = call Queue.dequeue();
dbg("Traffic", "Sending packet to UART.\n");
- if (call UARTSend.send(0xffff, msg, call Receive.payloadLength(msg)) == SUCCESS) {
+ if (call UARTSend.send(0xffff, msg, call RadioPacket.payloadLength(msg)) == SUCCESS) {
uartbusy = TRUE;
}
else {
post uartEchoTask();
}
else {
- call CtpCongestion.setClientCongested(FALSE);
+ // call CtpCongestion.setClientCongested(FALSE);
}
}