Hi
I am using the DSPS to perform role switching: I constantly changing the role from peripheral to central, and also has two options for the advertising packet (for summarize -> transmission of advertise 1, advertise 2 ,scanning ...) . I am using the app_gapm_reset_op(); for reset of the stack between the transmission. If I am scanning I change in the static struct gapm_set_dev_config_cmd* app_easy_gap_dev_config_create_msg(void) the role to CENTRAL_MST (0x05) and if ADVERTISING , it will 0x0A (Peripheral role).
My problem is that when I am connecting to the device, the peer device does not able to discover the services, and it return empty from some reason. If am resetting the stack but changing only from one advertiser to another, this is not happening, and services are being detected, so I thing this is somehow related to the scanning definition.
The connection initiator is the peer device (when the DA1480 is on advertise mode).
Any idea why this could happen ?
Thanks
Hi,
One correction, it also happens even without scanning. I have noticed that there is no SPS_SERVER_ENABLE_CFM callback when it happens.
Hi asalhuv,
I am not sure how the implementation is done, but be aware that, when the connection is established either acting as a central or acting as a peripheral the device goes into a discovery procedure mode. That means that acting as a central upon connection establishment you start sending some commands to the peripheral in order to discover the available services on the peripheral. In the DSPS host this is initiated app_prf_enable() function that will start this discovery chain. Upon completion the device will start operating in its normal functionallity.
Regarding the peripheral side of the DSPS, upon powering up the device the peripheral needs to build the databases that will form the supported services, this building of the services is done in the app_db_init_start() function, the SDK will check the supported profiles and will invoke the cretion of the db function (in the case of the DSPS the user_sps_db_create() function). That will result in a full set of services in the peripheral. So regarding your issue, do you implement those services in the peripheral side in order for the Client to be able to discover them? By just switching from central to peripheral isn't enough for the peripheral to also include the services that you require.
Thanks MT_dialog
Hi
After RESET, the data bases are initiated in peripheral mode. I am using app_gapm_reset_op() for reset between the modes.For scanning mode, I only change the cmd->role in the app_easy_gap_dev_config_create_msg(void) function to be GAP_CENTRAL_MST. When the timer is done, I reset the stack again and then configure the cmd->role as Peripheral.
连接是由对等设备(smartp发起hone) , obviously when my device is in peripheral mode. It seems that altohgh the DB was indeed created (i see it in the app_db_init_start() which returns TRUE) , there is no data base data to send to the peer device.
No need for explanation, just figured it out myself. I started to advertise before the data base was ready.
Thanks !!!
Hi salhuv,
Thanks for indicating.
Best regards MT_dialog