From 4b952d479aa4bafe203a64d6211512450833cf8f Mon Sep 17 00:00:00 2001 From: Dean Camera Date: Wed, 23 Jun 2010 08:10:21 +0000 Subject: Split RFCOMM channel signals into Remote and Local pairs. Use memcpy() to copy over data from the command parameters to the RFCOMM response parameters. Ensure that only the valid parameter bytes are sent back in response to MSC commands. --- Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c') diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c index 994a24b9a..7c39cb028 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c @@ -232,12 +232,14 @@ static void RFCOMM_ProcessSABM(const RFCOMM_Address_t* const FrameAddress, Bluet /* If the channel's DLCI is zero, the channel state entry is free */ if (!(CurrRFCOMMChannel->DLCI)) { - CurrRFCOMMChannel->DLCI = FrameAddress->DLCI; - CurrRFCOMMChannel->State = RFCOMM_Channel_Open; - CurrRFCOMMChannel->Priority = 7 + (CurrRFCOMMChannel->DLCI >> 3) + ((CurrRFCOMMChannel->DLCI >> 3) * 7); - CurrRFCOMMChannel->MTU = 0xFFFF; - CurrRFCOMMChannel->Signals = 0; - CurrRFCOMMChannel->BreakSignals = 0; + CurrRFCOMMChannel->DLCI = FrameAddress->DLCI; + CurrRFCOMMChannel->State = RFCOMM_Channel_Open; + CurrRFCOMMChannel->Priority = 7 + (CurrRFCOMMChannel->DLCI >> 3) + ((CurrRFCOMMChannel->DLCI >> 3) * 7); + CurrRFCOMMChannel->MTU = 0xFFFF; + CurrRFCOMMChannel->Remote.Signals = 0 | (1 << 0); + CurrRFCOMMChannel->Remote.BreakSignal = 0 | (1 << 0); + CurrRFCOMMChannel->Local.Signals = RFCOMM_SIGNAL_RTC | RFCOMM_SIGNAL_RTR | RFCOMM_SIGNAL_DV | (1 << 0); + CurrRFCOMMChannel->Local.BreakSignal = 0 | (1 << 0); BT_RFCOMM_DEBUG(1, ">> UA Sent"); RFCOMM_SendFrame(FrameAddress->DLCI, true, (RFCOMM_Frame_UA | FRAME_POLL_FINAL), 0, NULL, Channel); -- cgit v1.2.3