/20706-A2_Bluetooth/include/wiced_bt_rfcomm.h gives some explaination about API, it is almost same as given in API REF doc. Used parameters and functionality of the API is explained in the same.
Can you tell what doubt you have regarding the API with which I can help?
@@Thank you for your reply.
I want to return back to Connect when Bluetooth headset power On from power off.
I have found the port_handle is created in blow
rfcomm_result = wiced_bt_rfcomm_create_connection( UUID_SERVCLASS_HF_HANDSFREE,
( wiced_bt_port_mgmt_cback_t * )hci_control_ag_rfcomm_control_callback );
1.I want to know what is the relationship between [port_handle] and [rfc_conn_handle] and [rfc_serv_handle].
2.Could you show me the source code of wiced_bt_rfcomm_create_connection().
3.I found blow after do a survey:
When a headset connected to BT module, [port_handle] and [rfc_conn_handle] and [rfc_serv_handle] changed after the headset power On from power off,and when [port_handle]=[rfc_conn_handle] or [rfc_serv_handle],the headset can return back to connect.
wiced_bt_rfcomm_create_connection() performs two functions: it either establishes a connection with the peer device or accepts a connection from the peer device. the return value is the port handle created by this API.
If you see the implementation in hci_control_ag_rfcomm.c, hci_control_ag_rfcomm_start_server() is called first to setup the server. rfc_serv_handle is the port handle returned after server starts. If connection is initiated by the peer device, then hci_control_ag_rfcomm_do_open() is called where peer device returns the port handle rfc_conn_handle.
Hope this clears the confusion.!
Unfortunately, I cannot provide you the source code for API wiced_bt_rfcomm_create_connection(). Although I can give you some details. The API tries to establish a port handle considering the parameters UUID, BD address and MTU size.