cancel
Showing results for 
Search instead for 
Did you mean: 

BlueNRG-MS reconnection issues

yon hona
Associate II
Posted on May 27, 2018 at 20:14

Hi,

I'm using the BlueNRG-MS as HID peripheral and having trouble with the re-connection process.

In order to reconnect with the central, I use directed advertising.

The central recognize the slave and I get pairing complete event. The problem is that HID service remains encrypted for some reason and thus I cannot send HID reports (GATT services works). I can see that the device is connected.

What is the correct procedure of initiating a reconnecting between bonded devices ? pseudo code will be welcome.

Thanks,

Yon

Note: this post was migrated and contained many threaded conversations, some content may be missing.
8 REPLIES 8
Andrea Palmieri
ST Employee
Posted on May 28, 2018 at 12:59

Hi Yon,

What is the application you are testing for HID on the BlueNRG-MS device? I can recommend for reference the HID profile application included in the 

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32cube-expansion-packages/x-cube-ble1.html

 package (~\Projects\Multi\Applications\Profiles_LowPower\).

Kind Redards

Andrea

Posted on May 28, 2018 at 18:58

Hi,

I don't want to use this example because it is based on a compiled closed library.

I have mine own code which works fine, just the reconnection causing me problems.

Regards,

Yon

Posted on May 29, 2018 at 14:07

Hi Yon,

The projects included in the current version of the package (v3.3.0) are based on Profile Library in source form. You can use them as a reference point (e.g., in terms of parameter setting) against your own code.

Hope that can help.

Kind Regards

Andrea

Posted on May 29, 2018 at 19:27

Hi Again,

The project you have mentioned is very bad. All the relevant code is hidden in the compiled library. It is worthless for writing production firmware.

All I'm asking is a short pseudo code or sequence I should use in order to complete the pairing process successfully. Please help me with that.

Regards

Posted on May 30, 2018 at 09:51

Hi,

I guess you are missing something. Project '~\Projects\Multi\Applications\Profiles_LowPower' is one of the available applications which includes all Profile library files in source form.

Are you sure you are synced on the latest version of the package?

Posted on May 30, 2018 at 20:59

Hi,

I'm looking in this exact same project. Lets examine the HID file hid_profile.c, for example the function Advertize() is calling another function HidDevice_Make_Discoverable which is linked to the compiled library ProfPerip_HID_Device_L476RG.bin.

Could you please please please provide a short sequence for what I want? Why this have to be so complicated

Posted on May 31, 2018 at 10:08

Hi,

First of all, the file you are mentioning does not exist. HidDevice_Make_Discoverable() is invoked by Advertize() placed in hid_profile_application.c. 

HidDevice_Make_Discoverable() is declared in 'STM32CubeExpansion_BLE1_V3.3.0\Middlewares\ST\STM32_BlueNRG\LibProfPeriph\Inc\hid_device.h' and defined in 'STM32CubeExpansion_BLE1_V3.3.0\Middlewares\ST\STM32_BlueNRG\LibProfPeriph\Src\hid_device\hid_device.c' both in source form.

Please, check your package version or download it again.

Posted on June 21, 2018 at 18:20

so I have download this version and run the example.

What I see is that the on the first pairing everything works fine, but after I reset the board and try again, the device gets 'connected' in windows Bluetooth control window, but no messages are sent. It seems like the link is not encrypted for some reason. any idea why?