You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@mynewt.apache.org by "sjanc (via GitHub)" <gi...@apache.org> on 2025/06/24 07:36:56 UTC
Re: [PR] nimble/bttester: Add manual EATT connection control to BTP tester [mynewt-nimble]
sjanc commented on code in PR #2017:
URL: https://github.com/apache/mynewt-nimble/pull/2017#discussion_r2163178868
##########
apps/bttester/src/btp_gatt.c:
##########
@@ -1950,6 +1950,27 @@ set_mult(const void *cmd, uint16_t cmd_len,
return BTP_STATUS_SUCCESS;
}
+static uint8_t
+eatt_conn(const void *cmd, uint16_t cmd_len,
+ void *rsp, uint16_t *rsp_len)
+{
+ uint16_t conn_handle;
+ const struct btp_gatt_eatt_conn_cmd *cp = cmd;
+ int rc;
+
+ ble_gap_conn_find_handle_by_addr(&cp->address, &conn_handle);
+
+ rc = ble_eatt_connect(conn_handle, cp->num_channels);
+ if (rc == BLE_HS_EALREADY) {
Review Comment:
this check doesn't seem valid, I'd suggest something like
```
if (rc == 0 || rc == BLE_HS_EALREADY) {
return BTP_STATUS_SUCCESS;
}
return BTP_STATUS_FAILED;
```
(or reverse logic if you prefer to have success as 'default' case)
--
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