# wlc-mqtt **Repository Path**: willianfu/wlc-mqtt ## Basic Information - **Project Name**: wlc-mqtt - **Description**: MQTT C语言客户端库,基于MQTT V3.3.1协议实现,小巧、低内存占用,使用方便 - **Primary Language**: C - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 8 - **Forks**: 4 - **Created**: 2022-03-08 - **Last Updated**: 2025-08-01 ## Categories & Tags **Categories**: Uncategorized **Tags**: mqtt, MQTT客户端 ## README # wlc-mqtt > C语言实现的 `MQTT 3.3.1` 客户端,基于事件回调机制,简单易用,与业务完全解耦 ## 示例开发环境 > windows、mingw32-gcc、cmake > 在Clion下直接导入即可运行 ## 完成度 - 带/不带账号密码的认证连接 √ - 完整的QOS0消息发布订阅功能 √ - 多个TOPIC订阅-QOS0 √ - QOS1 x - QOS2 x - 遗嘱消息 x - 保留消息 x ## 使用方法 参考 `main.c` >如果是使用单片机串口外接网络模块透传,请使用串口中断做接收回调,调用 `mqtt_decode()` 1、配置 `mqtt.h` 中的 `SEND_BUF_MAX` 设置发送缓冲区,默认128 2、配置 MQTT_CONFIG 结构体,注册回调函数 MQTT_CALLBACK 3、在接收到tcp数据时,调用 `mqtt_decode()` 进行解码 ## 参考资料 > [mqtt3.3.1中文文档](http://mqtt.p2hp.com/mqtt311)