nrf: Remove the ble drv specific address struct

This commit is contained in:
arturo182 2018-07-19 20:40:33 +02:00
parent 5412bf66c3
commit 4b344812bf
3 changed files with 5 additions and 14 deletions

View File

@ -51,9 +51,5 @@ bool common_hal_bleio_adapter_get_enabled(void) {
} }
void common_hal_bleio_adapter_get_address(bleio_address_obj_t *address) { void common_hal_bleio_adapter_get_address(bleio_address_obj_t *address) {
ble_drv_addr_t drv_addr; ble_drv_address_get(address);
ble_drv_address_get(&drv_addr);
address->type = drv_addr.addr_type;
memcpy(address->value, drv_addr.addr, BLEIO_ADDRESS_BYTES);
} }

View File

@ -186,7 +186,7 @@ uint8_t ble_drv_stack_enabled(void) {
return is_enabled; 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(); SD_TEST_OR_ENABLE();
ble_gap_addr_t local_ble_addr; 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[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]); local_ble_addr.addr[2], local_ble_addr.addr[1], local_ble_addr.addr[0]);
p_addr->addr_type = local_ble_addr.addr_type; address->type = local_ble_addr.addr_type;
memcpy(p_addr->addr, local_ble_addr.addr, 6); memcpy(address->value, local_ble_addr.addr, BLEIO_ADDRESS_BYTES);
} }
bool ble_drv_uuid_add_vs(uint8_t *uuid, uint8_t *idx) { bool ble_drv_uuid_add_vs(uint8_t *uuid, uint8_t *idx) {

View File

@ -38,11 +38,6 @@
#include "shared-module/bleio/Scanner.h" #include "shared-module/bleio/Scanner.h"
#include "shared-module/bleio/Service.h" #include "shared-module/bleio/Service.h"
typedef struct {
uint8_t addr[6];
uint8_t addr_type;
} ble_drv_addr_t;
typedef struct { typedef struct {
uint8_t * p_peer_addr; uint8_t * p_peer_addr;
uint8_t addr_type; uint8_t addr_type;
@ -89,7 +84,7 @@ void ble_drv_stack_disable(void);
uint8_t ble_drv_stack_enabled(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); bool ble_drv_uuid_add_vs(uint8_t * p_uuid, uint8_t * idx);