다음을 통해 공유


BluetoothGATTBeginReliableWrite 함수(bluetoothleapis.h)

BluetoothGATTBeginReliableWrite 함수는 신뢰할 수 있는 쓰기가 시작되도록 지정합니다.

구문

HRESULT BluetoothGATTBeginReliableWrite(
  [in]  HANDLE                              hDevice,
  [out] PBTH_LE_GATT_RELIABLE_WRITE_CONTEXT ReliableWriteContext,
  [in]  ULONG                               Flags
);

매개 변수

[in] hDevice

서비스에 대한 핸들입니다.

[out] ReliableWriteContext

신뢰할 수 있는 쓰기 작업을 설명하는 컨텍스트를 포함하는 BTH_LE_GATT_RELIABLE_WRITE_CONTEXT 구조체의 주소입니다.

[in] Flags

BluetoothGATTBeginReliableWrite의 동작을 수정하는 플래그:

플래그 설명
BLUETOOTH_GATT_FLAG_NONE 클라이언트에 특정 GATT 요구 사항(기본값)이 없습니다.

반환 값

BluetoothGATTBeginReliableWrite 함수는 다음 값을 반환합니다.

반환 코드 Description
S_OK
작업이 성공적으로 완료되었습니다.
ERROR_ACCESS_DENIED
부모 서비스와 서비스 핸들이 모두 제공되고 서비스 계층이 제공된 부모 서비스 핸들로 롤업되지 않는 경우 반환됩니다.
ERROR_INVALID_FUNCTION
신뢰할 수 있는 쓰기 작업이 이미 진행 중입니다.

설명

BluetoothGATTBeginReliableWrite 함수는 Bluetooth 스택에 함수가 반환된 후 호출해야 하는 프로시저가 신뢰할 수 있는 쓰기 작업임을 알립니다. 신뢰할 수 있는 쓰기를 지원하지 않는 모든 작업은 ERROR_INVALID_FUNCTION 오류를 반환합니다. 다음 함수만 신뢰할 수 있는 쓰기 작업을 지원합니다.

예제


BTH_LE_GATT_RELIABLE_WRITE_CONTEXT ReliableWriteContext = NULL;
hr = BluetoothGATTBeginReliableWrite(hDevice, 
                                    &ReliableWriteContext,
                                    BLUETOOTH_GATT_FLAG_NONE);

if (SUCCEEDED(hr)) {
    // Calls to BluetoothGATTSetCharacteristicValue
}

if (NULL != ReliableWriteContext) {
    BluetoothGATTEndReliableWrite(hDevice, 
                                 ReliableWriteContext,
                                  BLUETOOTH_GATT_FLAG_NONE);
}

요구 사항

요구 사항
지원되는 최소 클라이언트 Windows 8 이상 버전의 Windows에서 지원됩니다.
대상 플랫폼 유니버설
헤더 bluetoothleapis.h
라이브러리 BluetoothAPIs.lib
DLL BluetoothAPIs.dll