[fpc-pascal] libmosquitto headers for FPC

Marcos Douglas B. Santos md at delfire.net
Thu Mar 14 18:39:38 CET 2019


On Thu, Mar 14, 2019 at 11:55 AM Karoly Balogh (Charlie/SGR)
<charlie at scenergy.dfmk.hu> wrote:
>
> Hi,
>
> Not sure if anyone have done this already, but I converted the
> libmosquitto (which is a C-written MQTT client library) header
> (mosquitto.h) to Free Pascal, so it allows using libmosquitto from Pascal
> code. I work on some IoT projects lately which transfers data over MQTT,
> and I wanted to write some of the code in Pascal (after some other
> languages failed to meet expectations, business as usual), so I just did
> it. I know some Pascal MQTT libraries exist, but all I encountered seemed
> to have some limitations, or things I didn't like (being too Delphi
> centric, or something) and libmosquitto just seems to be much more used.
>
> Note this is only a pure conversion of the C header file using ctypes,
> with some pascalisms added (like proper callback function types). I have
> an additional class-layer on top of it planned, but so far I only got the
> headers converted, but they work in our internal project. I want to add
> some examples later too.
>
> So in case anyone needs this:
>
> http://github.com/chainq/mosquitto-p
>
> As we hopefully will soon use this in production, I sort of committed
> to keep the headers up-to-date.
>
> I tested it on Darwin (x86_64) and Linux (x86_64 and arm), but adding
> Windows support should be trivial. (Probably only needs the right .dll
> name added as linklib, or something.)

Good job.

I'm thinking use some like that to split a big desktop application
code into few other applications, maintaining a communication among
them.
Is it a good case to use mosquitto? If so, I can help you on Windows,
testing and etc.

best regards,
Marcos Douglas



More information about the fpc-pascal mailing list