亲爱的对话框
首先,我会描述我的项目,我的从属是SNM模块,在连接之后,Master应该将请求写入从属,然后传感器数据是传输的。
其次,我的主人从DSP项目修改。
Q1:When master connected to Slave_1,master send a write request to it(i put the code in user_sps_client_enable_cfm_handler).then the master can receive the sensor data.
然后连接到slave_2,但主站无法将请求写入slave_2。
在调试后,我发现连接到slave_1后,然后主更改为sps_client_connection。
So I want to ask,how to process the SPS_CLIENT_CONNECTED(I mean when set it?connected Slave_1 or connected all the slave)and APP_CONNECTABLE ?or it 's caused by other reason.
Q2:can master send control cmd(notification)to Slave_2 ,when master connected to Slave_1 and have data transmiting?
Q3:可以同时使用Slave_1和Slave_2发送数据吗?或者必须通过转动将数据转换为更改Slave_1至Slave_2
Q4:你有更好的方法检查主站是扫描状态吗?
谢谢你的回复
Device:
Hi RandyYu,
Q1。关于SPS_CLIENT_CONNECTED只是一个年代tate of the profile that the application checks in order to know if a device is connected or not. When a connection is established the user_on_connection callback is invoked to inform the application, in user_on_connection function the app_prf_enable() function goes through, and enables, all the project involved profiles. In DSPS project, since the dsps profile is the only one existing profile, the app_prf_enable() calls only the user_sps_enable() for the specific connection. When enabling a profile in a client, you start the discovery procedure of the central, when the discovery procedure ends then the dsps client turns the application's state in SPS_CLIENT_CONNECTED. In a general application when you set the device as connected depends on the user application.
Q2。Q3。关于多个连接,如本帖子所述http://support.dialog-semiconductor.com/multiple-slaveda14580-connection...DSP不支持在不同外设上的多个连接,您需要重型自定义,以便实现这样的内容,处理sps_client_connected不是您的问题。DSP只有一个连接(Conidx 0,这是您所做的第一个连接)。请检查以下帖子http://support.dialog-semiconductor.com/multiple-slaveda14580-connection...关于修改一个人应该考虑以便使用DSP执行多次发送。
Q4。由于DSP仅支持一个连接,因此连接后,设备将其视为自连接,只要调用扫描操作,任务_App的状态就会成为App_connectable并且当设备将其连接到App_connection时,它会更改。在一个多连接方案中,连接后,将user_scan_start()的调用再次将Task_App状态更改为App_Connectable,因此该设备扫描的公平指示。
谢谢mt_dialog.
Q2 / Q3第一个URL是“无法找到此页面”
我需要以下职能enable slave to send data
UINT8_T METIOL_START [3] = {0x20,0x03,0x01};
/ *写请求* /
prf_gatt_write_ntf_ind(con_info,0x16,prf_cli_start_ntf);// custom2通知启用
prf_gatt_write_ntf_ind(con_info, 0x13, PRF_CLI_START_NTF); //custom1 notify enable
prf_gatt_write(con_info, 0x18, measure_start, sizeof (uint8_t)*3,GATTC_WRITE_NO_RESPONSE);
现在我有一个问题,
Q1:SPS主机环境变量中有多少CON_INFO?
Q2:如何更改con_info以启用下一个奴隶?
Hi RandyYu,
在DSP中,正如它的结构化,每次执行连接和SPS服务发现时,与配置文件相关的数据(连接的处理程序,从发现过程中发现的数据库结构以及其他信息)都是存储在一个反向变量中(在SPS_CLIENT_INIT中启动该变量)。在DSP中,它实现了仅支持一个连接的连接,即环境变量与一个SPS_TASK密切相关。当您执行例如写入外设时,调用宏PRF_CLIENT_GET_ENV以便索引索取数据并填写本地SPSC_ENV_TAG类型变量。由于它仅在称为PRF_Client_Get_Env时仅支持一个连接,它只被称为它只需重新编制一个SPSC_ENV_TAG,它们只能只包含一个连接只有一个CON_INFO。
您可以尝试使用存储在设备上的可用连接的App_Env变量,您可以检查填充SPSC环境中的Con_Info(在SPS_CLIENT_ENABLE_REQ_HANDLLER中),也许您只能使用一个环境并仅更改连接信息,但这只是自临时解决方案以来我提到的是,DSP支持多个奴隶needs heavy customizationand not just a tweak on the original code。
谢谢mt_dialog.
现在我有点混乱this process of multiple connection,does the below process is right?
- > user_scan_start.
->change the APP_STATE to APP_SCANNING (APP_SCANNING is added in APP_STATE by myslef)
->go to connect the needed slave
- >将app_state更改为app_connectable
- > user_on_scanning_Completed.
- > user_on_connection.
- > user_sps_enable.
- >向连接的从属发送写请求
- >然后重复此过程
Hi RandyYu,
Having multiple connections will probably need a quite different scheme in order to know the status of your device, i mean that probably when connected to the first you will have the state of your device as connected but after that you would will start scanning again. Its up to you how the application will handle its state. In the proximity monitor application for example, that handles more than one connections, when connected and scanning the application doesn't change its state to SCAN but the state remains as CONNECTED.
谢谢mt_dialog.
1.您所说的状态是应用程序状态或任务状态?当连接后,我的任务状态设置为连接。
2.if master connected to one slave and have data exchange,can the master coninute to scanning?
3.如果我想将Task_App状态的所有任务索引设置为可连接,我如何修改Ke_State_Set(Task_App,App_connectable);
Hi RandyYu,
1.我所指的状态是应用程序状态而不是配置文件状态,如果这是你的意思。如果您已经连接到设备,并且您正在扫描下一个扫描配置文件的状态,因为在触发配置文件状态的DSP上,因此触发了相应的处理程序。例如,当设备连接时,存在不同的处理程序,并且当设备处于发现状态时可用的不同的处理程序。
2.我没有看到任何问题,可以连接到一个从站并继续扫描。
3.是,使用ke_state_set更改任务的状态(application_task,state_of_the_task)
谢谢mt_dialog.