@@ -8,15 +8,15 @@ Create a MQTT client instance
88Simps\MQTT\Client::__construct(string $host, int $port, ClientConfig $config, int $clientType = Client::COROUTINE_CLIENT_TYPE)
99```
1010
11- * ` string $host `
11+ - ` string $host `
1212
1313Broker's host
1414
15- * ` int $port `
15+ - ` int $port `
1616
1717Broker's port
1818
19- * ` ClientConfig $config `
19+ - ` ClientConfig $config `
2020
2121ClientConfig object.
2222
@@ -39,9 +39,9 @@ $configObj = new Simps\MQTT\Config\ClientConfig($config);
3939$client = new Simps\MQTT\Client('127.0.0.1', 1883, $configObj);
4040```
4141
42- !> The Client will use the corresponding protocol resolution according to the ` protocol_level ` set.
42+ !> The Client will use the corresponding protocol resolution according to the ` protocolLevel ` set.
4343
44- * ` int $clientType `
44+ - ` int $clientType `
4545
4646Set the client type, use a Coroutine Client or a Sync Client, the default is Coroutine Client.
4747
@@ -55,13 +55,13 @@ Connect Broker
5555Simps\MQTT\Client->connect(bool $clean = true, array $will = [])
5656```
5757
58- * ` bool $clean `
58+ - ` bool $clean `
5959
6060Clean session. default is ` true ` .
6161
6262For a detailed description, please see the corresponding protocol document: ` Clean Session ` .
6363
64- * ` array $will `
64+ - ` array $will `
6565
6666When a client is disconnected, Broker will automatically send a will message to other clients
6767
@@ -91,13 +91,13 @@ Subscribe to one topic or multiple topics
9191Simps\MQTT\Client->subscribe(array $topics, array $properties = [])
9292```
9393
94- * ` array $topics `
94+ - ` array $topics `
9595
9696``` php
9797// MQTT 3.x
9898$topics = [
9999 // topic => Qos
100- 'topic1' => 0,
100+ 'topic1' => 0,
101101 'topic2' => 1,
102102];
103103
@@ -109,17 +109,17 @@ $topics = [
109109 'no_local' => true,
110110 'retain_as_published' => true,
111111 'retain_handling' => 2,
112- ],
112+ ],
113113 'topic2' => [
114114 'qos' => 2,
115115 'no_local' => false,
116116 'retain_as_published' => true,
117117 'retain_handling' => 1,
118- ],
118+ ],
119119];
120120```
121121
122- * ` array $properties `
122+ - ` array $properties `
123123
124124Optional in MQTT5
125125
@@ -131,13 +131,13 @@ Unsubscribe from a topic or multiple topics
131131Simps\MQTT\Client->unSubscribe(array $topics, array $properties = [])
132132```
133133
134- * ` array $topics `
134+ - ` array $topics `
135135
136136``` php
137137$topics = ['topic1', 'topic2'];
138138```
139139
140- * ` array $properties `
140+ - ` array $properties `
141141
142142Optional in MQTT5
143143
@@ -157,14 +157,6 @@ New AUTH type added in MQTT5. Authentication exchange.
157157Simps\MQTT\Client->auth(int $code = ReasonCode::SUCCESS, array $properties = [])
158158```
159159
160- ## recv()
161-
162- Receive messages
163-
164- ``` php
165- Simps\MQTT\Client->recv(): bool|arary|string
166- ```
167-
168160## send()
169161
170162Send messages
@@ -173,14 +165,22 @@ Send messages
173165Simps\MQTT\Client->send(array $data, $response = true)
174166```
175167
176- * ` array $data `
168+ - ` array $data `
177169
178170` $data ` is the data to be sent and must contain information such as ` type `
179171
180- * ` bool $response `
172+ - ` bool $response `
181173
182174Are acknowledgements required. If ` true ` , ` recv() ` is called once
183175
176+ ## recv()
177+
178+ Receive messages
179+
180+ ``` php
181+ Simps\MQTT\Client->recv(): bool|arary|string
182+ ```
183+
184184## ping()
185185
186186Send a heartbeat
0 commit comments