HCI_WritePacket

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

This is a blocking function. It returns only when the packet is written or an error is encountered.

The HCI_WritePacket function 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

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Bt_hcip.h.
Link Library: Btd.lib.

See Also

HCI_CloseConnection | BD_BUFFER | HCI_ReadHciParameters

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.