Bluetooth: Fix alignment issues resulting from new integer types

The switch from C99 integer types to u16_t, etc. caused misalignment
in structs and function definitions with multi-line parameter lists.

Change-Id: Ic0e33dc199f834ad7772417bca4c0b2d2f779d15
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2017-04-21 09:01:26 +03:00 committed by Anas Nashif
commit 97f0241c07
16 changed files with 154 additions and 166 deletions

View file

@ -42,15 +42,15 @@ static struct {
struct net_buf *buf;
struct k_fifo fifo;
u16_t remaining;
u16_t discard;
u16_t remaining;
u16_t discard;
bool have_hdr;
bool discardable;
u8_t hdr_len;
u8_t hdr_len;
u8_t type;
u8_t type;
union {
struct bt_hci_evt_hdr evt;
struct bt_hci_acl_hdr acl;

View file

@ -814,8 +814,8 @@ static u16_t parse_service(struct bt_conn *conn,
}
static u16_t parse_characteristic(struct bt_conn *conn,
struct bt_gatt_discover_params *params,
const u8_t *data, u8_t len)
struct bt_gatt_discover_params *params,
const u8_t *data, u8_t len)
{
u16_t end_handle = 0;
int i;
@ -847,8 +847,8 @@ static u16_t parse_characteristic(struct bt_conn *conn,
}
static u16_t parse_descriptor(struct bt_conn *conn,
struct bt_gatt_discover_params *params,
const u8_t *data, u8_t len)
struct bt_gatt_discover_params *params,
const u8_t *data, u8_t len)
{
u16_t end_handle = 0;
int i;
@ -1404,7 +1404,7 @@ void bt_gatt_cancel(struct bt_conn *conn, void *params)
}
static s32_t prep_write_evt(const struct nble_gatts_write_evt *ev,
const u8_t *data, u8_t len)
const u8_t *data, u8_t len)
{
#if CONFIG_BLUETOOTH_ATT_PREPARE_COUNT > 0
const struct bt_gatt_attr *attr = ev->attr;

View file

@ -134,7 +134,7 @@ struct bt_gatt_attr {
/** Attribute user data */
void *user_data;
/** Attribute handle */
u16_t handle;
u16_t handle;
/** Attribute permissions */
u8_t perm;
#if defined(CONFIG_BLUETOOTH_GATT_DYNAMIC_DB)
@ -147,7 +147,7 @@ struct bt_gatt_service {
/** Service UUID. */
const struct bt_uuid *uuid;
/** Service end handle. */
u16_t end_handle;
u16_t end_handle;
};
/** @brief Include Attribute Value. */
@ -155,9 +155,9 @@ struct bt_gatt_include {
/** Service UUID. */
const struct bt_uuid *uuid;
/** Service start handle. */
u16_t start_handle;
u16_t start_handle;
/** Service end handle. */
u16_t end_handle;
u16_t end_handle;
};
/* Characteristic Properties Bit field values */
@ -783,8 +783,8 @@ struct bt_gatt_discover_params;
* or BT_GATT_ITER_STOP to stop discovery procedure.
*/
typedef u8_t (*bt_gatt_discover_func_t)(struct bt_conn *conn,
const struct bt_gatt_attr *attr,
struct bt_gatt_discover_params *params);
const struct bt_gatt_attr *attr,
struct bt_gatt_discover_params *params);
enum {
BT_GATT_DISCOVER_PRIMARY,
@ -859,8 +859,8 @@ struct bt_gatt_read_params;
* @param length Attribute value length.
*/
typedef u8_t (*bt_gatt_read_func_t)(struct bt_conn *conn, u8_t err,
struct bt_gatt_read_params *params,
const void *data, u16_t length);
struct bt_gatt_read_params *params,
const void *data, u16_t length);
/** @brief GATT Read parameters
* @param func Read attribute callback
@ -908,7 +908,7 @@ struct bt_gatt_write_params;
* @param params Write parameters used.
*/
typedef void (*bt_gatt_write_func_t)(struct bt_conn *conn, u8_t err,
struct bt_gatt_write_params *params);
struct bt_gatt_write_params *params);
/** @brief GATT Write parameters */
struct bt_gatt_write_params {
@ -968,8 +968,8 @@ struct bt_gatt_subscribe_params;
* @param length Attribute value length.
*/
typedef u8_t (*bt_gatt_notify_func_t)(struct bt_conn *conn,
struct bt_gatt_subscribe_params *params,
const void *data, u16_t length);
struct bt_gatt_subscribe_params *params,
const void *data, u16_t length);
/* Subscription flags */
enum {

View file

@ -116,7 +116,7 @@ struct bt_l2cap_le_chan {
struct net_buf *tx_buf;
/** Segment SDU packet from upper layer */
struct net_buf *_sdu;
u16_t _sdu_len;
u16_t _sdu_len;
};
/** @def BT_L2CAP_LE_CHAN(_ch)
@ -215,7 +215,7 @@ struct bt_l2cap_chan_ops {
/** @brief L2CAP Server structure. */
struct bt_l2cap_server {
/** Server PSM */
u16_t psm;
u16_t psm;
/** Required minimim security level */
bt_security_t sec_level;

View file

@ -90,10 +90,10 @@ struct bt_rfcomm_dlc {
bt_security_t required_sec_level;
bt_rfcomm_role_t role;
u16_t mtu;
u8_t dlci;
u8_t state;
u8_t rx_credit;
u16_t mtu;
u8_t dlci;
u8_t state;
u8_t rx_credit;
/* Stack for TX fiber */
BT_STACK(stack, 256);

View file

@ -119,31 +119,31 @@ extern "C" {
* Possible values for attribute-id are listed below.
* See SDP Spec, section "Service Attribute Definitions" for more details.
*/
#define BT_SDP_ATTR_RECORD_HANDLE 0x0000
#define BT_SDP_ATTR_SVCLASS_ID_LIST 0x0001
#define BT_SDP_ATTR_RECORD_STATE 0x0002
#define BT_SDP_ATTR_SERVICE_ID 0x0003
#define BT_SDP_ATTR_PROTO_DESC_LIST 0x0004
#define BT_SDP_ATTR_BROWSE_GRP_LIST 0x0005
#define BT_SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006
#define BT_SDP_ATTR_SVCINFO_TTL 0x0007
#define BT_SDP_ATTR_SERVICE_AVAILABILITY 0x0008
#define BT_SDP_ATTR_PROFILE_DESC_LIST 0x0009
#define BT_SDP_ATTR_DOC_URL 0x000a
#define BT_SDP_ATTR_CLNT_EXEC_URL 0x000b
#define BT_SDP_ATTR_ICON_URL 0x000c
#define BT_SDP_ATTR_ADD_PROTO_DESC_LIST 0x000d
#define BT_SDP_ATTR_RECORD_HANDLE 0x0000
#define BT_SDP_ATTR_SVCLASS_ID_LIST 0x0001
#define BT_SDP_ATTR_RECORD_STATE 0x0002
#define BT_SDP_ATTR_SERVICE_ID 0x0003
#define BT_SDP_ATTR_PROTO_DESC_LIST 0x0004
#define BT_SDP_ATTR_BROWSE_GRP_LIST 0x0005
#define BT_SDP_ATTR_LANG_BASE_ATTR_ID_LIST 0x0006
#define BT_SDP_ATTR_SVCINFO_TTL 0x0007
#define BT_SDP_ATTR_SERVICE_AVAILABILITY 0x0008
#define BT_SDP_ATTR_PROFILE_DESC_LIST 0x0009
#define BT_SDP_ATTR_DOC_URL 0x000a
#define BT_SDP_ATTR_CLNT_EXEC_URL 0x000b
#define BT_SDP_ATTR_ICON_URL 0x000c
#define BT_SDP_ATTR_ADD_PROTO_DESC_LIST 0x000d
#define BT_SDP_ATTR_GROUP_ID 0x0200
#define BT_SDP_ATTR_IP_SUBNET 0x0200
#define BT_SDP_ATTR_VERSION_NUM_LIST 0x0200
#define BT_SDP_ATTR_SUPPORTED_FEATURES_LIST 0x0200
#define BT_SDP_ATTR_GOEP_L2CAP_PSM 0x0200
#define BT_SDP_ATTR_SVCDB_STATE 0x0201
#define BT_SDP_ATTR_GROUP_ID 0x0200
#define BT_SDP_ATTR_IP_SUBNET 0x0200
#define BT_SDP_ATTR_VERSION_NUM_LIST 0x0200
#define BT_SDP_ATTR_SUPPORTED_FEATURES_LIST 0x0200
#define BT_SDP_ATTR_GOEP_L2CAP_PSM 0x0200
#define BT_SDP_ATTR_SVCDB_STATE 0x0201
#define BT_SDP_ATTR_MPSD_SCENARIOS 0x0200
#define BT_SDP_ATTR_MPMD_SCENARIOS 0x0201
#define BT_SDP_ATTR_MPS_DEPENDENCIES 0x0202
#define BT_SDP_ATTR_MPSD_SCENARIOS 0x0200
#define BT_SDP_ATTR_MPMD_SCENARIOS 0x0201
#define BT_SDP_ATTR_MPS_DEPENDENCIES 0x0202
#define BT_SDP_ATTR_SERVICE_VERSION 0x0300
#define BT_SDP_ATTR_EXTERNAL_NETWORK 0x0301
@ -176,28 +176,28 @@ extern "C" {
#define BT_SDP_ATTR_PBAP_SUPPORTED_FEATURES 0x0317
#define BT_SDP_ATTR_MAP_SUPPORTED_FEATURES 0x0317
#define BT_SDP_ATTR_SPECIFICATION_ID 0x0200
#define BT_SDP_ATTR_VENDOR_ID 0x0201
#define BT_SDP_ATTR_PRODUCT_ID 0x0202
#define BT_SDP_ATTR_VERSION 0x0203
#define BT_SDP_ATTR_PRIMARY_RECORD 0x0204
#define BT_SDP_ATTR_VENDOR_ID_SOURCE 0x0205
#define BT_SDP_ATTR_SPECIFICATION_ID 0x0200
#define BT_SDP_ATTR_VENDOR_ID 0x0201
#define BT_SDP_ATTR_PRODUCT_ID 0x0202
#define BT_SDP_ATTR_VERSION 0x0203
#define BT_SDP_ATTR_PRIMARY_RECORD 0x0204
#define BT_SDP_ATTR_VENDOR_ID_SOURCE 0x0205
#define BT_SDP_ATTR_HID_DEVICE_RELEASE_NUMBER 0x0200
#define BT_SDP_ATTR_HID_PARSER_VERSION 0x0201
#define BT_SDP_ATTR_HID_DEVICE_SUBCLASS 0x0202
#define BT_SDP_ATTR_HID_COUNTRY_CODE 0x0203
#define BT_SDP_ATTR_HID_VIRTUAL_CABLE 0x0204
#define BT_SDP_ATTR_HID_RECONNECT_INITIATE 0x0205
#define BT_SDP_ATTR_HID_DESCRIPTOR_LIST 0x0206
#define BT_SDP_ATTR_HID_LANG_ID_BASE_LIST 0x0207
#define BT_SDP_ATTR_HID_SDP_DISABLE 0x0208
#define BT_SDP_ATTR_HID_BATTERY_POWER 0x0209
#define BT_SDP_ATTR_HID_REMOTE_WAKEUP 0x020a
#define BT_SDP_ATTR_HID_PROFILE_VERSION 0x020b
#define BT_SDP_ATTR_HID_SUPERVISION_TIMEOUT 0x020c
#define BT_SDP_ATTR_HID_NORMALLY_CONNECTABLE 0x020d
#define BT_SDP_ATTR_HID_BOOT_DEVICE 0x020e
#define BT_SDP_ATTR_HID_DEVICE_RELEASE_NUMBER 0x0200
#define BT_SDP_ATTR_HID_PARSER_VERSION 0x0201
#define BT_SDP_ATTR_HID_DEVICE_SUBCLASS 0x0202
#define BT_SDP_ATTR_HID_COUNTRY_CODE 0x0203
#define BT_SDP_ATTR_HID_VIRTUAL_CABLE 0x0204
#define BT_SDP_ATTR_HID_RECONNECT_INITIATE 0x0205
#define BT_SDP_ATTR_HID_DESCRIPTOR_LIST 0x0206
#define BT_SDP_ATTR_HID_LANG_ID_BASE_LIST 0x0207
#define BT_SDP_ATTR_HID_SDP_DISABLE 0x0208
#define BT_SDP_ATTR_HID_BATTERY_POWER 0x0209
#define BT_SDP_ATTR_HID_REMOTE_WAKEUP 0x020a
#define BT_SDP_ATTR_HID_PROFILE_VERSION 0x020b
#define BT_SDP_ATTR_HID_SUPERVISION_TIMEOUT 0x020c
#define BT_SDP_ATTR_HID_NORMALLY_CONNECTABLE 0x020d
#define BT_SDP_ATTR_HID_BOOT_DEVICE 0x020e
/*
* These identifiers are based on the SDP spec stating that
@ -271,9 +271,9 @@ extern "C" {
/** @brief SDP Generic Data Element Value. */
struct bt_sdp_data_elem {
u8_t type;
u32_t data_size;
u32_t total_size;
u8_t type;
u32_t data_size;
u32_t total_size;
const void *data;
};
@ -285,10 +285,10 @@ struct bt_sdp_attribute {
/** @brief SDP Service Record Value. */
struct bt_sdp_record {
u32_t handle; /* Redundant, for quick ref */
u32_t handle; /* Redundant, for quick ref */
struct bt_sdp_attribute *attrs; /* Base addr of attr array */
size_t attr_count; /* Number of attributes */
u8_t index; /* Index of the record in LL */
u8_t index; /* Index of the record in LL */
struct bt_sdp_record *next;
};

View file

@ -446,7 +446,7 @@ static u8_t find_info_cb(const struct bt_gatt_attr *attr, void *user_data)
}
static u8_t att_find_info_rsp(struct bt_att *att, u16_t start_handle,
u16_t end_handle)
u16_t end_handle)
{
struct bt_conn *conn = att->chan.chan.conn;
struct find_info_data data;
@ -565,8 +565,8 @@ static u8_t find_type_cb(const struct bt_gatt_attr *attr, void *user_data)
}
static u8_t att_find_type_rsp(struct bt_att *att, u16_t start_handle,
u16_t end_handle, const void *value,
u8_t value_len)
u16_t end_handle, const void *value,
u8_t value_len)
{
struct bt_conn *conn = att->chan.chan.conn;
struct find_type_data data;
@ -657,7 +657,7 @@ static bool uuid_create(struct bt_uuid *uuid, struct net_buf *buf)
}
static u8_t check_perm(struct bt_conn *conn, const struct bt_gatt_attr *attr,
u8_t mask)
u8_t mask)
{
if ((mask & BT_GATT_PERM_READ) &&
(!(attr->perm & BT_GATT_PERM_READ_MASK) || !attr->read)) {
@ -780,7 +780,7 @@ static u8_t read_type_cb(const struct bt_gatt_attr *attr, void *user_data)
}
static u8_t att_read_type_rsp(struct bt_att *att, struct bt_uuid *uuid,
u16_t start_handle, u16_t end_handle)
u16_t start_handle, u16_t end_handle)
{
struct bt_conn *conn = att->chan.chan.conn;
struct read_type_data data;
@ -898,8 +898,8 @@ static u8_t read_cb(const struct bt_gatt_attr *attr, void *user_data)
return BT_GATT_ITER_CONTINUE;
}
static u8_t att_read_rsp(struct bt_att *att, u8_t op, u8_t rsp,
u16_t handle, u16_t offset)
static u8_t att_read_rsp(struct bt_att *att, u8_t op, u8_t rsp, u16_t handle,
u16_t offset)
{
struct bt_conn *conn = att->chan.chan.conn;
struct read_data data;
@ -1082,7 +1082,7 @@ static u8_t read_group_cb(const struct bt_gatt_attr *attr, void *user_data)
}
static u8_t att_read_group_rsp(struct bt_att *att, struct bt_uuid *uuid,
u16_t start_handle, u16_t end_handle)
u16_t start_handle, u16_t end_handle)
{
struct bt_conn *conn = att->chan.chan.conn;
struct read_group_data data;
@ -1205,8 +1205,8 @@ static u8_t write_cb(const struct bt_gatt_attr *attr, void *user_data)
}
static u8_t att_write_rsp(struct bt_conn *conn, u8_t op, u8_t rsp,
u16_t handle, u16_t offset,
const void *value, u8_t len)
u16_t handle, u16_t offset, const void *value,
u8_t len)
{
struct write_data data;
@ -1319,9 +1319,8 @@ static u8_t prep_write_cb(const struct bt_gatt_attr *attr, void *user_data)
return BT_GATT_ITER_CONTINUE;
}
static u8_t att_prep_write_rsp(struct bt_att *att, u16_t handle,
u16_t offset, const void *value,
u8_t len)
static u8_t att_prep_write_rsp(struct bt_att *att, u16_t handle, u16_t offset,
const void *value, u8_t len)
{
struct bt_conn *conn = att->chan.chan.conn;
struct prep_data data;
@ -1592,56 +1591,49 @@ done:
return att_handle_rsp(att, NULL, 0, err);
}
static u8_t att_handle_find_info_rsp(struct bt_att *att,
struct net_buf *buf)
static u8_t att_handle_find_info_rsp(struct bt_att *att, struct net_buf *buf)
{
BT_DBG("");
return att_handle_rsp(att, buf->data, buf->len, 0);
}
static u8_t att_handle_find_type_rsp(struct bt_att *att,
struct net_buf *buf)
static u8_t att_handle_find_type_rsp(struct bt_att *att, struct net_buf *buf)
{
BT_DBG("");
return att_handle_rsp(att, buf->data, buf->len, 0);
}
static u8_t att_handle_read_type_rsp(struct bt_att *att,
struct net_buf *buf)
static u8_t att_handle_read_type_rsp(struct bt_att *att, struct net_buf *buf)
{
BT_DBG("");
return att_handle_rsp(att, buf->data, buf->len, 0);
}
static u8_t att_handle_read_rsp(struct bt_att *att,
struct net_buf *buf)
static u8_t att_handle_read_rsp(struct bt_att *att, struct net_buf *buf)
{
BT_DBG("");
return att_handle_rsp(att, buf->data, buf->len, 0);
}
static u8_t att_handle_read_blob_rsp(struct bt_att *att,
struct net_buf *buf)
static u8_t att_handle_read_blob_rsp(struct bt_att *att, struct net_buf *buf)
{
BT_DBG("");
return att_handle_rsp(att, buf->data, buf->len, 0);
}
static u8_t att_handle_read_mult_rsp(struct bt_att *att,
struct net_buf *buf)
static u8_t att_handle_read_mult_rsp(struct bt_att *att, struct net_buf *buf)
{
BT_DBG("");
return att_handle_rsp(att, buf->data, buf->len, 0);
}
static u8_t att_handle_write_rsp(struct bt_att *att,
struct net_buf *buf)
static u8_t att_handle_write_rsp(struct bt_att *att, struct net_buf *buf)
{
BT_DBG("");
@ -1649,15 +1641,14 @@ static u8_t att_handle_write_rsp(struct bt_att *att,
}
static u8_t att_handle_prepare_write_rsp(struct bt_att *att,
struct net_buf *buf)
struct net_buf *buf)
{
BT_DBG("");
return att_handle_rsp(att, buf->data, buf->len, 0);
}
static u8_t att_handle_exec_write_rsp(struct bt_att *att,
struct net_buf *buf)
static u8_t att_handle_exec_write_rsp(struct bt_att *att, struct net_buf *buf)
{
BT_DBG("");
@ -1707,10 +1698,10 @@ static u8_t att_confirm(struct bt_att *att, struct net_buf *buf)
}
static const struct att_handler {
u8_t op;
u8_t expect_len;
u8_t op;
u8_t expect_len;
att_type_t type;
u8_t (*func)(struct bt_att *att, struct net_buf *buf);
u8_t (*func)(struct bt_att *att, struct net_buf *buf);
} handlers[] = {
{ BT_ATT_OP_ERROR_RSP,
sizeof(struct bt_att_error_rsp),

View file

@ -35,12 +35,12 @@ struct bt_conn_le {
bt_addr_le_t init_addr;
bt_addr_le_t resp_addr;
u16_t interval;
u16_t interval_min;
u16_t interval_max;
u16_t interval;
u16_t interval_min;
u16_t interval_max;
u16_t latency;
u16_t timeout;
u16_t latency;
u16_t timeout;
u8_t features[1][8];
@ -80,7 +80,7 @@ struct bt_conn_tx {
};
struct bt_conn {
u16_t handle;
u16_t handle;
u8_t type;
u8_t role;

View file

@ -990,8 +990,8 @@ static int read_included_uuid(struct bt_conn *conn,
}
static u16_t parse_include(struct bt_conn *conn, const void *pdu,
struct bt_gatt_discover_params *params,
u16_t length)
struct bt_gatt_discover_params *params,
u16_t length)
{
const struct bt_att_read_type_rsp *rsp = pdu;
u16_t handle = 0;
@ -1082,8 +1082,8 @@ done:
}
static u16_t parse_characteristic(struct bt_conn *conn, const void *pdu,
struct bt_gatt_discover_params *params,
u16_t length)
struct bt_gatt_discover_params *params,
u16_t length)
{
const struct bt_att_read_type_rsp *rsp = pdu;
u16_t handle = 0;

View file

@ -56,11 +56,11 @@ struct bt_dev_le {
/* LE features */
u8_t features[1][8];
/* LE states */
u64_t states;
u64_t states;
#if defined(CONFIG_BLUETOOTH_CONN)
/* Controller buffer information */
u16_t mtu;
u16_t mtu;
struct k_sem pkts;
#endif /* CONFIG_BLUETOOTH_CONN */
};
@ -88,9 +88,9 @@ struct bt_dev {
/* Controller version & manufacturer information */
u8_t hci_version;
u8_t lmp_version;
u16_t hci_revision;
u16_t lmp_subversion;
u16_t manufacturer;
u16_t hci_revision;
u16_t lmp_subversion;
u16_t manufacturer;
/* LMP features (pages 0, 1, 2) */
u8_t features[LMP_FEAT_PAGES_COUNT][8];

View file

@ -28,8 +28,8 @@ enum {
};
struct bt_ltk {
u64_t rand;
u16_t ediv;
u64_t rand;
u16_t ediv;
u8_t val[16];
};
@ -40,14 +40,14 @@ struct bt_irk {
struct bt_csrk {
u8_t val[16];
u32_t cnt;
u32_t cnt;
};
struct bt_keys {
bt_addr_le_t addr;
u8_t enc_size;
ATOMIC_DEFINE(flags, BT_KEYS_NUM_FLAGS);
u16_t keys;
u16_t keys;
struct bt_ltk ltk;
struct bt_irk irk;
#if defined(CONFIG_BLUETOOTH_SIGNING)

View file

@ -89,7 +89,7 @@ struct bt_l2cap_br {
struct bt_l2cap_br_chan chan;
u8_t info_ident;
u8_t info_fixed_chan;
u32_t info_feat_mask;
u32_t info_feat_mask;
};
static struct bt_l2cap_br bt_l2cap_br_pool[CONFIG_BLUETOOTH_MAX_CONN];
@ -893,7 +893,7 @@ static void l2cap_br_send_reject(struct bt_conn *conn, u8_t ident,
}
static u16_t l2cap_br_conf_opt_mtu(struct bt_l2cap_chan *chan,
struct net_buf *buf, size_t len)
struct net_buf *buf, size_t len)
{
u16_t mtu, result = BT_L2CAP_CONF_SUCCESS;

View file

@ -198,8 +198,7 @@ struct bt_l2cap_le_credits {
struct bt_l2cap_fixed_chan {
u16_t cid;
int (*accept)(struct bt_conn *conn, struct bt_l2cap_chan **chan);
sys_snode_t node;
sys_snode_t node;
};
/* Register a fixed L2CAP channel for L2CAP */

View file

@ -65,7 +65,7 @@ struct bt_monitor_new_index {
u8_t type;
u8_t bus;
u8_t bdaddr[6];
char name[8];
char name[8];
} __packed;
struct bt_monitor_user_logging {

View file

@ -75,7 +75,7 @@ struct bt_sdp_client {
/* list of waiting to be resolved UUID params */
sys_slist_t reqs;
/* required SDP transaction ID */
u16_t tid;
u16_t tid;
/* UUID params holder being now resolved */
const struct bt_sdp_discover_params *param;
/* PDU continuation state object */
@ -104,11 +104,11 @@ struct select_attrs_data {
struct bt_sdp *sdp;
struct bt_sdp_data_elem_seq *seq;
struct search_state *state;
u32_t *filter;
u16_t max_att_len;
u16_t att_list_len;
u8_t cont_state_size;
u8_t num_filters;
u32_t *filter;
u16_t max_att_len;
u16_t att_list_len;
u8_t cont_state_size;
u8_t num_filters;
bool new_service;
};
@ -123,7 +123,7 @@ struct select_attrs_data {
* or BT_SDP_ITER_STOP to stop.
*/
typedef u8_t (*bt_sdp_attr_func_t)(struct bt_sdp_attribute *attr,
u8_t att_idx, void *user_data);
u8_t att_idx, void *user_data);
/* @typedef bt_sdp_svc_func_t
* @brief SDP service record iterator callback.
@ -135,7 +135,7 @@ typedef u8_t (*bt_sdp_attr_func_t)(struct bt_sdp_attribute *attr,
* or BT_SDP_ITER_STOP to stop.
*/
typedef u8_t (*bt_sdp_svc_func_t)(struct bt_sdp_record *rec,
void *user_data);
void *user_data);
/* @brief Callback for SDP connection
*
@ -329,7 +329,7 @@ static u16_t parse_data_elem(struct net_buf *buf,
* (used in recursion)
*/
static u32_t search_uuid(struct bt_sdp_data_elem *elem, struct bt_uuid *uuid,
bool *found, u8_t nest_level)
bool *found, u8_t nest_level)
{
const u8_t *cur_elem;
u32_t seq_size, size;
@ -565,7 +565,7 @@ static u16_t find_services(struct net_buf *buf,
* @return 0 for success, or relevant error code
*/
static u16_t sdp_svc_search_req(struct bt_sdp *sdp, struct net_buf *buf,
u16_t tid)
u16_t tid)
{
struct bt_sdp_svc_rsp *rsp;
struct net_buf *resp_buf;
@ -701,7 +701,7 @@ static u16_t sdp_svc_search_req(struct bt_sdp *sdp, struct net_buf *buf,
* (used in recursion)
*/
static u32_t copy_attribute(struct bt_sdp_data_elem *elem,
struct net_buf *buf, u8_t nest_level)
struct net_buf *buf, u8_t nest_level)
{
const u8_t *cur_elem;
u32_t size, seq_size, total_size;
@ -773,7 +773,7 @@ static u32_t copy_attribute(struct bt_sdp_data_elem *elem,
* @return Index of the attribute where the iterator stopped
*/
static u8_t bt_sdp_foreach_attr(struct bt_sdp_record *record, u8_t idx,
bt_sdp_attr_func_t func, void *user_data)
bt_sdp_attr_func_t func, void *user_data)
{
for (; idx < record->attr_count; idx++) {
if (func(&record->attrs[idx], idx, user_data) ==
@ -799,7 +799,7 @@ static u8_t bt_sdp_foreach_attr(struct bt_sdp_record *record, u8_t idx,
* or BT_SDP_ITER_STOP to stop.
*/
static u8_t select_attrs(struct bt_sdp_attribute *attr, u8_t att_idx,
void *user_data)
void *user_data)
{
struct select_attrs_data *sad = user_data;
u16_t att_id_lower, att_id_upper, att_id_cur, space;
@ -928,12 +928,11 @@ static u8_t select_attrs(struct bt_sdp_attribute *attr, u8_t att_idx,
*
* @return len Length of the attribute list created
*/
static u16_t create_attr_list(struct bt_sdp *sdp,
struct bt_sdp_record *record,
u32_t *filter, u8_t num_filters,
u16_t max_att_len, u8_t cont_state_size,
u8_t next_att, struct search_state *state,
struct net_buf *rsp_buf)
static u16_t create_attr_list(struct bt_sdp *sdp, struct bt_sdp_record *record,
u32_t *filter, u8_t num_filters,
u16_t max_att_len, u8_t cont_state_size,
u8_t next_att, struct search_state *state,
struct net_buf *rsp_buf)
{
struct select_attrs_data sad;
u8_t idx_att;
@ -974,7 +973,7 @@ static u16_t create_attr_list(struct bt_sdp *sdp,
* @return 0 for success, or relevant error code
*/
static u16_t get_att_search_list(struct net_buf *buf, u32_t *filter,
u8_t *num_filters)
u8_t *num_filters)
{
struct bt_sdp_data_elem data_elem;
u16_t res;
@ -1054,7 +1053,7 @@ static u8_t find_handle(struct bt_sdp_record *rec, void *user_data)
* @return 0 for success, or relevant error code
*/
static u16_t sdp_svc_att_req(struct bt_sdp *sdp, struct net_buf *buf,
u16_t tid)
u16_t tid)
{
u32_t filter[MAX_NUM_ATT_ID_FILTER];
struct search_state state = {
@ -1168,7 +1167,7 @@ static u16_t sdp_svc_att_req(struct bt_sdp *sdp, struct net_buf *buf,
* @return 0 for success, or relevant error code
*/
static u16_t sdp_svc_search_att_req(struct bt_sdp *sdp, struct net_buf *buf,
u16_t tid)
u16_t tid)
{
u32_t filter[MAX_NUM_ATT_ID_FILTER];
struct bt_sdp_record *matching_recs[BT_SDP_MAX_SERVICES];
@ -1313,8 +1312,7 @@ static u16_t sdp_svc_search_att_req(struct bt_sdp *sdp, struct net_buf *buf,
static const struct {
u8_t op_code;
u16_t (*func)(struct bt_sdp *sdp, struct net_buf *buf,
u16_t tid);
u16_t (*func)(struct bt_sdp *sdp, struct net_buf *buf, u16_t tid);
} handlers[] = {
{ BT_SDP_SVC_SEARCH_REQ, sdp_svc_search_req },
{ BT_SDP_SVC_ATTR_REQ, sdp_svc_att_req },
@ -1588,7 +1586,7 @@ static void sdp_client_params_iterator(struct bt_sdp_client *session)
}
static u16_t sdp_client_get_total(struct bt_sdp_client *session,
struct net_buf *buf, u16_t *total)
struct net_buf *buf, u16_t *total)
{
u16_t pulled;
u8_t seq;
@ -2170,9 +2168,9 @@ struct bt_sdp_uuid_desc {
struct bt_uuid_16 uuid16;
struct bt_uuid_32 uuid32;
};
u16_t attr_id;
u8_t *params;
u16_t params_len;
u16_t attr_id;
u8_t *params;
u16_t params_len;
};
/* Generic attribute item collector. */

View file

@ -677,9 +677,9 @@ static void sc_derive_link_key(struct bt_smp *smp)
if (atomic_test_bit(smp->flags, SMP_FLAG_CT2)) {
/* constants as specified in Core Spec Vol.3 Part H 2.4.2.4 */
static const u8_t salt[16] = { 0x31, 0x70, 0x6d, 0x74,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 };
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 };
if (smp_h7(salt, conn->le.keys->ltk.val, ilk)) {
bt_keys_link_key_clear(link_key);
@ -836,9 +836,9 @@ static void smp_br_derive_ltk(struct bt_smp_br *smp)
if (atomic_test_bit(smp->flags, SMP_FLAG_CT2)) {
/* constants as specified in Core Spec Vol.3 Part H 2.4.2.5 */
static const u8_t salt[16] = { 0x32, 0x70, 0x6d, 0x74,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 };
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00 };
if (smp_h7(salt, link_key->val, ilk)) {
bt_keys_link_key_clear(link_key);