MQTT - Conversion of win64-1.3.0 Library Headers for Freebasic

Started by Peter House, March 25, 2019, 01:15:44 AM

Previous topic - Next topic

Peter House

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

Paul Squires

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.
Paul Squires
PlanetSquires Software

José Roca

Next problem will be the nasty business of import libraries.

BTW the translation of


char struct_id[4];


to


struct_id as zstring * 4


is wrong.

It must be:


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

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 . . .