none
Windows Bluetooth LE apis - event callbacks RRS feed

  • Question

  • Hi,
    I'm couple days experimenting with bluetooth LE in win8. I need to implement it into win32 app. And also need to know how to do it for metro app. I'm implementing it for heart rate strap.

    At first I tried to do it for metro app, because there is more info about it. Finally I created custom driver profile, update original driver with my own, created meta-data for app package and it works. It looks realiable and test app catches events from driver with heart rate data. But I've qestions about this part.
    What we can do if more apps in metro wants to comunicate with heart rate strap. Profile driver cound by installed just one?

    And most important question for me now is about win32. I prepared app where I find device handle for GUID {0000180D-0000-1000-8000-00805f9b34fb} using SetupDi.. functions. Final handle of device is from CreateFileW and using InterfaceDetailData->DevicePath from SetupDiGetDeviceInterfaceDetail.
    BLE apies works fine, I can enumerate services,charactreustics,descriptors. I also call function BluetoothGATTRegisterEvent with S_OK result. I expect callback events, but nothing happens. But it's strange.
    I can use BLE apis just without profile driver. (if I want to use BLE apis with profile driver I get device handle but after call of first api method to enumerate services i get ERROR_GEN_FAILURE-device conneced to system doesn't work. I can use driver just in metro app and there is all ok. But after I roll back driver changes and reinsall profile driver to original and start win32 app, after that works also win32 app, I can even catch heart rate data using event callback there. But before NOT, what I'm doing wrong?

    Now only way how to catch callback in win32 is
    -BluetoothGATTRegisterEvent result S_OK but No event callback come to app.
    -update original service driver to own profile service driver
    -rollback to original driver
    -now win32 api BluetoothGATTRegisterEvent result also OK, but now callbacks works
    What I should do to catch callback without any changes with service profile driver.

    thanks
    jSamcak

    Monday, April 29, 2013 10:17 AM

Answers

All replies