romuloceccon / lightmqtt

MQTT 3.1.1 client library written in pure C, fully asynchronous, supporting QoS 0, 1 and 2 messages and large payloads
MIT License
14 stars 6 forks source link

CMake support and windows code for examples #6

Open tehKaiN opened 4 years ago

tehKaiN commented 4 years ago

Hi there,

I'm using this library for my own project and added CMake support. Would you be interested in pull request regarding it?

Also, I've added some code to examples to make them work on Windows. Unfortunately, I had to do file_write/read and socket_write/read separately since Windows isn't that much POSIX compliant. It's one big #if defined mess but it works on my end. ;) Would you want it in pull request too?

romuloceccon commented 4 years ago

Where's your fork? I'm not really maintaining this project anymore, but I might try taking a look...

tehKaiN commented 4 years ago

Sorry for not replying that fast, I was busy ;)

Here's CMake, it supports installing library into OS and including it into projects via find_package command: https://github.com/tehKaiN/lightmqtt/tree/cmake

and here's dirty windows branch, not tested if I broken something on Linux end: https://github.com/tehKaiN/lightmqtt/tree/windows

Unfortunately, I will not use this library since it doesn't support websocket publishing. Which is very, very sad for me - no MQTT library comes even close to yours in terms of ease of integrating and footprint.

tehKaiN commented 4 years ago

I wanted to use Paho library with some modifications in my embedded project, but unfortunately that library is too big for me and yours is very compact and has everything I need except for websocket protocol support.

I'll be adding it in a few next days so expect a pull request from me. ;)

tehKaiN commented 4 years ago

Okay, I've now added #7 - I've refrained from adding windows support as it's a bit hacky.