Overview on data mapping
IMPACT IoT provides the capability to map data from Devices into the IMPACT IoT data model and to map resources received from IMPACT IoT into the message formats that are acceptable to the device. The mapping is performed by the transformation gateway.
Uplink data transfer:
Upon receiving the uplink payload, the transformation gateway selects the script, that matches the manufacturer and model of the device. Further, the decode function of the script is executed. The script has the device-specific decode logic.
Further, the script decode function returns the resource details present in the payload to the transformation gateway as a notification message.
Downlink data transfer:
Using IMPACT IoT console or APIs, jobs such as read, write or execute are queued on a particular device resource. In the case of mapped protocol devices, read operation is a bidirectional message, which means, the device receives the read request and sends back a response. The write and execute operations are unidirectional, which indicates that the device does not send any response or acknowledgement for these requests from IMPACT IoT.
When a job is initiated from the IMPACT IoT console or through API, the transformation gateway then selects the codec script, that matches the manufacturer and model of the device. It then invokes the encode function in the script. The script encode function has the device-specific logic to form the payload, which is interpreted by the device. The transformation gateway takes this payload and forwards it towards the device. The device upon receiving the payload request processes it further. If the operation is unidirectional, then the flow ends here. Otherwise, for example, for a read operation on a resource, it is associated with a response from the device after which the flow is completed.
The response from the device takes the same flow as described in the uplink flow. However, unlike the notification message, the transformation gateway identifies a pending request associated with this response. Hence, it forwards the decoded message from the script as a response message to the read request.
Further, this message is forwarded to IMPACT IoT, which then updates the job with the received response.
Reference: For more information on example codec scripts, see Sample scripts section.