aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-06-29 04:40:02 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-06-29 04:40:02 +0000
commitfbabecee66b93596acc6f99a92be4a9dd3a750ce (patch)
tree26cfcfcd38225074dd4476d7ac0e397a9576b1a5 /Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
parentb6565404685fbac1698d256823abdbdb3d3ddaff (diff)
downloadlufa-fbabecee66b93596acc6f99a92be4a9dd3a750ce.tar.gz
lufa-fbabecee66b93596acc6f99a92be4a9dd3a750ce.tar.bz2
lufa-fbabecee66b93596acc6f99a92be4a9dd3a750ce.zip
Add RFCOMM service routine, to send pending configuration requests on RFCOMM channels. Add in RFCOMM channel config flags, to determine which configuration commands have been sent and received.
Add a new RFCOMM_SendChannelSignals() function to transmit a change in V24 terminal handshake lines to the receiving device. Prevent SABM packets sent to the control DLCI in the RFCOMM layer from creating a new channel entry, as the control DLCI does not have connection data associated with it. Fix up MSC control packet handling so that received responses can be acknowledged correctly, so that the RFCOMM layer can record when the receiving device has ACKed a sent change in V24 terminal handshake lines.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
index 66ed417d5..73b709de0 100644
--- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
+++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
@@ -58,6 +58,12 @@ int main(void)
for (;;)
{
+ Bluetooth_Channel_t* RFCOMMChannel = Bluetooth_GetChannelData(CHANNEL_PSM_RFCOMM, CHANNEL_SEARCH_PSM);
+
+ /* If an RFCOMM channel is open, service the RFCOMM logical channels */
+ if (RFCOMMChannel)
+ RFCOMM_ServiceChannels(RFCOMMChannel);
+
Bluetooth_Stack_USBTask();
Bluetooth_Host_Task();
USB_USBTask();
@@ -215,7 +221,6 @@ void Bluetooth_StackInitialized(void)
Bluetooth_State.LocalBDADDR[2], Bluetooth_State.LocalBDADDR[1], Bluetooth_State.LocalBDADDR[0]);
/* Reinitialize the services placed on top of the Bluetooth stack ready for new connections */
- SDP_Initialize();
RFCOMM_Initialize();
}
@@ -287,6 +292,7 @@ bool Bluetooth_ChannelConnectionRequest(const uint16_t PSM)
*/
void Bluetooth_PacketReceived(void* Data, uint16_t DataLen, Bluetooth_Channel_t* const Channel)
{
+ /* Run the correct packet handler based on the received packet's PSM, which indicates the service being carried */
switch (Channel->PSM)
{
case CHANNEL_PSM_SDP: