Fix Bluetooth stack CONNECTION RESPONSE packets - for this command and this command...
[pub/USBasp.git] / Demos / Host / Incomplete / BluetoothHost / Lib / BluetoothStack.c
index 7989063..ec1f637 100644 (file)
@@ -54,13 +54,13 @@ void Bluetooth_Stack_USBTask(void)
        Bluetooth_ACLTask();\r
 }\r
 \r
-Bluetooth_Channel_t* Bluetooth_GetChannelData(uint16_t ChannelNumber, bool SearchBySource)\r
+Bluetooth_Channel_t* Bluetooth_GetChannelData(uint16_t ChannelNumber, bool SearchByRemoteChannel)\r
 {\r
        for (uint8_t i = 0; i < BLUETOOTH_MAX_OPEN_CHANNELS; i++)\r
        {\r
                Bluetooth_Channel_t* ChannelData = &Bluetooth_Connection.Channels[i];\r
        \r
-               uint16_t CurrentChannelNumber = (SearchBySource) ? ChannelData->RemoteNumber : ChannelData->LocalNumber;\r
+               uint16_t CurrentChannelNumber = (SearchByRemoteChannel) ? ChannelData->RemoteNumber : ChannelData->LocalNumber;\r
        \r
                if (CurrentChannelNumber == ChannelNumber)\r
                  return ChannelData;\r
@@ -68,24 +68,3 @@ Bluetooth_Channel_t* Bluetooth_GetChannelData(uint16_t ChannelNumber, bool Searc
 \r
        return NULL;\r
 }\r
-\r
-Bluetooth_Channel_t* Bluetooth_InitChannelData(uint16_t RemoteChannelNumber, uint16_t PSM)\r
-{\r
-       for (uint8_t i = 0; i < BLUETOOTH_MAX_OPEN_CHANNELS; i++)\r
-       {\r
-               Bluetooth_Channel_t* ChannelData = &Bluetooth_Connection.Channels[i];\r
-       \r
-               if (ChannelData->State == Channel_Closed)\r
-               {\r
-                       ChannelData->RemoteNumber = RemoteChannelNumber;\r
-                       ChannelData->LocalNumber  = (BLUETOOTH_CHANNELNUMBER_BASEOFFSET + i);\r
-                       ChannelData->PSM          = PSM;\r
-                       ChannelData->LocalMTU     = MAXIMUM_CHANNEL_MTU;\r
-                       ChannelData->State        = Channel_Config_WaitConfig;\r
-                       \r
-                       return ChannelData;\r
-               }               \r
-       }\r
-\r
-       return NULL;\r
-}\r