commit | author | age
|
ea8e18
|
1 |
// |
L |
2 |
// MQTTSessionLegacy.h |
|
3 |
// MQTTClient.framework |
|
4 |
// |
|
5 |
|
|
6 |
/** |
|
7 |
Using MQTT in your Objective-C application |
|
8 |
This file contains definitions for mqttio-OBJC backward compatibility |
|
9 |
|
|
10 |
@author Christoph Krey krey.christoph@gmail.com |
|
11 |
@copyright Copyright © 2013-2016, Christoph Krey |
|
12 |
|
|
13 |
based on Copyright (c) 2011, 2013, 2lemetry LLC |
|
14 |
All rights reserved. This program and the accompanying materials |
|
15 |
are made available under the terms of the Eclipse Public License v1.0 |
|
16 |
which accompanies this distribution, and is available at |
|
17 |
http://www.eclipse.org/legal/epl-v10.html |
|
18 |
|
|
19 |
@see http://mqtt.org |
|
20 |
*/ |
|
21 |
|
|
22 |
|
|
23 |
#import <Foundation/Foundation.h> |
|
24 |
#import "MQTTSession.h" |
|
25 |
|
|
26 |
@interface MQTTSession(Create) |
|
27 |
|
|
28 |
/** convenience initializer |
|
29 |
@param clientId see clientId for description. |
|
30 |
@param userName see username for description. |
|
31 |
@param password see password for description. |
|
32 |
@param keepAliveInterval see keepAliveInterval for description. |
|
33 |
@param cleanSessionFlag see cleanSessionFlag for description. |
|
34 |
@param willFlag see willFlag for description. |
|
35 |
@param willTopic see willTopic for description. |
|
36 |
@param willMsg see willMsg for description. |
|
37 |
@param willQoS see willQos for description. |
|
38 |
@param willRetainFlag see willRetainFlg for description. |
|
39 |
@param protocolLevel see protocolLevel for description. |
|
40 |
@param runLoop see runLoop for description. |
|
41 |
@param runLoopMode see runLoopMode for description. |
|
42 |
@return the initialised MQTTSession object |
|
43 |
@exception NSInternalInconsistencyException if the parameters are invalid |
|
44 |
*/ |
|
45 |
- (MQTTSession *)initWithClientId:(NSString *)clientId |
|
46 |
userName:(NSString *)userName |
|
47 |
password:(NSString *)password |
|
48 |
keepAlive:(UInt16)keepAliveInterval |
|
49 |
cleanSession:(BOOL)cleanSessionFlag |
|
50 |
will:(BOOL)willFlag |
|
51 |
willTopic:(NSString *)willTopic |
|
52 |
willMsg:(NSData *)willMsg |
|
53 |
willQoS:(MQTTQosLevel)willQoS |
|
54 |
willRetainFlag:(BOOL)willRetainFlag |
|
55 |
protocolLevel:(UInt8)protocolLevel |
|
56 |
runLoop:(NSRunLoop *)runLoop |
|
57 |
forMode:(NSString *)runLoopMode; |
|
58 |
|
|
59 |
/** alternative initializer |
|
60 |
@param clientId see initWithClientId for description. |
|
61 |
@param userName see initWithClientId for description. |
|
62 |
@param password see initWithClientId for description. |
|
63 |
@param keepAliveInterval see initWithClientId for description. |
|
64 |
@param cleanSessionFlag see initWithClientId for description. |
|
65 |
@param willFlag see initWithClientId for description. |
|
66 |
@param willTopic see initWithClientId for description. |
|
67 |
@param willMsg see initWithClientId for description. |
|
68 |
@param willQoS see initWithClientId for description. |
|
69 |
@param willRetainFlag see initWithClientId for description. |
|
70 |
@param protocolLevel see initWithClientId for description. |
|
71 |
@param runLoop see initWithClientId for description. |
|
72 |
@param runLoopMode see initWithClientId for description. |
|
73 |
@param securityPolicy see initWithClientId for description. |
|
74 |
@return the initialised MQTTSession object |
|
75 |
@exception NSInternalInconsistencyException if the parameters are invalid |
|
76 |
*/ |
|
77 |
- (MQTTSession *)initWithClientId:(NSString *)clientId |
|
78 |
userName:(NSString *)userName |
|
79 |
password:(NSString *)password |
|
80 |
keepAlive:(UInt16)keepAliveInterval |
|
81 |
cleanSession:(BOOL)cleanSessionFlag |
|
82 |
will:(BOOL)willFlag |
|
83 |
willTopic:(NSString *)willTopic |
|
84 |
willMsg:(NSData *)willMsg |
|
85 |
willQoS:(MQTTQosLevel)willQoS |
|
86 |
willRetainFlag:(BOOL)willRetainFlag |
|
87 |
protocolLevel:(UInt8)protocolLevel |
|
88 |
runLoop:(NSRunLoop *)runLoop |
|
89 |
forMode:(NSString *)runLoopMode |
|
90 |
securityPolicy:(MQTTSSLSecurityPolicy *) securityPolicy; |
|
91 |
|
|
92 |
/** initialises the MQTT session |
|
93 |
* |
|
94 |
* this constructor can specifies SSL securityPolicy. the default value of securityPolicy is nil(which do nothing). |
|
95 |
* |
|
96 |
* if SSL is enabled, by default it only evaluate server's certificates using CA infrastructure, and for most case, this type of check is enough. |
|
97 |
* However, if your app using security model which require pinning SSL certificates to helps prevent man-in-the-middle attacks |
|
98 |
* and other vulnerabilities. you may need to set securityPolicy to properly value(see MQTTSSLSecurityPolicy.h for more detail). |
|
99 |
* |
|
100 |
* NOTE: about self-signed server certificates: |
|
101 |
* In CA infrastructure, you may establish a SSL/TLS connection with server which using self-signed certificates |
|
102 |
* by install the certificates into OS keychain(either programmatically or manually). however, this method has some disadvantages: |
|
103 |
* 1. every socket you app created will trust certificates you added. |
|
104 |
* 2. if user choice to remove certificates from keychain, you app need to handling certificates re-adding. |
|
105 |
* |
|
106 |
* If you only want to verify the cert for the socket you are creating and for no other sockets in your app, you need to use |
|
107 |
* MQTTSSLSecurityPolicy. |
|
108 |
* And if you use self-signed server certificates, your need to set property: MQTTSSLSecurityPolicy.allowInvalidCertificates=YES |
|
109 |
* (see MQTTSSLSecurityPolicy.h for more detail). |
|
110 |
* |
|
111 |
* @param clientId The Client Identifier identifies the Client to the Server. If nil, a random clientId is generated. |
|
112 |
* @param userName an NSString object containing the user's name (or ID) for authentication. May be nil. |
|
113 |
* @param password an NSString object containing the user's password. If userName is nil, password must be nil as well. |
|
114 |
* @param keepAliveInterval The Keep Alive is a time interval measured in seconds. The MQTTClient ensures that the interval between Control Packets being sent does not exceed the Keep Alive value. In the absence of sending any other Control Packets, the Client sends a PINGREQ Packet. |
|
115 |
* @param cleanSessionFlag specifies if the server should discard previous session information. |
|
116 |
* @param willFlag If the Will Flag is set to YES this indicates that a Will Message MUST be published by the Server when the Server detects that the Client is disconnected for any reason other than the Client flowing a DISCONNECT Packet. |
|
117 |
* @param willTopic If the Will Flag is set to YES, the Will Topic is a string, nil otherwise. |
|
118 |
* @param willMsg If the Will Flag is set to YES the Will Message must be specified, nil otherwise. |
|
119 |
* @param willQoS specifies the QoS level to be used when publishing the Will Message. If the Will Flag is set to NO, then the Will QoS MUST be set to 0. If the Will Flag is set to YES, the value of Will QoS can be 0 (0x00), 1 (0x01), or 2 (0x02). |
|
120 |
* @param willRetainFlag indicates if the server should publish the Will Messages with retainFlag. If the Will Flag is set to NO, then the Will Retain Flag MUST be set to NO . If the Will Flag is set to YES: If Will Retain is set to NO, the Server MUST publish the Will Message as a non-retained publication [MQTT-3.1.2-14]. If Will Retain is set to YES, the Server MUST publish the Will Message as a retained publication [MQTT-3.1.2-15]. |
|
121 |
* @param protocolLevel specifies the protocol to be used. The value of the Protocol Level field for the version 3.1.1 of the protocol is 4. The value for the version 3.1 is 3. |
|
122 |
* @param runLoop The runLoop where the streams are scheduled. If nil, defaults to [NSRunLoop currentRunLoop]. |
|
123 |
* @param runLoopMode The runLoopMode where the streams are scheduled. If nil, defaults to NSRunLoopCommonModes. |
|
124 |
* @param securityPolicy The security policy used to evaluate server trust for secure connections. |
|
125 |
* @param certificates An identity certificate used to reply to a server requiring client certificates according to the description given for SSLSetCertificate(). You may build the certificates array yourself or use the sundry method clientCertFromP12 |
|
126 |
* @return the initialised MQTTSession object |
|
127 |
* @exception NSInternalInconsistencyException if the parameters are invalid |
|
128 |
* |
|
129 |
* @code |
|
130 |
#import "MQTTClient.h" |
|
131 |
|
|
132 |
NSString* certificate = [[NSBundle bundleForClass:[MQTTSession class]] pathForResource:@"certificate" ofType:@"cer"]; |
|
133 |
MQTTSSLSecurityPolicy *securityPolicy = [MQTTSSLSecurityPolicy policyWithPinningMode:MQTTSSLPinningModeCertificate]; |
|
134 |
securityPolicy.pinnedCertificates = @[ [NSData dataWithContentsOfFile:certificate] ]; |
|
135 |
securityPolicy.allowInvalidCertificates = YES; // if your certificate is self-signed(which didn't coupled with CA infrastructure) |
|
136 |
|
|
137 |
MQTTSession *session = [[MQTTSession alloc] |
|
138 |
initWithClientId:@"example-1234" |
|
139 |
userName:@"user" |
|
140 |
password:@"secret" |
|
141 |
keepAlive:60 |
|
142 |
cleanSession:YES |
|
143 |
will:YES |
|
144 |
willTopic:@"example/status" |
|
145 |
willMsg:[[@"Client off-line"] dataUsingEncoding:NSUTF8StringEncoding] |
|
146 |
willQoS:2 |
|
147 |
willRetainFlag:YES |
|
148 |
protocolLevel:4 |
|
149 |
runLoop:[NSRunLoop currentRunLoop] |
|
150 |
forMode:NSRunLoopCommonModes |
|
151 |
securityPolicy:securityPolicy |
|
152 |
certificates:certificates]; |
|
153 |
|
|
154 |
[session connectToHost:@"example-1234" port:1883 usingSSL:YES]; |
|
155 |
@endcode |
|
156 |
*/ |
|
157 |
- (MQTTSession *)initWithClientId:(NSString *)clientId |
|
158 |
userName:(NSString *)userName |
|
159 |
password:(NSString *)password |
|
160 |
keepAlive:(UInt16)keepAliveInterval |
|
161 |
cleanSession:(BOOL)cleanSessionFlag |
|
162 |
will:(BOOL)willFlag |
|
163 |
willTopic:(NSString *)willTopic |
|
164 |
willMsg:(NSData *)willMsg |
|
165 |
willQoS:(MQTTQosLevel)willQoS |
|
166 |
willRetainFlag:(BOOL)willRetainFlag |
|
167 |
protocolLevel:(UInt8)protocolLevel |
|
168 |
runLoop:(NSRunLoop *)runLoop |
|
169 |
forMode:(NSString *)runLoopMode |
|
170 |
securityPolicy:(MQTTSSLSecurityPolicy *) securityPolicy |
|
171 |
certificates:(NSArray *)certificates; |
|
172 |
|
|
173 |
/** |
|
174 |
* for mqttio-OBJC backward compatibility |
|
175 |
* @param theClientId see initWithClientId for description. |
|
176 |
* @return the initialised MQTTSession object |
|
177 |
* All other parameters are set to defaults |
|
178 |
*/ |
|
179 |
- (id)initWithClientId:(NSString *)theClientId; |
|
180 |
|
|
181 |
/** for mqttio-OBJC backward compatibility |
|
182 |
@param theClientId see initWithClientId for description. |
|
183 |
@param theRunLoop see initWithClientId for description. |
|
184 |
@param theRunLoopMode see initWithClientId for description. |
|
185 |
@return the initialised MQTTSession object |
|
186 |
All other parameters are set to defaults |
|
187 |
*/ |
|
188 |
- (id)initWithClientId:(NSString*)theClientId |
|
189 |
runLoop:(NSRunLoop*)theRunLoop |
|
190 |
forMode:(NSString*)theRunLoopMode; |
|
191 |
|
|
192 |
/** for mqttio-OBJC backward compatibility |
|
193 |
@param theClientId see initWithClientId for description. |
|
194 |
@param theUsername see initWithClientId for description. |
|
195 |
@param thePassword see initWithClientId for description. |
|
196 |
@return the initialised MQTTSession object |
|
197 |
All other parameters are set to defaults |
|
198 |
*/ |
|
199 |
- (id)initWithClientId:(NSString*)theClientId |
|
200 |
userName:(NSString*)theUsername |
|
201 |
password:(NSString*)thePassword; |
|
202 |
|
|
203 |
/** for mqttio-OBJC backward compatibility |
|
204 |
@param theClientId see initWithClientId for description. |
|
205 |
@param theUserName see initWithClientId for description. |
|
206 |
@param thePassword see initWithClientId for description. |
|
207 |
@param theRunLoop see initWithClientId for description. |
|
208 |
@param theRunLoopMode see initWithClientId for description. |
|
209 |
@return the initialised MQTTSession object |
|
210 |
All other parameters are set to defaults |
|
211 |
*/ |
|
212 |
- (id)initWithClientId:(NSString*)theClientId |
|
213 |
userName:(NSString*)theUserName |
|
214 |
password:(NSString*)thePassword |
|
215 |
runLoop:(NSRunLoop*)theRunLoop |
|
216 |
forMode:(NSString*)theRunLoopMode; |
|
217 |
|
|
218 |
/** for mqttio-OBJC backward compatibility |
|
219 |
@param theClientId see initWithClientId for description. |
|
220 |
@param theUsername see initWithClientId for description. |
|
221 |
@param thePassword see initWithClientId for description. |
|
222 |
@param theKeepAliveInterval see initWithClientId for description. |
|
223 |
@param cleanSessionFlag see initWithClientId for description. |
|
224 |
@return the initialised MQTTSession object |
|
225 |
All other parameters are set to defaults |
|
226 |
*/ |
|
227 |
- (id)initWithClientId:(NSString*)theClientId |
|
228 |
userName:(NSString*)theUsername |
|
229 |
password:(NSString*)thePassword |
|
230 |
keepAlive:(UInt16)theKeepAliveInterval |
|
231 |
cleanSession:(BOOL)cleanSessionFlag; |
|
232 |
|
|
233 |
/** for mqttio-OBJC backward compatibility |
|
234 |
@param theClientId see initWithClientId for description. |
|
235 |
@param theUsername see initWithClientId for description. |
|
236 |
@param thePassword see initWithClientId for description. |
|
237 |
@param theKeepAlive see initWithClientId for description. |
|
238 |
@param theCleanSessionFlag see initWithClientId for description. |
|
239 |
@param theRunLoop see initWithClientId for description. |
|
240 |
@param theMode see initWithClientId for description. |
|
241 |
@return the initialised MQTTSession object |
|
242 |
All other parameters are set to defaults |
|
243 |
*/ |
|
244 |
- (id)initWithClientId:(NSString*)theClientId |
|
245 |
userName:(NSString*)theUsername |
|
246 |
password:(NSString*)thePassword |
|
247 |
keepAlive:(UInt16)theKeepAlive |
|
248 |
cleanSession:(BOOL)theCleanSessionFlag |
|
249 |
runLoop:(NSRunLoop*)theRunLoop |
|
250 |
forMode:(NSString*)theMode; |
|
251 |
|
|
252 |
/** for mqttio-OBJC backward compatibility |
|
253 |
@param theClientId see initWithClientId for description. |
|
254 |
@param theUserName see initWithClientId for description. |
|
255 |
@param thePassword see initWithClientId for description. |
|
256 |
@param theKeepAliveInterval see initWithClientId for description. |
|
257 |
@param theCleanSessionFlag see initWithClientId for description. |
|
258 |
@param willTopic see initWithClientId for description. |
|
259 |
@param willMsg see initWithClientId for description. |
|
260 |
@param willQoS see initWithClientId for description. |
|
261 |
@param willRetainFlag see initWithClientId for description. |
|
262 |
@return the initialised MQTTSession object |
|
263 |
All other parameters are set to defaults |
|
264 |
*/ |
|
265 |
- (id)initWithClientId:(NSString*)theClientId |
|
266 |
userName:(NSString*)theUserName |
|
267 |
password:(NSString*)thePassword |
|
268 |
keepAlive:(UInt16)theKeepAliveInterval |
|
269 |
cleanSession:(BOOL)theCleanSessionFlag |
|
270 |
willTopic:(NSString*)willTopic |
|
271 |
willMsg:(NSData*)willMsg |
|
272 |
willQoS:(UInt8)willQoS |
|
273 |
willRetainFlag:(BOOL)willRetainFlag; |
|
274 |
|
|
275 |
/** for mqttio-OBJC backward compatibility |
|
276 |
@param theClientId see initWithClientId for description. |
|
277 |
@param theUserName see initWithClientId for description. |
|
278 |
@param thePassword see initWithClientId for description. |
|
279 |
@param theKeepAliveInterval see initWithClientId for description. |
|
280 |
@param theCleanSessionFlag see initWithClientId for description. |
|
281 |
@param willTopic see initWithClientId for description. |
|
282 |
@param willMsg see initWithClientId for description. |
|
283 |
@param willQoS see initWithClientId for description. |
|
284 |
@param willRetainFlag see initWithClientId for description. |
|
285 |
@param theRunLoop see initWithClientId for description. |
|
286 |
@param theRunLoopMode see initWithClientId for description. |
|
287 |
@return the initialised MQTTSession object |
|
288 |
All other parameters are set to defaults |
|
289 |
*/ |
|
290 |
- (id)initWithClientId:(NSString*)theClientId |
|
291 |
userName:(NSString*)theUserName |
|
292 |
password:(NSString*)thePassword |
|
293 |
keepAlive:(UInt16)theKeepAliveInterval |
|
294 |
cleanSession:(BOOL)theCleanSessionFlag |
|
295 |
willTopic:(NSString*)willTopic |
|
296 |
willMsg:(NSData*)willMsg |
|
297 |
willQoS:(UInt8)willQoS |
|
298 |
willRetainFlag:(BOOL)willRetainFlag |
|
299 |
runLoop:(NSRunLoop*)theRunLoop |
|
300 |
forMode:(NSString*)theRunLoopMode; |
|
301 |
|
|
302 |
/** for mqttio-OBJC backward compatibility |
|
303 |
@param theClientId see initWithClientId for description. |
|
304 |
@param theKeepAliveInterval see initWithClientId for description. |
|
305 |
@param theConnectMessage has to be constructed using MQTTMessage connectMessage... |
|
306 |
@param theRunLoop see initWithClientId for description. |
|
307 |
@param theRunLoopMode see initWithClientId for description. |
|
308 |
@return the initialised MQTTSession object |
|
309 |
All other parameters are set to defaults |
|
310 |
*/ |
|
311 |
- (id)initWithClientId:(NSString*)theClientId |
|
312 |
keepAlive:(UInt16)theKeepAliveInterval |
|
313 |
connectMessage:(MQTTMessage*)theConnectMessage |
|
314 |
runLoop:(NSRunLoop*)theRunLoop |
|
315 |
forMode:(NSString*)theRunLoopMode; |
|
316 |
|
|
317 |
/** connects to the specified MQTT server |
|
318 |
|
|
319 |
@param host specifies the hostname or ip address to connect to. Defaults to @"localhost". |
|
320 |
@param port specifies the port to connect to |
|
321 |
@param usingSSL specifies whether to use SSL or not |
|
322 |
@param connectHandler identifies a block which is executed on successfull or unsuccessfull connect. Might be nil |
|
323 |
error is nil in the case of a successful connect |
|
324 |
sessionPresent indicates in MQTT 3.1.1 if persistent session data was present at the server |
|
325 |
|
|
326 |
@return nothing and returns immediately. To check the connect results, register as an MQTTSessionDelegate and |
|
327 |
- watch for events |
|
328 |
- watch for connect or connectionRefused messages |
|
329 |
- watch for error messages |
|
330 |
or use the connectHandler block |
|
331 |
|
|
332 |
@code |
|
333 |
#import "MQTTClient.h" |
|
334 |
|
|
335 |
MQTTSession *session = [[MQTTSession alloc] init]; |
|
336 |
|
|
337 |
[session connectToHost:@"192.168.0.1" port:1883 usingSSL:NO connectHandler:^(NSError *error, BOOL sessionPresent) { |
|
338 |
if (error) { |
|
339 |
NSLog(@"Error Connect %@", error.localizedDescription); |
|
340 |
} else { |
|
341 |
NSLog(@"Connected sessionPresent:%d", sessionPresent); |
|
342 |
} |
|
343 |
}]; |
|
344 |
@endcode |
|
345 |
|
|
346 |
@deprecated as not all connection parameters are supported, use connect |
|
347 |
*/ |
|
348 |
|
|
349 |
- (void)connectToHost:(NSString *)host |
|
350 |
port:(UInt32)port |
|
351 |
usingSSL:(BOOL)usingSSL |
|
352 |
connectHandler:(MQTTConnectHandler)connectHandler; |
|
353 |
|
|
354 |
/** connects to the specified MQTT server |
|
355 |
|
|
356 |
@param host see connectToHost for description |
|
357 |
@param port see connectToHost for description |
|
358 |
@param usingSSL see connectToHost for description |
|
359 |
|
|
360 |
@return see connectToHost for description |
|
361 |
@deprecated as not all connection parameters are supported, use connect |
|
362 |
|
|
363 |
*/ |
|
364 |
- (void)connectToHost:(NSString *)host port:(UInt32)port usingSSL:(BOOL)usingSSL; |
|
365 |
|
|
366 |
|
|
367 |
/** for mqttio-OBJC backward compatibility |
|
368 |
@param ip see connectToHost for description |
|
369 |
@param port see connectToHost for description |
|
370 |
@deprecated as not all connection parameters are supported, use connect |
|
371 |
*/ |
|
372 |
- (void)connectToHost:(NSString*)ip port:(UInt32)port; |
|
373 |
|
|
374 |
/** for mqttio-OBJC backward compatibility |
|
375 |
@param ip see connectToHost for description |
|
376 |
@param port see connectToHost for description |
|
377 |
@param connHandler event handler block |
|
378 |
@param messHandler message handler block |
|
379 |
@deprecated as not all connection parameters are supported, use connect |
|
380 |
|
|
381 |
*/ |
|
382 |
- (void)connectToHost:(NSString*)ip |
|
383 |
port:(UInt32)port |
|
384 |
withConnectionHandler:(void (^)(MQTTSessionEvent event))connHandler |
|
385 |
messageHandler:(void (^)(NSData* data, NSString* topic))messHandler; |
|
386 |
|
|
387 |
/** for mqttio-OBJC backward compatibility |
|
388 |
@param ip see connectToHost for description |
|
389 |
@param port see connectToHost for description |
|
390 |
@param usingSSL indicator to use TLS |
|
391 |
@param connHandler event handler block |
|
392 |
@param messHandler message handler block |
|
393 |
*/ |
|
394 |
- (void)connectToHost:(NSString*)ip |
|
395 |
port:(UInt32)port |
|
396 |
usingSSL:(BOOL)usingSSL |
|
397 |
withConnectionHandler:(void (^)(MQTTSessionEvent event))connHandler |
|
398 |
messageHandler:(void (^)(NSData* data, NSString* topic))messHandler; |
|
399 |
|
|
400 |
/** for mqttio-OBJC backward compatibility |
|
401 |
@param theTopic see subscribeToTopic for description |
|
402 |
*/ |
|
403 |
- (void)subscribeTopic:(NSString*)theTopic; |
|
404 |
|
|
405 |
/** for mqttio-OBJC backward compatibility |
|
406 |
@param theData see publishData for description |
|
407 |
@param theTopic see publishData for description |
|
408 |
*/ |
|
409 |
- (void)publishData:(NSData*)theData onTopic:(NSString*)theTopic; |
|
410 |
|
|
411 |
/** for mqttio-OBJC backward compatibility |
|
412 |
@param theData see publishData for description |
|
413 |
@param theTopic see publishData for description |
|
414 |
*/ |
|
415 |
- (void)publishDataAtLeastOnce:(NSData*)theData onTopic:(NSString*)theTopic; |
|
416 |
|
|
417 |
/** for mqttio-OBJC backward compatibility |
|
418 |
@param theData see publishData for description |
|
419 |
@param theTopic see publishData for description |
|
420 |
@param retainFlag see publishData for description |
|
421 |
*/ |
|
422 |
- (void)publishDataAtLeastOnce:(NSData*)theData onTopic:(NSString*)theTopic retain:(BOOL)retainFlag; |
|
423 |
|
|
424 |
/** for mqttio-OBJC backward compatibility |
|
425 |
@param theData see publishData for description |
|
426 |
@param theTopic see publishData for description |
|
427 |
*/ |
|
428 |
- (void)publishDataAtMostOnce:(NSData*)theData onTopic:(NSString*)theTopic; |
|
429 |
|
|
430 |
/** for mqttio-OBJC backward compatibility |
|
431 |
@param theData see publishData for description |
|
432 |
@param theTopic see publishData for description |
|
433 |
@param retainFlag see publishData for description |
|
434 |
*/ |
|
435 |
- (void)publishDataAtMostOnce:(NSData*)theData onTopic:(NSString*)theTopic retain:(BOOL)retainFlag; |
|
436 |
|
|
437 |
/** for mqttio-OBJC backward compatibility |
|
438 |
@param theData see publishData for description |
|
439 |
@param theTopic see publishData for description |
|
440 |
*/ |
|
441 |
- (void)publishDataExactlyOnce:(NSData*)theData onTopic:(NSString*)theTopic; |
|
442 |
|
|
443 |
/** for mqttio-OBJC backward compatibility |
|
444 |
@param theData see publishData for description |
|
445 |
@param theTopic see publishData for description |
|
446 |
@param retainFlag see publishData for description |
|
447 |
*/ |
|
448 |
- (void)publishDataExactlyOnce:(NSData*)theData onTopic:(NSString*)theTopic retain:(BOOL)retainFlag; |
|
449 |
|
|
450 |
/** for mqttio-OBJC backward compatibility |
|
451 |
@param payload JSON payload is converted to NSData and then send. See publishData for description |
|
452 |
@param theTopic see publishData for description |
|
453 |
*/ |
|
454 |
- (void)publishJson:(id)payload onTopic:(NSString*)theTopic; |
|
455 |
|
|
456 |
@end |