Bluetooth: nble: Update NBLE RPC interfaces
Following change in NBLE firmware update interfaces and structures. Change-Id: I47df2374961d13fabc54ee8e446a155a65999072 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
This commit is contained in:
parent
e6bffc88d2
commit
d2c87d1e86
5 changed files with 67 additions and 50 deletions
|
@ -702,12 +702,9 @@ struct ble_gap_cancel_connect_params {
|
||||||
* The response to this request is received through
|
* The response to this request is received through
|
||||||
* @ref on_ble_gap_cancel_connect_rsp
|
* @ref on_ble_gap_cancel_connect_rsp
|
||||||
*
|
*
|
||||||
* @param par Contains address of device for which the connection shall
|
|
||||||
* be canceled
|
|
||||||
* @param user_data Pointer to user data
|
* @param user_data Pointer to user data
|
||||||
*/
|
*/
|
||||||
void ble_gap_cancel_connect_req(const struct ble_gap_cancel_connect_params *par,
|
void ble_gap_cancel_connect_req(void *user_data);
|
||||||
void *priv);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Response to @ref ble_gap_cancel_connect_req.
|
* Response to @ref ble_gap_cancel_connect_req.
|
||||||
|
|
|
@ -186,16 +186,15 @@ void on_ble_gatts_get_attribute_value_rsp(const struct ble_gatts_attribute_respo
|
||||||
BT_DBG("");
|
BT_DBG("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_ble_gatt_register_rsp(const struct ble_gatt_register *par,
|
void on_ble_gatt_register_rsp(const struct ble_gatt_register_rsp *rsp,
|
||||||
const struct ble_gatt_attr_idx_entry *attr,
|
const struct ble_gatt_attr_handles *handles,
|
||||||
uint8_t len)
|
uint8_t len)
|
||||||
{
|
{
|
||||||
BT_DBG("");
|
BT_DBG("");
|
||||||
}
|
}
|
||||||
|
|
||||||
void on_ble_gattc_discover_rsp(const struct ble_gattc_evt *ev,
|
void on_ble_gattc_discover_rsp(const struct ble_gattc_disc_rsp *rsp,
|
||||||
const struct ble_gattc_attr *data,
|
const uint8_t *data, uint8_t len)
|
||||||
uint8_t data_len)
|
|
||||||
{
|
{
|
||||||
BT_DBG("");
|
BT_DBG("");
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,12 +46,19 @@ enum BLE_GATT_IND_TYPES {
|
||||||
};
|
};
|
||||||
|
|
||||||
/** GATT Register structure for one service */
|
/** GATT Register structure for one service */
|
||||||
struct ble_gatt_register {
|
struct ble_gatt_register_req {
|
||||||
/**< Index of service data base, used in response to match request */
|
/**< Base address of the attribute table in the Quark mem space */
|
||||||
uint8_t service_idx;
|
struct bt_gatt_attr *attr_base;
|
||||||
uint8_t attr_count; /**< Number of of attributes in this service */
|
uint8_t attr_count; /**< Number of of attributes in this service */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** GATT Register structure for one service */
|
||||||
|
struct ble_gatt_register_rsp {
|
||||||
|
int status; /**< Status of the registration op */
|
||||||
|
struct bt_gatt_attr *attr_base; /**< Pointer to the registered table */
|
||||||
|
uint8_t attr_count; /**< Number of attributes added */
|
||||||
|
};
|
||||||
|
|
||||||
/** Service index and Attribute index mapping structure.
|
/** Service index and Attribute index mapping structure.
|
||||||
*
|
*
|
||||||
* Mapping index into attribute tables as registered with bt_gatt_register/
|
* Mapping index into attribute tables as registered with bt_gatt_register/
|
||||||
|
@ -94,6 +101,23 @@ struct ble_gatt_wr_evt {
|
||||||
uint8_t op; /**< @ref BLE_GATTS_WR_OPS */
|
uint8_t op; /**< @ref BLE_GATTS_WR_OPS */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read event context data structure.
|
||||||
|
*/
|
||||||
|
struct nble_gatt_rd_evt {
|
||||||
|
struct bt_gatt_attr *attr; /**< GATT Attribute */
|
||||||
|
uint16_t conn_handle; /**< Connection handle */
|
||||||
|
uint16_t attr_handle; /**< handle of attribute to write */
|
||||||
|
uint16_t offset; /**< offset in attribute buffer */
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ble_gatts_rw_reply_params {
|
||||||
|
int status; /**< Reply status, from errno */
|
||||||
|
uint16_t conn_handle; /**< Connection handle */
|
||||||
|
uint16_t offset; /**< Offset in attribute buffer */
|
||||||
|
uint8_t write_reply; /**< 0 if read reply, otherwise rsp */
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Notification/Indication parameters
|
* Notification/Indication parameters
|
||||||
*/
|
*/
|
||||||
|
@ -158,6 +182,12 @@ struct ble_gattc_rsp {
|
||||||
uint16_t conn_handle; /**< GAP connection handle */
|
uint16_t conn_handle; /**< GAP connection handle */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct ble_gattc_disc_rsp {
|
||||||
|
int status;
|
||||||
|
uint16_t conn_handle;
|
||||||
|
uint8_t type; /**< @ref BLE_GATT_DISC_TYPES */
|
||||||
|
};
|
||||||
|
|
||||||
struct ble_gattc_evt {
|
struct ble_gattc_evt {
|
||||||
uint16_t conn_handle;
|
uint16_t conn_handle;
|
||||||
int status;
|
int status;
|
||||||
|
@ -289,7 +319,7 @@ void on_ble_gatts_send_svc_changed_rsp(const struct ble_core_response *par);
|
||||||
* @param attr Serialized attribute buffer
|
* @param attr Serialized attribute buffer
|
||||||
* @param attr_len Length of buffer
|
* @param attr_len Length of buffer
|
||||||
*/
|
*/
|
||||||
void ble_gatt_register_req(const struct ble_gatt_register *par,
|
void ble_gatt_register_req(const struct ble_gatt_register_req *par,
|
||||||
uint8_t *buf, uint16_t len);
|
uint8_t *buf, uint16_t len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -297,8 +327,8 @@ void ble_gatt_register_req(const struct ble_gatt_register *par,
|
||||||
*
|
*
|
||||||
* This is returned as a table on registering.
|
* This is returned as a table on registering.
|
||||||
*/
|
*/
|
||||||
struct ble_gatt_attr_idx_entry {
|
struct ble_gatt_attr_handles {
|
||||||
uint16_t handle; /* handle from ble contr should be sufficient */
|
uint16_t handle; /* handle from ble controller should be sufficient */
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Response to registering a BLE GATT Service.
|
/** Response to registering a BLE GATT Service.
|
||||||
|
@ -308,10 +338,10 @@ struct ble_gatt_attr_idx_entry {
|
||||||
*
|
*
|
||||||
* @param par Parameters of attribute data base
|
* @param par Parameters of attribute data base
|
||||||
* @param attr Returned attributes index list
|
* @param attr Returned attributes index list
|
||||||
* @param attr_len Length of buffer
|
* @param len Length of buffer
|
||||||
*/
|
*/
|
||||||
void on_ble_gatt_register_rsp(const struct ble_gatt_register *par,
|
void on_ble_gatt_register_rsp(const struct ble_gatt_register_rsp *par,
|
||||||
const struct ble_gatt_attr_idx_entry *attr,
|
const struct ble_gatt_attr_handles *attr,
|
||||||
uint8_t len);
|
uint8_t len);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -390,13 +420,12 @@ void ble_gattc_discover_req(const struct ble_core_discover_params *req,
|
||||||
/**
|
/**
|
||||||
* Response to @ref ble_gattc_discover_req.
|
* Response to @ref ble_gattc_discover_req.
|
||||||
*
|
*
|
||||||
* @param ev Pointer to the event structure
|
* @param rsp Response
|
||||||
* @param data Pointer to the data
|
* @param data Pointer to the data
|
||||||
* @param data_len Length of the data
|
* @param len Length of the data
|
||||||
*/
|
*/
|
||||||
void on_ble_gattc_discover_rsp(const struct ble_gattc_evt *ev,
|
void on_ble_gattc_discover_rsp(const struct ble_gattc_disc_rsp *rsp,
|
||||||
const struct ble_gattc_attr *data,
|
const uint8_t *data, uint8_t len);
|
||||||
uint8_t data_len);
|
|
||||||
|
|
||||||
/** GATT Attribute stream structure.
|
/** GATT Attribute stream structure.
|
||||||
*
|
*
|
||||||
|
|
|
@ -28,18 +28,22 @@
|
||||||
FN_SIG_P(ble_gap_clr_white_list_req, void *) \
|
FN_SIG_P(ble_gap_clr_white_list_req, void *) \
|
||||||
FN_SIG_P(ble_gap_stop_scan_req, void *) \
|
FN_SIG_P(ble_gap_stop_scan_req, void *) \
|
||||||
FN_SIG_P(ble_gap_sm_clear_bonds_req, void *) \
|
FN_SIG_P(ble_gap_sm_clear_bonds_req, void *) \
|
||||||
|
FN_SIG_P(ble_gap_cancel_connect_req, void *) \
|
||||||
FN_SIG_P(ble_get_bonded_device_list_req, void *)
|
FN_SIG_P(ble_get_bonded_device_list_req, void *)
|
||||||
|
|
||||||
#define LIST_FN_SIG_S_B \
|
#define LIST_FN_SIG_S_B \
|
||||||
FN_SIG_S_B(ble_gatt_register_req, \
|
FN_SIG_S_B(ble_gatt_register_req, \
|
||||||
const struct ble_gatt_register *, \
|
const struct ble_gatt_register_req *, \
|
||||||
uint8_t *, uint16_t) \
|
uint8_t *, uint16_t) \
|
||||||
FN_SIG_S_B(ble_gatt_send_notif_req, \
|
FN_SIG_S_B(ble_gatt_send_notif_req, \
|
||||||
const struct ble_gatt_send_notif_ind_params *, \
|
const struct ble_gatt_send_notif_ind_params *, \
|
||||||
uint8_t *, uint16_t) \
|
uint8_t *, uint16_t) \
|
||||||
FN_SIG_S_B(ble_gatt_send_ind_req, \
|
FN_SIG_S_B(ble_gatt_send_ind_req, \
|
||||||
const struct ble_gatt_send_notif_ind_params *, \
|
const struct ble_gatt_send_notif_ind_params *, \
|
||||||
uint8_t *, uint8_t)
|
uint8_t *, uint8_t) \
|
||||||
|
FN_SIG_S_B(nble_gatts_rw_authorize_reply_req, \
|
||||||
|
const struct ble_gatts_rw_reply_params *, \
|
||||||
|
uint8_t *, uint16_t)
|
||||||
|
|
||||||
#define LIST_FN_SIG_B_B_P \
|
#define LIST_FN_SIG_B_B_P \
|
||||||
FN_SIG_B_B_P(ble_gap_wr_white_list_req, bt_addr_le_t *, \
|
FN_SIG_B_B_P(ble_gap_wr_white_list_req, bt_addr_le_t *, \
|
||||||
|
@ -61,8 +65,6 @@
|
||||||
const struct ble_gap_connect_req_params *, void *) \
|
const struct ble_gap_connect_req_params *, void *) \
|
||||||
FN_SIG_S_P(ble_gap_start_scan_req, \
|
FN_SIG_S_P(ble_gap_start_scan_req, \
|
||||||
const struct ble_gap_scan_params *, void *) \
|
const struct ble_gap_scan_params *, void *) \
|
||||||
FN_SIG_S_P(ble_gap_cancel_connect_req, \
|
|
||||||
const struct ble_gap_cancel_connect_params *, void *)\
|
|
||||||
FN_SIG_S_P(ble_gap_generic_cmd_req, \
|
FN_SIG_S_P(ble_gap_generic_cmd_req, \
|
||||||
const struct ble_gap_gen_cmd_params *, void *) \
|
const struct ble_gap_gen_cmd_params *, void *) \
|
||||||
FN_SIG_S_P(ble_gap_set_option_req, \
|
FN_SIG_S_P(ble_gap_set_option_req, \
|
||||||
|
|
|
@ -37,30 +37,20 @@
|
||||||
const struct ble_gap_timout_evt *) \
|
const struct ble_gap_timout_evt *) \
|
||||||
FN_SIG_S(on_ble_gap_rssi_evt, \
|
FN_SIG_S(on_ble_gap_rssi_evt, \
|
||||||
const struct ble_gap_rssi_evt *) \
|
const struct ble_gap_rssi_evt *) \
|
||||||
FN_SIG_S(on_ble_gap_service_read_rsp, \
|
FN_SIG_S(on_ble_common_rsp, \
|
||||||
|
const struct ble_core_response *) \
|
||||||
|
FN_SIG_S(on_ble_gap_connect_rsp, \
|
||||||
|
const struct ble_core_response *) \
|
||||||
|
FN_SIG_S(on_ble_gap_cancel_connect_rsp, \
|
||||||
const struct ble_core_response *) \
|
const struct ble_core_response *) \
|
||||||
FN_SIG_S(on_ble_gap_read_bda_rsp, \
|
FN_SIG_S(on_ble_gap_read_bda_rsp, \
|
||||||
const struct ble_service_read_bda_response *) \
|
const struct ble_service_read_bda_response *) \
|
||||||
FN_SIG_S(on_ble_gap_disconnect_rsp, \
|
FN_SIG_S(on_ble_gap_disconnect_rsp, \
|
||||||
const struct ble_core_response *) \
|
const struct ble_core_response *) \
|
||||||
FN_SIG_S(on_ble_gap_sm_pairing_rsp, \
|
|
||||||
const struct ble_core_response *) \
|
|
||||||
FN_SIG_S(on_ble_gap_sm_config_rsp, \
|
FN_SIG_S(on_ble_gap_sm_config_rsp, \
|
||||||
struct ble_gap_sm_config_rsp *) \
|
struct ble_gap_sm_config_rsp *) \
|
||||||
FN_SIG_S(on_ble_gap_clr_white_list_rsp, \
|
|
||||||
const struct ble_core_response *) \
|
|
||||||
FN_SIG_S(on_ble_gap_sm_passkey_reply_rsp, \
|
FN_SIG_S(on_ble_gap_sm_passkey_reply_rsp, \
|
||||||
const struct ble_core_response *) \
|
const struct ble_core_response *) \
|
||||||
FN_SIG_S(on_ble_gap_connect_rsp, \
|
|
||||||
const struct ble_core_response *) \
|
|
||||||
FN_SIG_S(on_ble_gap_start_scan_rsp, \
|
|
||||||
const struct ble_core_response *) \
|
|
||||||
FN_SIG_S(on_ble_gap_stop_scan_rsp, \
|
|
||||||
const struct ble_core_response *) \
|
|
||||||
FN_SIG_S(on_ble_gap_cancel_connect_rsp, \
|
|
||||||
const struct ble_core_response *) \
|
|
||||||
FN_SIG_S(on_ble_gap_set_option_rsp, \
|
|
||||||
const struct ble_core_response *) \
|
|
||||||
FN_SIG_S(on_ble_gap_generic_cmd_rsp, \
|
FN_SIG_S(on_ble_gap_generic_cmd_rsp, \
|
||||||
const struct ble_core_response *) \
|
const struct ble_core_response *) \
|
||||||
FN_SIG_S(on_ble_gap_conn_update_rsp, \
|
FN_SIG_S(on_ble_gap_conn_update_rsp, \
|
||||||
|
@ -73,8 +63,6 @@
|
||||||
const struct ble_core_response *) \
|
const struct ble_core_response *) \
|
||||||
FN_SIG_S(on_ble_gap_set_rssi_report_rsp, \
|
FN_SIG_S(on_ble_gap_set_rssi_report_rsp, \
|
||||||
const struct ble_core_response *) \
|
const struct ble_core_response *) \
|
||||||
FN_SIG_S(on_ble_gap_wr_white_list_rsp, \
|
|
||||||
const struct ble_core_response *) \
|
|
||||||
FN_SIG_S(on_ble_gap_dbg_rsp, \
|
FN_SIG_S(on_ble_gap_dbg_rsp, \
|
||||||
const struct debug_response *) \
|
const struct debug_response *) \
|
||||||
FN_SIG_S(on_ble_gatts_send_svc_changed_rsp, \
|
FN_SIG_S(on_ble_gatts_send_svc_changed_rsp, \
|
||||||
|
@ -88,7 +76,9 @@
|
||||||
FN_SIG_S(on_ble_gap_start_advertise_rsp, \
|
FN_SIG_S(on_ble_gap_start_advertise_rsp, \
|
||||||
const struct ble_core_response *) \
|
const struct ble_core_response *) \
|
||||||
FN_SIG_S(on_ble_gap_stop_advertise_rsp, \
|
FN_SIG_S(on_ble_gap_stop_advertise_rsp, \
|
||||||
const struct ble_core_response *)
|
const struct ble_core_response *) \
|
||||||
|
FN_SIG_S(on_ble_gatts_read_evt, \
|
||||||
|
const struct nble_gatt_rd_evt *)
|
||||||
|
|
||||||
#define LIST_FN_SIG_P \
|
#define LIST_FN_SIG_P \
|
||||||
FN_SIG_P(on_ble_gap_dtm_init_rsp, void *)
|
FN_SIG_P(on_ble_gap_dtm_init_rsp, void *)
|
||||||
|
@ -106,12 +96,12 @@
|
||||||
const struct ble_gatts_attribute_response *, \
|
const struct ble_gatts_attribute_response *, \
|
||||||
uint8_t *, uint8_t) \
|
uint8_t *, uint8_t) \
|
||||||
FN_SIG_S_B(on_ble_gatt_register_rsp, \
|
FN_SIG_S_B(on_ble_gatt_register_rsp, \
|
||||||
const struct ble_gatt_register *, \
|
const struct ble_gatt_register_rsp *, \
|
||||||
const struct ble_gatt_attr_idx_entry *, \
|
const struct ble_gatt_attr_handles *, \
|
||||||
uint8_t) \
|
uint8_t) \
|
||||||
FN_SIG_S_B(on_ble_gattc_discover_rsp, \
|
FN_SIG_S_B(on_ble_gattc_discover_rsp, \
|
||||||
const struct ble_gattc_evt *, \
|
const struct ble_gattc_disc_rsp *, \
|
||||||
const struct ble_gattc_attr *, uint8_t)
|
const uint8_t *, uint8_t)
|
||||||
|
|
||||||
#define LIST_FN_SIG_B_B_P
|
#define LIST_FN_SIG_B_B_P
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue