aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/Lib
diff options
context:
space:
mode:
authorDean Camera <dean@fourwalledcubicle.com>2010-07-08 07:44:07 +0000
committerDean Camera <dean@fourwalledcubicle.com>2010-07-08 07:44:07 +0000
commit70983caea5dc6d817c3a887d66a2f43fce535bbd (patch)
tree67cc8f38d20179507f0f0678300bc0b8b9704d16 /Demos/Host/Incomplete/BluetoothHost/Lib
parentdea897ef571bf33bc80c0e1dbf35601009582f3d (diff)
downloadlufa-70983caea5dc6d817c3a887d66a2f43fce535bbd.tar.gz
lufa-70983caea5dc6d817c3a887d66a2f43fce535bbd.tar.bz2
lufa-70983caea5dc6d817c3a887d66a2f43fce535bbd.zip
Move out Bluetooth stack callback functions to a seperate BluetoothEvents.c/.h set of files for clarity in the Incomplete BluetoothHost demo. Add a new stack callback for opened ACL channels, make the demo save the RFCOMM channel when opened so that it does not have to search for it on each iteration of the main program loop.
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/Lib')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c2
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h2
2 files changed, 4 insertions, 0 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
index ec85aab6c..d4b951da5 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothACLPackets.c
@@ -552,6 +552,7 @@ static inline void Bluetooth_Signal_ConfigurationReq(const BT_Signal_Header_t* c
break;
case BT_Channel_Config_WaitReq:
ChannelData->State = BT_Channel_Open;
+ Bluetooth_ChannelOpened(ChannelData);
break;
}
}
@@ -594,6 +595,7 @@ static inline void Bluetooth_Signal_ConfigurationResp(const BT_Signal_Header_t*
break;
case BT_Channel_Config_WaitResp:
ChannelData->State = BT_Channel_Open;
+ Bluetooth_ChannelOpened(ChannelData);
break;
}
}
diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h
index 131c4aaf2..c1c938636 100644
--- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h
+++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.h
@@ -156,6 +156,8 @@
void Bluetooth_DisconnectionComplete(void);
bool Bluetooth_ChannelConnectionRequest(const uint16_t PSM);
void Bluetooth_PacketReceived(void* Data, uint16_t DataLen, Bluetooth_Channel_t* const Channel);
+ void Bluetooth_ChannelOpened(Bluetooth_Channel_t* const Channel);
+
Bluetooth_Channel_t* Bluetooth_GetChannelData(const uint16_t SearchValue, const uint8_t SearchKey);
Bluetooth_Channel_t* Bluetooth_OpenChannel(const uint16_t PSM);
void Bluetooth_CloseChannel(Bluetooth_Channel_t* const Channel);