You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2025/07/25 15:57:39 UTC
(mynewt-nimble) branch master updated (3bb26716e -> ae62dda39)
This is an automated email from the ASF dual-hosted git repository.
janc pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
from 3bb26716e ci: add GitHub Action to validate commit message style
new 90ce3a4ca nimble/bttester: Enable subrating for bttester
new 78e3b2f9f nimble/btp: Add support for subrating procedures
new 2022fb776 nimble/btp: Subrate change event handling
new ae62dda39 nimble/host/gap: Add callback for subrate change event
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
apps/bttester/src/btp/btp_gap.h | 22 ++++++++++++++
apps/bttester/src/btp_gap.c | 67 +++++++++++++++++++++++++++++++++++++++++
apps/bttester/syscfg.yml | 1 +
nimble/host/src/ble_gap.c | 1 +
4 files changed, 91 insertions(+)
(mynewt-nimble) 03/04: nimble/btp: Subrate change event handling
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 2022fb776ae63bb4302b397d25d6dc2d7fb0fc8c
Author: Szymon Czapracki <sz...@codecoup.pl>
AuthorDate: Mon Jul 7 17:10:51 2025 +0200
nimble/btp: Subrate change event handling
Add Subrate change event definition and handling
in BTP layer.
---
apps/bttester/src/btp/btp_gap.h | 11 +++++++++++
apps/bttester/src/btp_gap.c | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 48 insertions(+)
diff --git a/apps/bttester/src/btp/btp_gap.h b/apps/bttester/src/btp/btp_gap.h
index ac6f26d5a..c95a0d219 100644
--- a/apps/bttester/src/btp/btp_gap.h
+++ b/apps/bttester/src/btp/btp_gap.h
@@ -455,3 +455,14 @@ struct gap_periodic_transfer_recieved_ev {
uint8_t status;
ble_addr_t peer_addr;
} __packed;
+
+#define GAP_EV_SUBRATE_CHANGE 0x92
+struct gap_subrate_change_ev {
+ ble_addr_t addr;
+ uint8_t status;
+ uint16_t conn_handle;
+ uint16_t subrate_factor;
+ uint16_t periph_latency;
+ uint16_t cont_num;
+ uint16_t supervision_tmo;
+} __packed;
diff --git a/apps/bttester/src/btp_gap.c b/apps/bttester/src/btp_gap.c
index 220bbd74e..29fb50a10 100644
--- a/apps/bttester/src/btp_gap.c
+++ b/apps/bttester/src/btp_gap.c
@@ -1265,6 +1265,30 @@ periodic_transfer_received(struct ble_gap_event *event)
}
#endif
+#if MYNEWT_VAL(BLE_CONN_SUBRATING)
+static void
+subrate_change_received(struct ble_gap_event *event)
+{
+ int rc;
+ struct ble_gap_conn_desc desc;
+ struct gap_subrate_change_ev ev;
+
+ rc = ble_gap_conn_find(event->subrate_change.conn_handle, &desc);
+ assert(rc == 0);
+
+ ev.addr = desc.peer_ota_addr;
+ ev.status = event->subrate_change.status;
+ ev.conn_handle = event->subrate_change.conn_handle;
+ ev.subrate_factor = event->subrate_change.subrate_factor;
+ ev.periph_latency = event->subrate_change.periph_latency;
+ ev.cont_num = event->subrate_change.cont_num;
+ ev.supervision_tmo = event->subrate_change.supervision_tmo;
+
+ tester_event(BTP_SERVICE_ID_GAP, GAP_EV_SUBRATE_CHANGE, (uint8_t *)&ev,
+ sizeof(ev));
+}
+#endif
+
static void
print_bytes(const uint8_t *bytes, int len)
{
@@ -1563,6 +1587,19 @@ gap_event_cb(struct ble_gap_event *event, void *arg)
event->periodic_transfer.adv_clk_accuracy);
periodic_transfer_received(event);
break;
+#endif
+#if MYNEWT_VAL(BLE_CONN_SUBRATING)
+ case BLE_GAP_EVENT_SUBRATE_CHANGE:
+ console_printf(
+ "Subrate change received:"
+ "status=%d, conn_handle=%d, subrate_factor=%d, perpih_latency=%d,"
+ "cont_num=%d supervision_tmo=%d",
+ event->subrate_change.status, event->subrate_change.conn_handle,
+ event->subrate_change.subrate_factor,
+ event->subrate_change.periph_latency, event->subrate_change.cont_num,
+ event->subrate_change.supervision_tmo);
+ subrate_change_received(event);
+ break;
#endif
default:
break;
(mynewt-nimble) 01/04: nimble/bttester: Enable subrating for bttester
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 90ce3a4caa5b5ffb67416dce19f17da051cf0ced
Author: Szymon Czapracki <sz...@codecoup.pl>
AuthorDate: Mon Jul 7 12:49:50 2025 +0200
nimble/bttester: Enable subrating for bttester
Enable subrating features for bttester.
This feature is required for following tests:
GAP/CSUB/CSR/BV-01-C & GAP/CSUB/CSU/BV-01-C.
---
apps/bttester/syscfg.yml | 1 +
1 file changed, 1 insertion(+)
diff --git a/apps/bttester/syscfg.yml b/apps/bttester/syscfg.yml
index 646c1b66a..18fa8afb0 100644
--- a/apps/bttester/syscfg.yml
+++ b/apps/bttester/syscfg.yml
@@ -189,3 +189,4 @@ syscfg.vals.!BTTESTER_NODEFAULT:
BLE_MESH_RX_SEG_MAX: 13
BLE_MESH_TX_SEG_MSG_COUNT: 2
BLE_MAX_CONNECTIONS: 8
+ BLE_CONN_SUBRATING: 1
(mynewt-nimble) 04/04: nimble/host/gap: Add callback for subrate change event
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit ae62dda39e6f155025cdb4199f9aee34370b6f69
Author: Szymon Czapracki <sz...@codecoup.pl>
AuthorDate: Tue Jul 8 10:58:03 2025 +0200
nimble/host/gap: Add callback for subrate change event
`ble_gap_rx_subrate_change()` handler now
invokes `ble_gap_call_conn_event_cb()` to allow applications to react
to subrate change events.
This addition ensures that registered connection event callbacks are
notified when a subrate change occurs, providing better support
for LE Subrate procedures.
---
nimble/host/src/ble_gap.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index baa010e0b..80ab840c8 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -1993,6 +1993,7 @@ ble_gap_rx_subrate_change(const struct ble_hci_ev_le_subev_subrate_change *ev)
event.subrate_change.supervision_tmo = le16toh(ev->supervision_tmo);
ble_gap_event_listener_call(&event);
+ ble_gap_call_conn_event_cb(&event, ev->conn_handle);
}
#endif
(mynewt-nimble) 02/04: nimble/btp: Add support for subrating procedures
Posted by ja...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
commit 78e3b2f9fd53f395ff1d5ef8ce7a7282c775cc7f
Author: Szymon Czapracki <sz...@codecoup.pl>
AuthorDate: Mon Jul 7 12:51:43 2025 +0200
nimble/btp: Add support for subrating procedures
Add proper BTP subrating commands and functions in GAP.
Required to satisfy corresponding auto-pts layer.
---
apps/bttester/src/btp/btp_gap.h | 11 +++++++++++
apps/bttester/src/btp_gap.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+)
diff --git a/apps/bttester/src/btp/btp_gap.h b/apps/bttester/src/btp/btp_gap.h
index 5485cd66e..ac6f26d5a 100644
--- a/apps/bttester/src/btp/btp_gap.h
+++ b/apps/bttester/src/btp/btp_gap.h
@@ -328,6 +328,17 @@ struct gap_periodic_adv_sync_transfer_recv_cmd {
uint16_t sync_timeout;
uint8_t flags;
} __packed;
+
+#define GAP_SUBRATE_REQUEST 0x2b
+struct gap_subrate_request_cmd {
+ ble_addr_t address;
+ uint16_t subrate_min;
+ uint16_t subrate_max;
+ uint16_t max_latency;
+ uint16_t cont_num;
+ uint16_t supervision_timeout;
+} __packed;
+
/* events */
#define BTP_GAP_EV_NEW_SETTINGS 0x80
struct btp_gap_new_settings_ev {
diff --git a/apps/bttester/src/btp_gap.c b/apps/bttester/src/btp_gap.c
index 48e995867..220bbd74e 100644
--- a/apps/bttester/src/btp_gap.c
+++ b/apps/bttester/src/btp_gap.c
@@ -2210,6 +2210,29 @@ periodic_adv_sync_transfer_set_info(const void *cmd, uint16_t cmd_len,
}
#endif
+#if MYNEWT_VAL(BLE_CONN_SUBRATING)
+static uint8_t
+subrate_request(const void *cmd, uint16_t cmd_len, void *rsp, uint16_t *rsp_len)
+{
+ const struct gap_subrate_request_cmd *cp = cmd;
+ struct ble_gap_conn_desc desc;
+ int rc;
+
+ rc = gap_conn_find_by_addr(&cp->address, &desc);
+ if (rc) {
+ return BTP_STATUS_FAILED;
+ }
+
+ rc = ble_gap_subrate_req(desc.conn_handle, cp->subrate_min, cp->subrate_max,
+ cp->max_latency, cp->cont_num, cp->supervision_timeout);
+ if (rc) {
+ return BTP_STATUS_FAILED;
+ }
+
+ return BTP_STATUS_SUCCESS;
+}
+#endif
+
static const struct btp_handler handlers[] = {
{
.opcode = BTP_GAP_READ_SUPPORTED_COMMANDS,
@@ -2380,6 +2403,13 @@ static const struct btp_handler handlers[] = {
.func = periodic_adv_sync_transfer_recv,
},
#endif
+#if MYNEWT_VAL(BLE_CONN_SUBRATING)
+ {
+ .opcode = GAP_SUBRATE_REQUEST,
+ .expect_len = sizeof(struct gap_subrate_request_cmd),
+ .func = subrate_request,
+ },
+#endif
};
static void