Add information request/response signal handler to the Bluetooth Host demo.
authorDean Camera <dean@fourwalledcubicle.com>
Tue, 6 Apr 2010 02:48:47 +0000 (02:48 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Tue, 6 Apr 2010 02:48:47 +0000 (02:48 +0000)
Ensure that the AVRISP-MKII project's Windows avrdude compatibility define is named properly in all parts of the code.

Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
LUFA/ManPages/ChangeLog.txt
Projects/AVRISP-MKII/AVRISP.c
Projects/AVRISP-MKII/AVRISP.txt
Projects/AVRISP-MKII/makefile
Projects/XPLAINBridge/XPLAINBridge.c
Projects/XPLAINBridge/XPLAINBridge.txt

index ed39d5c..17503ea 100644 (file)
@@ -56,35 +56,33 @@ void Bluetooth_ProcessACLPackets(void)
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader.PayloadLength);\r
 #endif\r
 \r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader.PayloadLength);\r
 #endif\r
 \r
-       if (DataHeader.DestinationChannel == BLUETOOTH_CHANNEL_SIGNALING)\r
+       if (DataHeader.DestinationChannel == BT_CHANNEL_SIGNALING)\r
        {\r
                Bluetooth_SignalCommand_Header_t SignalCommandHeader;\r
                Pipe_Read_Stream_LE(&SignalCommandHeader, sizeof(SignalCommandHeader));\r
 \r
                switch (SignalCommandHeader.Code)\r
                {\r
        {\r
                Bluetooth_SignalCommand_Header_t SignalCommandHeader;\r
                Pipe_Read_Stream_LE(&SignalCommandHeader, sizeof(SignalCommandHeader));\r
 \r
                switch (SignalCommandHeader.Code)\r
                {\r
-                       case BLUETOOTH_SIGNAL_CONNECTION_REQUEST:\r
+                       case BT_SIGNAL_CONNECTION_REQUEST:\r
                                Bluetooth_SignalPacket_ConnectionRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
                                Bluetooth_SignalPacket_ConnectionRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
-                       case BLUETOOTH_SIGNAL_CONFIGURATION_REQUEST:\r
+                       case BT_SIGNAL_CONFIGURATION_REQUEST:\r
                                Bluetooth_SignalPacket_ConfigurationRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
                                Bluetooth_SignalPacket_ConfigurationRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
-                       case BLUETOOTH_SIGNAL_DISCONNECTION_REQUEST:\r
+                       case BT_SIGNAL_DISCONNECTION_REQUEST:\r
                                Bluetooth_SignalPacket_DisconnectionRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;                  \r
                                Bluetooth_SignalPacket_DisconnectionRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;                  \r
-                       case BLUETOOTH_SIGNAL_ECHO_REQUEST:\r
+                       case BT_SIGNAL_ECHO_REQUEST:\r
                                Bluetooth_SignalPacket_EchoRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
                                Bluetooth_SignalPacket_EchoRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
-                       case BLUETOOTH_SIGNAL_INFORMATION_REQUEST:\r
-                               BT_ACL_DEBUG("<< Information Request", NULL);\r
-\r
-                               Pipe_Discard_Stream(ACLPacketHeader.DataLength);\r
-                               Pipe_ClearIN();         \r
-                               Pipe_Freeze();\r
+                       case BT_SIGNAL_INFORMATION_REQUEST:\r
+                               Bluetooth_SignalPacket_InformationRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
                                break;\r
                        default:\r
                                break;\r
                        default:\r
+                               #if (ACL_DEBUG_LEVEL > 0)\r
                                BT_ACL_DEBUG("<< Unknown Signaling Command 0x%02X", SignalCommandHeader.Code);\r
                                BT_ACL_DEBUG("<< Unknown Signaling Command 0x%02X", SignalCommandHeader.Code);\r
-                                       \r
+                               #endif\r
+       \r
                                Pipe_Discard_Stream(ACLPacketHeader.DataLength);\r
                                Pipe_ClearIN();         \r
                                Pipe_Freeze();\r
                                Pipe_Discard_Stream(ACLPacketHeader.DataLength);\r
                                Pipe_ClearIN();         \r
                                Pipe_Freeze();\r
@@ -116,7 +114,9 @@ static inline void Bluetooth_SignalPacket_ConnectionRequest(Bluetooth_ACL_Header
        \r
        Pipe_Read_Stream_LE(&ConnectionRequest, sizeof(ConnectionRequest));\r
 \r
        \r
        Pipe_Read_Stream_LE(&ConnectionRequest, sizeof(ConnectionRequest));\r
 \r
+#if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG("<< L2CAP Connection Request", NULL);\r
        BT_ACL_DEBUG("<< L2CAP Connection Request", NULL);\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
 #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
@@ -131,14 +131,13 @@ static inline void Bluetooth_SignalPacket_ConnectionRequest(Bluetooth_ACL_Header
 \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(ConnectionResponse);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(ConnectionResponse);\r
 \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(ConnectionResponse);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(ConnectionResponse);\r
-       DataHeader->DestinationChannel        = BLUETOOTH_CHANNEL_SIGNALING;\r
-       SignalCommandHeader->Code             = BLUETOOTH_SIGNAL_CONNECTION_RESPONSE;\r
+       DataHeader->DestinationChannel        = BT_CHANNEL_SIGNALING;\r
+       SignalCommandHeader->Code             = BT_SIGNAL_CONNECTION_RESPONSE;\r
        SignalCommandHeader->Length           = sizeof(ConnectionResponse);\r
        \r
        Bluetooth_Channel_t* ChannelData      = Bluetooth_InitChannelData(ConnectionRequest.SourceChannel, ConnectionRequest.PSM);\r
        \r
        SignalCommandHeader->Length           = sizeof(ConnectionResponse);\r
        \r
        Bluetooth_Channel_t* ChannelData      = Bluetooth_InitChannelData(ConnectionRequest.SourceChannel, ConnectionRequest.PSM);\r
        \r
-       ConnectionResponse.Result             = (ChannelData == NULL) ? BLUETOOTH_CONNECTION_REFUSED_RESOURCES :\r
-                                                                                                                                   BLUETOOTH_CONNECTION_SUCCESSFUL;\r
+       ConnectionResponse.Result             = (ChannelData == NULL) ? BT_CONNECTION_REFUSED_RESOURCES : BT_CONNECTION_SUCCESSFUL;\r
        ConnectionResponse.DestinationChannel = ChannelData->LocalNumber;\r
        ConnectionResponse.SourceChannel      = ChannelData->RemoteNumber;\r
        ConnectionResponse.Status             = 0x00;\r
        ConnectionResponse.DestinationChannel = ChannelData->LocalNumber;\r
        ConnectionResponse.SourceChannel      = ChannelData->RemoteNumber;\r
        ConnectionResponse.Status             = 0x00;\r
@@ -158,7 +157,9 @@ static inline void Bluetooth_SignalPacket_ConnectionRequest(Bluetooth_ACL_Header
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength);                   \r
 #endif\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 Connection Response", NULL);\r
        BT_ACL_DEBUG(">> L2CAP Connection Response", NULL);\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
 #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
@@ -170,10 +171,13 @@ static inline void Bluetooth_SignalPacket_ConfigurationRequest(Bluetooth_ACL_Hea
                                                                Bluetooth_SignalCommand_Header_t* SignalCommandHeader)\r
 {\r
        Bluetooth_SignalCommand_ConfigurationRequest_t ConfigurationRequest;\r
                                                                Bluetooth_SignalCommand_Header_t* SignalCommandHeader)\r
 {\r
        Bluetooth_SignalCommand_ConfigurationRequest_t ConfigurationRequest;\r
-       \r
        Pipe_Read_Stream_LE(&ConfigurationRequest, sizeof(ConfigurationRequest));\r
        Pipe_Read_Stream_LE(&ConfigurationRequest, sizeof(ConfigurationRequest));\r
+       \r
+       // TODO: Process/Discard configuration options here\r
 \r
 \r
+#if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG("<< L2CAP Configuration Request", NULL);\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
 #if (ACL_DEBUG_LEVEL > 1)\r
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", ConfigurationRequest.DestinationChannel);\r
 #endif\r
@@ -187,8 +191,8 @@ static inline void Bluetooth_SignalPacket_ConfigurationRequest(Bluetooth_ACL_Hea
 \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(ConfigurationResponse);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(ConfigurationResponse);\r
 \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(ConfigurationResponse);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(ConfigurationResponse);\r
-       DataHeader->DestinationChannel        = BLUETOOTH_CHANNEL_SIGNALING;\r
-       SignalCommandHeader->Code             = BLUETOOTH_SIGNAL_CONFIGURATION_RESPONSE;\r
+       DataHeader->DestinationChannel        = BT_CHANNEL_SIGNALING;\r
+       SignalCommandHeader->Code             = BT_SIGNAL_CONFIGURATION_RESPONSE;\r
        SignalCommandHeader->Length           = sizeof(ConfigurationResponse);\r
        \r
        Bluetooth_Channel_t* ChannelData      = Bluetooth_GetChannelData(ConfigurationRequest.DestinationChannel, false);\r
        SignalCommandHeader->Length           = sizeof(ConfigurationResponse);\r
        \r
        Bluetooth_Channel_t* ChannelData      = Bluetooth_GetChannelData(ConfigurationRequest.DestinationChannel, false);\r
@@ -200,7 +204,7 @@ static inline void Bluetooth_SignalPacket_ConfigurationRequest(Bluetooth_ACL_Hea
 \r
        ConfigurationResponse.SourceChannel   = ChannelData->RemoteNumber;\r
        ConfigurationResponse.Flags           = 0x00;\r
 \r
        ConfigurationResponse.SourceChannel   = ChannelData->RemoteNumber;\r
        ConfigurationResponse.Flags           = 0x00;\r
-       ConfigurationResponse.Result          = (ChannelData != NULL) ? BLUETOOTH_CONFIGURATION_SUCCESSFUL : BLUETOOTH_CONFIGURATION_REJECTED;\r
+       ConfigurationResponse.Result          = (ChannelData != NULL) ? BT_CONFIGURATION_SUCCESSFUL : BT_CONFIGURATION_REJECTED;\r
 \r
        Pipe_Write_Stream_LE(ACLPacketHeader, sizeof(*ACLPacketHeader));\r
        Pipe_Write_Stream_LE(DataHeader, sizeof(*DataHeader));\r
 \r
        Pipe_Write_Stream_LE(ACLPacketHeader, sizeof(*ACLPacketHeader));\r
        Pipe_Write_Stream_LE(DataHeader, sizeof(*DataHeader));\r
@@ -217,7 +221,12 @@ static inline void Bluetooth_SignalPacket_ConfigurationRequest(Bluetooth_ACL_Hea
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength);                   \r
 #endif\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 Response", NULL);\r
        BT_ACL_DEBUG(">> L2CAP Configuration Response", NULL);\r
+#endif\r
+#if (ACL_DEBUG_LEVEL > 1)\r
+       BT_ACL_DEBUG("-- Result: 0x%02X", ConfigurationResponse.Result);\r
+#endif\r
 }\r
 \r
 static inline void Bluetooth_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
 }\r
 \r
 static inline void Bluetooth_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
@@ -228,7 +237,9 @@ static inline void Bluetooth_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Hea
        \r
        Pipe_Read_Stream_LE(&DisconnectionRequest, sizeof(DisconnectionRequest));\r
 \r
        \r
        Pipe_Read_Stream_LE(&DisconnectionRequest, sizeof(DisconnectionRequest));\r
 \r
+#if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG("<< L2CAP Disconnection Request", NULL);\r
        BT_ACL_DEBUG("<< L2CAP Disconnection Request", NULL);\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
 #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
@@ -243,8 +254,8 @@ static inline void Bluetooth_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Hea
 \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(DisconnectionResponse);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(DisconnectionResponse);\r
 \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(DisconnectionResponse);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(DisconnectionResponse);\r
-       DataHeader->DestinationChannel        = BLUETOOTH_CHANNEL_SIGNALING;\r
-       SignalCommandHeader->Code             = BLUETOOTH_SIGNAL_DISCONNECTION_RESPONSE;\r
+       DataHeader->DestinationChannel        = BT_CHANNEL_SIGNALING;\r
+       SignalCommandHeader->Code             = BT_SIGNAL_DISCONNECTION_RESPONSE;\r
        SignalCommandHeader->Length           = sizeof(DisconnectionResponse);\r
        \r
        Bluetooth_Channel_t* ChannelData      = Bluetooth_GetChannelData(DisconnectionRequest.SourceChannel, true);\r
        SignalCommandHeader->Length           = sizeof(DisconnectionResponse);\r
        \r
        Bluetooth_Channel_t* ChannelData      = Bluetooth_GetChannelData(DisconnectionRequest.SourceChannel, true);\r
@@ -270,7 +281,9 @@ static inline void Bluetooth_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Hea
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength);                   \r
 #endif\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 Disconnection Response", NULL);\r
        BT_ACL_DEBUG(">> L2CAP Disconnection Response", NULL);\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
 #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
@@ -281,7 +294,9 @@ static inline void Bluetooth_SignalPacket_EchoRequest(Bluetooth_ACL_Header_t* AC
                                                       Bluetooth_DataPacket_Header_t* DataHeader,\r
                                                       Bluetooth_SignalCommand_Header_t* SignalCommandHeader)\r
 {\r
                                                       Bluetooth_DataPacket_Header_t* DataHeader,\r
                                                       Bluetooth_SignalCommand_Header_t* SignalCommandHeader)\r
 {\r
+#if (ACL_DEBUG_LEVEL > 0)\r
        BT_ACL_DEBUG("<< L2CAP Echo Request", NULL);\r
        BT_ACL_DEBUG("<< L2CAP Echo Request", NULL);\r
+#endif\r
        \r
        Pipe_ClearIN();\r
        Pipe_Freeze();\r
        \r
        Pipe_ClearIN();\r
        Pipe_Freeze();\r
@@ -290,8 +305,8 @@ static inline void Bluetooth_SignalPacket_EchoRequest(Bluetooth_ACL_Header_t* AC
        \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader);\r
        \r
        ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader);\r
        DataHeader->PayloadLength             = sizeof(*SignalCommandHeader);\r
-       DataHeader->DestinationChannel        = BLUETOOTH_CHANNEL_SIGNALING;\r
-       SignalCommandHeader->Code             = BLUETOOTH_SIGNAL_ECHO_RESPONSE;\r
+       DataHeader->DestinationChannel        = BT_CHANNEL_SIGNALING;\r
+       SignalCommandHeader->Code             = BT_SIGNAL_ECHO_RESPONSE;\r
        SignalCommandHeader->Length           = 0;\r
        \r
        Pipe_Write_Stream_LE(ACLPacketHeader, sizeof(*ACLPacketHeader));\r
        SignalCommandHeader->Length           = 0;\r
        \r
        Pipe_Write_Stream_LE(ACLPacketHeader, sizeof(*ACLPacketHeader));\r
@@ -308,5 +323,82 @@ static inline void Bluetooth_SignalPacket_EchoRequest(Bluetooth_ACL_Header_t* AC
        BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
        BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength);                   \r
 #endif\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 Echo Response", NULL);\r
        BT_ACL_DEBUG(">> L2CAP Echo Response", NULL);\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
+{\r
+       Bluetooth_SignalCommand_InformationRequest_t InformationRequest;\r
+\r
+       Pipe_Read_Stream_LE(&InformationRequest, sizeof(InformationRequest));\r
+\r
+#if (ACL_DEBUG_LEVEL > 0)\r
+       BT_ACL_DEBUG("<< Information Request", NULL);\r
+#endif\r
+#if (ACL_DEBUG_LEVEL > 1)\r
+       BT_ACL_DEBUG("-- Info Type: 0x%04X", InformationRequest.InfoType);\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
+       uint8_t ResponseData[4];\r
+       uint8_t ResponseLen;\r
+\r
+       switch (InformationRequest.InfoType)\r
+       {\r
+               case BT_INFOREQ_MTU:            \r
+                       InformationResponse.Result = BT_INFORMATION_SUCCESSFUL;\r
+                       ResponseLen = 2;\r
+                       \r
+                       *((uint16_t*)&ResponseData) = 65533;\r
+                       break;\r
+               case BT_INFOREQ_EXTENDEDFEATURES:\r
+                       InformationResponse.Result = BT_INFORMATION_SUCCESSFUL;\r
+                       ResponseLen = 4;\r
+                       \r
+                       *((uint32_t*)&ResponseData) = 0;\r
+                       break;\r
+               default:\r
+                       InformationResponse.Result = BT_INFORMATION_NOTSUPPORTED;\r
+                       ResponseLen = 0;\r
+                       break;\r
+       }\r
+       \r
+       ACLPacketHeader->DataLength           = sizeof(*DataHeader) + sizeof(*SignalCommandHeader) + sizeof(InformationResponse) +\r
+                                               ResponseLen;\r
+       DataHeader->PayloadLength             = sizeof(*SignalCommandHeader) + sizeof(InformationResponse) + ResponseLen;\r
+       DataHeader->DestinationChannel        = BT_CHANNEL_SIGNALING;\r
+       SignalCommandHeader->Code             = BT_SIGNAL_INFORMATION_RESPONSE;\r
+       SignalCommandHeader->Length           = sizeof(InformationResponse) + ResponseLen;\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(&InformationResponse, sizeof(InformationResponse));\r
+       Pipe_Write_Stream_LE(ResponseData, ResponseLen);\r
+       \r
+       Pipe_ClearOUT();                \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 Information Response", NULL);    \r
+#endif\r
+#if (ACL_DEBUG_LEVEL > 1)\r
+       BT_ACL_DEBUG("-- Result: 0x%02X", InformationResponse.Result);\r
+#endif\r
 }\r
 }\r
index 9c7bd26..46d323f 100644 (file)
                #include "BluetoothStack.h"\r
                \r
        /* Macros: */\r
                #include "BluetoothStack.h"\r
                \r
        /* Macros: */\r
-               #define BT_ACL_DEBUG(s, ...)                     printf_P(PSTR("(ACL) " s "\r\n"), __VA_ARGS__)\r
-               #define ACL_DEBUG_LEVEL 1\r
+               #define BT_ACL_DEBUG(s, ...)              printf_P(PSTR("(ACL) " s "\r\n"), __VA_ARGS__)\r
+               #define ACL_DEBUG_LEVEL                   2\r
 \r
 \r
-               #define BLUETOOTH_CHANNEL_SIGNALING              0x0001\r
-               #define BLUETOOTH_CHANNEL_CONNECTIONLESS         0x0002\r
+               #define BT_CHANNEL_SIGNALING              0x0001\r
+               #define BT_CHANNEL_CONNECTIONLESS         0x0002\r
                \r
                \r
-               #define BLUETOOTH_SIGNAL_CONNECTION_REQUEST      0x02\r
-               #define BLUETOOTH_SIGNAL_CONNECTION_RESPONSE     0x03\r
-               #define BLUETOOTH_SIGNAL_CONFIGURATION_REQUEST   0x04\r
-               #define BLUETOOTH_SIGNAL_CONFIGURATION_RESPONSE  0x05\r
-               #define BLUETOOTH_SIGNAL_DISCONNECTION_REQUEST   0x06\r
-               #define BLUETOOTH_SIGNAL_DISCONNECTION_RESPONSE  0x07\r
-               #define BLUETOOTH_SIGNAL_ECHO_REQUEST            0x08\r
-               #define BLUETOOTH_SIGNAL_ECHO_RESPONSE           0x09\r
-               #define BLUETOOTH_SIGNAL_INFORMATION_REQUEST     0x0A\r
-               #define BLUETOOTH_SIGNAL_INFORMATION_RESPONSE    0x0B\r
+               #define BT_SIGNAL_CONNECTION_REQUEST      0x02\r
+               #define BT_SIGNAL_CONNECTION_RESPONSE     0x03\r
+               #define BT_SIGNAL_CONFIGURATION_REQUEST   0x04\r
+               #define BT_SIGNAL_CONFIGURATION_RESPONSE  0x05\r
+               #define BT_SIGNAL_DISCONNECTION_REQUEST   0x06\r
+               #define BT_SIGNAL_DISCONNECTION_RESPONSE  0x07\r
+               #define BT_SIGNAL_ECHO_REQUEST            0x08\r
+               #define BT_SIGNAL_ECHO_RESPONSE           0x09\r
+               #define BT_SIGNAL_INFORMATION_REQUEST     0x0A\r
+               #define BT_SIGNAL_INFORMATION_RESPONSE    0x0B\r
                \r
                \r
-               #define BLUETOOTH_CONNECTION_SUCCESSFUL          0x0000\r
-               #define BLUETOOTH_CONNECTION_REFUSED_RESOURCES   0x0004\r
+               #define BT_INFOREQ_MTU                    0x0001\r
+               #define BT_INFOREQ_EXTENDEDFEATURES       0x0002\r
                \r
                \r
-               #define BLUETOOTH_CONFIGURATION_SUCCESSFUL       0x0000\r
-               #define BLUETOOTH_CONFIGURATION_REJECTED         0x0002\r
-               #define BLUETOOTH_CONFIGURATION_UNKNOWNOPTIONS   0x0003\r
+               #define BT_INFORMATION_SUCCESSFUL         0x0000\r
+               #define BT_INFORMATION_NOTSUPPORTED       0x0001\r
+               \r
+               #define BT_CONNECTION_SUCCESSFUL          0x0000\r
+               #define BT_CONNECTION_REFUSED_RESOURCES   0x0004\r
+               \r
+               #define BT_CONFIGURATION_SUCCESSFUL       0x0000\r
+               #define BT_CONFIGURATION_REJECTED         0x0002\r
+               #define BT_CONFIGURATION_UNKNOWNOPTIONS   0x0003\r
                \r
        /* Type Defines: */\r
                typedef struct\r
                \r
        /* Type Defines: */\r
                typedef struct\r
                {\r
                        uint16_t DestinationChannel;\r
                        uint16_t Flags;\r
                {\r
                        uint16_t DestinationChannel;\r
                        uint16_t Flags;\r
-                       uint8_t  Options[];\r
                } Bluetooth_SignalCommand_ConfigurationRequest_t;\r
 \r
                typedef struct\r
                } Bluetooth_SignalCommand_ConfigurationRequest_t;\r
 \r
                typedef struct\r
                        uint16_t SourceChannel;\r
                        uint16_t Flags;\r
                        uint16_t Result;\r
                        uint16_t SourceChannel;\r
                        uint16_t Flags;\r
                        uint16_t Result;\r
-                       uint8_t  Config;\r
                } Bluetooth_SignalCommand_ConfigurationResponse_t;\r
                } Bluetooth_SignalCommand_ConfigurationResponse_t;\r
+\r
+               typedef struct\r
+               {\r
+                       uint16_t InfoType;\r
+               } Bluetooth_SignalCommand_InformationRequest_t;\r
                \r
                \r
+               typedef struct\r
+               {\r
+                       uint16_t InfoType;\r
+                       uint16_t Result;\r
+               } Bluetooth_SignalCommand_InformationResponse_t;\r
+\r
        /* Function Prototypes: */\r
                void Bluetooth_ProcessACLPackets(void);\r
 \r
        /* Function Prototypes: */\r
                void Bluetooth_ProcessACLPackets(void);\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_SignalPacket_DisconnectionRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
                                                                   Bluetooth_DataPacket_Header_t* DataHeader,\r
                                                                   Bluetooth_SignalCommand_Header_t* SignalCommandHeader);\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
                #endif\r
                \r
 #endif\r
                #endif\r
                \r
 #endif\r
index c8eddc1..724ef1e 100644 (file)
@@ -24,7 +24,7 @@
   *  - Standardized the naming scheme given to configuration descriptor sub-elements in the Device mode demos, bootloaders\r
   *    and projects\r
   *  - All Class Driver Host mode demos now correctly set the board LEDs to READY once the enumeration process has completed\r
   *  - Standardized the naming scheme given to configuration descriptor sub-elements in the Device mode demos, bootloaders\r
   *    and projects\r
   *  - All Class Driver Host mode demos now correctly set the board LEDs to READY once the enumeration process has completed\r
-  *  - Added WIN_LIBUSB_COMPAT compile time option to the AVRISP programmer project to make the code compatible with Windows\r
+  *  - Added LIBUSB_FILTERDRV_COMPAT compile time option to the AVRISP programmer project to make the code compatible with Windows\r
   *    builds of avrdude at the expense of AVRStudio compatibility\r
   *\r
   *  <b>Fixed:</b>\r
   *    builds of avrdude at the expense of AVRStudio compatibility\r
   *\r
   *  <b>Fixed:</b>\r
index ed101b8..2ba8001 100644 (file)
@@ -97,7 +97,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
        }\r
 \r
                LEDs_SetAllLEDs(LEDMASK_USB_ERROR);\r
        }\r
 \r
-       #if defined(WIN_LIBUSB_COMPAT)\r
+       #if defined(LIBUSB_FILTERDRV_COMPAT)\r
        if (!(Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK,\r
                                             ENDPOINT_DIR_IN, AVRISP_DATA_EPSIZE,\r
                                         ENDPOINT_BANK_SINGLE)))\r
        if (!(Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK,\r
                                             ENDPOINT_DIR_IN, AVRISP_DATA_EPSIZE,\r
                                         ENDPOINT_BANK_SINGLE)))\r
index b541257..fddae6d 100644 (file)
  *        to report a fixed 5V target voltage to the host regardless of the real target voltage.</td>  \r
  *   </tr>\r
  *   <tr>\r
  *        to report a fixed 5V target voltage to the host regardless of the real target voltage.</td>  \r
  *   </tr>\r
  *   <tr>\r
- *    <td>WIN_LIBUSB_COMPAT</td>\r
+ *    <td>LIBUSB_FILTERDRV_COMPAT</td>\r
  *    <td>Makefile CDEFS</td>\r
  *    <td>Define to switch to a non-standard endpoint scheme, breaking compatibility with AVRStudio under Windows but making\r
  *        the code compatible with Windows builds of avrdude using the libUSB driver. Linux platforms are not affected by this\r
  *    <td>Makefile CDEFS</td>\r
  *    <td>Define to switch to a non-standard endpoint scheme, breaking compatibility with AVRStudio under Windows but making\r
  *        the code compatible with Windows builds of avrdude using the libUSB driver. Linux platforms are not affected by this\r
index 1ea3b8d..db71f12 100644 (file)
@@ -199,7 +199,7 @@ CDEFS += -DENABLE_ISP_PROTOCOL
 CDEFS += -DENABLE_XPROG_PROTOCOL\r
 #CDEFS += -DXPROG_VIA_HARDWARE_USART\r
 #CDEFS += -DNO_VTARGET_DETECT\r
 CDEFS += -DENABLE_XPROG_PROTOCOL\r
 #CDEFS += -DXPROG_VIA_HARDWARE_USART\r
 #CDEFS += -DNO_VTARGET_DETECT\r
-#CDEFS += -DWIN_LIBUSB_COMPAT\r
+#CDEFS += -DLIBUSB_FILTERDRV_COMPAT\r
 \r
 \r
 # Place -D or -U options here for ASM sources\r
 \r
 \r
 # Place -D or -U options here for ASM sources\r
index 7ca94b2..090b767 100644 (file)
@@ -191,7 +191,7 @@ void EVENT_USB_Device_ConfigurationChanged(void)
                                                                                                    ENDPOINT_DIR_OUT, AVRISP_DATA_EPSIZE,\r
                                                                                                    ENDPOINT_BANK_SINGLE);\r
 \r
                                                                                                    ENDPOINT_DIR_OUT, AVRISP_DATA_EPSIZE,\r
                                                                                                    ENDPOINT_BANK_SINGLE);\r
 \r
-               #if defined(WIN_LIBUSB_COMPAT)\r
+               #if defined(LIBUSB_FILTERDRV_COMPAT)\r
                EndpointConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK,\r
                                                                    ENDPOINT_DIR_IN, AVRISP_DATA_EPSIZE,\r
                                                                    ENDPOINT_BANK_SINGLE);\r
                EndpointConfigSuccess &= Endpoint_ConfigureEndpoint(AVRISP_DATA_IN_EPNUM, EP_TYPE_BULK,\r
                                                                    ENDPOINT_DIR_IN, AVRISP_DATA_EPSIZE,\r
                                                                    ENDPOINT_BANK_SINGLE);\r
index cd8efbc..40ea08e 100644 (file)
@@ -79,7 +79,7 @@
  *    <td>Defines the maximum number of bytes which can be buffered in each Ring Buffer.</td>\r
  *   </tr>\r
  *   <tr>\r
  *    <td>Defines the maximum number of bytes which can be buffered in each Ring Buffer.</td>\r
  *   </tr>\r
  *   <tr>\r
- *    <td>WIN_LIBUSB_COMPAT</td>\r
+ *    <td>LIBUSB_FILTERDRV_COMPAT</td>\r
  *    <td>Makefile CDEFS</td>\r
  *    <td>Define to switch to a non-standard endpoint scheme, breaking compatibility with AVRStudio under Windows but making\r
  *        the code compatible with Windows builds of avrdude using the libUSB driver. Linux platforms are not affected by this\r
  *    <td>Makefile CDEFS</td>\r
  *    <td>Define to switch to a non-standard endpoint scheme, breaking compatibility with AVRStudio under Windows but making\r
  *        the code compatible with Windows builds of avrdude using the libUSB driver. Linux platforms are not affected by this\r