Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
c37fd0ef
Commit
c37fd0ef
authored
Jul 08, 2010
by
Dean Camera
Browse files
Add a new RFCOMM service callback for when new data has been received on a valid RFCOMM channel.
parent
70983cae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Demos/Host/Incomplete/BluetoothHost/BluetoothEvents.c
View file @
c37fd0ef
...
...
@@ -154,3 +154,16 @@ void Bluetooth_PacketReceived(void* Data, uint16_t DataLen, Bluetooth_Channel_t*
break
;
}
}
/** RFCOMM layer callback for when a packet is received on an open RFCOMM channel.
*
* \param[in] RFCOMMChannel RFCOMM channel that the data was directed to
* \param[in] DataLen Length of the received data, in bytes
* \param[in] Data Pointer to a buffer where the received data is stored
*/
void
RFCOMM_DataReceived
(
RFCOMM_Channel_t
*
const
RFCOMMChannel
,
uint16_t
DataLen
,
const
uint8_t
*
Data
)
{
/* Write the received bytes to the serial port */
for
(
uint8_t
i
=
0
;
i
<
DataLen
;
i
++
)
putchar
(
Data
[
i
]);
}
Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.c
View file @
c37fd0ef
...
...
@@ -352,11 +352,9 @@ static void RFCOMM_ProcessUIH(const RFCOMM_Address_t* const FrameAddress, const
BT_RFCOMM_DEBUG
(
1
,
"<< UIH Received"
);
BT_RFCOMM_DEBUG
(
2
,
"-- DLCI 0x%02X"
,
FrameAddress
->
DLCI
);
BT_RFCOMM_DEBUG
(
2
,
"-- Length 0x%02X"
,
FrameLength
);
puts
(
"RFCOMM Data: "
);
for
(
uint8_t
i
=
0
;
i
<
FrameLength
;
i
++
)
printf
(
"0x%02X (%c) "
,
FrameData
[
i
],
FrameData
[
i
]);
RFCOMM_Channel_t
*
RFCOMMChannel
=
RFCOMM_GetChannelData
(
FrameAddress
->
DLCI
);
printf
(
"
\r\n
"
);
if
(
RFCOMMChannel
!=
NULL
)
RFCOMM_DataReceived
(
RFCOMMChannel
,
FrameLength
,
FrameData
);
}
Demos/Host/Incomplete/BluetoothHost/Lib/RFCOMM.h
View file @
c37fd0ef
...
...
@@ -107,6 +107,8 @@
void
RFCOMM_SendChannelSignals
(
const
RFCOMM_Channel_t
*
const
RFCOMMChannel
,
Bluetooth_Channel_t
*
const
BluetoothChannel
);
void
RFCOMM_DataReceived
(
RFCOMM_Channel_t
*
const
RFCOMMChannel
,
uint16_t
DataLen
,
const
uint8_t
*
Data
);
RFCOMM_Channel_t
*
RFCOMM_GetFreeChannelEntry
(
const
uint8_t
DLCI
);
RFCOMM_Channel_t
*
RFCOMM_GetChannelData
(
const
uint8_t
DLCI
);
uint16_t
RFCOMM_GetVariableFieldValue
(
const
uint8_t
**
BufferPos
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment