forked from novastone-media/MQTT-Client-Framework
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
122 lines (120 loc) · 7.73 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MQTTClient: MQTT-Client-Framework</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">MQTTClient
</div>
<div id="projectbrief">an Objective-C Framework for MQTT</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">MQTT-Client-Framework </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>an Objective-C native MQTT Framework <a href="http://mqtt.org">http://mqtt.org</a></p>
<h3>Tested with a long list of brokers</h3>
<ul>
<li>mosquitto</li>
<li>paho</li>
<li>rabbitmq</li>
<li>hivemq</li>
<li>rsmb</li>
<li>mosca</li>
<li>vernemq</li>
<li>emqtt</li>
<li>moquette</li>
<li>ActiveMQ</li>
<li>Apollo</li>
<li>CloudMQTT</li>
<li>aws</li>
<li>hbmqtt (MQTTv311 only, limitations)</li>
<li><a href="https://github.com/mcollina/aedes">aedes</a></li>
</ul>
<h3>As a CocoaPod</h3>
<p>Use the CocoaPod MQTTClient!</p>
<p>Add this to your Podfile:</p>
<div class="fragment"><div class="line">pod 'MQTTClient'</div></div><!-- fragment --><p> which is a short for </p><div class="fragment"><div class="line">pod 'MQTTClient/Min'</div><div class="line">pod 'MQTTClient/Manager'</div></div><!-- fragment --><p>The Manager subspec includes the <a class="el" href="interface_m_q_t_t_session_manager.html">MQTTSessionManager</a> class.</p>
<p>Additionally add this subspec if you want to use MQTT over Websockets:</p>
<div class="fragment"><div class="line">pod 'MQTTClient/Websocket'</div></div><!-- fragment --><p>If you want to do your logging with CocoaLumberjack (my suggestion), use </p><div class="fragment"><div class="line">pod 'MQTTClient/MinL'</div><div class="line">pod 'MQTTClient/ManagerL'</div><div class="line">pod 'MQTTClient/WebsocketL'</div></div><!-- fragment --><p> instead.</p>
<h3>As a dynamic library</h3>
<p>Or use the dynamic library created in the MQTTFramework target.</p>
<h3>As source</h3>
<p>Or include the source from here.</p>
<h3>With Carthage</h3>
<p><a href="https://github.com/Carthage/Carthage">Carthage</a></p>
<h3>Usage</h3>
<p>Create a new client and connect to a broker:</p>
<div class="fragment"><div class="line">#import "MQTTClient.h"</div><div class="line"></div><div class="line">\@interface MyDelegate : ... <MQTTSessionDelegate></div><div class="line">...</div><div class="line"></div><div class="line"> MQTTCFSocketTransport *transport = [[MQTTCFSocketTransport alloc] init];</div><div class="line"> transport.host = @"localhost";</div><div class="line"> transport.port = 1883;</div><div class="line"></div><div class="line"> MQTTSession *session = [[MQTTSession alloc] init];</div><div class="line"> session.transport = transport;</div><div class="line"></div><div class="line"> session.delegate = self;</div><div class="line"></div><div class="line"> [session connectAndWaitTimeout:30]; //this is part of the synchronous API</div></div><!-- fragment --><p>Subscribe to a topic:</p>
<div class="fragment"><div class="line">[session subscribeToTopic:@"example/#" atLevel:2 subscribeHandler:^(NSError *error, NSArray<NSNumber *> *gQoss){</div><div class="line"> if (error) {</div><div class="line"> NSLog(@"Subscription failed %@", error.localizedDescription);</div><div class="line"> } else {</div><div class="line"> NSLog(@"Subscription sucessfull! Granted Qos: %@", gQoss);</div><div class="line"> }</div><div class="line"> }]; // this is part of the block API</div></div><!-- fragment --><p>Add the following to receive messages for the subscribed topics </p><div class="fragment"><div class="line"> - (void)newMessage:(MQTTSession *)session</div><div class="line"> data:(NSData *)data</div><div class="line"> onTopic:(NSString *)topic</div><div class="line"> qos:(MQTTQosLevel)qos</div><div class="line"> retained:(BOOL)retained</div><div class="line"> mid:(unsigned int)mid {</div><div class="line"> // this is one of the delegate callbacks</div><div class="line">}</div></div><!-- fragment --><p>Publish a message to a topic:</p>
<div class="fragment"><div class="line">[session publishAndWaitData:data</div><div class="line"> onTopic:@"topic"</div><div class="line"> retain:NO</div><div class="line"> qos:MQTTQosLevelAtLeastOnce]; // this is part of the asynchronous API</div></div><!-- fragment --><h3>docs</h3>
<p>Documentation generated with doxygen <a href="http://doxygen.org">http://doxygen.org</a> in the <code>./MQTTClient/dist/documentation</code> subdirectory.</p>
<p>You may open the HTML version of the documentation here `./MQTTClient/dist/documentation/html/index.html'</p>
<p>Run <code>make install</code> in the <code>./MQTTClient/dist/documentation/html</code> subdirectory to install the the documentation as a DOCSET on your Mac.</p>
<h3>Comparison MQTT Clients for iOS (incomplete)</h3>
<table class="doxtable">
<tr>
<th>Wrapper</th><th>—</th><th>-—</th><th>MQTTKit </th><th>Marquette</th><th>Moscapsule</th><th>Musqueteer</th><th>MQTT-Client</th><th>MqttSDK</th><th>CocoaMQTT </th></tr>
<tr>
<td></td><td></td><td></td><td>Obj-C </td><td>Obj-C </td><td>Swift </td><td>Obj-C </td><td>Obj-C </td><td>Obj-C </td><td>Swift </td></tr>
<tr>
<td>Library</td><td>IBM</td><td>Paho</td><td>Mosquitto</td><td>Mosquitto</td><td>Mosquitto </td><td>Mosquitto </td><td>native </td><td>native </td><td>native </td></tr>
</table>
</div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Wed Jul 26 2017 14:33:15 for MQTTClient by  <a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>