Partager via


HCI_WritePacket (Windows CE 5.0)

Send Feedback

This function writes the packet to the connecting device.

int HCI_WritePacket(HCI_TYPE eType, BD_BUFFER* pOutBuffer);

Parameters

  • eType
    [in] Defines the HCI type.
  • pOutBuffer
    [in] Pointer to the Bluetooth device 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

The HCI_WritePacket function allocates an empty buffer with pre-allocated spaces for packet headers and trailers, which are requested by HCI_ReadHciParameters.

This function blocks while writing the packet. It returns the packet type and buffer. If an error is returned, the stack will be shut down.

HCI_WritePacket is given a buffer (BD_BUFFER) where:

  • cStart defines the beginning of the HCI packet.
  • The spaces between 0 and cStart and between cEnd and cSize are big enough to accommodate the transport header and trailer requested by the HCI_ReadHciParameters function.

The HCI_WritePacket function uses this buffer to store its own information. The packet type returned in *****peType can be one of the following:

  • DATA_PACKET_ACL
  • DATA_PACKET_SCO
  • EVENT_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

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.