pw_bluetooth: Add InquiryResultWithRssiEvent Emboss definition
Fix LEExtendedAdvertisingReportData.rssi type (UInt -> Int).
Test: pw presubmit --step gn_emboss_nanopb_build
Change-Id: I09d0508b3e649c894d8950453af236b36db1c467
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/167859
Pigweed-Auto-Submit: Ben Lawson <benlawson@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed-service-accounts.iam.gserviceaccount.com>
Reviewed-by: Ali Saeed <saeedali@google.com>
diff --git a/pw_bluetooth/public/pw_bluetooth/hci_events.emb b/pw_bluetooth/public/pw_bluetooth/hci_events.emb
index 301d2b6..bb822bd 100644
--- a/pw_bluetooth/public/pw_bluetooth/hci_events.emb
+++ b/pw_bluetooth/public/pw_bluetooth/hci_events.emb
@@ -539,7 +539,7 @@
-- Units: dBm. A value of 0x7F means Tx Power information is not available.
[requires: -127 <= this <= 20 || this == 0x7F]
- $next [+1] UInt rssi
+ $next [+1] Int rssi
-- Units: dBm. A value of 0x7F means RSSI is not available.
[requires: -127 <= this <= 20 || this == 0x7F]
@@ -614,3 +614,33 @@
let hdr_size = hci.EventHeader.$size_in_bytes
0 [+hdr_size] hci.EventHeader header
$next [+1] LinkType ll_type
+
+
+struct InquiryResultWithRssi:
+ -- A single inquiry result (with RSSI).
+ 0 [+hci.BdAddr.$size_in_bytes] hci.BdAddr bd_addr
+ -- The address for the device which responded.
+
+ $next [+1] hci.PageScanRepetitionMode page_scan_repetition_mode
+ -- The Page Scan Repetition Mode being used by the remote device.
+
+ $next [+1] UInt reserved
+ $next [+3] hci.ClassOfDevice class_of_device
+ $next [+2] hci.ClockOffset clock_offset
+ -- The lower 15 bits represent bits 16-2 of CLKNPeripheral-CLK. The most
+ -- significant bit is reserved.
+
+ $next [+1] Int rssi
+ -- Units: dBm
+ [requires: -127 <= this <= 20]
+
+
+struct InquiryResultWithRssiEvent:
+ -- Inquiry Result with RSSI Event (v1.2) (BR/EDR)
+ let hdr_size = hci.EventHeader.$size_in_bytes
+ 0 [+hdr_size] hci.EventHeader header
+ $next [+1] UInt num_responses
+ -- The number of responses included.
+
+ let response_size = InquiryResultWithRssi.$size_in_bytes
+ $next [+num_response*response_size] InquiryResultWithRssi[] responses