aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-06-23 07:17:47 +0000
committerDean <Dean@d5102386-fcda-11dd-9fdb-3debd5008f28>2010-06-23 07:17:47 +0000
commit40d35490ab00030c398e53dd3e414608d494150a (patch)
treee730c05882a027ce2cbed2ac57fa05b888e6946c
parent015d0176d00ab2560c74e5f4283b63365abd525b (diff)
Add TEST RFCOMM command handler. Remove the RFCOMM channel UseUIFrame element, as the Bluetooth adaptions to RFCOMM only allow UIH frames to be used.
git-svn-id: http://lufa-lib.googlecode.com/svn/trunk@1348 d5102386-fcda-11dd-9fdb-3debd5008f28
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c1
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h1
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c26
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.h4
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/SDP.c4
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/SDP.h4
-rw-r--r--LUFA/ManPages/LUFAPoweredProjects.txt1
7 files changed, 29 insertions, 12 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c
index 6634863f..994a24b9 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c
@@ -235,7 +235,6 @@ static void RFCOMM_ProcessSABM(const RFCOMM_Address_t* const FrameAddress, Bluet
CurrRFCOMMChannel->DLCI = FrameAddress->DLCI;
CurrRFCOMMChannel->State = RFCOMM_Channel_Open;
CurrRFCOMMChannel->Priority = 7 + (CurrRFCOMMChannel->DLCI >> 3) + ((CurrRFCOMMChannel->DLCI >> 3) * 7);
- CurrRFCOMMChannel->UseUIFrames = false;
CurrRFCOMMChannel->MTU = 0xFFFF;
CurrRFCOMMChannel->Signals = 0;
CurrRFCOMMChannel->BreakSignals = 0;
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h
index 78e9b54e..d37c068d 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h
@@ -85,7 +85,6 @@
uint8_t DLCI;
uint8_t State;
uint8_t Priority;
- bool UseUIFrames;
uint16_t MTU;
uint8_t StatusFlags;
uint8_t Signals;
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c
index 3a6bf67c..1d186334 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c
@@ -47,7 +47,7 @@ void RFCOMM_ProcessControlCommand(const uint8_t* Command, Bluetooth_Channel_t* c
switch (CommandHeader->Command)
{
case RFCOMM_Control_Test:
- RFCOMM_ProcessTestCommand(CommandHeader, CommandData, Channel);
+ RFCOMM_ProcessTestCommand(CommandHeader, CommandDataLen, CommandData, Channel);
break;
case RFCOMM_Control_FlowControlEnable:
RFCOMM_ProcessFCECommand(CommandHeader, CommandData, Channel);
@@ -73,10 +73,29 @@ void RFCOMM_ProcessControlCommand(const uint8_t* Command, Bluetooth_Channel_t* c
}
}
-static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData,
- Bluetooth_Channel_t* const Channel)
+static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t CommandDataLen,
+ const uint8_t* CommandData, Bluetooth_Channel_t* const Channel)
{
+ const uint8_t* Params = (const uint8_t*)CommandData;
+
BT_RFCOMM_DEBUG(1, "<< TEST Command");
+
+ struct
+ {
+ RFCOMM_Command_t CommandHeader;
+ uint8_t Length;
+ uint8_t TestData[CommandDataLen];
+ } TestResponse;
+
+ /* Fill out the Test response data */
+ TestResponse.CommandHeader = (RFCOMM_Command_t){.Command = RFCOMM_Control_Test, .EA = true};
+ TestResponse.Length = (CommandDataLen << 1) | 0x01;
+ memcpy(TestResponse.TestData, Params, CommandDataLen);
+
+ BT_RFCOMM_DEBUG(1, ">> TEST Response");
+
+ /* Send the PDN response to acknowledge the command */
+ RFCOMM_SendFrame(RFCOMM_CONTROL_DLCI, false, RFCOMM_Frame_UIH, sizeof(TestResponse), &TestResponse, Channel);
}
static void RFCOMM_ProcessFCECommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData,
@@ -190,7 +209,6 @@ static void RFCOMM_ProcessDPNCommand(const RFCOMM_Command_t* const CommandHeader
/* Save the new channel configuration */
RFCOMMChannel->State = RFCOMM_Channel_Open;
RFCOMMChannel->Priority = Params->Priority;
- RFCOMMChannel->UseUIFrames = (Params->FrameType != 0);
RFCOMMChannel->MTU = Params->MaximumFrameSize;
struct
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.h b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.h
index 8cefa51c..b992c27c 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.h
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.h
@@ -113,8 +113,8 @@
void RFCOMM_ProcessControlCommand(const uint8_t* Command, Bluetooth_Channel_t* const Channel);
#if defined(INCLUDE_FROM_RFCOMM_CONTROL_C)
- static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData,
- Bluetooth_Channel_t* const Channel);
+ static void RFCOMM_ProcessTestCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t CommandDataLen,
+ const uint8_t* CommandData, Bluetooth_Channel_t* const Channel);
static void RFCOMM_ProcessFCECommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData,
Bluetooth_Channel_t* const Channel);
static void RFCOMM_ProcessFCDCommand(const RFCOMM_Command_t* const CommandHeader, const uint8_t* CommandData,
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.c b/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.c
index d0122515..c5c490ed 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.c
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.c
@@ -487,8 +487,8 @@ static bool SDP_SearchServiceTable(uint8_t UUIDList[][UUID_SIZE_BYTES], const ui
*
* \return True if all the UUIDs given in the UUID list appear in the given attribute table, false otherwise
*/
-static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs, uint16_t* UUIDMatchFlags,
- const void* CurrAttribute)
+static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs,
+ uint16_t* const UUIDMatchFlags, const void* CurrAttribute)
{
uint8_t CurrAttributeType = (pgm_read_byte(CurrAttribute) & ~0x07);
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.h b/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.h
index e7d02b0a..5310b6f7 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.h
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/SDP.h
@@ -218,8 +218,8 @@
static bool SDP_SearchServiceTable(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs,
const ServiceAttributeTable_t* CurrAttributeTable);
- static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs, uint16_t* UUIDMatchFlags,
- const void* CurrAttribute);
+ static void SDP_CheckUUIDMatch(uint8_t UUIDList[][UUID_SIZE_BYTES], const uint8_t TotalUUIDs,
+ uint16_t* const UUIDMatchFlags, const void* CurrAttribute);
static uint8_t SDP_GetAttributeList(uint16_t AttributeList[][2], const void** const CurrentParameter);
static uint8_t SDP_GetUUIDList(uint8_t UUIDList[][UUID_SIZE_BYTES], const void** const CurrentParameter);
diff --git a/LUFA/ManPages/LUFAPoweredProjects.txt b/LUFA/ManPages/LUFAPoweredProjects.txt
index bf445bcb..0cc1d8e2 100644
--- a/LUFA/ManPages/LUFAPoweredProjects.txt
+++ b/LUFA/ManPages/LUFAPoweredProjects.txt
@@ -27,6 +27,7 @@
* - Teensy and Teensy++, two other AVR USB development boards: http://www.pjrc.com/teensy/index.html
* - U2DIL/U4DIL, a set of DIP layout USB AVR boards: http://www.reworld.eu/re/en/products/u2dil/
* - USB10 AKA "The Ferret", a AT90USB162 development board: http://www.soc-machines.com
+ * - USBFOO 2, AT90USB162 based development board: http://shop.kernelconcepts.de/product_info.php?products_id=102
*
* \section Sec_LUFAProjects Projects Using LUFA (Hobbyist)
*