Merge "Set preferred PHY and read PHY implementation (2/3)"

This commit is contained in:
Jakub Pawlowski 2017-03-24 01:08:07 +00:00 committed by Gerrit Code Review
commit 4929629d91
2 changed files with 26 additions and 0 deletions

View file

@ -166,6 +166,10 @@ typedef void (*services_removed_callback)(int conn_id, uint16_t start_handle, ui
/** GATT services were added */
typedef void (*services_added_callback)(int conn_id, btgatt_db_element_t *added, int added_count);
/** Callback invoked when the PHY for a given connection changes */
typedef void (*phy_updated_callback)(int conn_id, uint8_t tx_phy,
uint8_t rx_phy, uint8_t status);
typedef struct {
register_client_callback register_client_cb;
connect_callback open_cb;
@ -184,6 +188,7 @@ typedef struct {
get_gatt_db_callback get_gatt_db_cb;
services_removed_callback services_removed_cb;
services_added_callback services_added_cb;
phy_updated_callback phy_updated_cb;
} btgatt_client_callbacks_t;
/** Represents the standard BT-GATT client interface. */
@ -255,6 +260,14 @@ typedef struct {
bt_status_t (*conn_parameter_update)(const bt_bdaddr_t *bd_addr, int min_interval,
int max_interval, int latency, int timeout);
bt_status_t (*set_preferred_phy)(int conn_id, uint8_t tx_phy,
uint8_t rx_phy, uint16_t phy_options);
bt_status_t (*read_phy)(
int conn_id,
base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)>
cb);
/** Test mode interface */
bt_status_t (*test_command)( int command, btgatt_test_params_t* params);

View file

@ -105,6 +105,10 @@ typedef void (*congestion_callback)(int conn_id, bool congested);
/** Callback invoked when the MTU for a given connection changes */
typedef void (*mtu_changed_callback)(int conn_id, int mtu);
/** Callback invoked when the PHY for a given connection changes */
typedef void (*phy_updated_callback)(int conn_id, uint8_t tx_phy,
uint8_t rx_phy, uint8_t status);
typedef struct {
register_server_callback register_server_cb;
connection_callback connection_cb;
@ -120,6 +124,7 @@ typedef struct {
indication_sent_callback indication_sent_cb;
congestion_callback congestion_cb;
mtu_changed_callback mtu_changed_cb;
phy_updated_callback phy_updated_cb;
} btgatt_server_callbacks_t;
/** Represents the standard BT-GATT server interface. */
@ -156,6 +161,14 @@ typedef struct {
bt_status_t (*send_response)(int conn_id, int trans_id,
int status, btgatt_response_t *response);
bt_status_t (*set_preferred_phy)(int conn_id, uint8_t tx_phy,
uint8_t rx_phy, uint16_t phy_options);
bt_status_t (*read_phy)(
int conn_id,
base::Callback<void(uint8_t tx_phy, uint8_t rx_phy, uint8_t status)>
cb);
} btgatt_server_interface_t;
__END_DECLS