Recent

Author Topic: Bluetooth LE in windoes  (Read 3744 times)

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Bluetooth LE in windoes
« on: January 26, 2022, 03:06:18 am »
Does anyone have a recommendation as to the best approach to accessing Bluetooth LE hardware in windows?  I saw the Bluetooth page at
https://wiki.freepascal.org/Bluetooth
but I need to access the BLE at the characteristic level.

Thank you
MAS
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

af0815

  • Hero Member
  • *****
  • Posts: 1289
Re: Bluetooth LE in windoes
« Reply #1 on: January 26, 2022, 07:28:35 am »
Is there a soloution for this without pascal ? Prefered is C-only libs.

I was searching for it on Linux, but i found no working sample for my devices. All the python scripts were experimental and not working with my device.
regards
Andreas

PascalDragon

  • Hero Member
  • *****
  • Posts: 5446
  • Compiler Developer
Re: Bluetooth LE in windoes
« Reply #2 on: January 26, 2022, 09:27:15 am »
I don't know anything ready to use right now, but you can try to translate the C code mentioned here.

Graham1

  • Jr. Member
  • **
  • Posts: 57
Re: Bluetooth LE in windoes
« Reply #3 on: January 29, 2022, 01:20:42 am »
I believe Delphi has support for classic Bluetooth and Bluetooth LE but as you've found, native Lazarus support in Windows is non-existent and support in Linux is limited to an 8 year old BT only library.

I ended up using this: https://www.nsoftware.com/ipworks/ble/. It says it's for Delphi but it works in Lazarus too. But it's only a Windows solution and it is expensive. Not as expensive as Delphi, but more than you'd want to spend on a small project.

For Linux I'm not sure how to handle it. I think I'm going to need to learn about DBus for the notifications and BlueZ for the communications but I'm not looking forward to any of that!
Windows 10/11 Home 64-bit (and Linux because I have to)
Lazarus 2.0.12 / FPC 3.2.0 (because libQt5pas 1.2.6)
Linux Mint 20 (because GLIBC_2.31)

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Re: Bluetooth LE in windoes
« Reply #4 on: January 29, 2022, 01:35:53 am »
thanks everyone. 
I may be able to interface to a Nordic driver
https://www.nordicsemi.com/Products/Development-tools/nrf-connect-for-desktop
My backup plan = PascalDragon recommendation and build a unit that interfaces directly with windows but I have not done that before in the 64 bit world so more homework is in order.
I'll also check out Graham1 suggestion.  if it works for win10 & up then that may be a better use of my time.

I'll post my results back here when I finally start on the project in a few weeks.  I've been wanting to contribute to FPC, perhaps this interface will be the unit!
MAS
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Re: Bluetooth LE in windoes
« Reply #5 on: March 17, 2022, 08:50:51 pm »
Update: I found a Bluetooth library that also supports BLE at www.btFramework.com.  The libraries are reasonably priced, Licensed, and they have converted their Delph code so it supports FPC. The Delph demo code is free but will have a popup on run.  I suggest you take a look.
MAS
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

Graham1

  • Jr. Member
  • **
  • Posts: 57
Re: Bluetooth LE in windoes
« Reply #6 on: March 21, 2022, 10:57:25 pm »
Interesting, but note where the company is based: Krychaw, Mogilev Province, Belarus

Personally, I won't use any software from Russia or Belarus.
Windows 10/11 Home 64-bit (and Linux because I have to)
Lazarus 2.0.12 / FPC 3.2.0 (because libQt5pas 1.2.6)
Linux Mint 20 (because GLIBC_2.31)

mas steindorff

  • Hero Member
  • *****
  • Posts: 532
Re: Bluetooth LE in windoes
« Reply #7 on: March 22, 2022, 09:23:33 pm »
Interesting, but note where the company is based: Krychaw, Mogilev Province, Belarus

Personally, I won't use any software from Russia or Belarus.
Apparently they have the same opinion as you as far as Russia goes according to the big red letters on their web site. Even so, this is a small company which is not on the "Do not do business with" list given to our company from the US government.
Do what you will, but I'll direct my anger toward the Russian government, not towards it's people.
Mas
windows 10 &11, Ubuntu 21+ - fpc 3.0.4, IDE 2.0 general releases

Graham1

  • Jr. Member
  • **
  • Posts: 57
Re: Bluetooth LE in windoes
« Reply #8 on: January 31, 2023, 12:47:44 am »
I came across this project:

https://forum.lazarus.freepascal.org/index.php/topic,61140.0.html

It works really well in Win64 and Linux but currently has a problem with Win32 builds. This might be due to the DLL's being built in MSVS - could that cause issues with Pascal? Anyway, hopefully that issue will be resolved soon.

If you are interested in BLE in Pascal it would be worth joining the SimpleBLE Discord channel (from the project's main page, not Erik's Pascal bindings page) and letting Kevin know you're following it as he is currently deciding whether to incorporate Erik's Pascal bindings into the main project and include Lazarus as one of the supported platforms.
« Last Edit: January 31, 2023, 12:50:46 am by Graham1 »
Windows 10/11 Home 64-bit (and Linux because I have to)
Lazarus 2.0.12 / FPC 3.2.0 (because libQt5pas 1.2.6)
Linux Mint 20 (because GLIBC_2.31)

 

TinyPortal © 2005-2018