fgueli
fgueli

Reputation: 367

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

I want to send beacon's eddystone telemetry when calling the getforobserved method of Google proximity beacon api.

The documentation isn't clear: https://developers.google.com/beacons/proximity/reference/rest/v1beta1/beaconinfo/getforobserved#Observation

For the telemetry field it states:

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.

What should i put in the json? Should i send only the TLM frame or the complete eddystone packet? Should i encode it using base64? Can someone point me to an example? Thanks

Upvotes: 1

Views: 249

Answers (1)

davidgyoung
davidgyoung

Reputation: 64941

The docs don't say how the bytes should be encoded, but base64 is a reasonable assumption, given that's how the beacon id is encoded. So if you have a telemetry byte string that looks like this (bytes shown in hex):

2000000000080100000001000000

The Base 64 encoding would be:

IAAAAAAIAQAAAAEAAAA=

So you could try sending something like this:

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

Upvotes: 1

Related Questions