Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: xtoff3 CYS_Receiver
Fork of RF24Network by
Revision 6:80195a45b25c, committed 2018-03-09
- Comitter:
- pietor
- Date:
- Fri Mar 09 12:22:14 2018 +0000
- Parent:
- 3:dfc8da7ac18c
- Child:
- 7:d72e1d8f5355
- Commit message:
- 9/03 test;
Changed in this revision
| RF24Network.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/RF24Network.cpp Thu Nov 05 05:54:47 2015 +0000
+++ b/RF24Network.cpp Fri Mar 09 12:22:14 2018 +0000
@@ -148,8 +148,8 @@
// Read the beginning of the frame as the header
RF24NetworkHeader *header = (RF24NetworkHeader*)(&frame_buffer);
- IF_SERIAL_DEBUG(printf_P(PSTR("%lu: MAC Received on %u %s\n\r"),millis(),pipe_num,header->toString()));
- IF_SERIAL_DEBUG(const uint16_t* i = reinterpret_cast<const uint16_t*>(frame_buffer + sizeof(RF24NetworkHeader)); printf_P(PSTR("%lu: NET message %04x\n\r"),millis(),*i));
+ IF_SERIAL_DEBUG(printf_P(PSTR("%lu: MAC Received %s\n\r"),pipe_num,header->toString()));
+ IF_SERIAL_DEBUG(const uint16_t* i = reinterpret_cast<const uint16_t*>(frame_buffer + sizeof(RF24NetworkHeader)); printf_P(PSTR("%lu: NET message %04x\n\r"),*i));
// Throw it away if it's not a valid address
@@ -244,7 +244,7 @@
bool result = false;
uint8_t message_size = frame_size - sizeof(RF24NetworkHeader);
- IF_SERIAL_DEBUG(printf_P(PSTR("%lu: NET Enqueue @%x "),millis(),next_frame-frame_queue));
+ IF_SERIAL_DEBUG(printf_P(PSTR("u: NET Enqueue @%x "),next_frame-frame_queue));
#if !defined ( DISABLE_FRAGMENTATION )
@@ -439,9 +439,9 @@
if (maxlen > 0) {
maxlen = min(maxlen,bufsize);
memcpy(message,frame_queue+10,maxlen);
- IF_SERIAL_DEBUG(printf("%lu: NET message size %d\n",millis(),bufsize););
+ IF_SERIAL_DEBUG(printf(": NET message size %d\n",bufsize););
- IF_SERIAL_DEBUG( uint16_t len = maxlen; printf_P(PSTR("%lu: NET r message "),millis()); const uint8_t* charPtr = reinterpret_cast<const uint8_t*>(message); while(len--) {
+ IF_SERIAL_DEBUG( uint16_t len = maxlen; printf_P(PSTR(": NET r message ")); const uint8_t* charPtr = reinterpret_cast<const uint8_t*>(message); while(len--) {
printf("%02x ",charPtr[len]);
}
printf_P(PSTR("\n\r") ) );
@@ -450,7 +450,7 @@
memmove(frame_queue,frame_queue+bufsize+10,sizeof(frame_queue)- bufsize);
next_frame-=bufsize+10;
- //IF_SERIAL_DEBUG(printf_P(PSTR("%lu: NET Received %s\n\r"),millis(),header.toString()));
+ IF_SERIAL_DEBUG(printf_P(PSTR(": NET Received %s\n\r"),header.toString()));
}
return bufsize;
@@ -500,7 +500,7 @@
}
//Check payload size
if (len > MAX_PAYLOAD_SIZE) {
- IF_SERIAL_DEBUG(printf("%u: NET write message failed. Given 'len' %d is bigger than the MAX Payload size %i\n\r",millis(),len,MAX_PAYLOAD_SIZE););
+ IF_SERIAL_DEBUG(printf("%u: NET write message failed. Given 'len' %d is bigger than the MAX Payload size %i\n\r",len,MAX_PAYLOAD_SIZE););
return false;
}
@@ -601,13 +601,13 @@
// Build the full frame to send
memcpy(frame_buffer,&header,sizeof(RF24NetworkHeader));
- IF_SERIAL_DEBUG(printf_P(PSTR("%lu: NET Sending %s\n\r"),millis(),header.toString()));
+ IF_SERIAL_DEBUG(printf_P(PSTR("NET Sending %s\n\r"),header.toString()));
if (len) {
memcpy(frame_buffer + sizeof(RF24NetworkHeader),message,len);
- IF_SERIAL_DEBUG(uint16_t tmpLen = len; printf_P(PSTR("%lu: NET message "),millis()); const uint8_t* charPtr = reinterpret_cast<const uint8_t*>(message); while(tmpLen--) {
+ IF_SERIAL_DEBUG(uint16_t tmpLen = len; printf_P(PSTR("NET message ")); const uint8_t* charPtr = reinterpret_cast<const uint8_t*>(message); while(tmpLen--) {
printf("%02x ",charPtr[tmpLen]);
}
printf_P(PSTR("\n\r") ) );
@@ -665,7 +665,7 @@
logicalToPhysicalAddress(&conversion);
- IF_SERIAL_DEBUG(printf_P(PSTR("%lu: MAC Sending to 0%o via 0%o on pipe %x\n\r"),millis(),to_node,conversion.send_node,conversion.send_pipe));
+ IF_SERIAL_DEBUG(printf_P(PSTR("MAC Sending to 0%o via 0%o on pipe %x\n\r"),to_node,conversion.send_node,conversion.send_pipe));
/**Write it*/
ok=write_to_pipe(conversion.send_node, conversion.send_pipe, conversion.multicast);
@@ -1025,7 +1025,7 @@
#endif
- IF_SERIAL_DEBUG(uint32_t* top = reinterpret_cast<uint32_t*>(out+1); printf_P(PSTR("%lu: NET Pipe %i on node 0%o has address %lx%x\n\r"),millis(),pipe,node,*top,*out));
+ IF_SERIAL_DEBUG(uint32_t* top = reinterpret_cast<uint32_t*>(out+1); printf_P(PSTR("NET Pipe %i on node 0%o has address %lx%x\n\r"),pipe,node,*top,*out));
return result;
}
