网关REST模式文件中似乎忽略了"操作"数组

2020-09-20 19:38发布

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


大家好,

最近要解决此问题,在其中映射这样的属性:

" device_data":{" type":" object"," mapTo":" value"," actions":[{" type":" ADD"," mapTo":" capability_alternate_id"," value": " HR003"},{" type":" ADD"," mapTo":" sensor_type_alternate_id"," value":123123123},{" type":" ADD"," mapTo":" sensor_alternate_id"," value": " hrsens01"}]," properties":{" *":{" mapKeyTo":" property_name"," mapTo":" value"}}}

制作"动作"数组似乎被忽略了,这种单测量功能不会发生这种情况:

" user_uuid":{" type":" integer"," mapTo":" value"," actions":[{" type":" ADD"," mapTo":" capability_alternate_id"," value": " HR001"},{" type":" ADD"," mapTo":" sensor_type_alternate_id"," value":123123123},{" type":" ADD"," mapTo":" sensor_alternate_id"," value": " hrsens01"}]}

请问我做错什么了吗?

谢谢

Federico

         点击此处--->   EasySAP.com群内免费提供SAP练习系统(在群公告中)

加入QQ群:457200227(SAP S4 HANA技术交流) 群内免费提供SAP练习系统(在群公告中)


大家好,

最近要解决此问题,在其中映射这样的属性:

" device_data":{" type":" object"," mapTo":" value"," actions":[{" type":" ADD"," mapTo":" capability_alternate_id"," value": " HR003"},{" type":" ADD"," mapTo":" sensor_type_alternate_id"," value":123123123},{" type":" ADD"," mapTo":" sensor_alternate_id"," value": " hrsens01"}]," properties":{" *":{" mapKeyTo":" property_name"," mapTo":" value"}}}

制作"动作"数组似乎被忽略了,这种单测量功能不会发生这种情况:

" user_uuid":{" type":" integer"," mapTo":" value"," actions":[{" type":" ADD"," mapTo":" capability_alternate_id"," value": " HR001"},{" type":" ADD"," mapTo":" sensor_type_alternate_id"," value":123123123},{" type":" ADD"," mapTo":" sensor_alternate_id"," value": " hrsens01"}]}

请问我做错什么了吗?

谢谢

Federico

付费偷看设置
发送
3条回答
土豆飞人
1楼-- · 2020-09-20 19:48

你好费德里科,

我们需要更多详细信息来帮助您。

您的目标是什么? 您能否提供消息的示例,以及如何将消息的字段映射到IoTServices Capability/Sensor/SensorType?

亲切的问候,

Andrea

bbpeas
2楼-- · 2020-09-20 19:48

嗨Andrea,

我正在附加JSON文件,以使其更具可读性。 我正在考虑的功能是 capability.txt 。 我可以通过发送类似 format1.txt 的文件来做到这一点,但是我想要 是以 format2.txt 的格式发送的。 我已经尝试过 schema1.txt schema2.txt 。 在第一种情况下,没有报告错误,但IoTS未接收到测量结果。 在第二种情况下,我附加了 gatewaylog.txt ,但基本上似乎将它们视为单个功能,并且 而不是多指标功能。

最诚挚的问候,

Federico

闻人可可
3楼-- · 2020-09-20 19:46

嗨Federico,

要在不指定 capabilityAlternateId , sensorAlternateId 和 sensorTypeAlternateId 的情况下发送Bean,则必须使用如下模式: >
 {
 " type":"对象",
 " parserData":{
 " format":" JSON",
 "资源":" MQTT_message",
 " messageType":"默认",
 " messageTypeFinder":{
 " format":" JSON_POINTER",
 " jsonPointer":"/img/messageType"
 }
 },
 "动作":[{
 " type":" ADD",
 " mapTo":" sensor_type_alternate_id",
 "值":123123123
 },{
 " type":" ADD",
 " mapTo":" capability_alternate_id",
 "值":" HR003"
 },{
 " type":" ADD",
 " mapTo":" sensor_alternate_id",
 " value":" hrsens01"
 }
 ],
 "属性":{
 " device_data":{
 " type":"对象",
 " mapTo":"值"
 }
 }
 }

 

并以数组格式的数组发送有效载荷,例如:

 {
 " device_data":[[20,"序列",96," fw_version"," hw_version","罗马"]]
 } 

一周热门 更多>