sjanc commented on a change in pull request #744: Add support for Enhanced LE
CoC as per BT 5.2
URL: https://github.com/apache/mynewt-nimble/pull/744#discussion_r388928497
##########
File path: apps/btshell/src/main.c
##########
@@ -2334,6 +2373,43 @@ btshell_l2cap_disconnect(uint16_t conn_handle, uint16_t
idx)
#endif
}
+int
+btshell_l2cap_reconfig(uint16_t conn_handle, uint16_t mtu,
+ uint8_t num, uint8_t idxs[])
+{
+ struct btshell_conn *conn;
+ struct btshell_l2cap_coc *coc;
+ struct ble_l2cap_chan * chans[5] = {0};
+ int i, j;
+ int cnt;
+
+ conn = btshell_conn_find(conn_handle);
+ if (conn == NULL) {
+ console_printf("conn=%d does not exist\n", conn_handle);
+ return 0;
+ }
+
+ i = 0;
+ j = 0;
+ cnt = 0;
+ SLIST_FOREACH(coc, &conn->coc_list, next) {
+ for (i = 0; i < num; i++) {
+ if (idxs[i] == j) {
+ chans[cnt] = coc->chan;
+ cnt++;
+ break;
+ }
+ }
+ j++;
+ }
+
+ if (cnt != num) {
+ console_printf("Missing coc? (%d!=%d)\n", num, cnt);
Review comment:
I'd just fail here
----------------------------------------------------------------
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:
[email protected]
With regards,
Apache Git Services