aboutsummaryrefslogtreecommitdiffstats
path: root/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
diff options
context:
space:
mode:
Diffstat (limited to 'Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c')
-rw-r--r--Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
index 73b709de0..2ad3ed515 100644
--- a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
+++ b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
@@ -58,12 +58,15 @@ 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);
-
+ if (Bluetooth_Connection.IsConnected)
+ {
+ 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();