HCI_ReadPacket (Windows CE 5.0)
This function reads the packet from the connecting device.
int HCI_ReadPacket(HCI_TYPE* peType, BD_BUFFER* pInBuffer);
Parameters
- peType
[out] Pointer to the HCI type. These values can be DATA_PACKET_ACL, DATA_PACKET_SCO, or EVENT_PACKET. - pInBuffer
[in, out] Pointer to the packet buffer.
Return Values
TRUE on successful completion. FALSE if error has occurred. If this function returns FALSE, the stack interface to hardware will immediately be brought down by calling HCI_CloseConnection.
Remarks
This function returns with a packet type and error condition. This is a blocking function. It returns only when the packet is read or an error is encountered. It blocks while doing a read. If an error is returned, the Bluetooth protocol stack will be 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 however it wants. 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
OS Versions: Windows CE .NET 4.0 and later.
Header: Bt_hcip.h.
Link Library: Btd.lib.
See Also
Bluetooth HCI Transport Layer Functions | Transferring Data
Send Feedback on this topic to the authors