pre commentaire
Dependencies: EthernetInterface WebSocketClient mbed-rtos mbed
Fork of Code_APP3_C by
Revision 10:565271e4d52a, committed 2017-02-14
- Comitter:
- JoeyDionne
- Date:
- Tue Feb 14 17:34:31 2017 +0000
- Parent:
- 9:400cfcf4b06e
- Child:
- 11:f0ceb634d85c
- Commit message:
- APP3 pre commentaires
Changed in this revision
--- a/config.h Tue Feb 14 04:08:58 2017 +0000 +++ b/config.h Tue Feb 14 17:34:31 2017 +0000 @@ -1,5 +1,5 @@ static const short PAN_ID = 0x0777; -static char* WEBSOCKET_URL= "ws://192.168.0.1:8000/"; -static const char* mbedIp = "192.168.0.2"; +static char* WEBSOCKET_URL= "ws://10.43.157.184:8000/"; +static const char* mbedIp = "192.168.137.2"; static const char* mbedMask = "255.255.255.0"; -static const char* mbedGateway = "192.168.0.1"; \ No newline at end of file +static const char* mbedGateway = "192.168.137.1"; \ No newline at end of file
--- a/main.cpp Tue Feb 14 04:08:58 2017 +0000 +++ b/main.cpp Tue Feb 14 17:34:31 2017 +0000 @@ -13,8 +13,9 @@ int main() { // Setup du port ethernet - EthernetInterface eth; - eth.init(mbedIp, mbedMask, mbedGateway); + EthernetInterface eth; + eth.init(); //Use DHCP + //eth.init(mbedIp, mbedMask, mbedGateway); //Use config eth.connect(); DigitalOut RESET(p8); @@ -38,7 +39,7 @@ Websocket ws(WEBSOCKET_URL); ws.connect(); - wait(1); + //wait(1); while(1) { @@ -102,11 +103,6 @@ } #endif ws.send(DATA_TO_READ._ptr); - wait_ms(5); - char* result; - ws.read(result); - - pc.printf(result); delete DATA_TO_READ._ptr; }
--- a/xbee.cpp Tue Feb 14 04:08:58 2017 +0000 +++ b/xbee.cpp Tue Feb 14 17:34:31 2017 +0000 @@ -1,7 +1,7 @@ #include "xbee.h" Timeout timeOut; -PwmOut led_error(LED2); +AnalogOut led_error(p18); void LED_TurnOff() { led_error = 0;
--- a/xbee.h Tue Feb 14 04:08:58 2017 +0000 +++ b/xbee.h Tue Feb 14 17:34:31 2017 +0000 @@ -24,7 +24,6 @@ char calculate_checksum(CArray* message, short header_size); void send(Serial* COM, CArray* message); void read(Serial* COM, CArray* returnValue); -void read(Serial* COM, CArray* returnValue); void setPAN(Serial* COM, short pan_id); #endif // XBEE_H \ No newline at end of file