1. MASAHIRO HATANAKA
  2. PowerBuilder
  3. Wednesday, 3 April 2024 05:41 AM UTC
Hello everyone.

I am using POWERBUILDER 2017 R3. The thermometer I have has "Health Thermometer Profile" written in the Bluetooth specification column. Therefore, I thought that I could obtain data by using the "Health Thermometer" service of "GATT Services". However, I can't think of a way to get data from a Bluetooth device with POWERBUILDER. If you know the sample code, could you please let me know?
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 4 April 2024 17:25 PM UTC
  2. PowerBuilder
  3. # 1

Here is documentation for Bluetooth / Winsock:

https://learn.microsoft.com/en-us/windows/win32/bluetooth/using-bluetooth

 

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 3 April 2024 20:45 PM UTC
  2. PowerBuilder
  3. # 2

Hi, Masahiro -

Although it appears to be possible to interface a Windows application via C/C++, it looks as though a direct implementation would require the use of callback functions, which PB does not support. There also appears to be a way to communicate with a Bluetooth device via Windows Sockets. I found the following URL that covers these topics:

    https://learn.microsoft.com/en-us/windows/win32/bluetooth/about-bluetooth

It is possible for a PB application to utilize Windows Sockets. Roland Smith's TopWizProgramming website contains a free code sample that illustrates how a PB application can interface with Windows Sockets, but this example app does not specifically interface with Bluetooth (as far as I know):

    https://www.topwizprogramming.com/freecode_winsock.html

There is additional Microsoft documentation regarding Bluetooth via Windows Sockets that can be accessed via the first URL listed above.

Depending on your C++ skills, it might be possible to create an interface between PB and Bluetooth using PBNI (PowerBuilder Native Interface). Theoretically, you could then use the C++ Bluetooth interface directly:

    https://docs.appeon.com/pb2022r3/native_interface_programmers_guide_and_reference/index.html

Good luck and Best Regards, John

 

Comment
There are no comments made yet.
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 3 April 2024 15:06 PM UTC
  2. PowerBuilder
  3. # 3

Hi MASAHIRO;

  You could have accomplished this using the Appeon Mobile product and the "eon_cordova_bluetooth" Cordova object class. That was specifically designed for Bluetooth communication. Alas, the Appeon Mobile product has been discontinued - so that path is no longer an option.

   For USB devices though a simple FileOpen() / FileRead() / FileWrite() etc set of commands works for me but I have never tried to use that approach for BT devices. It might work (food for thought).  HTH

Regards .. Chris

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.