diff --git a/ports/nrf/common-hal/bleio/Adapter.c b/ports/nrf/common-hal/bleio/Adapter.c index f4c35ac69f..e264b9d49b 100644 --- a/ports/nrf/common-hal/bleio/Adapter.c +++ b/ports/nrf/common-hal/bleio/Adapter.c @@ -51,9 +51,5 @@ bool common_hal_bleio_adapter_get_enabled(void) { } void common_hal_bleio_adapter_get_address(bleio_address_obj_t *address) { - ble_drv_addr_t drv_addr; - ble_drv_address_get(&drv_addr); - - address->type = drv_addr.addr_type; - memcpy(address->value, drv_addr.addr, BLEIO_ADDRESS_BYTES); + ble_drv_address_get(address); } diff --git a/ports/nrf/drivers/bluetooth/ble_drv.c b/ports/nrf/drivers/bluetooth/ble_drv.c index 1ab1d9337c..2d0aa7cfaa 100644 --- a/ports/nrf/drivers/bluetooth/ble_drv.c +++ b/ports/nrf/drivers/bluetooth/ble_drv.c @@ -186,7 +186,7 @@ uint8_t ble_drv_stack_enabled(void) { return is_enabled; } -void ble_drv_address_get(ble_drv_addr_t * p_addr) { +void ble_drv_address_get(bleio_address_obj_t *address) { SD_TEST_OR_ENABLE(); ble_gap_addr_t local_ble_addr; @@ -208,8 +208,8 @@ void ble_drv_address_get(ble_drv_addr_t * p_addr) { local_ble_addr.addr[5], local_ble_addr.addr[4], local_ble_addr.addr[3], \ local_ble_addr.addr[2], local_ble_addr.addr[1], local_ble_addr.addr[0]); - p_addr->addr_type = local_ble_addr.addr_type; - memcpy(p_addr->addr, local_ble_addr.addr, 6); + address->type = local_ble_addr.addr_type; + memcpy(address->value, local_ble_addr.addr, BLEIO_ADDRESS_BYTES); } bool ble_drv_uuid_add_vs(uint8_t *uuid, uint8_t *idx) { diff --git a/ports/nrf/drivers/bluetooth/ble_drv.h b/ports/nrf/drivers/bluetooth/ble_drv.h index e5282db73d..c48cb6c213 100644 --- a/ports/nrf/drivers/bluetooth/ble_drv.h +++ b/ports/nrf/drivers/bluetooth/ble_drv.h @@ -38,11 +38,6 @@ #include "shared-module/bleio/Scanner.h" #include "shared-module/bleio/Service.h" -typedef struct { - uint8_t addr[6]; - uint8_t addr_type; -} ble_drv_addr_t; - typedef struct { uint8_t * p_peer_addr; uint8_t addr_type; @@ -89,7 +84,7 @@ void ble_drv_stack_disable(void); uint8_t ble_drv_stack_enabled(void); -void ble_drv_address_get(ble_drv_addr_t * p_addr); +void ble_drv_address_get(bleio_address_obj_t *address); bool ble_drv_uuid_add_vs(uint8_t * p_uuid, uint8_t * idx);