::google::protobuf::Empty* response) override {
std::unique_lock<std::mutex> lock(mutex_);
can_send_hci_command_ = false;
- hal_->sendHciCommand(
- SerializePacket(hci::InquiryBuilder::Create(0x33 /* LAP=0x9e8b33 */, static_cast<uint8_t>(request->length()),
- static_cast<uint8_t>(request->num_responses()))));
+ hci::Lap lap;
+ lap.lap_ = 0x33;
+
+ hal_->sendHciCommand(SerializePacket(hci::InquiryBuilder::Create(lap, static_cast<uint8_t>(request->length()),
+ static_cast<uint8_t>(request->num_responses()))));
while (!can_send_hci_command_) {
cv_.wait(lock);
}
packet NoCommandComplete : CommandComplete (command_op_code = NONE){
}
+struct Lap { // Lower Address Part
+ lap : 6,
+ _reserved_ : 2,
+ _fixed_ = 0x9e8b : 16,
+}
+
// LINK_CONTROL
packet Inquiry : DiscoveryCommand (op_code = INQUIRY) {
- lap0 : 8, // 0x00 - 0x3F
- _fixed_ = 0x9E8B : 16, // LAP upper bits are _fixed_
+ lap : Lap,
inquiry_length : 8, // 0x1 - 0x30 (times 1.28s)
num_responses : 8, // 0x00 unlimited
}
}
packet ReadInquiryScanActivity : DiscoveryCommand (op_code = READ_INQUIRY_SCAN_ACTIVITY) {
- _payload_, // placeholder (unimplemented)
+}
+
+packet ReadInquiryScanActivityComplete : CommandComplete (command_op_code = READ_INQUIRY_SCAN_ACTIVITY) {
+ status : ErrorCode,
+ inquiry_scan_interval : 16, // Range: 0x0012 to 0x1000; only even values are valid * 0x625 ms
+ inquiry_scan_window : 16, // Range: 0x0011 to 0x1000
}
packet WriteInquiryScanActivity : DiscoveryCommand (op_code = WRITE_INQUIRY_SCAN_ACTIVITY) {
num_support_iac : 8,
}
-struct Lap { // Lower Address Part
- lap : 6,
- _reserved_ : 2,
- _fixed_ = 0x9e8b : 16,
+packet ReadCurrentIacLap : DiscoveryCommand (op_code = READ_CURRENT_IAC_LAP) {
}
-packet ReadCurrentIacLap : DiscoveryCommand (op_code = READ_CURRENT_IAC_LAP) {
- _payload_, // placeholder (unimplemented)
+packet ReadCurrentIacLapComplete : CommandComplete (command_op_code = READ_CURRENT_IAC_LAP) {
+ status : ErrorCode,
+ _count_(laps_to_read) : 8,
+ laps_to_read : Lap[],
}
packet WriteCurrentIacLap : DiscoveryCommand (op_code = WRITE_CURRENT_IAC_LAP) {