X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/f13bc35a199f3840aaaabecf5f8616f20da7c262..35b7946950e178c5ba51b87ef16e8a927239fda4:/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.c diff --git a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.c b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.c index d78a9efa1..07d867b4b 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.c @@ -28,6 +28,12 @@ this software. */ +/** \file + * + * Main module for the Bluetooth stack. This module contains the overall Bluetooth + * stack state variables and the main Bluetooth stack management functions. + */ + #include "BluetoothStack.h" /** Bluetooth device connection information structure. Once connected to a remote device, this structure tracks the @@ -78,9 +84,14 @@ Bluetooth_Channel_t* Bluetooth_GetChannelData(const uint16_t SearchValue, const for (uint8_t i = 0; i < BLUETOOTH_MAX_OPEN_CHANNELS; i++) { Bluetooth_Channel_t* ChannelData = &Bluetooth_Connection.Channels[i]; + + /* Closed channels should be ignored as they are not considered valid data */ + if (ChannelData->State == BT_Channel_Closed) + continue; bool FoundMatch = false; + /* Search the current channel for the search key to see if it matches */ switch (SearchKey) { case CHANNEL_SEARCH_LOCALNUMBER: