public byte [ ] getTelemetryBytes ( Beacon beacon ) { if ( beacon . getExtraDataFields ( ) . size ( ) >= 5 ) { Beacon telemetryBeacon = new Beacon . Builder ( ) . setDataFields ( beacon . getExtraDataFields ( ) ) . build ( ) ; BeaconParser telemetryParser = new BeaconParser ( ) . setBeaconLayout ( BeaconParser . EDDYSTONE_TLM_LAYOUT ) ; byte [ ] telemetryBytes = telemetryParser . getBeaconAdvertisementData ( telemetryBeacon ) ; Log . d ( TAG , "Rehydrated telemetry bytes are :" + byteArrayToString ( telemetryBytes ) ) ; return telemetryBytes ; } else { return null ; } }
Extracts the raw Eddystone telemetry bytes from the extra data fields of an associated beacon . This is useful for passing the telemetry to Google s backend services .