Add bidirectional channel configuration -- remote device is not ACKing sent Configura...
[pub/USBasp.git] / Demos / Host / Incomplete / BluetoothHost / Lib / BluetoothStack.c
index 5da4d0b..1d3d199 100644 (file)
@@ -50,21 +50,20 @@ void Bluetooth_Stack_Init(void)
 \r
 void Bluetooth_Stack_USBTask(void)\r
 {\r
-       Bluetooth_ProcessHCICommands();\r
-       Bluetooth_ProcessACLPackets();\r
+       Bluetooth_HCITask();\r
+       Bluetooth_ACLTask();\r
 }\r
 \r
 Bluetooth_Channel_t* Bluetooth_GetChannelData(uint16_t ChannelNumber, bool SearchBySource)\r
 {\r
        for (uint8_t i = 0; i < BLUETOOTH_MAX_OPEN_CHANNELS; i++)\r
        {\r
-               Bluetooth_Channel_t* CurrentChannelStructure = &Bluetooth_Connection.Channels[i];\r
+               Bluetooth_Channel_t* ChannelData = &Bluetooth_Connection.Channels[i];\r
        \r
-               uint16_t CurrentChannelNumber = (SearchBySource) ? CurrentChannelStructure->RemoteNumber :\r
-                                                                  CurrentChannelStructure->LocalNumber;\r
+               uint16_t CurrentChannelNumber = (SearchBySource) ? ChannelData->RemoteNumber : ChannelData->LocalNumber;\r
        \r
                if (CurrentChannelNumber == ChannelNumber)\r
-                 return CurrentChannelStructure;\r
+                 return ChannelData;\r
        }\r
 \r
        return NULL;\r
@@ -74,16 +73,16 @@ Bluetooth_Channel_t* Bluetooth_InitChannelData(uint16_t RemoteChannelNumber, uin
 {\r
        for (uint8_t i = 0; i < BLUETOOTH_MAX_OPEN_CHANNELS; i++)\r
        {\r
-               Bluetooth_Channel_t* CurrentChannelStructure = &Bluetooth_Connection.Channels[i];\r
+               Bluetooth_Channel_t* ChannelData = &Bluetooth_Connection.Channels[i];\r
        \r
-               if (CurrentChannelStructure->State == Channel_Closed)\r
+               if (ChannelData->State == Channel_Closed)\r
                {\r
-                       CurrentChannelStructure->RemoteNumber = RemoteChannelNumber;\r
-                       CurrentChannelStructure->LocalNumber  = (BLUETOOTH_CHANNELNUMBER_BASEOFFSET + i);\r
-                       CurrentChannelStructure->PSM          = PSM;\r
-                       CurrentChannelStructure->State        = Channel_Config;\r
+                       ChannelData->RemoteNumber = RemoteChannelNumber;\r
+                       ChannelData->LocalNumber  = (BLUETOOTH_CHANNELNUMBER_BASEOFFSET + i);\r
+                       ChannelData->PSM          = PSM;\r
+                       ChannelData->State        = Channel_Config_WaitConfig;\r
                        \r
-                       return CurrentChannelStructure;\r
+                       return ChannelData;\r
                }               \r
        }\r
 \r