Skip to content

Commit 6edc397

Browse files
committed
[libmqttc] cleanup and use socket as backend
1 parent fe41452 commit 6edc397

File tree

9 files changed

+289
-206
lines changed

9 files changed

+289
-206
lines changed

INSTALL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
2+
## Supported
3+
| | |
4+
|--|--|
5+
|linux | gcc | x86_64-w64-mingw32-gcc | cmake |
6+
|windows | Visual Studio c1 | linux-mingw | cmake |
7+
|mac | gcc | cmake| |
8+
19
### esp32
210
* toolchain: xtensa-esp32-elf
311
copy or softlink gear-lib to esp32 components dir

README.cn.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
| librtsp: RTSP协议,适合IPCamera和NVR开发 | librtmpc: RTMP协议,适合推流直播 |
2727
| libsock: Socket封装 | librpc: 远程过程调用库 |
2828
| libipc: 进程间通信 | libp2p: p2p穿透传输 |
29-
| libhomekit: Apple homekit协议库 | |
29+
| libmqttc: MQTT客户端协议 | libhomekit: Apple homekit协议库 |
3030

3131
## 异步
3232
| | |

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ This is a collection of basic libraries.
2626
| librtsp: Real Time Streaming Protocol server for ipcamera or NVR | librtmpc: Real Time Messaging Protocol client for liveshow |
2727
| libsock: socket warpper api for easily use | librpc: Remote Procedure Call library |
2828
| libipc: Inter-Process Communication, support mqueue/netlink/shm | libp2p: High level p2p punch hole library, easy API to use |
29-
| libhomekit: Apple homekit protocol |
29+
| libmqttc: MQTT client protocol | libhomekit: Apple homekit protocol |
3030

3131
## Async
3232
| | |

gear-lib/libmqttc/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ TGT_LIB_SO = $(LIBNAME).so
3131
TGT_LIB_SO_VER = $(TGT_LIB_SO).${VER}
3232
TGT_UNIT_TEST = test_$(LIBNAME)
3333

34-
OBJS_LIB = $(LIBNAME).o
34+
OBJS_LIB = $(LIBNAME).o mqttc_socket.o
3535
OBJS_UNIT_TEST = test_$(LIBNAME).o
3636

3737
###############################################################################
@@ -58,6 +58,7 @@ CFLAGS += -I$(OUTPUT)/include/gear-lib
5858
SHARED := -shared
5959

6060
LDFLAGS := $($(ARCH)_LDFLAGS)
61+
LDFLAGS += -L$(OUTLIBPATH)/lib/gear-lib -ltime -lsock -lgevent -ldarray -lthread -lringbuffer
6162
LDFLAGS += -pthread
6263

6364
###############################################################################

gear-lib/libmqttc/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
## libmqttc
22
This is a simple mqtt client library based on paho.mqtt(29ab2aa).
33

4+
sudo apt install mosquitto
5+
46
1.mosquitto_sub -h localhost -t "will topic" -P "testpassword" -u "testuser" -v
57
2.test_libmqttc
68

0 commit comments

Comments
 (0)