Add user callback function to the Bluetooth host demo to filter out connections from...
[pub/USBasp.git] / Demos / Host / Incomplete / BluetoothHost / Lib / BluetoothStack.c
index 7f49fc9..4e0330e 100644 (file)
 \r
 #include "BluetoothStack.h"\r
 \r
+/** Bluetooth device connection information structure. Once connected to a remote device, this structure tracks the\r
+ *  connection state of the individual L2CAP channels.\r
+ */\r
 Bluetooth_Connection_t Bluetooth_Connection = {IsConnected: false};\r
 \r
-Bluetooth_Device_t     Bluetooth_DeviceConfiguration ATTR_WEAK =\r
+/** Bluetooth configuration structure. This structure configures the bluetooth stack's user alterable settings. */\r
+Bluetooth_Device_t Bluetooth_DeviceConfiguration =\r
        {\r
-               Class:   DEVICE_CLASS_MAJOR_MISC,\r
+               Class:   (DEVICE_CLASS_SERVICE_CAPTURING | DEVICE_CLASS_MAJOR_COMPUTER | DEVICE_CLASS_MINOR_COMPUTER_PALM),\r
                PINCode: "0000",\r
-               Name:    "LUFA BT Device"\r
+               Name:    "LUFA Bluetooth Demo"\r
        };\r
 \r
-void Bluetooth_State_Init(void)\r
+void Bluetooth_Stack_Init(void)\r
 {\r
        Bluetooth_HCIProcessingState = Bluetooth_Init;\r
 }\r
 \r
-void Bluetooth_Stack_Task(void)\r
+void Bluetooth_Stack_USBTask(void)\r
 {\r
        Bluetooth_ProcessHCICommands();\r
        Bluetooth_ProcessACLPackets();\r
 }\r
 \r
+bool CALLBACK_Bluetooth_ConnectionRequest(uint8_t* RemoteAddress)\r
+{\r
+       /* Always accept connections from remote devices */\r
+       return true;\r
+}\r
+\r
 Bluetooth_Channel_t* Bluetooth_GetChannelData(uint16_t ChannelNumber, bool SearchBySource)\r
 {\r
        Bluetooth_Channel_t* CurrentChannelStructure;\r