aboutsummaryrefslogtreecommitdiffstats
path: root/Demos
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-06-03 08:42:20 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-06-03 08:42:20 +0000
commit13d812a7188f0b0ecaa07ee66e376a2c5a88742f (patch)
treec1cdb400f522988e143d1ce4300ca72f98c8973c /Demos
parenta405a9bdf8338d947159317fba373fccd01fa0f3 (diff)
downloadlufa-13d812a7188f0b0ecaa07ee66e376a2c5a88742f.tar.gz
lufa-13d812a7188f0b0ecaa07ee66e376a2c5a88742f.tar.bz2
lufa-13d812a7188f0b0ecaa07ee66e376a2c5a88742f.zip
Delay needed in bluetooth code due to the send function not waiting for the pipe bank to become ready before writing. Add in a call to Pipe_WaitUntilReady() to fix the issue.
Diffstat (limited to 'Demos')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
index 818caac75..698210488 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
@@ -32,7 +32,6 @@
TODO: Make SendPacket respect receiver's MTU
TODO: Make ReceivePacket stitch together MTU fragments (?)
TODO: Add channel opened/closed callbacks
- TODO: Figure out why delay is needed in connection for services
*/
#define INCLUDE_FROM_BLUETOOTH_ACLPACKETS_C
@@ -228,8 +227,10 @@ uint8_t Bluetooth_SendPacket(void* Data, const uint16_t DataLen, Bluetooth_Chann
DataHeader.DestinationChannel = (Channel == NULL) ? BT_CHANNEL_SIGNALING : Channel->RemoteNumber;
Pipe_SelectPipe(BLUETOOTH_DATA_OUT_PIPE);
+
+ Pipe_WaitUntilReady();
Pipe_Unfreeze();
-
+
/* Write the packet contents to the pipe so that it can be sent to the remote device */
Pipe_Write_Stream_LE(&ACLPacketHeader, sizeof(ACLPacketHeader));
Pipe_Write_Stream_LE(&DataHeader, sizeof(DataHeader));
@@ -369,8 +370,6 @@ static inline void Bluetooth_Signal_ConnectionReq(const BT_Signal_Header_t* cons
BT_ACL_DEBUG(2, "-- PSM: 0x%04X", ConnectionRequest.PSM);
BT_ACL_DEBUG(2, "-- Source Channel: 0x%04X", ConnectionRequest.SourceChannel);
- _delay_ms(15); // TODO - Determine why this is needed
-
/* Try to retrieve the existing channel's information structure if it exists */
Bluetooth_Channel_t* ChannelData = Bluetooth_GetChannelData(ConnectionRequest.SourceChannel, CHANNEL_SEARCH_REMOTENUMBER);