Hi Dialog
I modifity the newest DSPS(host) project, I'm using the "da1458x_config_basic.h", I change the CFG_MAX_CONNECTIONS parameter to 6 to allow multiple slave to connect.
However, once the first slave(DA14580) established connect, the other slave(DA14580) are unable connect to host(DA14580).next I do not how to modifity the project.could you
帮我个忙吗?请求e give me some suggest or introduce this function's document.
Thanks!
Keywords:
Device:
Hi RandyYu,
请求e check the following posthttp://support.dialog-semiconductor.com/dsps-connect-few-peripheral-one-....
Thanks MT_dialog
It is possible to modify DSPS to support multiple peripherals.
But you will have to get deep into understanding the DSPS code architecture, and make numerous extensive modifications.
We have successfully done it, but you have to tread carefully.
A few notes:
You need to decide how you will handle your UART port. Are you going to share one UART port amongst all the Peripherals ?
- That of course gets weird ... in our case, we added a "multiplexing" data protocol over one shared UART port.
- There is a 2nd UART on the DA14580, so you also have the option of dedicating a 2nd UART port ... but this would only allow supporting 2 Peripherals
- RTS/CTS flow control ... you need to figure out how to handle this when supporting multiple Peripherals.
- you need to decide what you want to accomplish here
Modify the connection strategy
- Presently DSPS connects to the first DSPS peripheral it finds
- You will need to determine your own strategy, and modify the code appropriately.
Modify the DPSP code to support multiple instances
- a lot of the DSPS code simply uses "TASK_SPS_CLIENT" when referencing a ke_task_id_t structure
- this is a bit of short-cutting code ... it effectively means an instance of TASK_SPS_CLIENT on connection index 0 (conidx = 0)
- you need to modify all these calls to use the "proper" instance of "TASK_SPS_CLIENT" throughoutALLof the appropriate code
- For example ... original DSPS code may have something like this ...
struct sps_client_data_tx_req * req = KE_MSG_ALLOC_DYN(SPS_CLIENT_DATA_TX_REQ, TASK_SPS_CLIENT, TASK_APP, sps_client_data_tx_req, msg->length);
- You would need to change it to something like this to properly refer to the right instance of the TASK_SPS_CLIENT
ke_task_id_t task_sps_client_instance_id = KE_BUILD_ID(TASK_SPS_CLIENT, conidx);
struct sps_client_data_tx_req * req = KE_MSG_ALLOC_DYN(SPS_CLIENT_DATA_TX_REQ, task_sps_client_instance_id, TASK_APP, sps_client_data_tx_req, msg->length);
But as mentioned, to make it work, you really have to get very deep into understanding all the operations of DSPS.
Thanks, Martin
Hi MSun,
Thanks for sharing your implementation.
Best Regards MT_dialog
Hi Dialog
As Mr.MSun mentioned in the above post ,
void user_sps_enable(uint16_t conhdl)
{
ke_task_id_t task_sps_client_instance_id = KE_BUILD_ID(TASK_SPS_CLIENT, app_env_vp.devices[conhdl].conidx);
struct sps_client_enable_req * req = KE_MSG_ALLOC(SPS_CLIENT_ENABLE_REQ, task_sps_client_instance_id, TASK_APP,
sps_client_enable_req );
// Fill in the parameter structure
req->conhdl = app_env_vp.devices[conhdl].conhdl; //req->conhdl = conhdl;
req->con_type = PRF_CON_DISCOVERY;
}
like this do i have to change all the other functions ?? => void user_send_ble_data(const uint8_t *data, uint16_t length )
=> void user_send_ble_flow_ctrl(uint8_t flow_ctrl )
for that do i have to pass the param -> conhdl from all the below fuctions ??
=> user_sps_client_enable_cfm_handler
=> user_sps_client_data_tx_cfm_handler
=> user_sps_client_data_rx_ind_handler
=> user_sps_client_tx_flow_ctrl_ind_handler ,
Thank you Dialog