Closed satendra929 closed 7 years ago
Namespace is 16 bytes not 32. This question would make more sense on StackOverflow maybe?
Sorry I am new to this community. I thought this would be relevant as the code I wrote was in reference to the one in the repo. I'll go ahead and remove this if asked to.
They bytes you've provided show a common pitfall: Confusing hex vs bytes vs UTF-8 vs other encodings.
The code "01020304050607080910".getBytes();
encodes the given string into bytes using the platform's default charset (Could be UTF-8, or something else). https://docs.oracle.com/javase/7/docs/api/java/lang/String.html#getBytes()
Instead, what you want here is to parse the given string as hex. The sample code here: https://github.com/google/eddystone/blob/master/eddystone-uid/tools/txeddystone-uid/TxEddystone-UID/app/src/main/java/com/google/sample/txeddystone_uid/MainActivity.java#L357 does this, but there may be libs you could use to avoid having to "roll your own".
Thanks a lot for your reply. I think that is what causing the issue.
Hi,
As per the repo , I am trying to make an app that sends out UID frames. Here's a code snippet private void advertise() { //To check if Bluetooth Multiple Advertising is supported on the Device if( !BluetoothAdapter.getDefaultAdapter().isMultipleAdvertisementSupported() ) { Toast.makeText( this, "Multiple advertisement not supported", Toast.LENGTH_SHORT ).show(); start.setEnabled(false); }
What could be causing the data to be too large ? The service data is built as per the code in the repo.