2017-02-21 32 views

回答

0

是的,您只需按照新的github README部分解释HTTP传输选项即可。

干杯,

0

您只需要所有设备的配置/模板。这样的配置必须指定协议是IoTA-JSON,传输是HTTP。该请求被发送到JSON的物联网剂的nothbound接口:

POST http://iota_host:iota_port/iot/services 
Fiware-Service: <service> 
Fiware-ServicePath: <subservice> 

{ 
    "services": [ 
     { 
     "entity_type": "<default_entity_type>", 
     "protocol": "IoTA-JSON", 
     "transport": "HTTP", 
     "apikey": "<api_key>", 
     "attributes": [ "<common_active_attrs_if_any>" ], 
     "lazy": [ <common_lazy_attrs_if_any> ], 
     "commands": [ <common_commands_if_any> ], 
     "static_attributes": [ <common_static_attrs_if_any> ] 
     } 
    ] 
} 

之后,你就可以使用HTTP传输基于JSON的规定设备:

POST http://iota_host:iota_port/iot/devices 
Fiware-Service: <service> 
Fiware-ServicePath: <subservice> 

{ 
    "devices": [ 
     { 
     "device_id": "<device_id>", 
     "entity_name": "<entity_name>", 
     "entity_type": "<alternative_entity_type>", 
     "attributes": [ <additional_active_attrs_if_any> ], 
     "lazy": [ <additional_lazy_attrs_if_any> ], 
     "commands": [ <additional_commands_if_any> ], 
     "static_attributes": [ <additional_static_attrs_if_any> ] 
     } 
    ] 
} 

甚至,你可以创建没有指定传输的配置/模板,即配置/模板将只与所有基于Json的代理相关,而与传输无关,然后在配置基于Json的设备时指定传输。