MiMicSDK Websocket module sample program.
Dependencies: NyFileSystems libMiMic mbed-rtos mbed
Fork of UPnPBasicDevice by
This is Websocket server.
WebSocketのサンプルです。 MiMicSDKのWebsocketはhttpdの1モジュールとして動作するので、ファイルサーバ等と一緒に動かすことが出来ます。
ファームウェアを書き込んだ後にブラウザから "http://192.168.128.39/" にアクセスすると、AIN1のデータをリアルタイムに表示するページが開きます。
Diff: main.cpp
- Revision:
- 21:7dbe2100b419
- Parent:
- 20:4b0b449ddb12
- Child:
- 23:6340bfc0bfe3
--- a/main.cpp Fri Aug 09 10:45:36 2013 +0000 +++ b/main.cpp Fri Aug 09 14:23:08 2013 +0000 @@ -63,6 +63,15 @@ cfg.setFriendlyName("UPnPBasicDevice(LPC176x)"); //set friendly name cfg.setUPnPPresentationURL("/rom/index.html"); //set presentationURL cfg.setZeroconf(true);//AutoIP enable + + /* + DHCP client has a bug which can not obtain IP address from a DHCP server. + In that case, please turn off setZeroconf and give an IP address manually as temporary solution. + cfg.setIpAddr(1,2,3,4); + cfg.setNetMask(1,2,3,4); + cfg.setGateway(1,2,3,4); + */ + UPnPBasicDeviceHttpd httpd(cfg); //create a httpd instance. net->start(cfg);