- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to develop a simple C++ application that will grab real time sensor data from the Wiced Sense SDK and hardware.
I have successfully modified the HelloClient windows app to be a simple console application (without MFC). I have verified I can grab simple device information like battery life and manufacturer/model names.
Now what I am unsure about is how to enable notifications from the device. Beyond that, once notifications are enabled, how do I poll for sensor data? Do I need a callback that will hit everytime the BLE device gets data? I am a bit lost here and since the documentation is a bit sparse, and code not well commented, I am not really sure what I should be doing from here.
There is a function called RegisterNotification(); in the Win8Interface.cpp file, but I am not clear on how I should be using this function.
I have tried analyzing the Android app code to see if I can figure out how its enabling notifications and live streaming sensor data, but havent found the clues I need.
Can anyone lend a hand or point me to some documentation I might have missed?
Thanks in advance,
Justin
Solved! Go to Solution.
- Labels:
-
WICED Sense
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thankyou Vik86. FYI - I was able to successfully modify the Hello Client windows app example to grab sensor data from the Wiced Sense. It was not very straightforward and we had to port code over from using MFC and change alot of the variable types from wide character string (wcstr) types to standard (cstr) to work as a simple console application.
I look forward to seeing your official windows wiced sense app example.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello jschunick,
Take a look at this Table of Contents:
Specifically these sections:
WICED Sense Firmware Walk-Thru Video
Thanks
JT
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi JT,
I have already reviewd all of the videos and documentation found on your website, but it doesnt speak to anything regarding C++ windows application development.
You have a helloclient.exe app example, which I am trying to use, but it is not documented or commented very well. I need to figure out how to enable notifications using the functions already existing in the code that Broadcom provided.
The function, I believe, is: RegisterNotification()
Is this the correct function? I try running the function, but it doesnt seem to take any inputs to send enable or disable notifications. From your code:
void CBtWin8Interface::RegisterNotification()
{
// register to receive notification
GUID guid = UUID_HELLO_SERVICE;
HANDLE hService = OpenBleService(&m_bth, &guid);
if (hService == INVALID_HANDLE_VALUE)
return;
BLUETOOTH_GATT_VALUE_CHANGED_EVENT_REGISTRATION reg;
reg.NumCharacteristics = 1;
reg.Characteristics[0] = m_charHelloNotify;
if (m_pEventHandle == INVALID_HANDLE_VALUE)
{
HRESULT hr = BluetoothGATTRegisterEvent(hService, CharacteristicValueChangedEvent, ®, &NotificationCallback, m_NotificationContext, &m_pEventHandle, BLUETOOTH_GATT_FLAG_NONE);
ods("BluetoothGATTRegisterEvent hr:0x%x\n", hr);
}
CloseHandle(hService);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I believe all of our code is written in C.
Here's some additional threads you will find useful during your research:
Introduction to Format of WICED Sensor Data
WICED Sense Notification and Characteristic values, e.g. Temp
Reading WICED Sense Data from JavaScript
What causes the sensor Tag to send measurements?
WICED Sense Notification and Characteristic values, e.g. Temp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@mwf_mmfae,
You have a C++ windows application example in your SDK. I am referring to the visual studio project, which is located here: \\WICED-Smart-SDK-2.1.1\WICED-Smart-SDK\Apps\hello_sensor\peerapps\Windows\HelloClient
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We have a windows client app to read sensor data, its being tested right now, once we have it we shall post that .
Thnx
vik86
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thankyou Vik86. FYI - I was able to successfully modify the Hello Client windows app example to grab sensor data from the Wiced Sense. It was not very straightforward and we had to port code over from using MFC and change alot of the variable types from wide character string (wcstr) types to standard (cstr) to work as a simple console application.
I look forward to seeing your official windows wiced sense app example.
Thanks.