\r
void Bluetooth_ProcessACLPackets(void)\r
{\r
- Bluetooth_ACL_Header_t ACLPacketHeader;\r
+ Bluetooth_ACL_Header_t ACLPacketHeader;\r
Bluetooth_DataPacket_Header_t DataHeader;\r
\r
Pipe_SelectPipe(BLUETOOTH_DATA_IN_PIPE);\r
- Pipe_SetPipeToken(PIPE_TOKEN_IN);\r
Pipe_Unfreeze();\r
\r
if (!(Pipe_IsReadWriteAllowed()))\r
Pipe_Read_Stream_LE(&ACLPacketHeader, sizeof(ACLPacketHeader));\r
Pipe_Read_Stream_LE(&DataHeader, sizeof(DataHeader));\r
\r
- BT_DEBUG("(ACL) Packet Received", NULL);\r
- BT_DEBUG("(ACL) -- Connection Handle: 0x%04X", ACLPacketHeader.ConnectionHandle);\r
- BT_DEBUG("(ACL) -- Data Length: 0x%04X", ACLPacketHeader.DataLength);\r
- BT_DEBUG("(ACL) -- Destination Channel: 0x%04X", DataHeader.DestinationChannel);\r
- BT_DEBUG("(ACL) -- Payload Length: 0x%04X", DataHeader.PayloadLength);\r
+ BT_ACL_DEBUG("Packet Received", NULL);\r
+ BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader.ConnectionHandle & 0x0FFF));\r
+ BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader.DataLength);\r
+ BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader.DestinationChannel);\r
+ BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader.PayloadLength);\r
\r
if (DataHeader.DestinationChannel == BLUETOOTH_CHANNEL_SIGNALING)\r
{\r
Bluetooth_ProcessSignalPacket_ConfigurationRequest(&ACLPacketHeader, &DataHeader, &SignalCommandHeader);\r
break;\r
case BLUETOOTH_SIGNAL_INFORMATION_REQUEST:\r
- BT_DEBUG("(ACL) -- Information Request, Discarded", NULL);\r
+ BT_ACL_DEBUG(">> Information Request, Discarded", NULL);\r
\r
Pipe_Discard_Stream(ACLPacketHeader.DataLength);\r
Pipe_ClearIN(); \r
Pipe_Freeze();\r
break;\r
default:\r
- BT_DEBUG("(ACL) >> Unknown Signaling Command 0x%02X", SignalCommandHeader.Code);\r
+ BT_ACL_DEBUG(">> Unknown Signaling Command 0x%02X", SignalCommandHeader.Code);\r
\r
Pipe_Discard_Stream(ACLPacketHeader.DataLength);\r
Pipe_ClearIN(); \r
Pipe_Read_Stream_LE(&DataPayload, sizeof(DataPayload));\r
DataHeader.PayloadLength = 0;\r
\r
- BT_DEBUG("(ACL) -- Data Payload: ", NULL);\r
+ BT_ACL_DEBUG("-- Data Payload: ", NULL);\r
for (uint16_t B = 0; B < sizeof(DataPayload); B++)\r
printf("0x%02X ", DataPayload[B]);\r
- BT_DEBUG("", NULL);\r
+ printf("\r\n");\r
\r
Pipe_Discard_Stream(ACLPacketHeader.DataLength);\r
Pipe_ClearIN(); \r
\r
Pipe_Read_Stream_LE(&ConnectionRequest, sizeof(ConnectionRequest));\r
\r
- BT_DEBUG("(ACL) >> L2CAP Connection Request", NULL);\r
- BT_DEBUG("(ACL) -- PSM: 0x%04X", ConnectionRequest.PSM);\r
- BT_DEBUG("(ACL) -- Source Channel: 0x%04X", ConnectionRequest.SourceChannel);\r
+ BT_ACL_DEBUG(">> L2CAP Connection Request", NULL);\r
+ BT_ACL_DEBUG("-- PSM: 0x%04X", ConnectionRequest.PSM);\r
+ BT_ACL_DEBUG("-- Source Channel: 0x%04X", ConnectionRequest.SourceChannel);\r
\r
Pipe_ClearIN();\r
Pipe_Freeze();\r
Pipe_SelectPipe(BLUETOOTH_DATA_OUT_PIPE);\r
- Pipe_SetPipeToken(PIPE_TOKEN_OUT);\r
Pipe_Unfreeze();\r
\r
Bluetooth_SignalCommand_ConnectionResponse_t ConnectionResponse;\r
Pipe_ClearOUT(); \r
Pipe_Freeze();\r
\r
- BT_DEBUG("(ACL) Packet Sent", NULL);\r
- BT_DEBUG("(ACL) -- Connection Handle: 0x%04X", ACLPacketHeader->ConnectionHandle);\r
- BT_DEBUG("(ACL) -- Data Length: 0x%04X", ACLPacketHeader->DataLength);\r
- BT_DEBUG("(ACL) -- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
- BT_DEBUG("(ACL) -- Payload Length: 0x%04X", DataHeader->PayloadLength); \r
- BT_DEBUG("(ACL) >> L2CAP Connection Response", NULL);\r
- BT_DEBUG("(ACL) -- Source Channel: 0x%04X", ConnectionResponse.SourceChannel);\r
- BT_DEBUG("(ACL) -- Destination Channel: 0x%04X", ConnectionResponse.DestinationChannel);\r
+ BT_ACL_DEBUG("Packet Sent", NULL);\r
+ BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader->ConnectionHandle & 0x0FFF));\r
+ BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader->DataLength);\r
+ BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
+ BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength); \r
+ BT_ACL_DEBUG(">> L2CAP Connection Response", NULL);\r
+ BT_ACL_DEBUG("-- Source Channel: 0x%04X", ConnectionResponse.SourceChannel);\r
+ BT_ACL_DEBUG("-- Destination Channel: 0x%04X", ConnectionResponse.DestinationChannel);\r
}\r
\r
static inline void Bluetooth_ProcessSignalPacket_ConfigurationRequest(Bluetooth_ACL_Header_t* ACLPacketHeader,\r
\r
Pipe_Read_Stream_LE(&ConfigurationRequest, sizeof(ConfigurationRequest));\r
\r
- BT_DEBUG("(ACL) >> L2CAP Configuration Request", NULL);\r
- BT_DEBUG("(ACL) -- Destination Channel: 0x%04X", ConfigurationRequest.DestinationChannel);\r
+ BT_ACL_DEBUG(">> L2CAP Configuration Request", NULL);\r
+ BT_ACL_DEBUG("-- Destination Channel: 0x%04X", ConfigurationRequest.DestinationChannel);\r
\r
Pipe_ClearIN();\r
Pipe_Freeze();\r
Pipe_SelectPipe(BLUETOOTH_DATA_OUT_PIPE);\r
- Pipe_SetPipeToken(PIPE_TOKEN_OUT);\r
Pipe_Unfreeze();\r
\r
Bluetooth_SignalCommand_ConfigurationResponse_t ConfigurationResponse;\r
if (ChannelData != NULL)\r
ChannelData->State = Channel_Open;\r
\r
- // TODO: Add channel config data to the tail of ConfigurationResponse\r
+ // TODO: Add channel config data to the tail of ConfigurationResponse\r
\r
ConfigurationResponse.SourceChannel = ChannelData->RemoteNumber;\r
ConfigurationResponse.Flags = 0x00;\r
Pipe_ClearOUT(); \r
Pipe_Freeze();\r
\r
- BT_DEBUG("(ACL) Packet Sent", NULL);\r
- BT_DEBUG("(ACL) -- Connection Handle: 0x%04X", ACLPacketHeader->ConnectionHandle);\r
- BT_DEBUG("(ACL) -- Data Length: 0x%04X", ACLPacketHeader->DataLength);\r
- BT_DEBUG("(ACL) -- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
- BT_DEBUG("(ACL) -- Payload Length: 0x%04X", DataHeader->PayloadLength); \r
- BT_DEBUG("(ACL) >> L2CAP Configuration Response", NULL);\r
+ BT_ACL_DEBUG("Packet Sent", NULL);\r
+ BT_ACL_DEBUG("-- Connection Handle: 0x%04X", (ACLPacketHeader->ConnectionHandle & 0x0FFF));\r
+ BT_ACL_DEBUG("-- Data Length: 0x%04X", ACLPacketHeader->DataLength);\r
+ BT_ACL_DEBUG("-- Destination Channel: 0x%04X", DataHeader->DestinationChannel);\r
+ BT_ACL_DEBUG("-- Payload Length: 0x%04X", DataHeader->PayloadLength); \r
+ BT_ACL_DEBUG(">> L2CAP Configuration Response", NULL);\r
}\r