Is this possible? For example to communicate with the new LEGO electric devices...
https://lego.github.io/lego-ble-wireless-protocol-docs/
PureBasic & Bluetooth LE?
Re: PureBasic & Bluetooth LE?
I don't know if GATT is possible with the 'normal' bluetooth lib.
But you can write a wrapper for the standard bluetooth stuff:
But you can write a wrapper for the standard bluetooth stuff:
Code: Select all
; https://docs.microsoft.com/en-us/windows/desktop/api/bluetoothapis/
; http://mielke.cc/brltty/archive/Windows/Bluetooth/BluetoothAPIs.h
; https://www.purebasic.fr/german/viewtopic.php?f=8&t=23878
#BLUETOOTH_MAX_NAME_SIZE = 248
#BLUETOOTH_MAX_PASSKEY_SIZE = 16
#BLUETOOTH_MAX_PASSKEY_BUFFER_SIZE = #BLUETOOTH_MAX_PASSKEY_SIZE + 1
Structure BLUETOOTH_ADDRESS
StructureUnion
ullLong.q ; easier to compare again BLUETOOTH_NULL_ADDRESS
rgBytes.a[6] ; easier To format when broken out
EndStructureUnion
EndStructure
Structure BLUETOOTH_DEVICE_INFO
dwSize.l
Address.BLUETOOTH_ADDRESS
ulClassofDevice.l
fConnected.l
fRemembered.l
fAuthenticated.l
stLastSeen.SYSTEMTIME
stLastUsed.SYSTEMTIME
szName.s[#BLUETOOTH_MAX_NAME_SIZE]
EndStructure
PrototypeC.l Proto_BluetoothAuthenticateDevice(hwndParent.l , hRadio.l, *pbtbi.BLUETOOTH_DEVICE_INFO, *pszPasskey.p-Unicode, ulPasskeyLength.l)
Global BluetoothAuthenticateDevice.Proto_BluetoothAuthenticateDevice
BluetoothLibrary = OpenLibrary(#PB_Any, "Bthprops.cpl")
If BluetoothLibrary
BluetoothAuthenticateDevice = GetFunction(BluetoothLibrary, "BluetoothAuthenticateDevice")
Debug BluetoothAuthenticateDevice
CloseLibrary(BluetoothLibrary)
EndIf
Last edited by infratec on Sun Apr 28, 2019 10:19 pm, edited 2 times in total.
Re: PureBasic & Bluetooth LE?
Btw. HeXOR has already written something:
https://www.purebasic.fr/german/viewtop ... =8&t=23878
https://www.purebasic.fr/german/viewtop ... =8&t=23878