cancel
Showing results for 
Search instead for 
Did you mean: 

Bluenrg_ms simultaneous master&slave

Matteo Pezzoli
Associate II
Posted on April 04, 2017 at 11:46

Hi,

I'm currently using a bluenerg_ms module; i've managed to make it work in slave and master mode (separately), and i'm now trying to wrap my head around the master&slave simultaneous mode.

What i currently do is to create a connection to a slave using the create_connection function, with this parameters:

aci_gap_create_connection(0x0010, 0x0010, STATIC_RANDOM_ADDR, slaveAddr, STATIC_RANDOM_ADDR, 0x36, 0x36, 0x00, 0xC80, 0x000C, 0x000C)

This procedure seems to work fine, the connection is established and the slave stops advertising (i can't see the slave device anymore using my phone). I then try to start an advertising procedure using the master&slave module, with these parameters:

aci_gap_set_discoverable(ADV_IND, 0x20, 0x100, STATIC_RANDOM_ADDR,NO_WHITE_LIST_USE, strlen(BLE_name) + 1, local_name, 0, NULL, 0xFFFF, 0xFFFF)

This function returns 0 (which i think is 'OK'), but i can't see the master&slave device using my phone. If i do the same procedure in reverse (advertise then connect), the advertising works fine, but the master&slave can't connect to the slave device. Is there something i'm doing wrong here?

Thanks,

Matteo

#bluenrg-master&slave #bluenrg-ms
3 REPLIES 3
Andrea Palmieri
ST Employee
Posted on April 04, 2017 at 12:59

Hi Matteo

The issue you are facing can be related to the values of ADV and SCAN intervals currently used.

Please, refer to the

http://www.st.com/content/st_com/en/products/embedded-software/mcus-embedded-software/stm32-embedded-software/stm32-ode-function-pack-sw/fp-net-blestar1.html

function pack which is an helpful example of simultaneous deployment of Master and Slave roles.

Regards

Andrea

Posted on April 04, 2017 at 13:52

Hi Andrea,

i used the same values as the function pack you linked me, but that had no effect (same result as before, function returns 0, but the device is not discoverable). The function pack uses PUBLIC_ADDR instead of STATIC_RANDOM_ADDR though: changing my code to PUBLIC_ADDR makes it work as intended, thank you! Do you have any idea why this happens? I'm pretty happy with the result as it is, but understanding why i coudn't use the STATIC_RANDOM_ADDR would help me avoid any future errors.

Thanks again.

Matteo

Posted on April 04, 2017 at 15:50

Hi Matteo

what is the version of the BlueNTG-MS FW you are using? Is it the latest one: 7.2c?