Add LUFA-side channel open/close routines, add signalling handlers for the creation and configuration of channels from the local device to the remote device, to add to the existing remote to local channel capabilities.
This commit is contained in:
parent
797130bddc
commit
28f1ac8117
4 changed files with 163 additions and 41 deletions
|
@ -68,31 +68,3 @@ Bluetooth_Channel_t* Bluetooth_GetChannelData(uint16_t ChannelNumber, bool Searc
|
|||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Bluetooth_Channel_t* Bluetooth_InitChannelData(uint16_t RemoteChannelNumber, uint16_t PSM)
|
||||
{
|
||||
Bluetooth_Channel_t* ChannelData = Bluetooth_GetChannelData(RemoteChannelNumber, false);
|
||||
|
||||
if (ChannelData == NULL)
|
||||
{
|
||||
for (uint8_t i = 0; i < BLUETOOTH_MAX_OPEN_CHANNELS; i++)
|
||||
{
|
||||
if (Bluetooth_Connection.Channels[i].State == Channel_Closed)
|
||||
{
|
||||
ChannelData = &Bluetooth_Connection.Channels[i];
|
||||
ChannelData->LocalNumber = (BLUETOOTH_CHANNELNUMBER_BASEOFFSET + i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (ChannelData != NULL)
|
||||
{
|
||||
ChannelData->RemoteNumber = RemoteChannelNumber;
|
||||
ChannelData->PSM = PSM;
|
||||
ChannelData->LocalMTU = MAXIMUM_CHANNEL_MTU;
|
||||
ChannelData->State = Channel_Config_WaitConfig;
|
||||
}
|
||||
|
||||
return ChannelData;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue