HCI_ReadPacket (Compact 2013)
3/26/2014
This function reads the packet from the connecting device.
Syntax
int HCI_ReadPacket(
HCI_TYPE *peType,
BD_BUFFER *pInBuffer
);
Parameters
- peType
[out] Pointer to the Host Controller Interface (HCI) type. These values can be DATA_PACKET_ACL, DATA_PACKET_SCO, or EVENT_PACKET.
- pInBuffer
[in, out] Pointer to the packet buffer.
Return Value
Returns TRUE on success; FALSE otherwise.
Remarks
If this function returns FALSE, the stack will immediately bring down the interface to the hardware by calling HCI_CloseConnection.
This is a blocking function. The function blocks while reading and returns only when the packet is read or an error is encountered. If an error is returned, the Bluetooth protocol stack is shut down.
HCI_ReadPacket is given a buffer (BD_BUFFER) where:
- cSize is no smaller than the value returned by the HCI_ReadHciParameters function.
- cStart is set to 0.
- cEnd equals cSize.
The HCI_ReadPacket function can use this buffer for temporary values while reading. When it returns a value, however, the data between cStart and cEnd must contain a valid Bluetooth HCI packet.
This function must unblock and return an error if HCI_CloseConnection is called.
Requirements
Header |
bt_hcip.h |
Library |
Btd.lib |