hci.c (e0dbca836d24c7b5fd8ef62976cf5e397ef40224) hci.c (a45d6b9ff9eb41c47113e31e1570900eb65b2a5c)
1/*
2 * Copyright (C) 2009-2012 by Matthias Ringwald
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

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

57#include "btstack_memory.h"
58#include "debug.h"
59#include "hci_dump.h"
60
61#include <btstack/hci_cmds.h>
62
63#define HCI_CONNECTION_TIMEOUT_MS 10000
64
1/*
2 * Copyright (C) 2009-2012 by Matthias Ringwald
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

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

57#include "btstack_memory.h"
58#include "debug.h"
59#include "hci_dump.h"
60
61#include <btstack/hci_cmds.h>
62
63#define HCI_CONNECTION_TIMEOUT_MS 10000
64
65#define HCI_INTIALIZING_SUBSTATE_AFTER_SLEEP 10
65#define HCI_INTIALIZING_SUBSTATE_AFTER_SLEEP 11
66
67#ifdef USE_BLUETOOL
68#include "bt_control_iphone.h"
69#endif
70
71static void hci_update_scan_enable(void);
72
73// the STACK is here

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

743
744 // register packet handlers with transport
745 transport->register_packet_handler(&packet_handler);
746
747 hci_stack.state = HCI_STATE_OFF;
748
749 // class of device
750 hci_stack.class_of_device = 0x007a020c; // Smartphone
66
67#ifdef USE_BLUETOOL
68#include "bt_control_iphone.h"
69#endif
70
71static void hci_update_scan_enable(void);
72
73// the STACK is here

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

743
744 // register packet handlers with transport
745 transport->register_packet_handler(&packet_handler);
746
747 hci_stack.state = HCI_STATE_OFF;
748
749 // class of device
750 hci_stack.class_of_device = 0x007a020c; // Smartphone
751
752 // Secure Simple Pairing
753 hci_stack.ssp_enable = 0;
754 hci_stack.ssp_io_capability = SSP_IO_CAPABILITY_UNKNOWN;
755 hci_stack.ssp_authentication_requirement = 0;
751}
752
753void hci_close(){
754 // close remote device db
755 if (hci_stack.remote_device_db) {
756 hci_stack.remote_device_db->close();
757 }
758 while (hci_stack.connections) {

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

1153#endif
1154 hci_send_cmd(&hci_write_local_name, hostname);
1155 }
1156 break;
1157 case 9:
1158 hci_send_cmd(&hci_set_event_mask,0xffffffff, 0xFFFFFFFF); ///0x1DFFFFFF
1159 break;
1160 case 10:
756}
757
758void hci_close(){
759 // close remote device db
760 if (hci_stack.remote_device_db) {
761 hci_stack.remote_device_db->close();
762 }
763 while (hci_stack.connections) {

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

1158#endif
1159 hci_send_cmd(&hci_write_local_name, hostname);
1160 }
1161 break;
1162 case 9:
1163 hci_send_cmd(&hci_set_event_mask,0xffffffff, 0xFFFFFFFF); ///0x1DFFFFFF
1164 break;
1165 case 10:
1166 hci_send_cmd(&hci_write_simple_pairing_mode, hci_stack.ssp_enable);
1167 break;
1168 case 11:
1161 hci_send_cmd(&hci_write_scan_enable, (hci_stack.connectable << 1) | hci_stack.discoverable); // page scan
1162 break;
1169 hci_send_cmd(&hci_write_scan_enable, (hci_stack.connectable << 1) | hci_stack.discoverable); // page scan
1170 break;
1163 case 11:
1171 case 12:
1164 // done.
1165 hci_stack.state = HCI_STATE_WORKING;
1166 hci_emit_state();
1167 break;
1168 default:
1169 break;
1170 }
1171 hci_stack.substate++;

--- 272 unchanged lines hidden ---
1172 // done.
1173 hci_stack.state = HCI_STATE_WORKING;
1174 hci_emit_state();
1175 break;
1176 default:
1177 break;
1178 }
1179 hci_stack.substate++;

--- 272 unchanged lines hidden ---