monitor: Add support for decoding Broadcom Raw RSSI command

This commit is contained in:
Marcel Holtmann 2018-06-16 22:27:51 +02:00
parent d81794bf40
commit 3a28583216
3 changed files with 32 additions and 0 deletions

View File

@ -49,6 +49,11 @@ static void print_handle(uint16_t handle)
packet_print_handle(handle);
}
static void print_rssi(int8_t rssi)
{
packet_print_rssi(rssi);
}
static void print_sco_routing(uint8_t routing)
{
const char *str;
@ -364,6 +369,24 @@ static void write_uart_clock_setting_cmd(const void *data, uint8_t size)
print_clock_setting(clock);
}
static void read_raw_rssi_cmd(const void *data, uint8_t size)
{
uint16_t handle = get_le16(data);
print_handle(handle);
}
static void read_raw_rssi_rsp(const void *data, uint8_t size)
{
uint8_t status = get_u8(data);
uint16_t handle = get_le16(data + 1);
int8_t rssi = get_s8(data + 3);
print_status(status);
print_handle(handle);
print_rssi(rssi);
}
static void write_ram_cmd(const void *data, uint8_t size)
{
uint32_t addr = get_le32(data);
@ -540,6 +563,9 @@ static const struct vendor_ocf vendor_ocf_table[] = {
{ 0x045, "Write UART Clock Setting",
write_uart_clock_setting_cmd, 1, true,
status_rsp, 1, true },
{ 0x048, "Read Raw RSSI",
read_raw_rssi_cmd, 2, true,
read_raw_rssi_rsp, 4, true },
{ 0x04c, "Write RAM",
write_ram_cmd, 4, false,
status_rsp, 1, true },

View File

@ -3881,6 +3881,11 @@ void packet_print_handle(uint16_t handle)
print_handle_native(handle);
}
void packet_print_rssi(int8_t rssi)
{
print_rssi(rssi);
}
void packet_print_ad(const void *data, uint8_t size)
{
print_eir(data, size, true);

View File

@ -51,6 +51,7 @@ void packet_print_version(const char *label, uint8_t version,
void packet_print_company(const char *label, uint16_t company);
void packet_print_addr(const char *label, const void *data, bool random);
void packet_print_handle(uint16_t handle);
void packet_print_rssi(int8_t rssi);
void packet_print_ad(const void *data, uint8_t size);
void packet_print_features_lmp(const uint8_t *features, uint8_t page);
void packet_print_features_ll(const uint8_t *features);