use hci_event_pin_code_request_get_bd_addr

This commit is contained in:
Milanka Ringwald 2016-04-01 14:04:14 +02:00
parent 9543ea381f
commit a6ef64ba22
16 changed files with 16 additions and 21 deletions

View File

@ -446,7 +446,7 @@ and address from the *gap_event_advertising_report* event use following getters:
<!-- -->
uint8_t address type = gap_event_advertising_report_get_address_type(event);
bd_addr_t address;
gap_event_advertising_report_get_address(event, &address);
gap_event_advertising_report_get_address(event, address);
## Bluetooth HCI Packet Logs {#sec:packetlogsHowTo}

View File

@ -136,7 +136,7 @@ PIN, see Listing [below](#lst:PinCodeRequest).
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Pin code request - using '0000'\n\r");
bt_flip_addr(bd_addr, &packet[2]);
hci_event_pin_code_request_get_bd_addr(packet, bd_addr);
// baseband address, pin length, PIN: c-string
hci_send_cmd(&hci_pin_code_request_reply, &bd_addr, 4, "0000");

View File

@ -451,7 +451,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Pin code request - using '0000'\n");
reverse_bd_addr(&packet[2], event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;

View File

@ -105,7 +105,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Pin code request - using '0000'\n");
reverse_bd_addr(&packet[2], event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;

View File

@ -189,7 +189,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
case HCI_EVENT_PIN_CODE_REQUEST:
// pre-ssp: inform about pin code request
printf("Pin code request - using '0000'\n");
reverse_bd_addr(&packet[2], event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;

View File

@ -162,7 +162,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Pin code request - using '0000'\n\r");
reverse_bd_addr(&packet[2], event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;

View File

@ -138,8 +138,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
pin[i] = '\0';
}
printf("PIN = '%s'\n", pin);
reverse_bd_addr(&packet[2],
event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
bt_send_cmd(&hci_pin_code_request_reply, &event_addr, strlen(pin), pin);
break;

View File

@ -152,8 +152,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
i--;
}
printf("PIN (%u)= '%s'\n", i, pin);
reverse_bd_addr(&packet[2],
event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
bt_send_cmd(&hci_pin_code_request_reply, &event_addr, i, pin);
break;

View File

@ -94,8 +94,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Using PIN 0000\n");
reverse_bd_addr(&packet[2],
event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
bt_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;

View File

@ -110,8 +110,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Using PIN 0000\n");
reverse_bd_addr(&packet[2],
event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
bt_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;

View File

@ -131,8 +131,7 @@ void packet_handler(uint8_t packet_type, uint16_t channel, uint8_t *packet, uint
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Using PIN 0000\n");
reverse_bd_addr(&packet[2],
event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
bt_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;

View File

@ -118,7 +118,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Pin code request - using '0000'\n\r");
reverse_bd_addr(&packet[2], event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;

View File

@ -157,7 +157,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Pin code request - using '0000'\n\r");
reverse_bd_addr(&packet[2], event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;

View File

@ -1595,7 +1595,7 @@ static void event_handler(uint8_t *packet, int size){
}
// PIN CODE REQUEST means the link key request didn't succee -> delete stored link key
if (!hci_stack->link_key_db) break;
reverse_bd_addr(&packet[2], addr);
hci_event_pin_code_request_get_bd_addr(packet, addr);
hci_stack->link_key_db->delete_link_key(addr);
break;

View File

@ -317,7 +317,7 @@ static void packet_handler (uint8_t packet_type, uint16_t channel, uint8_t *pack
break;
case HCI_EVENT_PIN_CODE_REQUEST:
reverse_bd_addr(&packet[2], remote);
hci_event_pin_code_request_get_bd_addr(packet, remote);
printf("GAP Legacy PIN Request for %s (press ENTER to send)\nPasskey:", bd_addr_to_str(remote));
fflush(stdout);
ui_chars_for_pin = 1;

View File

@ -114,7 +114,7 @@ static void packet_handler(void * connection, uint8_t packet_type, uint16_t chan
case HCI_EVENT_PIN_CODE_REQUEST:
// inform about pin code request
printf("Pin code request - using '0000'\n\r");
reverse_bd_addr(&packet[2], event_addr);
hci_event_pin_code_request_get_bd_addr(packet, event_addr);
hci_send_cmd(&hci_pin_code_request_reply, &event_addr, 4, "0000");
break;