Bluetooth: samples: Use bt_hci_cmd_alloc()
Use bt_hci_cmd_alloc() instead of the soon to be deprecated bt_hci_cmd_create(). Signed-off-by: Johan Hedberg <johan.hedberg@silabs.com>
This commit is contained in:
parent
c186a3110c
commit
187ec7012d
@ -57,7 +57,7 @@ static void read_conn_rssi(uint16_t handle, int8_t *rssi)
|
|||||||
|
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
buf = bt_hci_cmd_create(BT_HCI_OP_READ_RSSI, sizeof(*cp));
|
buf = bt_hci_cmd_alloc(K_FOREVER);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
printk("Unable to allocate command buffer\n");
|
printk("Unable to allocate command buffer\n");
|
||||||
return;
|
return;
|
||||||
@ -86,8 +86,7 @@ static void set_tx_power(uint8_t handle_type, uint16_t handle, int8_t tx_pwr_lvl
|
|||||||
struct net_buf *buf, *rsp = NULL;
|
struct net_buf *buf, *rsp = NULL;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
buf = bt_hci_cmd_create(BT_HCI_OP_VS_WRITE_TX_POWER_LEVEL,
|
buf = bt_hci_cmd_alloc(K_FOREVER);
|
||||||
sizeof(*cp));
|
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
printk("Unable to allocate command buffer\n");
|
printk("Unable to allocate command buffer\n");
|
||||||
return;
|
return;
|
||||||
@ -119,8 +118,7 @@ static void get_tx_power(uint8_t handle_type, uint16_t handle, int8_t *tx_pwr_lv
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
*tx_pwr_lvl = 0xFF;
|
*tx_pwr_lvl = 0xFF;
|
||||||
buf = bt_hci_cmd_create(BT_HCI_OP_VS_READ_TX_POWER_LEVEL,
|
buf = bt_hci_cmd_alloc(K_FOREVER);
|
||||||
sizeof(*cp));
|
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
printk("Unable to allocate command buffer\n");
|
printk("Unable to allocate command buffer\n");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -65,7 +65,7 @@ static void enable_legacy_adv_scan_request_event(bool enable)
|
|||||||
struct net_buf *buf;
|
struct net_buf *buf;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
buf = bt_hci_cmd_create(BT_HCI_OP_VS_SET_SCAN_REQ_REPORTS, sizeof(*cp));
|
buf = bt_hci_cmd_alloc(K_FOREVER);
|
||||||
if (!buf) {
|
if (!buf) {
|
||||||
printk("%s: Unable to allocate HCI command buffer\n", __func__);
|
printk("%s: Unable to allocate HCI command buffer\n", __func__);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user