Browse Source

pkg: nordic_softdevice_ble: fix cppcheck warnings

master
Oleg Hahm 6 years ago
parent
commit
22fd9c12cc
  1. 7
      pkg/nordic_softdevice_ble/src/ble-mac.c
  2. 4
      pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c

7
pkg/nordic_softdevice_ble/src/ble-mac.c

@ -172,13 +172,12 @@ int ble_mac_send(uint8_t dest[8], void *data, size_t len)
od_hex_dump(data, len, OD_WIDTH_DEFAULT);
#endif
int i;
ble_ipsp_handle_t *handle;
int ret = -1;
if ((!dest) || _is_broadcast(dest)) {
DEBUG("broadcast\n");
for (i = 0; i < BLE_MAC_MAX_INTERFACE_NUM; i++) {
for (int i = 0; i < BLE_MAC_MAX_INTERFACE_NUM; i++) {
if (interfaces[i].handle.cid != 0 && interfaces[i].handle.conn_handle != 0) {
ret = _send_to_peer(&interfaces[i].handle, data, len);
DEBUG("ret=%i\n", ret);
@ -207,9 +206,7 @@ static uint32_t ble_mac_ipsp_evt_handler_irq(ble_ipsp_handle_t *p_handle, ble_ip
{
uint32_t retval = NRF_SUCCESS;
ble_mac_interface_t *p_instance = NULL;
p_instance = ble_mac_interface_lookup(p_handle);
ble_mac_interface_t *p_instance = ble_mac_interface_lookup(p_handle);
if (p_handle) {
DEBUG("ble-mac: IPSP event [handle:%d CID 0x%04X]\n", p_handle->conn_handle, p_handle->cid);

4
pkg/nordic_softdevice_ble/src/gnrc_nordic_ble_6lowpan.c

@ -80,9 +80,7 @@ static void _ble_mac_callback(ble_mac_event_enum_t event, void* arg)
static void _handle_raw_sixlowpan(ble_mac_inbuf_t *inbuf)
{
gnrc_pktsnip_t *pkt = NULL;
pkt = gnrc_pktbuf_add(NULL, inbuf->payload,
gnrc_pktsnip_t *pkt = gnrc_pktbuf_add(NULL, inbuf->payload,
inbuf->len,
GNRC_NETTYPE_SIXLOWPAN);

Loading…
Cancel
Save