1
0
mirror of https://github.com/bluekitchen/btstack.git synced 2025-03-23 19:20:51 +00:00

change hci_local_bd_adr

This commit is contained in:
matthias.ringwald@gmail.com 2015-03-24 08:44:48 +00:00
parent 71f3d86927
commit 690bd0bab8
3 changed files with 11 additions and 6 deletions
example/embedded
src

@ -375,6 +375,7 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
int rc;
uint8_t event;
bd_addr_t event_addr;
bd_addr_t local_addr;
uint16_t uuid_source;
uint16_t uuid_dest;
uint16_t mtu;
@ -422,7 +423,8 @@ static void packet_handler (void * connection, uint8_t packet_type, uint16_t cha
memcpy(&event_addr, &packet[8], sizeof(bd_addr_t));
printf("BNEP connection from %s source UUID 0x%04x dest UUID: 0x%04x, max frame size: %u\n", bd_addr_to_str(event_addr), uuid_source, uuid_dest, mtu);
/* Create the tap interface */
tap_fd = tap_alloc(tap_dev_name, *hci_local_bd_addr());
hci_local_bd_addr(local_addr);
tap_fd = tap_alloc(tap_dev_name, local_addr);
if (tap_fd < 0) {
printf("Creating BNEP tap device failed: %s\n", strerror(errno));
} else {

@ -496,7 +496,10 @@ static int hci_send_acl_packet_fragments(hci_connection_t *connection){
// release buffer now for synchronous transport
if (hci_transport_synchronous()){
hci_release_packet_buffer();
hci_release_packet_buffer();
// notify upper stack that iit might be possible to send again
uint8_t event[] = { DAEMON_EVENT_HCI_PACKET_SENT, 0};
hci_stack->packet_handler(HCI_EVENT_PACKET, &event[0], sizeof(event));
}
return err;
@ -1883,8 +1886,8 @@ void hci_connectable_control(uint8_t enable){
hci_update_scan_enable();
}
uint8_t * hci_local_bd_addr(void){
return hci_stack->local_bd_addr;
void hci_local_bd_addr(bd_addr_t address_buffer){
memcpy(address_buffer, hci_stack->local_bd_addr, 6);
}
void hci_run(){

@ -667,8 +667,8 @@ int hci_is_packet_buffer_reserved(void);
// get point to packet buffer
uint8_t* hci_get_outgoing_packet_buffer(void);
// returns pointer to a bd_addr_t array
uint8_t * hci_local_bd_addr(void);
// gets local address
void hci_local_bd_addr(bd_addr_t address_buffer);
hci_connection_t * hci_connection_for_handle(hci_con_handle_t con_handle);
hci_connection_t * hci_connection_for_bd_addr_and_type(bd_addr_t addr, bd_addr_type_t addr_type);