aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAli Saeed <saeedali@google.com>2023-03-20 18:49:11 +0000
committerCQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-03-20 18:49:11 +0000
commitb1c96f03cd4b6c1f74c35b4ff1ddb4fa0cf5b5e7 (patch)
treeff00198b5a0d3003d06135970a931e2070a74d09
parentdac6a8fcd2c14d527c37b55270ec3547b8e317cc (diff)
downloadpigweed-b1c96f03cd4b6c1f74c35b4ff1ddb4fa0cf5b5e7.tar.gz
pw_bluetooth: Add LEMetaEvent and 2 other event packets
Add LEMetaEvent, LEConnectionCompleteSubevent, and LEConnectionUpdateCompleteSubevent. Add LEClockAccuracy enum. Test: pw presubmit --step gn_emboss_build Change-Id: Ie3925563fb2324e8b9d5f37d5ff7541cf7dea197 Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/134532 Commit-Queue: Ali Saeed <saeedali@google.com> Reviewed-by: Ben Lawson <benlawson@google.com>
-rw-r--r--pw_bluetooth/public/pw_bluetooth/hci.emb77
1 files changed, 77 insertions, 0 deletions
diff --git a/pw_bluetooth/public/pw_bluetooth/hci.emb b/pw_bluetooth/public/pw_bluetooth/hci.emb
index 82463029b..d781b3f18 100644
--- a/pw_bluetooth/public/pw_bluetooth/hci.emb
+++ b/pw_bluetooth/public/pw_bluetooth/hci.emb
@@ -933,6 +933,20 @@ bits LmpFeatures(page: UInt:8):
10 [+1] Flag slot_availability_mask
11 [+1] Flag train_nudging
+
+enum LEClockAccuracy:
+ -- Possible values that can be reported for the |central_clock_accuracy| and
+ -- |advertiser_clock_accuracy| parameters.
+ [maximum_bits: 8]
+ PPM_500 = 0x00
+ PPM_250 = 0x01
+ PPM_150 = 0x02
+ PPM_100 = 0x03
+ PPM_75 = 0x04
+ PPM_50 = 0x05
+ PPM_30 = 0x06
+ PPM_20 = 0x07
+
# ========================= HCI packet headers ==========================
@@ -2476,6 +2490,69 @@ struct ReadRemoteSupportedFeaturesCompleteEvent:
$next [+8] LmpFeatures(0) lmp_features
-- Page 0 of the LMP features.
+
+struct LEMetaEvent:
+ let hdr_size = EventHeader.$size_in_bytes
+ 0 [+hdr_size] EventHeader header
+ $next [+1] UInt subevent_code
+ -- The event code for the LE subevent.
+
+
+struct LEConnectionCompleteSubevent:
+ 0 [+LEMetaEvent.$size_in_bytes] LEMetaEvent le_meta_event
+
+ $next [+1] StatusCode status
+
+ $next [+2] UInt connection_handle
+ -- Only the lower 12-bits are meaningful.
+ [requires: 0x0000 <= this <= 0x0EFF]
+
+ $next [+1] ConnectionRole role
+
+ $next [+1] LEPeerAddressType peer_address_type
+
+ $next [+BdAddr.$size_in_bytes] BdAddr peer_address
+ -- Public Device Address or Random Device Address of the peer device.
+
+ $next [+2] UInt connection_interval
+ -- Time: N * 1.25 ms
+ -- Range: 7.5 ms to 4 s
+ [requires: 0x0006 <= this <= 0x0C80]
+
+ $next [+2] UInt peripheral_latency
+ [requires: 0x0000 <= this <= 0x01F3]
+
+ $next [+2] UInt supervision_timeout
+ -- Time: N * 10 ms
+ -- Range: 100 ms to 32 s
+ [requires: 0x000A <= this <= 0x0C80]
+
+ $next [+1] LEClockAccuracy central_clock_accuracy
+ -- Only valid for a peripheral. On a central, this parameter shall be set to 0x00.
+
+
+struct LEConnectionUpdateCompleteSubevent:
+ 0 [+LEMetaEvent.$size_in_bytes] LEMetaEvent le_meta_event
+
+ $next [+1] StatusCode status
+
+ $next [+2] UInt connection_handle
+ -- Only the lower 12-bits are meaningful.
+ [requires: 0x0000 <= this <= 0x0EFF]
+
+ $next [+2] UInt connection_interval
+ -- Time: N * 1.25 ms
+ -- Range: 7.5 ms to 4 s
+ [requires: 0x0006 <= this <= 0x0C80]
+
+ $next [+2] UInt peripheral_latency
+ [requires: 0x0000 <= this <= 0x01F3]
+
+ $next [+2] UInt supervision_timeout
+ -- Time: N * 10 ms
+ -- Range: 100 ms to 32 s
+ [requires: 0x000A <= this <= 0x0C80]
+
# ============================ Test packets =============================