aboutsummaryrefslogtreecommitdiff
path: root/nimbluez/bluetoothmsbt.nim
diff options
context:
space:
mode:
authorElectric-Blue <Electric-Blue@users.noreply.github.com>2016-01-31 22:03:56 +0300
committerElectric-Blue <Electric-Blue@users.noreply.github.com>2016-01-31 22:03:56 +0300
commit48c3a10ccf6ddb82d2dffa063032f9c6e47d238f (patch)
treeca57acff6c6e048d66766c4eed3f2ef1531251b8 /nimbluez/bluetoothmsbt.nim
parent315b1d08d278517bf90a65a2bb340fe7f8eeb747 (diff)
downloadNimBluez-48c3a10ccf6ddb82d2dffa063032f9c6e47d238f.tar.gz
NimBluez-48c3a10ccf6ddb82d2dffa063032f9c6e47d238f.zip
Class of device for msbt + some type refinement.
Diffstat (limited to 'nimbluez/bluetoothmsbt.nim')
-rw-r--r--nimbluez/bluetoothmsbt.nim13
1 files changed, 12 insertions, 1 deletions
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