This is a native module written in C programming language, which can be loaded by the Azure IoT Gateway SDK.
The convertor module will receive the message sent from a BLE or Simulated_Device module, and then convert the data into json format as
{"deviceId": "Intel NUC Gateway", "messageId": 0, "temperature": 0.0}
You can run the SDK's BLE or simulated_device_cloud_upload sample correctly.
clone this repo into a linux system (Intel NUC), then run the following command:
chmod 777 build.sh # change the build script runnable
sed -i -e "s/\r$\/\/" build.sh # remove the invalid windows character
./build.sh
Note the libmy_module.so
binary file's absolutely path.
-
Choose the
ble_gateway.json
orsimulated_device_cloud_upload.json
according to whether you run a BLE sample or simulated_device sample -
Add a new module as
MyModule
using the following json{ "name": "MyModule", "loader": { "name": "native", "entrypoint":{ "module.path": "[Your libmy_module.so path]" } }, "args": null },
-
Modify the
links
parta. if you are using the BLE sample, modify the
links
partfrom:
{ "source": "SensorTag", "sink": "mapping" }
to:
{ "source": "SensorTag", "sink": "MyModule" }, { "source": "MyModule", "sink": "mapping" }
b. if you are using the simulated_device_cloud_upload sample, modify the
links
partfrom:
{ "source": "BLE", "sink": "mapping" }
to:
{ "source": "BLE", "sink": "MyModule" }, { "source": "MyModule", "sink": "mapping" }