HCI_ReadPacket (Windows Embedded CE 6.0)
1/6/2010
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 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
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
Header | bt_hcip.h |
Library | Btd.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
See Also
Reference
Bluetooth HCI Transport Layer Functions