Hi,
I'm currently trying to develop a code based on AT Command that automatically perform the scan, connection and the command sending after
a button is pressed. I'm using the user_execute_commands(char* cmd) function.
Currently after the button pressing I can automatically scan, detect and connect to a pheripheral device (I have 2 pro-demo kit), but I'm not able to send
a remote command (e.g. ATrI). I tried to use the send_to_peer () function but it does not work. Anyway after the connection if I type from Tera Term the
remote command (e.g. ATrI) it works. I tried to check which conditions have to be satisfied and I imposed them before to call send_to_peer (). Currently I
imposed:
codeless_env。bt_role = GAP_CENTRAL_MST;
ke_state_set(TASK_APP, APP_CONNECTED);
codeless_env。linked_to_codeless_device = true;
codeless_env。gap_activity = IDLE;
codeless_env。command_route = CMD_FROM_LOCAL_RESP_PEER;
do you know any other conticiton I have to check/satisfy in order to make send_to_peer () working or do you have any suggestion?
Thank you in advance.
Giancarlo
Hi gperroni,
Well, the codeless is developed in order to quick evaluate or perform some basic BLE functionallity without having to dive in the code, since you would like to do this kind of modification i would suggest to debug and step through the send_to_peer() function when invoking it using code instead of an AT command and compare with a AT command. As far as i can tell you should be connected to a Codeless device in order for the central to have performed the discovery procedure and obtain the proper handle, i dont see anything extra, the send_to_peer() directly communicates with the stack if the codeless_env.linked_to_codeless_device is set to true.
Thanks MT_dialog