Module iot_device_bridge::device_adapter
source · [−]Expand description
Device Adapter for bridging and transformig messages from device to the messages to cloud IoT.
Objectives:
- events filtering
- standardizing the event to
cloudevents.io
format
Workflow:
- maps the topic according to the dictionary (HashMap) in DeviceState got via DeviceShadow
- checks if the event is whitlisted and if true
- retrieves the subject from the dictionary (whitelist)
- calls the
create_device_iot_message
which maps the device message to standardized format - sends the message to the IoT Connector for publishing to AWS IoT Core
Structs
DeviceState
is a structure holding parameters for device specific processing in DeviceStateConfig
as structured in the Device Shadow.
The DeviceState
defines the sub-structure to correspond to the node config
in the Device Shadow.
DeviceStateConfig
is a structure holding parameters for device specific processing.
In this DeviceAdapter it is data for event mapping, event filtering and source id transformation.
EventFilter
is a structure storing the parameters and rules for filtering of messages.
Enums
Device topics filter strategy type
Device identifier type
Functions
The on_device_event
is called when a PUBLISH message is received from the device broker.