DeviceHive C++ framework
This is MQX RTOS C++ framework for DeviceHive. For more information please see corresponding documentation and the description below.
DeviceHive is developed by DataArt Apps and distributed under Open Source MIT license. This basically means you can do whatever you want with the software as long as the copyright notice is included. This also means you don't have to contribute the end product or modified sources back to Open Source, but if you feel like sharing, you are highly encouraged to do so!
Copyright (C) 2012 DataArt Apps
All Rights Reserved
This is an example of a device, driven by Freescale MQX RTOS 4.1.1 (http://www.freescale.com/mqx). The example demonstrates how the device can register itself in the DeviceHive cloud, receive commands form the server and send notifications. This example was originally developed for a custom board with Freescale Kinetis K70 processor as a core and requires IAR Embedded Workbench for ARM v. 7.30 or higher installed. For now the only available workspace configuration is Debug. The Release configuration will be available soon.
- Clone the source code
- Install Freescale MQX RTOS 4.1.1 into externals\MQX_4_1 subfolder of the project.
- CyaSSL library is bound as a submodule for the project and in order to make it to build successfully, apply a patch (externals\SSL\CyaSSL-patch.diff) for CyaSSL: from within externals\SSL\CyaSSL subfolder type
git apply --ignore-space-change --ignore-whitespace ../CyaSSL-patch.diffand press enter. This action will modify the project files for building CyaSSL library and library’s settings to fit the requirements of the whole workspace.
- Follow this link http://devicehive.com/user/register to register, get a playground and get an appropriate URL to work with.
- Open IAR workspace: IDE\DeviceHive-MQX.eww
- Press Ctrl+Shift+F in order to find “
nnXXXX.pg.devicehive.com” string in the source code and change this URL to the one, you got on step 4 (do not forget to add the beginning of the URL path, e.g. /api/).
- Make board-specific and project-specific changes:
7.1. Optional. Change required MQX source files according to MQX BSP modification and other instructions. You may skip this step, but you may want to use externals\MQX-patch.diff patch to make all the necessary changes in MQX RTOS sources for running this example on the custom board this example was originally developed for (to apply the patch type
git apply --ignore-space-change --ignore-whitespace externals/ MQX-patch.difffrom within the root folder of the project and press enter). This is only illustrational action and you must not expect these changes will fit your particular board requirement!
7.2. Modify TestPin_think.c and TestPin_think.h files in Peripherals subfolder to get LEDs and Push button of your board properly controllable.
7.3. Set up the Debugger in DeviceHive-MQX->Debugger project’s options.
- In the IAR IDE go to Project->Batch build… menu, choose the Debug configuration and press Make button.