Bluetooth: Take advantage of the new net_buf_pull_u8() helper

Change-Id: I41ac2bc721b916f6d939f23be293750a83d21523
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
Johan Hedberg 2016-02-12 14:57:53 +02:00 committed by Gerrit Code Review
commit 1bc6597d4d
3 changed files with 4 additions and 10 deletions

View file

@ -209,8 +209,7 @@ static int h4_send(enum bt_buf_type buf_type, struct net_buf *buf)
}
while (buf->len) {
uart_poll_out(h4_dev, buf->data[0]);
net_buf_pull(buf, 1);
uart_poll_out(h4_dev, net_buf_pull_u8(buf));
}
net_buf_unref(buf);

View file

@ -584,11 +584,7 @@ void bt_uart_isr(void *unused)
static uint8_t h5_get_type(struct net_buf *buf)
{
uint8_t type = UNALIGNED_GET((uint8_t *)buf->data);
net_buf_pull(buf, sizeof(type));
return type;
return net_buf_pull_u8(buf);
}
static int h5_queue(enum bt_buf_type buf_type, struct net_buf *buf)

View file

@ -1390,13 +1390,12 @@ int bt_le_scan_update(bool fast_scan)
static void le_adv_report(struct net_buf *buf)
{
uint8_t num_reports = buf->data[0];
uint8_t num_reports = net_buf_pull_u8(buf);
struct bt_hci_ev_le_advertising_info *info;
BT_DBG("Adv number of reports %u", num_reports);
info = net_buf_pull(buf, sizeof(num_reports));
info = (void *)buf->data;
while (num_reports--) {
int8_t rssi = info->data[info->length];
const bt_addr_le_t *addr;