[英]FIWARE IoT Agent: how to send the location attribut to the contextBroker Entity?
我想使用 MQTT IoT 代理向 contextBroker 中的實體添加位置信息。 我按照這個鏈接這樣做https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus/blob/develop/doc/modules.md
我的問題是屬性“位置”作為字符串發送到 contextBroker 而不是作為“坐標”
這是我發送給 MQTT IoT 代理的內容:
int qos = 1;
boolean retain = false;
String topic = "myKey/sensorId/location";
String payload= "12.5/14.5";
this.dataService.publish(topic, position.getBytes(), qos, retain, 2);
我假設 contextBroker 中的位置屬性將具有“coords”類型,類似於:
{
"name":"position",
"type":"coords",
"value":"33.000,-3.234234",
"metadatas":[
{
"name":"location",
"type":"string",
"value":"WGS84"
}]
}
但是我在 contextBroker 中得到的是:
"location" : {
"value" : "12.5/14.5",
"type" : "string",
"md" : [
{
"name" : "TimeInstant",
"type" : "ISO8601",
"value" : "2015-11-24T16:26:09.530507"
}
],
"creDate" : 1448382369,
"modDate" : 1448382369
}
我錯過了什么? 在此先感謝您的幫助!
我想通了,在開始使用它之前,我必須使用屬性“位置”在物聯網代理中注冊設備。
"attributes": [
{ "object_id":"location",
"type": "coords",
"name":"position"
} ]
確切地說,您在“MQTT”和“Ultralight”部分的“轉換為位置實體...”小節中有完整的描述:
https://github.com/telefonicaid/fiware-IoTAgent-Cplusplus/blob/develop/doc/modules.md
感謝您使用 FIWARE!
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.