Revision 623
cleanup and colonet debugging
wireless.c | ||
---|---|---|
370 | 370 |
} |
371 | 371 |
|
372 | 372 |
int len = xbee_get_packet(wl_buf); |
373 |
if (len < 0)//no packet received
|
|
373 |
if (len == -1)
|
|
374 | 374 |
return; |
375 | 375 |
|
376 | 376 |
if (wl_buf[0] == XBEE_TX_STATUS) |
... | ... | |
385 | 385 |
//this only works with under 16 groups |
386 | 386 |
int group = (int)(wl_buf[1] >> 4); |
387 | 387 |
int success = 0; |
388 |
if (wl_buf[2] == 0) { |
|
388 |
if (wl_buf[2] == 0) |
|
389 |
{ |
|
389 | 390 |
success = 1; |
390 | 391 |
} |
391 | 392 |
else |
... | ... | |
403 | 404 |
|
404 | 405 |
if (wl_packet_groups[group] != NULL && wl_packet_groups[group]->handle_response != NULL) |
405 | 406 |
wl_packet_groups[group]->handle_response((int)wl_buf[1] & 0x0F, success); |
406 |
return; |
|
407 | 407 |
} |
408 |
|
|
409 |
if (wl_buf[0] == XBEE_RX) |
|
408 |
else if (wl_buf[0] == XBEE_RX) |
|
410 | 409 |
{ |
411 | 410 |
if (len < 7) |
412 | 411 |
{ |
... | ... | |
427 | 426 |
int type = wl_buf[6]; |
428 | 427 |
int packetLen = len - 7; |
429 | 428 |
|
430 |
if (wl_packet_groups[group] != NULL && wl_packet_groups[group]->handle_receive != NULL) |
|
429 |
if (wl_packet_groups[group] != NULL && wl_packet_groups[group]->handle_receive != NULL) {
|
|
431 | 430 |
wl_packet_groups[group]->handle_receive(type, source, wl_buf + 7, packetLen); |
432 |
return;
|
|
431 |
}
|
|
433 | 432 |
} |
434 |
|
|
435 |
WL_DEBUG_PRINT("Unexpected packet received from XBee.\r\n"); |
|
436 |
return; |
|
433 |
else |
|
434 |
{ |
|
435 |
WL_DEBUG_PRINT("Unexpected packet received from XBee.\r\n"); |
|
436 |
} |
|
437 | 437 |
} |
438 | 438 |
|
439 | 439 |
|
Also available in: Unified diff