PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: MQTT - Conversion of win64-1.3.0 Library Headers for Freebasic  (Read 240 times)

Peter House

  • Junior Member
  • **
  • Posts: 82
  • FF3, FF4, SQLTools, WinFBE User

I would like to use FreeBasic to work with an MQTT server.  Eclipse-Paho has a library package for Windows for use with C and I need to convert the Library Files.

There are 6 Header files, Two are master header files and the last two are included inside the first two:
MQTTAsync.h - This is the Master Header File I need for Non-Blocking Communications
MQTTClient.h - Do not Need this Master Header File.
MQTTClientPersistence.h - This file is included in both above Master Header Files
MQTTProperties.h - This file is included in both above Master Header Files
MQTTReasonCodes.h - This file is included in both above Master Header Files
MQTTSubscribeOpts.h - This file is included in both above Master Header Files

These Header files are in the attached .zip file.

Location of All Source Files for this MQTT Library:
https://www.eclipse.org/downloads/download.php?file=/paho/1.4/eclipse-paho-mqtt-c-win64-1.3.0.zip

I was thinking of writing a conversion program to automatically convert these so I could use it for converting future updates.

I am looking for pointers, help, or both and am willing to provide information on MQTT if you are interested.  At this time, this is NOT a commercial project although MQTT is widely used in many industries.

Thank you,

Peter House
Logged

Paul Squires

  • Administrator
  • Guru Member
  • *****
  • Posts: 8780
  • Windows 10
    • PlanetSquires Software
Re: MQTT - Conversion of win64-1.3.0 Library Headers for Freebasic
« Reply #1 on: March 25, 2019, 09:52:33 AM »

I have attached a copy of the latest FBFrog.exe along with the original *.h and converted *.bi include files.

FYI
If you had tried to compile FBFrog yourself using WinFBE then you would have run into trouble because there was a bug in WinFBE that prevented the compiling of all of the individual *.o object files when creating the FBFrog project. That bug is fixed and I will upload a new version of WinFBE shortly.
Logged
Paul Squires
PlanetSquires Software
WinFBE Editor and Visual Designer

Josť Roca

  • Guru Member
  • *****
  • Posts: 3171
Re: MQTT - Conversion of win64-1.3.0 Library Headers for Freebasic
« Reply #2 on: March 25, 2019, 10:00:44 AM »

Next problem will be the nasty business of import libraries.

BTW the translation of

Code: [Select]
char struct_id[4];

to

Code: [Select]
struct_id as zstring * 4

is wrong.

It must be:

Code: [Select]
struct_id(3) as byte   ' (3) = 0 to 3, i.e. 4 elements

zstring * 4 only leaves you to write 3 characters because of the null terminator.

Peter House

  • Junior Member
  • **
  • Posts: 82
  • FF3, FF4, SQLTools, WinFBE User
Re: MQTT - Conversion of win64-1.3.0 Library Headers for Freebasic
« Reply #3 on: March 25, 2019, 11:52:46 AM »

Paul and Jose,

Thank you so much - I will work on this and see if I can get it the rest of the way to working.  I've written a bunch of C code under Linux to work with this library - it should be fun to get it working with FB under Windows.

I will keep posting as it goes . . .
Logged