Share via


HCI_WritePacket (Windows Embedded CE 6.0)

1/6/2010

This function writes the packet to the connecting device.

Syntax

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 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

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

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

Concepts

Transferring Data