#include "BluetoothHost.h"
-/** Bluetooth configuration structure. This structure configures the bluetooth stack's user alterable settings. */
+/** Bluetooth configuration structure. This structure configures the Bluetooth stack's user alterable settings. */
Bluetooth_Device_t Bluetooth_DeviceConfiguration =
{
Class: (DEVICE_CLASS_SERVICE_CAPTURING | DEVICE_CLASS_MAJOR_COMPUTER | DEVICE_CLASS_MINOR_COMPUTER_PALM),
printf_P(PSTR("Stack initialized with local address %02X:%02X:%02X:%02X:%02X:%02X.\r\n"),
Bluetooth_State.LocalBDADDR[5], Bluetooth_State.LocalBDADDR[4], Bluetooth_State.LocalBDADDR[3],
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();
}
/** Bluetooth stack callback event for a Bluetooth connection request. When this callback fires, the
* the user application must indicate if the channel connection should be rejected or not, based on the
* protocol (PSM) value of the requested channel.
*
- * \param PSM Protocol PSM value for the requested channel
+ * \param[in] PSM Protocol PSM value for the requested channel
*
* \return Boolean true to accept the channel connection request, false to reject it
*/
/* Service Discovery Protocol packet */
SDP_ProcessPacket(Data, Channel);
break;
+ case CHANNEL_PSM_RFCOMM:
+ /* RFCOMM (Serial Port) Protocol packet */
+ RFCOMM_ProcessPacket(Data, Channel);
+ break;
default:
/* Unknown Protocol packet */
- printf_P(PSTR("Packet Received (Channel 0x%04X, PSM: 0x%02x):\r\n"), Channel->LocalNumber, Channel->PSM);
- for (uint16_t Byte = 0; Byte < DataLen; Byte++)
- printf_P(PSTR("0x%02X "), ((uint8_t*)Data)[Byte]);
- puts_P(PSTR("\r\n"));
-
+ printf_P(PSTR("Unknown Packet Received (Channel 0x%04X, PSM: 0x%02X, Len: 0x%04X):\r\n"),
+ Channel->LocalNumber, Channel->PSM, DataLen);
break;
}
}