How to use rsl10 asha sending audio stream to ble_android_asha example

hi,I am implementing asha sending . following 2 sample codes in RSL10 SDK .
the sending RSL10 is using ble_central_client_bond sample code , the receiving RSL10 is using ble_android_asha sample code .
initially I hard code the peer address in ble_central_client_bond , and I can see ble connection established between the 2 RSL10 devices. now I want to initiate l2cap coc connection to ble_android_asha .here is what I add in ble_central_client_bond >>source >>app_msg_handler.c , I add L2CC_LecbConnectCmd function when GAPC_CONNECTION_REQ_IND received ,but I can not get L2CC_LECB_CONNECT_REQ_IND message on ble_android_asha .
below text is from my updates for app_msg_handler.c

块引用

case GAPC_CONNECTION_REQ_IND:
{
const struct gapc_connection_req_ind* p = param;
PRINTF("\n\r__GAPC_CONNECTION_REQ_IND");
PRINTF("\n\r ADDR: “);
for (uint8_t i = 0;i < GAP_BD_ADDR_LEN; i++)
PRINTF(”%d “, p->peer_addr.addr[i]);
PRINTF(”\n\r ADDR_TYPE: %d", p->peer_addr_type);

#if CFG_BOND_LIST_IN_NVR2
if(GAP_IsAddrPrivateResolvable(p->peer_addr.addr, p->peer_addr_type) &&
BondList_Size() > 0)
{
PRINTF("\n\r Starting GAPM_ResolvAddrCmd\n\r");
GAPM_ResolvAddrCmd(conidx, p->peer_addr.addr, 0, NULL);
}
else
#endif
{
struct gapc_connection_cfm cfm;
APP_SetConnectionCfmParams(conidx, &cfm);
GAPC_ConnectionCfm(conidx, &cfm); /* Send connection confirmation */

#if CFG_BOND_LIST_IN_NVR2
if(GAPC_IsBonded(conidx)) /* If previously bonded, send encryption request /
{
GAPC_EncryptCmd(conidx, GAPC_GetBondInfo(conidx)->EDIV,
GAPC_GetBondInfo(conidx)->RAND,
GAPC_GetBondInfo(conidx)->LTK, GAP_KEY_LEN);
PRINTF("\n\r__Sending GAPC_EncryptCmd");
}
else /
If not previously bonded, send bond request /
{
struct gapc_pairing pairing =
{
.iocap = GAP_IO_CAP_NO_INPUT_NO_OUTPUT,
.oob = GAP_OOB_AUTH_DATA_NOT_PRESENT,
.key_size = KEY_LEN,
.ikey_dist = (GAP_KDIST_IDKEY | GAP_KDIST_SIGNKEY),
.rkey_dist = (GAP_KDIST_ENCKEY | GAP_KDIST_IDKEY | GAP_KDIST_SIGNKEY),
#ifdef SECURE_CONNECTION
.auth = GAP_AUTH_REQ_SEC_CON_BOND,
.sec_req = GAP_SEC1_SEC_CON_PAIR_ENC
#else /
ifdef SECURE_CONNECTION /
.auth = GAP_AUTH_REQ_NO_MITM_BOND,
.sec_req = GAP_NO_SEC
#endif
};
PRINTF(" \n\r__Sending GAPC_BondCmd\n\r");
GAPC_BondCmd(conidx, &pairing);
}
#endif /
#if CFG_BOND_LIST_IN_NVR2 */
}

        //sending LECB_CONNECT ,this not work ,no indication in ble_android_asha 
        struct l2cc_lecb_connect_cmd lecb_connect;
        lecb_connect.operation = L2CC_LECB_CONNECT;
        lecb_connect.le_psm = ASHA_LE_PSM;
        lecb_connect.local_credit = ASHA_L2CC_INITIAL_CREDITS;
        lecb_connect.local_mps = 251;
        lecb_connect.local_mtu = 512;  
  
       // L2CC_LecbConnectCmd(conidx, &lecb_connect); 

        /* If not yet connected to all peers, keep scanning */
        if(GAPC_GetConnectionCount() < APP_NB_PEERS)
        {
         //   GAPM_StartConnectionCmd(&startConnectionCmd);
        //   for test , this is working ,I can see indication in   ble_andorid_asha
 		   GAPC_ParamUpdateCmd(conidx, 16,16,12,200,13,100);
 		  PRINTF("\n\r GAPC_ParamUpdateCmd");
        }

块引用

so my question is : how to intital l2cap coc connection after gap connection established

below is debug output when
android phone connecting to ble_android_asha,I can get L2CC_LECB_CONNECT_REQ_IND output

块引用

sending GAPM_LEPSM_REG_CMD…
GAPM_LEPSM_REG: LEPSM registered successfully
GAPC_CONNECTION_REQ_IND: con_interval=36, con_latency = 0, sup_to = 500, clk_acc uracy = 5
ADDR: 203 140 133 161 9 65
ADDR_TYPE: 1
Starting GAPM_ResolvAddrCmd

GAPM_ADDR_SOLVED_IND connectionCfm->ltk_present = 1

GAPC_BOND_REQ_IND / GAPC_PAIRING_REQ: accept = 1 conidx=0
GAPC_BOND_REQ_IND / GAPC_CSRK_EXCH
GAPC_PARAM_UPDATE_REQ_IND: intv_min=6, intv_max = 6, latency = 0, time_out = 500
GAPC_PARAM_UPDATE_REQ_IND: intv_min=36, intv_max = 36, latency = 0, time_out = 5 00
ASHA_ReadOnlyProperties_Callback: conidx=0 length=17
ASHA_LE_PSM_Callback: conidx=0, length=2, le_psm=0x 0A8
ASHA_MsgHandler: L2CC_LECB_CONNECT_REQ_IND le_psm=0xA8
ASHA_MsgHandler: L2CC_LECB_CONNECT_IND: peer_cid=92
ASHA_Volume_Callback: conidx=0 volume=-38
APP_ASHA_CallbackHandler - ASHA_VOLUME_CHANGE: volume=-38

GAPC_PARAM_UPDATE_REQ_IND: intv_min=16, intv_max = 16, latency = 10, time_out = 100
ASHA_AudioControlPoint_Callback: opCode=3 codec=2 audioType=16 volume=-38, other State=0

APP_ASHA_CallbackHandler - ASHA_AUDIO_STATUS. Other peripheral state: 2

块引用

can rsl10 used to initial l2cc_credit_connection ? because when I am trying to initial a LECB_CONNECT
I get l2cc_cmp_evt ,it has status = L2C_ERR_NO_RES_AVAIL

                            lecbConnectionCmd.operation = L2CC_LECB_CONNECT;
    			lecbConnectionCmd.le_psm = ASHA_LE_PSM;
    			lecbConnectionCmd.local_credit = ASHA_L2CC_INITIAL_CREDITS;
    			lecbConnectionCmd.local_mps = GAPM_DEFAULT_MPS_MAX;
    			lecbConnectionCmd.local_mtu = GAPM_DEFAULT_MTU_MAX;
    			L2CC_LecbConnectCmd(conidx, &lecbConnectionCmd);

@hfvoip
To assist you with setting up the central side of the L2CAP Connection we have put together this simple firmware based on our ‘ble_central_client_bond’ sample application.

Within this firmware we have marked all of the L2CAP specific additions with the ‘ //TODO: ’ comment tag so that you can easily find the added code. At the moment, it is only configured to negotiate an L2CAP Connection with a new device that has been paired/bonded for the first time, but it should provide a good basis for expanding the functionality.

ble_central_client_bond_L2CAP.zip (183.4 KB)

Thank you for using community forum!

thank you very much ,will test soon