Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nimble/host: Add support to send power control event in registered callback #1490

Merged
merged 1 commit into from
Oct 10, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions nimble/host/src/ble_gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,34 +1721,38 @@ void
ble_gap_rx_le_pathloss_threshold(const struct ble_hci_ev_le_subev_path_loss_threshold *ev)
{
struct ble_gap_event event;
uint16_t conn_handle = le16toh(ev->conn_handle);

memset(&event, 0, sizeof event);

event.type = BLE_GAP_EVENT_PATHLOSS_THRESHOLD;
event.pathloss_threshold.conn_handle = le16toh(ev->conn_handle);
event.pathloss_threshold.conn_handle = conn_handle;
event.pathloss_threshold.current_path_loss = ev->current_path_loss;
event.pathloss_threshold.zone_entered = ev->zone_entered;

ble_gap_event_listener_call(&event);
ble_gap_call_conn_event_cb(&event, conn_handle);
}

void
ble_gap_rx_transmit_power_report(const struct ble_hci_ev_le_subev_transmit_power_report *ev)
{
struct ble_gap_event event;
uint16_t conn_handle = le16toh(ev->conn_handle);

memset(&event, 0, sizeof event);

event.type = BLE_GAP_EVENT_TRANSMIT_POWER;
event.transmit_power.status = ev->status;
event.transmit_power.conn_handle = le16toh(ev->conn_handle);
event.transmit_power.conn_handle = conn_handle;
event.transmit_power.reason = ev->reason;
event.transmit_power.phy = ev->phy;
event.transmit_power.transmit_power_level = ev->transmit_power_level;
event.transmit_power.transmit_power_level_flag = ev->transmit_power_level_flag;
event.transmit_power.delta = ev->delta;

ble_gap_event_listener_call(&event);
ble_gap_call_conn_event_cb(&event, conn_handle);
}
#endif

Expand Down
Loading