Add bidirectional channel configuration -- remote device is not ACKing sent Configura...
[pub/USBasp.git] / Demos / Host / Incomplete / BluetoothHost / Lib / BluetoothACLPackets.c
index c2c9902..d26ba19 100644 (file)
 #define  INCLUDE_FROM_BLUETOOTH_ACLPACKETS_C\r
 #include "BluetoothACLPackets.h"\r
 \r
-void Bluetooth_ProcessACLPackets(void)\r
+void Bluetooth_ACLTask(void)\r
 {\r
-       Bluetooth_ACL_Header_t        ACLPacketHeader;\r
-       Bluetooth_DataPacket_Header_t DataHeader;\r
+       Bluetooth_ProcessACLPackets();\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
+               bool MustSendConfigReq = true;\r
+       \r
+               switch (ChannelData->State)\r
+               {\r
+                       case Channel_Config_WaitConfig:\r
+                               ChannelData->State = Channel_Config_WaitReqResp;\r
+                               break;\r
+                       case Channel_Config_WaitSendConfig:\r
+                               ChannelData->State = Channel_Config_WaitResp;\r
+                               break;\r
+                       default:\r
+                               MustSendConfigReq  = false;\r
+                               break;\r
+               }\r
+               \r
+               if (MustSendConfigReq)\r
+               {\r
+                       BT_ACL_Header_t              ACLPacketHeader;\r
+                       BT_DataPacket_Header_t       DataHeader;\r
+                       BT_Signal_Header_t           SignalCommandHeader;\r
+                       BT_Signal_ConfigurationReq_t ConfigurationRequest;\r
+\r
+                       ACLPacketHeader.ConnectionHandle     = Bluetooth_Connection.ConnectionHandle;\r
+                       ACLPacketHeader.DataLength           = sizeof(DataHeader) + sizeof(SignalCommandHeader) + sizeof(ConfigurationRequest);\r
+                       DataHeader.PayloadLength             = sizeof(SignalCommandHeader) + sizeof(ConfigurationRequest);\r
+                       DataHeader.DestinationChannel        = BT_CHANNEL_SIGNALING;\r
+                       SignalCommandHeader.Code             = BT_SIGNAL_CONFIGURATION_REQUEST;\r
+                       SignalCommandHeader.Identifier       = ++Bluetooth_Connection.SignallingIdentifier;\r
+                       SignalCommandHeader.Length           = sizeof(ConfigurationRequest);\r
+                       \r
+                       ConfigurationRequest.DestinationChannel = ChannelData->RemoteNumber;\r
+                       ConfigurationRequest.Flags              = 0;\r
+\r
+                       Pipe_SelectPipe(BLUETOOTH_DATA_OUT_PIPE);\r
+                       Pipe_Unfreeze();\r
+                       \r
+                       Pipe_Write_Stream_LE(&ACLPacketHeader, sizeof(ACLPacketHeader));\r
+                       Pipe_Write_Stream_LE(&DataHeader, sizeof(DataHeader));\r
+                       Pipe_Write_Stream_LE(&SignalCommandHeader, sizeof(SignalCommandHeader));\r
+                       Pipe_Write_Stream_LE(&ConfigurationRequest, sizeof(ConfigurationRequest));\r
+\r
+                       Pipe_Freeze();\r
+\r
+                       #if (ACL_DEBUG_LEVEL > 1)\r
+                       BT_ACL_DEBUG("Packet Sent", NULL);\r
+                       BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader.ConnectionHandle & 0x0FFF));\r
+                       BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader.DataLength);\r
+                       BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader.DestinationChannel);\r
+                       BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader.PayloadLength);                    \r
+                       #endif\r
+                       #if (ACL_DEBUG_LEVEL > 0)\r
+                       BT_ACL_DEBUG(">> L2CAP Configuration Request", NULL);\r
+                       #endif\r
+                       #if (ACL_DEBUG_LEVEL > 1)\r
+                       BT_ACL_DEBUG("-- Destination Channel: 0x%04X", ConfigurationRequest.DestinationChannel);\r
+                       #endif\r
+               }\r
+       }\r
+}\r
+\r
+static void Bluetooth_ProcessACLPackets(void)\r
+{\r
+       BT_ACL_Header_t        ACLPacketHeader;\r
+       BT_DataPacket_Header_t DataHeader;\r
 \r
        Pipe_SelectPipe(BLUETOOTH_DATA_IN_PIPE);\r
        Pipe_Unfreeze();\r
@@ -48,35 +116,35 @@ void Bluetooth_ProcessACLPackets(void)
        Pipe_Read_Stream_LE(&ACLPacketHeader, sizeof(ACLPacketHeader));\r
        Pipe_Read_Stream_LE(&DataHeader, sizeof(DataHeader));\r
 \r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("Packet Received", NULL);\r
        BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader.ConnectionHandle & 0x0FFF));\r
        BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader.DataLength);\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader.DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader.PayloadLength);\r
-#endif\r
+       #endif\r
 \r
        if (DataHeader.DestinationChannel == BT_CHANNEL_SIGNALING)\r
        {\r
-               Bluetooth_SignalCommand_Header_t SignalCommandHeader;\r
+               BT_Signal_Header_t SignalCommandHeader;\r
                Pipe_Read_Stream_LE(&SignalCommandHeader, sizeof(SignalCommandHeader));\r
 \r
                switch (SignalCommandHeader.Code)\r
                {\r
                        case BT_SIGNAL_CONNECTION_REQUEST:\r
-                               Bluetooth_SignalPacket_ConnectionRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
+                               Bluetooth_Signal_ConnectionReq(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
                        case BT_SIGNAL_CONFIGURATION_REQUEST:\r
-                               Bluetooth_SignalPacket_ConfigurationRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
+                               Bluetooth_Signal_ConfigurationReq(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
                        case BT_SIGNAL_DISCONNECTION_REQUEST:\r
-                               Bluetooth_SignalPacket_DisconnectionRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
+                               Bluetooth_Signal_DisconnectionReq(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;                  \r
                        case BT_SIGNAL_ECHO_REQUEST:\r
-                               Bluetooth_SignalPacket_EchoRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
+                               Bluetooth_Signal_EchoReq(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
                        case BT_SIGNAL_INFORMATION_REQUEST:\r
-                               Bluetooth_SignalPacket_InformationRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
+                               Bluetooth_Signal_InformationReq(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
                        default:\r
                                #if (ACL_DEBUG_LEVEL > 0)\r
@@ -100,15 +168,21 @@ void Bluetooth_ProcessACLPackets(void)
        }\r
 }\r
 \r
-void Bluetooth_SendPacket(uint8_t* Data, uint16_t DataLen, Bluetooth_Channel_t* Channel)\r
+uint8_t Bluetooth_SendPacket(uint8_t* Data, uint16_t DataLen, Bluetooth_Channel_t* Channel)\r
 {\r
-       Bluetooth_ACL_Header_t        ACLPacketHeader;\r
-       Bluetooth_DataPacket_Header_t DataHeader;\r
+       BT_ACL_Header_t        ACLPacketHeader;\r
+       BT_DataPacket_Header_t DataHeader;\r
+\r
+       if (Bluetooth_Connection.IsConnected)\r
+         return BT_SENDPACKET_NotConnected;\r
+\r
+       if (Channel->State != Channel_Open)\r
+         return BT_SENDPACKET_ChannelNotOpen;\r
 \r
        ACLPacketHeader.ConnectionHandle      = Bluetooth_Connection.ConnectionHandle;\r
        ACLPacketHeader.DataLength            = sizeof(DataHeader) + DataLen;\r
-       DataHeader.PayloadLength              = DataLen;\r
        DataHeader.DestinationChannel         = Channel->RemoteNumber;\r
+       DataHeader.PayloadLength              = DataLen;\r
 \r
        Pipe_SelectPipe(BLUETOOTH_DATA_OUT_PIPE);\r
        Pipe_Unfreeze();\r
@@ -118,30 +192,32 @@ void Bluetooth_SendPacket(uint8_t* Data, uint16_t DataLen, Bluetooth_Channel_t*
        Pipe_Write_Stream_LE(Data, DataLen);\r
 \r
        Pipe_Freeze();\r
+       \r
+       return BT_SENDPACKET_NoError;\r
 }\r
 \r
-static inline void Bluetooth_SignalPacket_ConnectionRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
-                                                            Bluetooth_DataPacket_Header_t* DataHeader,\r
-                                                            Bluetooth_SignalCommand_Header_t* SignalCommandHeader)\r
+static inline void Bluetooth_Signal_ConnectionReq(BT_ACL_Header_t* ACLPacketHeader,\r
+                                                  BT_DataPacket_Header_t* DataHeader,\r
+                                                  BT_Signal_Header_t* SignalCommandHeader)\r
 {\r
-       Bluetooth_SignalCommand_ConnectionRequest_t ConnectionRequest;\r
+       BT_Signal_ConnectionReq_t ConnectionRequest;\r
        \r
        Pipe_Read_Stream_LE(&ConnectionRequest, sizeof(ConnectionRequest));\r
 \r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG("<< L2CAP Connection Request", NULL);\r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("-- PSM: 0x%04X", ConnectionRequest.PSM);\r
        BT_ACL_DEBUG("-- Source Channel: 0x%04X", ConnectionRequest.SourceChannel);\r
-#endif\r
+       #endif\r
        \r
        Pipe_ClearIN();\r
        Pipe_Freeze();\r
        Pipe_SelectPipe(BLUETOOTH_DATA_OUT_PIPE);\r
        Pipe_Unfreeze();\r
        \r
-       Bluetooth_SignalCommand_ConnectionResponse_t ConnectionResponse;\r
+       BT_Signal_ConnectionResp_t ConnectionResponse;\r
 \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(ConnectionResponse);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(ConnectionResponse);\r
@@ -164,44 +240,45 @@ static inline void Bluetooth_SignalPacket_ConnectionRequest(Bluetooth_ACL_Header
        Pipe_ClearOUT();                \r
        Pipe_Freeze();\r
        \r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("Packet Sent", NULL);\r
        BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader->ConnectionHandle & 0x0FFF));\r
        BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader->DataLength);\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength);                   \r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG(">> L2CAP Connection Response", NULL);\r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("-- Source Channel: 0x%04X", ConnectionResponse.SourceChannel);\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", ConnectionResponse.DestinationChannel);\r
-#endif\r
+       #endif\r
 }\r
 \r
-static inline void Bluetooth_SignalPacket_ConfigurationRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
-                                                               Bluetooth_DataPacket_Header_t* DataHeader,\r
-                                                               Bluetooth_SignalCommand_Header_t* SignalCommandHeader)\r
+static inline void Bluetooth_Signal_ConfigurationReq(BT_ACL_Header_t* ACLPacketHeader,\r
+                                                     BT_DataPacket_Header_t* DataHeader,\r
+                                                     BT_Signal_Header_t* SignalCommandHeader)\r
 {\r
-       Bluetooth_SignalCommand_ConfigurationRequest_t ConfigurationRequest;\r
+       BT_Signal_ConfigurationReq_t ConfigurationRequest;\r
        Pipe_Read_Stream_LE(&ConfigurationRequest, sizeof(ConfigurationRequest));\r
        \r
        // TODO: Process/Discard configuration options here\r
+       Pipe_Discard_Stream(DataHeader->PayloadLength - sizeof(*SignalCommandHeader));\r
 \r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG("<< L2CAP Configuration Request", NULL);\r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", ConfigurationRequest.DestinationChannel);\r
-#endif\r
+       #endif\r
        \r
        Pipe_ClearIN();\r
        Pipe_Freeze();\r
        Pipe_SelectPipe(BLUETOOTH_DATA_OUT_PIPE);\r
        Pipe_Unfreeze();\r
        \r
-       Bluetooth_SignalCommand_ConfigurationResponse_t ConfigurationResponse;\r
+       BT_Signal_ConfigurationResp_t ConfigurationResponse;\r
 \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(ConfigurationResponse);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(ConfigurationResponse);\r
@@ -212,7 +289,20 @@ static inline void Bluetooth_SignalPacket_ConfigurationRequest(Bluetooth_ACL_Hea
        Bluetooth_Channel_t* ChannelData      = Bluetooth_GetChannelData(ConfigurationRequest.DestinationChannel, false);\r
 \r
        if (ChannelData != NULL)\r
-         ChannelData->State = Channel_Open;\r
+       {\r
+               switch (ChannelData->State)\r
+               {\r
+                       case Channel_Config_WaitConfig:\r
+                               ChannelData->State = Channel_Config_WaitSendConfig;\r
+                               break;\r
+                       case Channel_Config_WaitReqResp:\r
+                               ChannelData->State = Channel_Config_WaitResp;\r
+                               break;\r
+                       case Channel_Config_WaitReq:\r
+                               ChannelData->State = Channel_Open;\r
+                               break;\r
+               }\r
+       }\r
          \r
        // TODO: Add channel config data to the tail of ConfigurationResponse\r
 \r
@@ -228,43 +318,43 @@ static inline void Bluetooth_SignalPacket_ConfigurationRequest(Bluetooth_ACL_Hea
        Pipe_ClearOUT();\r
        Pipe_Freeze();\r
        \r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("Packet Sent", NULL);\r
        BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader->ConnectionHandle & 0x0FFF));\r
        BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader->DataLength);\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength);                   \r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG(">> L2CAP Configuration Response", NULL);\r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("-- Result: 0x%02X", ConfigurationResponse.Result);\r
