2016-03-28 12:15 PM
Hi,
why after the aci_gap_set_discoverable and after the implementation of aci gap create_connection team advertising disappears and the connection is not established? But if carried out in the reverse order it works.P.S. Bluenrg-MS (Stack mode 3).2017-04-18 02:43 PM
Can you clarify, call by call (aci_gap..., etc.) what are your steps and what are your results and what are your expected results?
Before I see your response, I might guess that you need stack mode 4 to do what you want to do?/**
* Select the BlueNRG mode configurations.\n * @li Mode 1: slave or master, 1 connection, RAM1 only (small GATT DB) * @li Mode 2: slave or master, 1 connection, RAM1 and RAM2 (large GATT DB) * @li Mode 3: master/slave, 8 connections, RAM1 and RAM2. * @li Mode 4: master/slave, 4 connections, RAM1 and RAM2 simultaneous scanning and advertising. */#define CONFIG_DATA_MODE_OFFSET (0x2D)2017-04-27 04:46 AM
Hi,
I try to start advertising while scanning operation is enabled.
The scanning works well, but the advertising never start.
I look at the Simultaneous_Mode_Master_Slave.py script, and I found that s
imultaneous
scanning and advertising is not tested, so in fact,there is no example to show scanning and advertising at the same time.This is my functions call and configuration:
/*---------------------------------------------------------------------------*
/
Stack mode : 0x04
gap_role = GAP_PERIPHERAL_ROLE_IDB05A1 | GAP_CENTRAL_ROLE_IDB05A1;
status = aci_gap_init_IDB05A1(gap_role,0,
strlen(local_name)-2,
&service_handle,
&dev_name_char_handle,
&appearance_char_handle);
/*---------------------------------------------------------------------------*
/
After initializing the gap role, I start a scanning:
/*---------------------------------------------------------------------------*
/
aci_gap_start_general_discovery_proc(((SCAN_INTERVAL*1000)/(625)),
((SCAN_WINDOW*1000)/(625)), PUBLIC_ADDR, 0x00)/*---------------------------------------------------------------------------*
/
at this level, the scanning works well, The BlueNRG scans the adv packets and I have my EVT_LE_ADVERTISING_REPORT events.
When I scan a specific Advertising Data, I start the advertising without setting any advertising data:
/*---------------------------------------------------------------------------*
/
status = aci_gap_set_discoverable(ADV_IND, // Advertising_Event_Type
0x0320, 0x0320, PUBLIC_ADDR, // Address_Type NO_WHITE_LIST_USE,NULL
,NULL
, NULL, NULL, NULL, NULL);/*---------------------------------------------------------------------------*
/
and here I obtaint a BLE_STATUS_TIMEOUT.
I hope these information will help to get any answer about this issue.
Kind regards,
M.BRA�K
2017-04-27 08:48 AM
It looks like you are running this from a tool, and my only experience is running from debugger with actual code interacting with BlueNRG-MS over SPI, so I don't know where is the 'timeout' for your scenario - it seems there should be a return value, either success or error code ... a timeout would indicate SPI bus hang or something bad outside of just advertising/scanning request.
When you show 'Stack mode : 0x04', I suppose this means that for sure you got success from your call to aci_hal_write_config_data(CONFIG_DATA_MODE_OFFSET, CONFIG_DATA_MODE_LEN,... ?
Perhaps you can ensure that your advertising intervals of 0x0320 are achievable with your scan intervals of (SCAN_INTERVAL*1000)/(625) - perhaps you need to reduce scan window to allow time for the advertising?