You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "szymon-czapracki (via GitHub)" <gi...@apache.org> on 2025/06/25 11:48:40 UTC
[PR] EATT manual connection & multiple channels initial support [mynewt-nimble]
szymon-czapracki opened a new pull request, #2055:
URL: https://github.com/apache/mynewt-nimble/pull/2055
New syscfg options for multiple EATT channels.
Introduce multiple channels to `ble_eatt` structure.
Add new API function for connecting EATT on demand.
Add new shell command for manually connecting EATT channels.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] EATT manual connection & multiple channels initial support [mynewt-nimble]
Posted by "szymon-czapracki (via GitHub)" <gi...@apache.org>.
szymon-czapracki closed pull request #2055: EATT manual connection & multiple channels initial support
URL: https://github.com/apache/mynewt-nimble/pull/2055
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] EATT manual connection & multiple channels initial support [mynewt-nimble]
Posted by "MariuszSkamra (via GitHub)" <gi...@apache.org>.
MariuszSkamra commented on code in PR #2055:
URL: https://github.com/apache/mynewt-nimble/pull/2055#discussion_r2290670038
##########
apps/btshell/src/cmd_gatt.c:
##########
@@ -664,3 +664,38 @@ cmd_gatt_clear_pending_notif(int argc, char **argv)
return ENOTSUP;
#endif
}
+
+/*****************************************************************************
+ * $gatt-eatt-connect *
+ *****************************************************************************/
+
+int
+cmd_gatt_eatt_connect(int argc, char **argv)
+{
+#if MYNEWT_VAL(BLE_EATT_CHAN_NUM)
+ uint16_t conn_handle;
+ uint16_t chan_num;
+ int rc;
+
+ rc = parse_arg_init(argc - 1, argv + 1);
+ if (rc != 0) {
+ return rc;
+ }
+
+ conn_handle = parse_arg_uint16("conn", &rc);
+ if (rc != 0) {
+ console_printf("invalid 'conn' parameter\n");
+ return rc;
+ }
+
+ chan_num = parse_arg_uint16("chan_num", &rc);
+ if (rc != 0) {
+ console_printf("invalid 'chan_num' parameter\n");
+ return rc;
+ }
+ return ble_eatt_connect(conn_handle, chan_num);
+#else
+ console_printf("To enable this features set BLE_EATT_CHAN_NUM\n");
+ return ENOTSUP;
Review Comment:
IMO The function should be conditionally compiled as well
##########
apps/btshell/src/cmd.c:
##########
@@ -4643,6 +4662,13 @@ static const struct shell_cmd btshell_commands[] = {
.sc_cmd_func = cmd_gatt_clear_pending_notif,
#if MYNEWT_VAL(SHELL_CMD_HELP)
.help = &gatt_clear_pending_notif_help,
+#endif
+ },
+ {
+ .sc_cmd = "gatt-eatt-connect",
+ .sc_cmd_func = cmd_gatt_eatt_connect,
+#if MYNEWT_VAL(SHELL_CMD_HELP)
+ .help = &gatt_eatt_connect_help,
#endif
},
Review Comment:
Make it conditional (on `MYNEWT_VAL(BLE_EATT_CHAN_NUM)`);
It has to be conditionally compiled, otherwise it will fail, because `gatt_eatt_connect_help` is undefined if `BLE_EATT_CHAN_NUM` is not set
##########
nimble/host/src/ble_eatt.c:
##########
@@ -231,7 +310,15 @@ ble_eatt_l2cap_event_fn(struct ble_l2cap_event *event, void *arg)
ble_eatt_free(eatt);
return 0;
}
- eatt->chan = event->connect.chan;
+ chan_idx = ble_eatt_free_channel_idx(eatt);
+ if (chan_idx > 0) {
+ eatt->chan[chan_idx] = event->connect.chan;
Review Comment:
Probably, the condition is incorrect, as array index 0 is valid
##########
nimble/host/src/ble_eatt.c:
##########
@@ -472,17 +572,25 @@ int
ble_eatt_tx(uint16_t conn_handle, uint16_t cid, struct os_mbuf *txom)
{
struct ble_eatt *eatt;
+ static struct ble_l2cap_chan *channel;
int rc;
BLE_EATT_LOG_DEBUG("eatt: %s, size %d ", __func__, OS_MBUF_PKTLEN(txom));
eatt = ble_eatt_find(conn_handle, cid);
- if (!eatt || !eatt->chan) {
+ if (!eatt) {
+ BLE_EATT_LOG_ERROR("Eatt not available");
+ rc = BLE_HS_ENOENT;
+ goto error;
+ }
+
+ channel = ble_eatt_channel_find_by_cid(eatt, cid);
Review Comment:
This looks odd to me. If `ble_eatt_find()` takes as parameter `cid`, I would expect it will return `eatt` instance matching `cid` given. Now, when you place an array of channels into eatt so it does not simply wrap L2CAP channel, the `ble_eatt_find()` should not take `cid` as parameter IMO.
--
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.
To unsubscribe, e-mail: notifications-unsubscribe@mynewt.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org