From 48c3a10ccf6ddb82d2dffa063032f9c6e47d238f Mon Sep 17 00:00:00 2001 From: Electric-Blue Date: Sun, 31 Jan 2016 22:03:56 +0300 Subject: Class of device for msbt + some type refinement. --- nimbluez/bluetoothmsbt.nim | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'nimbluez/bluetoothmsbt.nim') diff --git a/nimbluez/bluetoothmsbt.nim b/nimbluez/bluetoothmsbt.nim index 4d10392..35cdb14 100644 --- a/nimbluez/bluetoothmsbt.nim +++ b/nimbluez/bluetoothmsbt.nim @@ -6,7 +6,8 @@ ## services. It is based on Microsoft Bluetooth protocol stack implementation ## for Windows. -import os, strutils, algorithm, sequtils, winlean +import os, strutils, algorithm, sequtils +from winlean import WINBOOL, NO_ERROR import msbt/ms_bluetoothapis, msbt/ms_bthsdpdef, msbt/ms_bthdef export BLUETOOTH_ADDRESS, BLUETOOTH_RADIO_INFO, BLUETOOTH_DEVICE_INFO @@ -220,3 +221,13 @@ proc name*(device: BluetoothDeviceRemote): string = var buf: array[BLUETOOTH_MAX_NAME_SIZE + 1, WCHAR] copyMem(addr(buf), addr(device.fDeviceInfo.szName), BLUETOOTH_MAX_NAME_SIZE) return cast[WideCString](addr(buf)) $ BLUETOOTH_MAX_NAME_SIZE + + +proc classRaw*(device: BluetoothDeviceLocal): uint32 = + ## Returns raw class of remote Bluetooth device. + result = device.fRadioInfo.ulClassofDevice + + +proc classRaw*(device: BluetoothDeviceRemote): uint32 = + ## Returns raw class of remote Bluetooth device. + result = device.fDeviceInfo.ulClassofDevice -- cgit v1.2.3