projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6cfa3b7
)
Fix Bluetooth stack CONNECTION RESPONSE packets - for this command and this command...
author
Dean Camera
<dean@fourwalledcubicle.com>
Mon, 12 Apr 2010 13:42:35 +0000
(13:42 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Mon, 12 Apr 2010 13:42:35 +0000
(13:42 +0000)
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
patch
|
blob
|
blame
|
history
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
patch
|
blob
|
blame
|
history
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h
patch
|
blob
|
blame
|
history
diff --git
a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
index
45fad7b
..
449d57f
100644
(file)
--- 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:
\r
Bluetooth_Signal_InformationReq(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);
\r
break;
\r
case BT_SIGNAL_INFORMATION_REQUEST:
\r
Bluetooth_Signal_InformationReq(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);
\r
break;
\r
+ case BT_SIGNAL_COMMAND_REJECT:
\r
+ BT_ACL_DEBUG(1, "<< Command Reject", NULL);
\r
+
\r
+ uint16_t RejectReason;
\r
+ Pipe_Read_Stream_LE(&RejectReason, sizeof(RejectReason));
\r
+ Pipe_Discard_Stream(ACLPacketHeader.DataLength - sizeof(RejectReason));
\r
+ Pipe_ClearIN();
\r
+ Pipe_Freeze();
\r
+
\r
+ BT_ACL_DEBUG(2, "-- Reason: %d", RejectReason);
\r
+ break;
\r
default:
\r
BT_ACL_DEBUG(1, "<< Unknown Signaling Command 0x%02X", SignalCommandHeader.Code);
\r
\r
default:
\r
BT_ACL_DEBUG(1, "<< Unknown Signaling Command 0x%02X", SignalCommandHeader.Code);
\r
\r
@@
-315,9
+326,10
@@
static inline void Bluetooth_Signal_ConnectionReq(BT_ACL_Header_t* ACLPac
ResponsePacket.SignalCommandHeader.Code = BT_SIGNAL_CONNECTION_RESPONSE;
\r
ResponsePacket.SignalCommandHeader.Identifier = SignalCommandHeader->Identifier;
\r
ResponsePacket.SignalCommandHeader.Length = sizeof(ResponsePacket.ConnectionResponse);
\r
ResponsePacket.SignalCommandHeader.Code = BT_SIGNAL_CONNECTION_RESPONSE;
\r
ResponsePacket.SignalCommandHeader.Identifier = SignalCommandHeader->Identifier;
\r
ResponsePacket.SignalCommandHeader.Length = sizeof(ResponsePacket.ConnectionResponse);
\r
- ResponsePacket.ConnectionResponse.Result = (ChannelData == NULL) ? BT_CONNECTION_REFUSED_RESOURCES : BT_CONNECTION_SUCCESSFUL;
\r
- ResponsePacket.ConnectionResponse.DestinationChannel = ChannelData->RemoteNumber;
\r
- ResponsePacket.ConnectionResponse.SourceChannel = ChannelData->LocalNumber;
\r
+ ResponsePacket.ConnectionResponse.DestinationChannel = ChannelData->LocalNumber;
\r
+ ResponsePacket.ConnectionResponse.SourceChannel = ChannelData->RemoteNumber;
\r
+ ResponsePacket.ConnectionResponse.Result = (ChannelData == NULL) ? BT_CONNECTION_REFUSED_RESOURCES :
\r
+ BT_CONNECTION_SUCCESSFUL;
\r
ResponsePacket.ConnectionResponse.Status = 0x00;
\r
\r
Bluetooth_SendPacket(&ResponsePacket, sizeof(ResponsePacket), NULL);
\r
ResponsePacket.ConnectionResponse.Status = 0x00;
\r
\r
Bluetooth_SendPacket(&ResponsePacket, sizeof(ResponsePacket), NULL);
\r
diff --git
a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
index
012fbc0
..
d38721a
100644
(file)
--- a/
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
+++ b/
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.h
@@
-42,13
+42,14
@@
\r
/* Macros: */
\r
#define BT_ACL_DEBUG(l, s, ...) do { if (ACL_DEBUG_LEVEL >= l) printf_P(PSTR("(ACL) " s "\r\n"), __VA_ARGS__); } while (0)
\r
\r
/* Macros: */
\r
#define BT_ACL_DEBUG(l, s, ...) do { if (ACL_DEBUG_LEVEL >= l) printf_P(PSTR("(ACL) " s "\r\n"), __VA_ARGS__); } while (0)
\r
- #define ACL_DEBUG_LEVEL
1
\r
+ #define ACL_DEBUG_LEVEL
2
\r
\r
#define BT_CHANNELNUMBER_BASEOFFSET 0x0040
\r
\r
#define BT_CHANNEL_SIGNALING 0x0001
\r
#define BT_CHANNEL_CONNECTIONLESS 0x0002
\r
\r
\r
#define BT_CHANNELNUMBER_BASEOFFSET 0x0040
\r
\r
#define BT_CHANNEL_SIGNALING 0x0001
\r
#define BT_CHANNEL_CONNECTIONLESS 0x0002
\r
\r
+ #define BT_SIGNAL_COMMAND_REJECT 0x01
\r
#define BT_SIGNAL_CONNECTION_REQUEST 0x02
\r
#define BT_SIGNAL_CONNECTION_RESPONSE 0x03
\r
#define BT_SIGNAL_CONFIGURATION_REQUEST 0x04
\r
#define BT_SIGNAL_CONNECTION_REQUEST 0x02
\r
#define BT_SIGNAL_CONNECTION_RESPONSE 0x03
\r
#define BT_SIGNAL_CONFIGURATION_REQUEST 0x04
\r
diff --git
a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h
b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h
index
5ab7a6f
..
fa30524
100644
(file)
--- a/
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h
+++ b/
Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h
@@
-41,7
+41,7
@@
#define BLUETOOTH_DATA_OUT_PIPE 2
\r
#define BLUETOOTH_EVENTS_PIPE 3
\r
\r
#define BLUETOOTH_DATA_OUT_PIPE 2
\r
#define BLUETOOTH_EVENTS_PIPE 3
\r
\r
- #define BLUETOOTH_MAX_OPEN_CHANNELS
2
\r
+ #define BLUETOOTH_MAX_OPEN_CHANNELS
6
\r
\r
#define CHANNEL_PSM_SERVICEDISCOVERY 0x0001
\r
#define CHANNEL_PSM_UDP 0x0002
\r
\r
#define CHANNEL_PSM_SERVICEDISCOVERY 0x0001
\r
#define CHANNEL_PSM_UDP 0x0002
\r