aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-06-26 15:07:13 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-06-26 15:07:13 +0000
commitb6565404685fbac1698d256823abdbdb3d3ddaff (patch)
tree441d18429db23b2b4235122071de8a347fa69e4a /Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c
parentd29a408ffd906b537bcdce2a0cd98827ea5c27e3 (diff)
downloadlufa-b6565404685fbac1698d256823abdbdb3d3ddaff.tar.gz
lufa-b6565404685fbac1698d256823abdbdb3d3ddaff.tar.bz2
lufa-b6565404685fbac1698d256823abdbdb3d3ddaff.zip
Make Bluetooth ACL channel searches skip over closed (invalid) channels. RFCOMM channels are considered invalid when the channel state is closed, not when the DLCI is zero - fix incorrect code.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c
index 01fab788f..5e9c86b1d 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMMControl.c
@@ -188,12 +188,12 @@ static void RFCOMM_ProcessDPNCommand(const RFCOMM_Command_t* const CommandHeader
/* Find a free entry in the RFCOMM channel multiplexer state array */
for (uint8_t i = 0; i < RFCOMM_MAX_OPEN_CHANNELS; i++)
{
- /* If the channel's DLCI is zero, the channel state entry is free */
- if (!(RFCOMM_Channels[i].DLCI))
+ /* If the channel's state is closed, the channel state entry is free */
+ if (RFCOMMChannel->State == RFCOMM_Channel_Closed)
{
- RFCOMMChannel = &RFCOMM_Channels[i];
- RFCOMMChannel->DLCI = Params->DLCI;
- RFCOMMChannel->MTU = 0xFFFF;
+ RFCOMMChannel = &RFCOMM_Channels[i];
+ RFCOMMChannel->DLCI = Params->DLCI;
+ RFCOMMChannel->MTU = 0xFFFF;
RFCOMMChannel->Remote.Signals = 0 | (1 << 0);
RFCOMMChannel->Remote.BreakSignal = 0 | (1 << 0);
RFCOMMChannel->Local.Signals = RFCOMM_SIGNAL_RTC | RFCOMM_SIGNAL_RTR | RFCOMM_SIGNAL_DV | (1 << 0);
@@ -230,6 +230,6 @@ static void RFCOMM_ProcessDPNCommand(const RFCOMM_Command_t* const CommandHeader
BT_RFCOMM_DEBUG(1, ">> DPN Response");
- /* Send the PDN response to acknowledge the command */
+ /* Send the DPN response to acknowledge the command */
RFCOMM_SendFrame(RFCOMM_CONTROL_DLCI, false, RFCOMM_Frame_UIH, sizeof(DPNResponse), &DPNResponse, Channel);
}