![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
for zabuton
Dependencies: EthernetInterface HTTPClient SocketIO WebSocketClient mbed-rtos mbed picojson
main.cpp
- Committer:
- 3116redtrain
- Date:
- 2016-12-16
- Revision:
- 0:6b7be77233ac
File content as of revision 0:6b7be77233ac:
#include "mbed.h" #include "CushionNodeConnector.h" #include "EthernetInterface.h" int main() { EthernetInterface eth; eth.init(); //Use DHCP eth.connect(); printf("IP Address is %s\n", eth.getIPAddress()); CushionNodeConnector cnc; bool ret = cnc.connect(); if (!ret) exit(1); char msg[256]; while(1) { int res = cnc.mess_send(1, "down"); int type=cnc.mess_recv(msg); if (type > 0) { printf("messtype:%d rcv: %s\r\n",type, msg); } if(!cnc.is_connected()) break; wait(0.1); } cnc.close(); eth.disconnect(); }