IoT Gateway
Operations
Gateway -> Device
- SendControlMessage : Index -> Format -> Data -> Success
Device -> Gateway
- SendSensorUpdate : Index -> Format -> Data
Controller -> Gateway
- GetSensors : [ DeviceId, Index, CRC ] -> [ DeviceId, Index, CRC, Data ]
- SendControl : [ DeviceId, Index, Format, Data ] -> Success
Attach device
- AttachRequest : DeviceId -> [D:Format] -> [C:Format]
- AttachConfirm : same as SendControlMessage with pre-defined control format
- User and controller may be involved in accepting an new device
Security
- Encryption key kan be installed at factory or installed once at attach
Cloud Gateway Data Structures
TBD
Edge Gateway Data Structures
Lookup table for control data : intermediate data towards devices
- [ Device ID, SegmentIndex, DataIndex, ControlFormatId, CRC ] : static element size
- DeviceIndex specify number if multiple control segements are supported
- [ Data ] : variable element size where element start is at
DataIndex
- [ ControlFormatId, ControlFormatSpec ]
Lookup table for sensor data : latest sensor data from devices
- [ Device ID, SegmentIndex, DataIndex, SensorFormatId, CRC ] : static element size
- DeviceIndex specify number if multiple control segements are supported
- [ Data ] : variable element size where element start is at
DataIndex
- [ SensorFormatId, SensorFormatSpec ]
Data format spec
- [ Name, Type ]
Device Data Structures
Sensor data is stored in C code structires which can be translated to binary air protocol
- [ SegmentIndex, ControlData ]
- [ SegmentIndex, SensorData ]
TODO
References
Tags: IoT, MQTT, Gateway