Stream Gyro data to PC

Hi,

I'm trying to stream gyroscope data to a PC over BLE using c++. Has anyone done this? I'm looking for information on how to get started.

Thanks!

Comments

  • You can check out the MetaWear C++ API GitHub page for how to information.
    https://github.com/mbientlab/Metawear-CppAPI/wiki/API-v0.3.0-How-To

    Are you planning on doing your whole project with C++?  I have only used the C# Btle functions but I suspect the C++ equivalents have the same or very similar names.
  • Hi Eric, I am doing the whole project with C++ because there is a C++ toolkit I need for other aspects of the project.

    What I really need help with is setting up a bluetooth connection with the sensor. Any help would be appreciated! Thanks!
  • If you're developing a Windows Universal app, then the C++ calls are pretty much the same as the C# calls.  If you're on *nix, then you'll have to use the bluez library and unfortunately I'm not that familiar with using the bluez library.
  • We are using VS on windows. If possible, we would love to see what the C# code looks like so we could try to piece it together in C++.
  • Check out the C# wrapper solution, specifically the WrapperTest project.
  • @maged Ported the C# app to C++/CX.  You should checkout his project for C++ info.

  • Thanks! I'll check it out!
  • edited May 2016
    I've been at something similar for number of weeks now ...  

    I'm running on Ubuntu 14.04 with Bluez 5.39.  If anybody has actually managed to get streaming working on a Ubuntu PC I would appreciate the insights.  I can connect, read, and write to the device, but something is going wrong with the initialization ...  It does couple reads and then a write and the callback for initialization never fires.

    [ INFO] [1464223903.956038311]: Calling gatt_read_char [0x001a]

    [ INFO] [1464223904.095766412]: Calling gatt_read_char [0x0014]

    [ INFO] [1464223904.235732515]: Calling gatt_write_char [0x001d]: 0x01

    What is the sequence of reads and writes one should expect when using metawear c++ api?
  • Yes, but ...

    The best I can tell the MetaWear notification characteristic is not changing or at least I'm not getting the notification (so nothing to forward).  I'll double check maybe I did not enable it properly or too late.

  • ...  Yes, everything works much better once you turn on notification on the correct characteristic.  

    Just for the record to turn on notification for METAWEAR_SERVICE_NOTIFY_CHAR one has to write 0100 to 0x0020 on a Metawear CPRO. 
This discussion has been closed.