|
|
Hi, I tried to implement BLE into metro app. It works for me even driver certification and meta-data creation is not fun. But generally I haven't problem and I'm able to read heart rate in metro app. But now I need add BLE support into our win32 app, there I have problem. -I can create handle for service even for device using SetupDi... functions. -I can enumerate all services,characterictics and find characterictic for heart rate with notify flag (using device or direct service handle) -I can read values from all charactreistics with read flag using BluetoothGATTGe tCharacteristic Value even with BLUETOOTH_GATT_ FLAG_FORCE_READ _FROM_DEVICE flag to read actual data directly from device. -I can register my callback function with BluetoothGATTRe gisterEvent for herat rate characteristic with S_OK result and valid pEventHandle (using service handle) -but NO callback events come from device. -if I update heart rate service driver with custom driver for metro app, win32 LE functions returns for service handle (ERROR_GEN_FAIL URE) : Device connected to device doesn't work. -if I rollback driver changes and have original driver like before, after that even callback works and everything is OK. What I'm doing wrong, please any idea? I really need to solve it... Thanks Jiri
Hi, I have a stupid question: Why do I need to write a driver with 1000s of lines of code and going through the hassle of all the driver signing crap just to access a GATT profile? In IOS its 10 lines of code to do that. Is there any possibiltiy to access BLE devices in a normal C++ exe without all the driver stupidity? Regards Harald
The drivers are required because of the restrictions imposed on the API set that can be used from a Windows Store Application. The drivers use the Win32 Bluetooth GATT API, which is available to all Windows Desktop Applications. Currently the drivers are required for all Windows Store Applications that want to use Bluetooth LE devices.
@FlorinB I dont get your answer: Is it now possible to use those API in a "normal' .exe or not? If yes can you provide me with a sample. I dont care about "Windows Store Apps". Regards
Hello, I'm tasked to create a profile driver for a glucose device, But Windows 8 was not successful in pairing with the device. Windows 8 would proceed on adding the device in the list of paired devices, but the device would prompt an error in pairing. I was hoping I could create my own Bluetooth application that will discover and pair with the device. I tried using the WinSocket and Bluetooth APIs, but neither of them works in discovering the BLE device.
Hello Jane, There are no current Windows Runtime APIs for working with Bluetooth devices for Windows 8, which is why you need a profile driver in the first place. In order to provide you with the most accurate and up to date information, we need to know more information about your Bluetooth Blood Glucose device. Can you tell us if it is a device that's already shipping, if not, as many details about the device like the Bluetooth firmware and radio manufacturer would also be helpful. In order for you to be able to work with your device, it needs to be paired with Windows, so if pairing failed, then you can't access resources on the device. Which is why the first step would be to figure out why pairing with the device failed.
Hi, Thank you for the quick response. We were not able to pair the device with Windows 8 (Acer W510), the device has customize its pairing sequence. Part of the pairing sequence requires the Windows 8 side to input the passkey displayed on the device. Windows 8 skips this part and continues with adding the device to its list of paired devices. Hence, the device prompting an error in the pairing sequence. Is there a way for me to create my own application that can discover Bluetooth LE devices and has its own custom pairing sequence that complies with device's requirements? The company provided us with an iOS App, and it was able to discover and pair with the device. The chipset used is BlueCore CSR1000 QFN - Single Mode
Can you change the IO Capabilities reported by the device in it's Pairing Response to NoInputNoOutput and require no Man In The Middle protection. That should allow for a Just Works unauthenticated pairing procedure to complete successfully.
Hi, I know that Windows 8 provides 13 BLE functions for a GATT client application to access a GATT server. Is it possible to define a GATT server role on Windows 8 so that a Bluetooth LE peripheral can access it? If so, what API's do I need to use in the profile driver to handle requests from the GATT client? Thanks, Chetan
Windows 8 does not currently support the server role (other than the mandatory server characteristics required for interoperability). The server role is primarily implemented by low energy devices which act as peripherals and Windows is the central device. As such, there are no APIs which allow Windows to function as a Bluetooth LE server.
Hi i'm trying to set a characteristic and I got this error 0x80070522(ERROR_PRIVILEGE_NOT _HELD) Events and the rest of the example works fine. Any ideas? Regards Jorge
That particular error is typically returned when using a device handle instead of a service handle to write a characteristic value. Are you using a handle of the service device interface to write the characteristic value?
Hi Can anyone provide design document of sample code, which at least explain basic architecture of codes? How one can gain insight of codes quickly and start building application around it? At present, i am able to compile the code and try to learn more about it. I have done some BLE application development of iOS and i expected similar framework for Windows surface but it is bit complicated and without documentation it makes more time consuming to learn about it. Any hint which can help to quickly analyses major requirement of code. Thanks in advance! Suresh
Hi I am getting following error when i compile it in VS pro 2012 with WDK install on it. ------------------------ 3> Stdafxsrc.cpp 3>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(69): error C2065: 'SAL_2_Clean_Vi olation_using__ out' : undeclared identifier 3>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(69): error C2146: syntax error : missing ')' before identifier 'LPCRITICAL_SEC TION' 3>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(69): error C2433: '_AtlInitialize CriticalSection Ex' : 'inline' not permitted on data declarations 3>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(69): error C2059: syntax error : ')' 3>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(70): error C2143: syntax error : missing ';' before '{' 3>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(70): error C2447: '{' : missing function header (old-style formal list?) 4>ClCompile: 4> Stdafxsrc.cpp --------------- -- 4>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(69): error C2065: 'SAL_2_Clean_Vi olation_using__ out' : undeclared identifier 4>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(69): error C2146: syntax error : missing ')' before identifier 'LPCRITICAL_SEC TION' 4>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(69): error C2433: '_AtlInitialize CriticalSection Ex' : 'inline' not permitted on data declarations 4>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(69): error C2059: syntax error : ')' 4>C:\Program Files\Microsoft Visual Studio 11.0\VC\atlmfc\ include\atlwinv erapi.h(70): error C2143: syntax error : missing ';' before '{' --------------- How to resolve it? Do you have any standard document which explain what this sample is doing?
Resolved compile error by removing macro as stated in thread discussion below
I have installed VS Express 2012 for windows 8 on my Laptop with Windows 8 OS. I also install VS Express 2012 update-2 and WDK. But i am unable to fix below error. I can understand that sample code is build in VS 2010 and it has one incompatible package for VS 2012 based on below error message. But i can not find anywhere "Update VC++ Projects..." Can anyone help to fix this issue? OR shall uninstall this 2012 version and use older 2010 version? Error 1 error MSB8020: The builds tools for WindowsUserModeDriver8.0 (Platform Toolset = 'WindowsUserMod eDriver8.0') cannot be found. To build using the WindowsUserMode Driver8.0 build tools, either click the Project menu or right-click the solution, and then select "Update VC++ Projects...". Install WindowsUserMode Driver8.0 to build using the WindowsUserMode Driver8.0 build tools. C:\Program Files\MSBuild\M icrosoft.Cpp\v4 .0\V110\Microso ft.Cpp.Platform .targets 44 5 WpdHealthThermo meterService
The wdk requires vs pro, it does not work with express. You can install pro for free and use it for a 90 day trial.
Hi, I would like to access to the sample driver from desktop application via DeviceIoControl. I set "\\\\.\\BTHLEDe vice\\{0000180d -0000-1000-8000 -00805f9b34fb}" to 1st parameter of CreateFile(), but it returned GetLastError code 3(ERROR_PATH_NO T_FOUND). What should I set value to 1st parameter?
Since there can be multiple Bluetooth devices implementing the Heart Rate Profile which are paired with Windows at the same time, the device path you specified above is not specific enough to access the device interface you want. To correctly open the device interface for the heart rate service, you can use the new Windows.Devices.Enumeration.De viceInformation class' FindAllAsync method with an AQS query of "System.Devices .InterfaceClass Guid:=\"{000018 0d-0000-1000-80 00-00805f9b34fb \" AND System.Devices. InterfaceEnable d:=System.Struc turedQueryType. Boolean#True". This will return a DeviceInformati onCollection with all the Bluetooth Heart Rate Services enumerated on the system. If there's only one you can use the first DeviceInformati on object's Id property and call create file on that. Alternatively you can use the older SetupDi functions to achieve the same functionality if you prefer. To quickly check your device's instance path, just open Device Manager, navigate to the heart rate service you're interested in, right-click -> Properties -> Navigate to the Details tab and select Device Instance Path to find out the instance path of your heart rate service. Please let me know if you need more information to achieve your scenario.
At first I can compile the project. But once I edited the .cpp files, many mistakes may appear, such as “WPP_INIT_TRACING”: Can not find the identifier,WPP_ CALL_HealthHear tRateService_cp p173 can not fid the identifier. I don't know how to us the wpp tracing of vs2012.
When modifying the code did you remove the #include "HealthHeartRateService.tmh" from HealthHeartRate Service.cpp? Is HealthHeartRate Service.tmh present in $(IntDir)? It should be generated during the build, if you build for Win8Debug the file should be generated at C++\WpdHealthHe artRate\Win8Deb ug\WpdBluetooth GattServiceDriv er.tmh
First thank you for answering my question. I did not remove the "HealthHeartRateService.tmh". And the ".tmh" file was generated in $(IntDir). I just added some comment in the source file.