X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/fa1a092901319b3b41bf09e0c4cb9cbbec470d6b..083d797acaa58f792960a1cb9d7d8d41c3c956a7:/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 4e0330e52..5da4d0b16 100644 --- a/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.c +++ b/Demos/Host/Incomplete/BluetoothHost/Lib/BluetoothStack.c @@ -54,21 +54,14 @@ void Bluetooth_Stack_USBTask(void) Bluetooth_ProcessACLPackets(); } -bool CALLBACK_Bluetooth_ConnectionRequest(uint8_t* RemoteAddress) -{ - /* Always accept connections from remote devices */ - return true; -} - Bluetooth_Channel_t* Bluetooth_GetChannelData(uint16_t ChannelNumber, bool SearchBySource) { - Bluetooth_Channel_t* CurrentChannelStructure; - for (uint8_t i = 0; i < BLUETOOTH_MAX_OPEN_CHANNELS; i++) { - CurrentChannelStructure = &Bluetooth_Connection.Channels[i]; + Bluetooth_Channel_t* CurrentChannelStructure = &Bluetooth_Connection.Channels[i]; - uint16_t CurrentChannelNumber = ((SearchBySource) ? CurrentChannelStructure->RemoteNumber : CurrentChannelStructure->LocalNumber); + uint16_t CurrentChannelNumber = (SearchBySource) ? CurrentChannelStructure->RemoteNumber : + CurrentChannelStructure->LocalNumber; if (CurrentChannelNumber == ChannelNumber) return CurrentChannelStructure; @@ -79,11 +72,9 @@ Bluetooth_Channel_t* Bluetooth_GetChannelData(uint16_t ChannelNumber, bool Searc Bluetooth_Channel_t* Bluetooth_InitChannelData(uint16_t RemoteChannelNumber, uint16_t PSM) { - Bluetooth_Channel_t* CurrentChannelStructure; - for (uint8_t i = 0; i < BLUETOOTH_MAX_OPEN_CHANNELS; i++) { - CurrentChannelStructure = &Bluetooth_Connection.Channels[i]; + Bluetooth_Channel_t* CurrentChannelStructure = &Bluetooth_Connection.Channels[i]; if (CurrentChannelStructure->State == Channel_Closed) {