diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-06-23 08:10:21 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-06-23 08:10:21 +0000 |
commit | 4b952d479aa4bafe203a64d6211512450833cf8f (patch) | |
tree | 36eea2b2b837fde748145dbb2472353c97ecf89c /Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c | |
parent | 2eff731ecfbcfec4f3152992e5ae5602a3694424 (diff) | |
download | lufa-4b952d479aa4bafe203a64d6211512450833cf8f.tar.gz lufa-4b952d479aa4bafe203a64d6211512450833cf8f.tar.bz2 lufa-4b952d479aa4bafe203a64d6211512450833cf8f.zip |
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.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c')
-rw-r--r-- | Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c | 14 |
1 files changed, 8 insertions, 6 deletions
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); |