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.
Dependencies: mbed EthernetInterface WebSocketClient mbed-rtos BufferedSerial
Fork of APP3_Lab by
Diff: main.cpp
- Revision:
- 11:ecf5776b950a
- Parent:
- 9:3631d3685cfa
- Child:
- 12:1286b80c68f7
--- a/main.cpp Sat Sep 30 20:29:47 2017 +0000
+++ b/main.cpp Sat Sep 30 21:09:13 2017 +0000
@@ -4,7 +4,7 @@
#include "parser.h"
#include "sensors.h"
-#define IS_COORDINATOR 0
+#define IS_COORDINATOR 1
#define PAN_ID 0xC0FFEE
@@ -22,7 +22,7 @@
char hello_world[12] = "Hello world";
- frame_t* current_frame;
+ frame_t current_frame;
#if IS_COORDINATOR
@@ -34,24 +34,18 @@
#endif
while(1) {
- /*if (pc.readable())
- {
- c = pc.getc();
- xbee.putc(c);
- //pc.putc(c);
- }*/
-
- bool finished_packet = receive(current_frame, 2048);
+ bool finished_packet = receive(¤t_frame, 2048);
if (finished_packet)
{
- pc.printf("DATA RECEIVED : Data count = %u", current_frame->length);
- for (int i = 0; i < current_frame->length; i++)
+ pc.printf("Data count = %u\r\n", current_frame.length);
+ pc.printf("data start::: ");
+ for (int i = 0; i < current_frame.length && i < 2048; i++)
{
- pc.putc(current_frame->buffer[i]);
+ pc.putc(current_frame.buffer[i]);
}
- pc.printf("\n\r");
+ pc.printf(" :::end\n\r");
}
-
+ //wait_ms(1);
}
}
