projects
/
pub
/
USBasp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add RFCOMM service routine, to send pending configuration requests on RFCOMM channels...
[pub/USBasp.git]
/
Demos
/
Host
/
Incomplete
/
BluetoothHost
/
BluetoothHost.c
diff --git
a/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
b/Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
index
66ed417
..
73b709d
100644
(file)
--- a/
Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
+++ b/
Demos/Host/Incomplete/BluetoothHost/BluetoothHost.c
@@
-58,6
+58,12
@@
int main(void)
for (;;)
{
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);
+
Bluetooth_Stack_USBTask();
Bluetooth_Host_Task();
USB_USBTask();
Bluetooth_Stack_USBTask();
Bluetooth_Host_Task();
USB_USBTask();
@@
-215,7
+221,6
@@
void Bluetooth_StackInitialized(void)
Bluetooth_State.LocalBDADDR[2], Bluetooth_State.LocalBDADDR[1], Bluetooth_State.LocalBDADDR[0]);
/* Reinitialize the services placed on top of the Bluetooth stack ready for new connections */
Bluetooth_State.LocalBDADDR[2], Bluetooth_State.LocalBDADDR[1], Bluetooth_State.LocalBDADDR[0]);
/* Reinitialize the services placed on top of the Bluetooth stack ready for new connections */
- SDP_Initialize();
RFCOMM_Initialize();
}
RFCOMM_Initialize();
}
@@
-287,6
+292,7
@@
bool Bluetooth_ChannelConnectionRequest(const uint16_t PSM)
*/
void Bluetooth_PacketReceived(void* Data, uint16_t DataLen, Bluetooth_Channel_t* const Channel)
{
*/
void Bluetooth_PacketReceived(void* Data, uint16_t DataLen, Bluetooth_Channel_t* const Channel)
{
+ /* Run the correct packet handler based on the received packet's PSM, which indicates the service being carried */
switch (Channel->PSM)
{
case CHANNEL_PSM_SDP:
switch (Channel->PSM)
{
case CHANNEL_PSM_SDP: