Win32 API 日本語リファレンス
ホームDevices.Bluetooth › BluetoothGATTEndReliableWrite

BluetoothGATTEndReliableWrite

関数
GATT信頼性書き込みトランザクションを確定し終了する。
DLLBluetoothApis.dll呼出規約winapi対応OSwindows8.0

シグネチャ

// BluetoothApis.dll
#include <windows.h>

HRESULT BluetoothGATTEndReliableWrite(
    HANDLE hDevice,
    ULONGLONG ReliableWriteContext,
    DWORD Flags
);

パラメーター

名前方向
hDeviceHANDLEin
ReliableWriteContextULONGLONGin
FlagsDWORDin

戻り値の型: HRESULT

各言語での呼び出し定義

// BluetoothApis.dll
#include <windows.h>

HRESULT BluetoothGATTEndReliableWrite(
    HANDLE hDevice,
    ULONGLONG ReliableWriteContext,
    DWORD Flags
);
[DllImport("BluetoothApis.dll", ExactSpelling = true)]
static extern int BluetoothGATTEndReliableWrite(
    IntPtr hDevice,   // HANDLE
    ulong ReliableWriteContext,   // ULONGLONG
    uint Flags   // DWORD
);
<DllImport("BluetoothApis.dll", ExactSpelling:=True)>
Public Shared Function BluetoothGATTEndReliableWrite(
    hDevice As IntPtr,   ' HANDLE
    ReliableWriteContext As ULong,   ' ULONGLONG
    Flags As UInteger   ' DWORD
) As Integer
End Function
' hDevice : HANDLE
' ReliableWriteContext : ULONGLONG
' Flags : DWORD
Declare PtrSafe Function BluetoothGATTEndReliableWrite Lib "bluetoothapis" ( _
    ByVal hDevice As LongPtr, _
    ByVal ReliableWriteContext As LongLong, _
    ByVal Flags As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

BluetoothGATTEndReliableWrite = ctypes.windll.bluetoothapis.BluetoothGATTEndReliableWrite
BluetoothGATTEndReliableWrite.restype = ctypes.c_int
BluetoothGATTEndReliableWrite.argtypes = [
    wintypes.HANDLE,  # hDevice : HANDLE
    ctypes.c_ulonglong,  # ReliableWriteContext : ULONGLONG
    wintypes.DWORD,  # Flags : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('BluetoothApis.dll')
BluetoothGATTEndReliableWrite = Fiddle::Function.new(
  lib['BluetoothGATTEndReliableWrite'],
  [
    Fiddle::TYPE_VOIDP,  # hDevice : HANDLE
    -Fiddle::TYPE_LONG_LONG,  # ReliableWriteContext : ULONGLONG
    -Fiddle::TYPE_INT,  # Flags : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "bluetoothapis")]
extern "system" {
    fn BluetoothGATTEndReliableWrite(
        hDevice: *mut core::ffi::c_void,  // HANDLE
        ReliableWriteContext: u64,  // ULONGLONG
        Flags: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("BluetoothApis.dll")]
public static extern int BluetoothGATTEndReliableWrite(IntPtr hDevice, ulong ReliableWriteContext, uint Flags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'BluetoothApis_BluetoothGATTEndReliableWrite' -Namespace Win32 -PassThru
# $api::BluetoothGATTEndReliableWrite(hDevice, ReliableWriteContext, Flags)
#uselib "BluetoothApis.dll"
#func global BluetoothGATTEndReliableWrite "BluetoothGATTEndReliableWrite" sptr, sptr, sptr
; BluetoothGATTEndReliableWrite hDevice, ReliableWriteContext, Flags   ; 戻り値は stat
; hDevice : HANDLE -> "sptr"
; ReliableWriteContext : ULONGLONG -> "sptr"
; Flags : DWORD -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "BluetoothApis.dll"
#cfunc global BluetoothGATTEndReliableWrite "BluetoothGATTEndReliableWrite" sptr, int64, int
; res = BluetoothGATTEndReliableWrite(hDevice, ReliableWriteContext, Flags)
; hDevice : HANDLE -> "sptr"
; ReliableWriteContext : ULONGLONG -> "int64"
; Flags : DWORD -> "int"
; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
; HRESULT BluetoothGATTEndReliableWrite(HANDLE hDevice, ULONGLONG ReliableWriteContext, DWORD Flags)
#uselib "BluetoothApis.dll"
#cfunc global BluetoothGATTEndReliableWrite "BluetoothGATTEndReliableWrite" intptr, int64, int
; res = BluetoothGATTEndReliableWrite(hDevice, ReliableWriteContext, Flags)
; hDevice : HANDLE -> "intptr"
; ReliableWriteContext : ULONGLONG -> "int64"
; Flags : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	bluetoothapis = windows.NewLazySystemDLL("BluetoothApis.dll")
	procBluetoothGATTEndReliableWrite = bluetoothapis.NewProc("BluetoothGATTEndReliableWrite")
)

// hDevice (HANDLE), ReliableWriteContext (ULONGLONG), Flags (DWORD)
r1, _, err := procBluetoothGATTEndReliableWrite.Call(
	uintptr(hDevice),
	uintptr(ReliableWriteContext),
	uintptr(Flags),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function BluetoothGATTEndReliableWrite(
  hDevice: THandle;   // HANDLE
  ReliableWriteContext: UInt64;   // ULONGLONG
  Flags: DWORD   // DWORD
): Integer; stdcall;
  external 'BluetoothApis.dll' name 'BluetoothGATTEndReliableWrite';
result := DllCall("BluetoothApis\BluetoothGATTEndReliableWrite"
    , "Ptr", hDevice   ; HANDLE
    , "Int64", ReliableWriteContext   ; ULONGLONG
    , "UInt", Flags   ; DWORD
    , "Int")   ; return: HRESULT
●BluetoothGATTEndReliableWrite(hDevice, ReliableWriteContext, Flags) = DLL("BluetoothApis.dll", "int BluetoothGATTEndReliableWrite(void*, qword, dword)")
# 呼び出し: BluetoothGATTEndReliableWrite(hDevice, ReliableWriteContext, Flags)
# hDevice : HANDLE -> "void*"
# ReliableWriteContext : ULONGLONG -> "qword"
# Flags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。