Add a new RFCOMM service callback for when new data has been received on a valid...
[pub/lufa.git] / Demos / Host / Incomplete / BluetoothHost / BluetoothEvents.c
index 17cf7ed..1b7997a 100644 (file)
@@ -154,3 +154,16 @@ void Bluetooth_PacketReceived(void* Data, uint16_t DataLen, Bluetooth_Channel_t*
                        break;\r
        }\r
 }\r
+\r
+/** RFCOMM layer callback for when a packet is received on an open RFCOMM channel.\r
+ *\r
+ *  \param[in] RFCOMMChannel  RFCOMM channel that the data was directed to\r
+ *  \param[in] DataLen        Length of the received data, in bytes\r
+ *  \param[in] Data           Pointer to a buffer where the received data is stored\r
+ */\r
+void RFCOMM_DataReceived(RFCOMM_Channel_t* const RFCOMMChannel, uint16_t DataLen, const uint8_t* Data)\r
+{\r
+       /* Write the received bytes to the serial port */\r
+       for (uint8_t i = 0; i < DataLen; i++)\r
+         putchar(Data[i]);\r
+}\r