-#endif\r
+       #endif\r
 }\r
 \r
-static inline void Bluetooth_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
-                                                               Bluetooth_DataPacket_Header_t* DataHeader,\r
-                                                               Bluetooth_SignalCommand_Header_t* SignalCommandHeader)\r
+static inline void Bluetooth_Signal_DisconnectionReq(BT_ACL_Header_t* ACLPacketHeader,\r
+                                                     BT_DataPacket_Header_t* DataHeader,\r
+                                                     BT_Signal_Header_t* SignalCommandHeader)\r
 {\r
-       Bluetooth_SignalCommand_DisconnectionRequest_t DisconnectionRequest;\r
+       BT_Signal_DisconnectionReq_t DisconnectionRequest;\r
        \r
        Pipe_Read_Stream_LE(&DisconnectionRequest, sizeof(DisconnectionRequest));\r
 \r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG("<< L2CAP Disconnection Request", NULL);\r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DisconnectionRequest.DestinationChannel);\r
        BT_ACL_DEBUG("-- Source Channel: 0x%04X", DisconnectionRequest.SourceChannel);\r
-#endif\r
+       #endif\r
        \r
        Pipe_ClearIN();\r
        Pipe_Freeze();\r
        Pipe_SelectPipe(BLUETOOTH_DATA_OUT_PIPE);\r
        Pipe_Unfreeze();\r
        \r
-       Bluetooth_SignalCommand_DisconnectionResponse_t DisconnectionResponse;\r
+       BT_Signal_DisconnectionResp_t DisconnectionResponse;\r
 \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(DisconnectionResponse);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(DisconnectionResponse);\r
@@ -288,29 +378,29 @@ static inline void Bluetooth_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Hea
        Pipe_ClearOUT();\r
        Pipe_Freeze();\r
        \r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("Packet Sent", NULL);\r
        BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader->ConnectionHandle & 0x0FFF));\r
        BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader->DataLength);\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength);                   \r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG(">> L2CAP Disconnection Response", NULL);\r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("-- Source Channel: 0x%04X", DisconnectionResponse.SourceChannel);\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DisconnectionResponse.DestinationChannel);\r
-#endif\r
+       #endif\r
 }\r
 \r
-static inline void Bluetooth_SignalPacket_EchoRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
-                                                      Bluetooth_DataPacket_Header_t* DataHeader,\r
-                                                      Bluetooth_SignalCommand_Header_t* SignalCommandHeader)\r
+static inline void Bluetooth_Signal_EchoReq(BT_ACL_Header_t* ACLPacketHeader,\r
+                                            BT_DataPacket_Header_t* DataHeader,\r
+                                            BT_Signal_Header_t* SignalCommandHeader)\r
 {\r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG("<< L2CAP Echo Request", NULL);\r
-#endif\r
+       #endif\r
        \r
        Pipe_ClearIN();\r
        Pipe_Freeze();\r
@@ -330,39 +420,39 @@ static inline void Bluetooth_SignalPacket_EchoRequest(Bluetooth_ACL_Header_t* AC
        Pipe_ClearOUT();                \r
        Pipe_Freeze();\r
        \r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("Packet Sent", NULL);\r
        BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader->ConnectionHandle & 0x0FFF));\r
        BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader->DataLength);\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength);                   \r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG(">> L2CAP Echo Response", NULL);\r
-#endif\r
+       #endif\r
 }\r
 \r
-static inline void Bluetooth_SignalPacket_InformationRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
-                                                             Bluetooth_DataPacket_Header_t* DataHeader,\r
-                                                             Bluetooth_SignalCommand_Header_t* SignalCommandHeader)\r
+static inline void Bluetooth_Signal_InformationReq(BT_ACL_Header_t* ACLPacketHeader,\r
+                                                   BT_DataPacket_Header_t* DataHeader,\r
+                                                   BT_Signal_Header_t* SignalCommandHeader)\r
 {\r
-       Bluetooth_SignalCommand_InformationRequest_t InformationRequest;\r
+       BT_Signal_InformationReq_t InformationRequest;\r
 \r
        Pipe_Read_Stream_LE(&InformationRequest, sizeof(InformationRequest));\r
 \r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG("<< Information Request", NULL);\r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("-- Info Type: 0x%04X", InformationRequest.InfoType);\r
-#endif\r
+       #endif\r
        \r
        Pipe_ClearIN();\r
        Pipe_Freeze();\r
        Pipe_SelectPipe(BLUETOOTH_DATA_OUT_PIPE);\r
        Pipe_Unfreeze();\r
        \r
-       Bluetooth_SignalCommand_InformationResponse_t InformationResponse;\r
+       BT_Signal_InformationResp_t InformationResponse;\r
        uint8_t ResponseData[4];\r
        uint8_t ResponseLen;\r
 \r
@@ -402,17 +492,17 @@ static inline void Bluetooth_SignalPacket_InformationRequest(Bluetooth_ACL_Heade
        Pipe_ClearOUT();                \r
        Pipe_Freeze();\r
 \r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("Packet Sent", NULL);\r
        BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader->ConnectionHandle & 0x0FFF));\r
        BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader->DataLength);\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength);                   \r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 0)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG(">> L2CAP Information Response", NULL);    \r
-#endif\r
-#if (ACL_DEBUG_LEVEL > 1)\r
+       #endif\r
+       #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("-- Result: 0x%02X", InformationResponse.Result);\r
-#endif\r
+       #endif\r
 }\r