Compartilhar via


HCI_WritePacket (Compact 2013)

3/26/2014

This function writes the packet to the connecting device.

Syntax

int HCI_WritePacket(
  HCI_TYPE eType, 
  BD_BUFFER* pOutBuffer
);

Parameters

  • eType
    [in] Packet type.
  • pOutBuffer
    [in] Pointer to the data buffer.

Return Value

Returns TRUE on success; FALSE otherwise.

Remarks

If this function returns FALSE, the stack immediately brings down the transport layer by calling HCI_CloseConnection.

This function allocates an empty buffer with pre-allocated spaces for packet headers and trailers. The information needed to allocate the buffer is in the structure returned by HCI_ReadHciParameters.

This function blocks while writing the packet.

This function requires 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.

This function must unblock and return an error if HCI_CloseConnection is called.

Requirements

Header

bt_hcip.h

Library

Btd.lib

See Also

Reference

Bluetooth HCI Transport Layer Functions
HCI_TYPE