michal-narajowski commented on a change in pull request #744: [WIP] Add support 
for Enhanced LE CoC as per BT 5.2 
URL: https://github.com/apache/mynewt-nimble/pull/744#discussion_r375387077
 
 

 ##########
 File path: apps/btshell/src/main.c
 ##########
 @@ -2265,35 +2324,53 @@ btshell_l2cap_event(struct ble_l2cap_event *event, 
void *arg)
 #endif
 
 int
-btshell_l2cap_create_srv(uint16_t psm, int accept_response)
+btshell_l2cap_create_srv(uint16_t psm, uint16_t mtu, int accept_response)
 {
 #if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) == 0
     console_printf("BLE L2CAP LE COC not supported.");
     console_printf(" Configure nimble host to enable it\n");
     return 0;
 #else
 
-    return ble_l2cap_create_server(psm, BTSHELL_COC_MTU, btshell_l2cap_event,
+    if (mtu == 0 || mtu > BTSHELL_COC_MTU) {
+        mtu = BTSHELL_COC_MTU;
+    }
+
+    return ble_l2cap_create_server(psm, mtu, btshell_l2cap_event,
                                    INT_TO_PTR(accept_response));
 #endif
 }
 
 int
-btshell_l2cap_connect(uint16_t conn_handle, uint16_t psm)
+btshell_l2cap_connect(uint16_t conn_handle, uint16_t psm, uint16_t mtu, 
uint8_t num)
 {
 #if MYNEWT_VAL(BLE_L2CAP_COC_MAX_NUM) == 0
     console_printf("BLE L2CAP LE COC not supported.");
     console_printf(" Configure nimble host to enable it\n");
     return 0;
 #else
 
-    struct os_mbuf *sdu_rx;
+    struct os_mbuf *sdu_rx[num];
+    int i;
 
-    sdu_rx = os_mbuf_get_pkthdr(&sdu_os_mbuf_pool, 0);
-    assert(sdu_rx != NULL);
+    if (mtu == 0 || mtu > BTSHELL_COC_MTU) {
+        mtu = BTSHELL_COC_MTU;
+    }
+
+    console_printf("L2CAP CoC MTU: %d, max available %d", mtu, 
BTSHELL_COC_MTU);
 
 Review comment:
   Missing newline

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to