Google Proximity Beacon API 中 getforobserved 方法的遥测格式是什么?

Which is the telemetry format for the getforobserved method in Google Proximity Beacon API?

我想在调用 Google proximity beacon api.

的 getforobserved 方法时发送 beacon 的涡流遥测数据

文档不明确:https://developers.google.com/beacons/proximity/reference/rest/v1beta1/beaconinfo/getforobserved#Observation

对于遥测字段,它指出:

The array of telemetry bytes received from the beacon. The server is responsible for parsing it. This field may frequently be empty, as with a beacon that transmits telemetry only occasionally.

我应该在 json 中输入什么?我应该只发送 TLM 帧还是完整的 eddystone 数据包?我应该使用 base64 对其进行编码吗?有人能给我举个例子吗?谢谢

文档没有说明字节应该如何编码,但是 base64 是一个合理的假设,因为 the beacon id is encoded 就是这样。因此,如果您有一个看起来像这样的遥测字节字符串(以十六进制显示的字节):

2000000000080100000001000000

Base 64 编码为:

IAAAAAAIAQAAAAEAAAA=

所以你可以尝试发送这样的东西:

{
...
  "telemetry": "IAAAAAAIAQAAAAEAAAA=",
...
}