Skip to content

Commit f6521a2

Browse files
committed
Readme update
1 parent fa5b7f7 commit f6521a2

File tree

5 files changed

+63
-21
lines changed

5 files changed

+63
-21
lines changed

PubSubClient/LICENSE.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2008-2012 Nicholas O'Leary
1+
Copyright (c) 2008-2015 Nicholas O'Leary
22

33
Permission is hereby granted, free of charge, to any person obtaining
44
a copy of this software and associated documentation files (the

PubSubClient/library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ maintainer=Nick O'Leary <nick.oleary@gmail.com>
55
sentence=A client library for MQTT messaging.
66
paragraph=MQTT is a lightweight messaging protocol ideal for small devices. This library allows you to send and receive MQTT messages from a remote server. It supports the latest MQTT 3.1.1 protocol and can be configured to use the older MQTT 3.1 if needed. It supports all Arduino Ethernet Client compatible hardware, including the Intel Galileo/Edison and ESP8266.
77
category=Communication
8-
url=http://knolleary.net/arduino-client-for-mqtt/
8+
url=http://knolleary.github.io/pubsubclient/
99
architectures=*

PubSubClient/src/PubSubClient.h

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*
22
PubSubClient.h - A simple client for MQTT.
3-
Nicholas O'Leary
3+
Nick O'Leary
44
http://knolleary.net
55
*/
66

@@ -15,15 +15,29 @@
1515
#define MQTT_VERSION_3_1 3
1616
#define MQTT_VERSION_3_1_1 4
1717

18-
// MQTT_VERSION
18+
// MQTT_VERSION : Pick the version
19+
//#define MQTT_VERSION MQTT_VERSION_3_1
1920
#define MQTT_VERSION MQTT_VERSION_3_1_1
2021

22+
2123
// MQTT_MAX_PACKET_SIZE : Maximum packet size
2224
#define MQTT_MAX_PACKET_SIZE 128
2325

2426
// MQTT_KEEPALIVE : keepAlive interval in Seconds
2527
#define MQTT_KEEPALIVE 15
2628

29+
// Possible values for client.state()
30+
#define MQTT_CONNECTION_TIMEOUT -4
31+
#define MQTT_CONNECTION_LOST -3
32+
#define MQTT_CONNECT_FAILED -2
33+
#define MQTT_DISCONNECTED -1
34+
#define MQTT_CONNECTED 0
35+
#define MQTT_CONNECT_BAD_PROTOCOL 1
36+
#define MQTT_CONNECT_BAD_CLIENT_ID 2
37+
#define MQTT_CONNECT_UNAVAILABLE 3
38+
#define MQTT_CONNECT_BAD_CREDENTIALS 4
39+
#define MQTT_CONNECT_UNAUTHORIZED 5
40+
2741
#define MQTTCONNECT 1 << 4 // Client request to connect to Server
2842
#define MQTTCONNACK 2 << 4 // Connect Acknowledgment
2943
#define MQTTPUBLISH 3 << 4 // Publish message
@@ -44,19 +58,6 @@
4458
#define MQTTQOS1 (1 << 1)
4559
#define MQTTQOS2 (2 << 1)
4660

47-
#define MQTT_CONNECTION_TIMEOUT -4
48-
#define MQTT_CONNECTION_LOST -3
49-
#define MQTT_CONNECT_FAILED -2
50-
#define MQTT_DISCONNECTED -1
51-
#define MQTT_CONNECTED 0
52-
#define MQTT_CONNECT_BAD_PROTOCOL 1
53-
#define MQTT_CONNECT_BAD_CLIENT_ID 2
54-
#define MQTT_CONNECT_UNAVAILABLE 3
55-
#define MQTT_CONNECT_BAD_CREDENTIALS 4
56-
#define MQTT_CONNECT_UNAUTHORIZED 5
57-
58-
59-
6061
#define MQTT_CALLBACK_SIGNATURE void (*callback)(char*,uint8_t*,unsigned int)
6162

6263
class PubSubClient {

README

Lines changed: 0 additions & 4 deletions
This file was deleted.

README.md

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Arduino Client for MQTT
2+
3+
This library provides a client for doing simple publish/subscribe messaging with
4+
a server that supports MQTT.
5+
6+
## Examples
7+
8+
The library comes with a number of example sketches. See File > Examples > PubSubClient
9+
within the Arduino application.
10+
11+
Full API documentation is available here: http://knolleary.github.io/pubsubclient/
12+
13+
## Limitations
14+
15+
- It can only publish QoS 0 messages. It can subscribe at QoS 0 or QoS 1.
16+
- The maximum message size, including header, is **128 bytes** by default. This
17+
is configurable via `MQTT_MAX_PACKET_SIZE` in `PubSubClient.h`.
18+
- The keepalive interval is set to 15 seconds by default. This is configurable
19+
via `MQTT_KEEPALIVE` in `PubSubClient.h`.
20+
- The client uses MQTT 3.1.1 by default. It can be changed to use MQTT 3.1 by
21+
changing value of `MQTT_VERSION` in `PubSubClient.h`.
22+
23+
24+
## Compatible Hardware
25+
26+
The library uses the Arduino Ethernet Client api for interacting with the
27+
underlying network hardware. This means it Just Works with a growing number of
28+
boards and shields, including:
29+
30+
- Arduino Ethernet
31+
- Arduino Ethernet Shield
32+
- Arduino YUN – use the included `YunClient` in place of `EthernetClient`, and
33+
be sure to do a `Bridge.begin()` first
34+
- Arduino WiFi Shield
35+
- Sparkfun WiFly Shield – when used with [this library](https://github.com/dpslwk/WiFly)
36+
- Intel Galileo/Edison
37+
- ESP8266
38+
39+
The library cannot currently be used with hardware based on the ENC28J60 chip –
40+
such as the Nanode or the Nuelectronics Ethernet Shield. For those, there is an
41+
[alternative library](https://github.com/njh/NanodeMQTT) available.
42+
43+
## License
44+
45+
This code is released under the MIT License.

0 commit comments

Comments
 (0)