Acquire data from smartwatch sensors via USB
5 views (last 30 days)
Show older comments
Bicalho
on 5 Mar 2021
Commented: Walter Roberson
on 5 Mar 2021
Hello, does anybody know if matlab can acquire sensors data of a smartwatch in the USB port? ps: I dont want bluetooth or UDP/similars
0 Comments
Accepted Answer
Walter Roberson
on 5 Mar 2021
That is going to depend in part on the smartwatch.
I just tried with an Apple Series 3 smartwatch. The charging cable is a USB-A, and the descriptors allowed me to find a descriptor dump at https://jaredharley.com/2015/10/03/apple-watch-magnetic-charging-cable/ that show that there is no useful transfer descriptor for the device that can be used to query data.
3 Comments
Walter Roberson
on 5 Mar 2021
USB is a shared bus. Multiple devices can be connected to the same bus, same data lines, and there are protocols about who gets to use the bus at any one time. Furthermore any one device may have data in different modes that have different priorities, such a USB camera can have a microphone (audio stream) and video stream, potentially even several of those. Each device has a unique ID that is used to send commands to it; when other devices on the same bus see a packet labeled for another device, they stop paying attention to it other than any information that might help them predict when the transmission will be finished so as to be ready promptly afterwards. Each different functionality on a device is assigned a number by the device, and the controller can ask for information about what kind of functions are supported by that section of the device. Each different section is called an endpoint, and the structured information about the capabilities of the endpoint is known as an endpoint descriptor.
I wanted to know what kind of transfers were supported by the Apple watch. For example can I stream video from the watch? If I could stream video from the watch, there would have to be an endpoint descriptor that was marked as being a video source. But the Apple smartwatch only had a single endpoint descriptor, which would be the control / status descriptor. And that descriptor was configured for the absolute minimum packet size permitted by USB, of 64 bytes, a fair bit of which is overhead. I would have to review the USB specifications to be sure, but my memory is that the minimum length packet only has room for roughly 8 bytes of data. No chance of sneaking a meaningful amount of data into a control packet for that watch.
It looks like you might be using Windows. If so then I recommend that you use USBVIEW to investigate what kinds of transfers are offered by your watch. For example if all you find is a Bulk Data endpoint, then the implication would be that the watch offers a file system... which might permit you to read back saved sensor readings but not to stream readings. It is possible, though, that it might offer streaming endpoints for the sensors; you would need to check the USB capabilities.
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!