Hi
I am currently working on a project that involves TI sensorTag(cc2541) advertise all of its data to device scanning, instead of going the route of connect and & discover. I checked, that android does not have support for parsing that scanRecord to something useful (like an JSON object). Do you guys know any good ways to archive this?
Thanks
Bo
Parsing advertisement data (scanRecord)
Parsing advertisement data (scanRecord)
Last edited by yubozhao on 03:03, 22 Nov 2014, edited 1 time in total.
Re: Parsing advertisement data (scanRecord)
You're in luck. Yesterday, working on an unrelated project, I put the finishing touches on my scanRecord parser. You'll probably want to use the "manufacturer data" field.
Re: Parsing advertisement data (scanRecord)
Hi Fredrik
You are awesome. I will check it out now, and let you know how that goes
You are awesome. I will check it out now, and let you know how that goes
Re: Parsing advertisement data (scanRecord)
hi Fredrik
I keep getting this error when I try to use it
processMessage failed: Error: RangeError: softshould be a multiple ofr cordova.js:1044
processMessage failed: Stack: RangeError: softshould be a multiple ofr
processMessage failed: Message: S11 BLE1081554528 {"scanRecord":"AgEEAwLzGAz\/16X+wAsGDwUAAAACCgAMCWNvV29ya1BvaW50CRb\/AbxqKa7WKQAAAAAAAAAAAAAAAAAAAAA=","address":"BC:6A:29:AE:D6:29","name":"coWorkPoint","rssi":-38}
for this section of code : line 202 var data = new Uint16Array(byteArray.buffer, pos, length);
I tracked it down to this https://code.google.com/p/v8/issues/detail?id=3159
Any ideas of how to fix this?
I keep getting this error when I try to use it
processMessage failed: Error: RangeError: softshould be a multiple ofr cordova.js:1044
processMessage failed: Stack: RangeError: softshould be a multiple ofr
processMessage failed: Message: S11 BLE1081554528 {"scanRecord":"AgEEAwLzGAz\/16X+wAsGDwUAAAACCgAMCWNvV29ya1BvaW50CRb\/AbxqKa7WKQAAAAAAAAAAAAAAAAAAAAA=","address":"BC:6A:29:AE:D6:29","name":"coWorkPoint","rssi":-38}
for this section of code : line 202 var data = new Uint16Array(byteArray.buffer, pos, length);
I tracked it down to this https://code.google.com/p/v8/issues/detail?id=3159
Any ideas of how to fix this?
Re: Parsing advertisement data (scanRecord)
I wonder if there is a workaround for this bug? Can the array buffer be constructed in an alternative way?
What Android version and device are you using?
Best, Mikael
What Android version and device are you using?
Best, Mikael
Re: Parsing advertisement data (scanRecord)
Issue 3159 relates only to the formatting of the error message.
According to the TypedArray specification, "The given byteOffset must be a multiple of the element size of the specific type, otherwise an exception is raised."
In your example, the Uint16Array is created with offset 5, which is not a multiple of 2. This causes the exception.
I must change the function to use more forgiving means of extracting multi-byte integers. I'll post here again once that's done.
According to the TypedArray specification, "The given byteOffset must be a multiple of the element size of the specific type, otherwise an exception is raised."
In your example, the Uint16Array is created with offset 5, which is not a multiple of 2. This causes the exception.
I must change the function to use more forgiving means of extracting multi-byte integers. I'll post here again once that's done.
Re: Parsing advertisement data (scanRecord)
Fixed, I hope.
I don't have your device, so I can't really test it, but since the exception-throwing line is gone now, it should work better.
I don't have your device, so I can't really test it, but since the exception-throwing line is gone now, it should work better.
Re: Parsing advertisement data (scanRecord)
HI guys
Thank you for all of the help!
The test device is Nexus 7 (2012) with 4.4.4 installed and rooted. I will let you know how did this go!
Thank you for all of the help!
The test device is Nexus 7 (2012) with 4.4.4 installed and rooted. I will let you know how did this go!
Return to “Questions and answers”
Who is online
Users browsing this forum: No registered users and 10 guests