Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
http://www.interdigital.com/post/getting-started-with-arm-mbed-os-and-wot-io 這裡說明了一個基本的mbed client 程式控制流程
initialize i2c initialize FXOS8700QAccelerometer initialize Ethernet adapter acquire a DHCP lease initialize an ipv4 tcp/ip stack pick a random port and create a M2MInterface object to connect to MDS create a M2MSecurity context for our MDS connection create a M2MDevice object to create the device's OMNA LWM2M resources create a M2MObject that will actually represent our device sensor tree create two M2MResources for our x and y axis (not following the OMNA LWM2M conventions) add our M2MObject and M2MDevice to a list to be used to update registrations setup a timer to update the registration every 20 seconds enable the accelerometer setup a timer to sample the accelerometer every 5 seconds setup a callback to setup the device and resource registrations start the main scheduler loop