@ TargetApi ( Build . VERSION_CODES . FROYO ) public String getBase64EncodedTelemetry ( Beacon beacon ) { byte [ ] bytes = getTelemetryBytes ( beacon ) ; if ( bytes != null ) { String base64EncodedTelemetry = Base64 . encodeToString ( bytes , Base64 . DEFAULT ) ; // 12-21 00:17:18.844 20180-20180/? D/EddystoneTLMAccessor: Rehydrated telemetry bytes are :20 00 00 00 88 29 18 4d 00 00 18 4d 00 00 // 12-21 00:17:18.844 20180-20180/? D/EddystoneTLMAccessor: Base64 telemetry bytes are :IAAAAIgpGE0AABhNAAA= Log . d ( TAG , "Base64 telemetry bytes are :" + base64EncodedTelemetry ) ; return base64EncodedTelemetry ; } else { return null ; } }
Extracts the raw Eddystone telemetry bytes from the extra data fields of an associated beacon and base64 encodes them . This is useful for passing the telemetry to Google s backend services .