模组规格配置文件样例
模组规格配置文件需要开发者在{project_dir}/config/module_def目录下新建module_demo.json文件。
{ "id": 1, "name": "demo", "category": "addition", "driver": "/usr/local/mindx/MindXOM/lib/libdemo_adapter.so", "dynamic": true, "attributes": { "name": { "description": "device name", "type": "string", "id": 1, "accessMode": "Read" }, "class": { "description": "device class", "type": "string", "id": 2, "accessMode": "Read" }, "present": { "description": "device present", "type": "int", "id": 65537, "accessMode": "ReadWrite" }, "temperature": { "description": "device temperature", "type": "float", "id": 65538, "accessMode": "ReadWrite" }, "voltage": { "description": "device voltage", "type": "float", "id": 65539, "accessMode": "ReadWrite" }, "switch": { "description": "device switch", "type": "bool", "id": 65540, "accessMode": "ReadWrite" }, "memory": { "description": "device memory", "type": "long long", "id": 65541, "accessMode": "ReadWrite" }, "version": { "description": "device version", "type": "string", "id": 65542, "accessMode": "ReadWrite" }, "signal": { "description": "device account info", "type": "json", "id": 65543, "accessMode": "ReadWrite", "subAttributes": { "signal_type": { "accessMode": "ReadWrite", "description": "signal_type", "type": "string", "id": 1 }, "signal_strength": { "accessMode": "ReadWrite", "description": "signal_strength", "type": "string", "id": 2 } } } } }
父主题: 附录