hci.c (3b6d4121dc4629796befd599261e0d13d4ffb073) hci.c (b04dfa37bafdda36b153d66dad8889d7bdc56baa)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 1691 unchanged lines hidden (view full) ---

1700 hci_stack->decline_reason = 0;
1701 hci_stack->new_scan_enable_value = 0xff;
1702
1703 // LE
1704 hci_stack->adv_addr_type = 0;
1705 memset(hci_stack->adv_address, 0, 6);
1706 hci_stack->le_scanning_state = LE_SCAN_IDLE;
1707 hci_stack->le_scan_type = 0xff;
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 1691 unchanged lines hidden (view full) ---

1700 hci_stack->decline_reason = 0;
1701 hci_stack->new_scan_enable_value = 0xff;
1702
1703 // LE
1704 hci_stack->adv_addr_type = 0;
1705 memset(hci_stack->adv_address, 0, 6);
1706 hci_stack->le_scanning_state = LE_SCAN_IDLE;
1707 hci_stack->le_scan_type = 0xff;
1708 hci_stack->le_connecting_state = LE_CONNECTING_IDLE;
1708 hci_stack->le_connection_parameter_range.le_conn_interval_min = 0x0006;
1709 hci_stack->le_connection_parameter_range.le_conn_interval_max = 0x0C80;
1710 hci_stack->le_connection_parameter_range.le_conn_latency_min = 0x0000;
1711 hci_stack->le_connection_parameter_range.le_conn_latency_max = 0x03E8;
1712 hci_stack->le_connection_parameter_range.le_supervision_timeout_min = 0x000A;
1713 hci_stack->le_connection_parameter_range.le_supervision_timeout_max = 0x0C80;
1714}
1715

--- 784 unchanged lines hidden (view full) ---

2500 hci_stack->adv_addr_type = packet[8];
2501 }
2502 if (IS_COMMAND(packet, hci_le_set_random_address)){
2503 bt_flip_addr(hci_stack->adv_address, &packet[3]);
2504 }
2505 if (IS_COMMAND(packet, hci_le_set_advertise_enable)){
2506 hci_stack->le_advertisements_active = packet[3];
2507 }
1709 hci_stack->le_connection_parameter_range.le_conn_interval_min = 0x0006;
1710 hci_stack->le_connection_parameter_range.le_conn_interval_max = 0x0C80;
1711 hci_stack->le_connection_parameter_range.le_conn_latency_min = 0x0000;
1712 hci_stack->le_connection_parameter_range.le_conn_latency_max = 0x03E8;
1713 hci_stack->le_connection_parameter_range.le_supervision_timeout_min = 0x000A;
1714 hci_stack->le_connection_parameter_range.le_supervision_timeout_max = 0x0C80;
1715}
1716

--- 784 unchanged lines hidden (view full) ---

2501 hci_stack->adv_addr_type = packet[8];
2502 }
2503 if (IS_COMMAND(packet, hci_le_set_random_address)){
2504 bt_flip_addr(hci_stack->adv_address, &packet[3]);
2505 }
2506 if (IS_COMMAND(packet, hci_le_set_advertise_enable)){
2507 hci_stack->le_advertisements_active = packet[3];
2508 }
2509 if (IS_COMMAND(packet, hci_le_create_connection)){
2510 // white list used?
2511 uint8_t initiator_filter_policy = packet[7];
2512 switch (initiator_filter_policy){
2513 case 0:
2514 // whitelist not used
2515 hci_stack->le_connecting_state = LE_CONNECTING_DIRECT;
2516 break;
2517 case 1:
2518 hci_stack->le_connecting_state = LE_CONNECTING_WHITELIST;
2519 break;
2520 default:
2521 log_error("Invalid initiator_filter_policy in LE Create Connection %u", initiator_filter_policy);
2522 break;
2523 }
2524 }
2525 if (IS_COMMAND(packet, hci_le_create_connection_cancel)){
2526 hci_stack->le_connecting_state = LE_CONNECTING_IDLE;
2527 }
2508#endif
2509
2510 hci_stack->num_cmd_packets--;
2511
2512 hci_dump_packet(HCI_COMMAND_DATA_PACKET, 0, packet, size);
2513 int err = hci_stack->hci_transport->send_packet(HCI_COMMAND_DATA_PACKET, packet, size);
2514
2515 // release packet buffer for synchronous transport implementations

--- 566 unchanged lines hidden ---
2528#endif
2529
2530 hci_stack->num_cmd_packets--;
2531
2532 hci_dump_packet(HCI_COMMAND_DATA_PACKET, 0, packet, size);
2533 int err = hci_stack->hci_transport->send_packet(HCI_COMMAND_DATA_PACKET, packet, size);
2534
2535 // release packet buffer for synchronous transport implementations

--- 566 unchanged lines hidden ---