diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2010-04-12 13:42:35 +0000 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2010-04-12 13:42:35 +0000 |
commit | 8b0ec6c5cafe99595743725a20ad40ce4898de14 (patch) | |
tree | 80357eb73d020c3684e167e007caeb4c3cb6fdcb /Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c | |
parent | 6cfa3b7db8b5585a8443f457dcb728b65a7f7ffd (diff) | |
download | lufa-8b0ec6c5cafe99595743725a20ad40ce4898de14.tar.gz lufa-8b0ec6c5cafe99595743725a20ad40ce4898de14.tar.bz2 lufa-8b0ec6c5cafe99595743725a20ad40ce4898de14.zip |
Fix Bluetooth stack CONNECTION RESPONSE packets - for this command and this command only, the source/destination roles are switched. Reverse the Local/Remote channel ordering so that Windows mobile and other stacks which depend on valid channel values to connect.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c')
-rw-r--r-- | Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c index 45fad7bd7..449d57fb2 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c @@ -141,6 +141,17 @@ static void Bluetooth_ProcessACLPackets(void) case BT_SIGNAL_INFORMATION_REQUEST:
Bluetooth_Signal_InformationReq(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);
break;
+ case BT_SIGNAL_COMMAND_REJECT:
+ BT_ACL_DEBUG(1, "<< Command Reject", NULL);
+
+ uint16_t RejectReason;
+ Pipe_Read_Stream_LE(&RejectReason, sizeof(RejectReason));
+ Pipe_Discard_Stream(ACLPacketHeader.DataLength - sizeof(RejectReason));
+ Pipe_ClearIN();
+ Pipe_Freeze();
+
+ BT_ACL_DEBUG(2, "-- Reason: %d", RejectReason);
+ break;
default:
BT_ACL_DEBUG(1, "<< Unknown Signaling Command 0x%02X", SignalCommandHeader.Code);
@@ -315,9 +326,10 @@ static inline void Bluetooth_Signal_ConnectionReq(BT_ACL_Header_t* ACLPac ResponsePacket.SignalCommandHeader.Code = BT_SIGNAL_CONNECTION_RESPONSE;
ResponsePacket.SignalCommandHeader.Identifier = SignalCommandHeader->Identifier;
ResponsePacket.SignalCommandHeader.Length = sizeof(ResponsePacket.ConnectionResponse);
- ResponsePacket.ConnectionResponse.Result = (ChannelData == NULL) ? BT_CONNECTION_REFUSED_RESOURCES : BT_CONNECTION_SUCCESSFUL;
- ResponsePacket.ConnectionResponse.DestinationChannel = ChannelData->RemoteNumber;
- ResponsePacket.ConnectionResponse.SourceChannel = ChannelData->LocalNumber;
+ ResponsePacket.ConnectionResponse.DestinationChannel = ChannelData->LocalNumber;
+ ResponsePacket.ConnectionResponse.SourceChannel = ChannelData->RemoteNumber;
+ ResponsePacket.ConnectionResponse.Result = (ChannelData == NULL) ? BT_CONNECTION_REFUSED_RESOURCES :
+ BT_CONNECTION_SUCCESSFUL;
ResponsePacket.ConnectionResponse.Status = 0x00;
Bluetooth_SendPacket(&ResponsePacket, sizeof(ResponsePacket), NULL);
|