RPI-Pico-Arduino-AzSDK: The Src Lib
Much of this additional functionality has been hived off into a separate directory under the sketch folder. This has also been copied as top level folder of the repository which could eventually become a compiled Arduino library.
This is the sixteenth (and final … for now) post in this series.
The Azure_IoT_Hub_RPI_Pico_LightSensor_WithCDM project has extended the ESP2866 Sample in the Azure SDK for C Arduino, (which is based upon the Azure Embedded SDK for C), to include more detailed CD Messaging, Direct Methods and Device Twins (Twin Document GET and PATCH). There are also 4 console apps for exercising this functionality whilst the blog posts here discuss in detail how to exercise the functionality through the VS Code IoT extension and using Azure IoT Explorer. Nb: Whilst there is soft restart direct method, Device Provisoning is not part of this diecussion.
Much of the added functionality is in a src folder:
The src lib
It is then reference in the sketch code file using:
It could potentailly be copied and pasted directly into another Arduino sketch project but it is not yet completely separable from the existing Azure_IoT_Hub_RPI_Pico_LightSensor_WithCDM sketch project. The MQTT setup code in the sketch file needs to be moved to the library. The networking, WiFi in this case, would continue to be setup in the ```.ino`` file but would need to be passed to the library. It is envisaged that all hardware references would remain in the sketch code but could be called from the library as a delegate.
Some ToDos here!
Another 2Do: Propeties grouped as components are ignored. Having them in the Device Twin Document doesn’t crash the software though and it won’t be hard to fully implement them.
An index to all posts on this topic can be found here
|This Category Links|
|Category:||Pico W AzSDK Index:||Pico W AzSDK|
|< Prev:||RPI-Pico-Arduino-AzSDK||Device Twin Prop PATCH|