react-native-gizwits-sdk-v5 1.3.2 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +4 -4
- package/android/src/main/java/com/gizwits/reactnativegizwitssdkv5/RNGizSDKManagerModule.kt +18 -1
- package/android/src/main/java/com/gizwits/reactnativegizwitssdkv5/RNGizUserManagerModule.kt +5 -6
- package/package.json +1 -1
- package/react-native-gizwits-sdk-v5.podspec +3 -1
- package/ios/GizwitsiOSSDK.framework/GizwitsiOSSDK +0 -0
- package/ios/GizwitsiOSSDK.framework/Headers/CocoaAsyncSocket.h +0 -18
- package/ios/GizwitsiOSSDK.framework/Headers/DDASLLogger.h +0 -41
- package/ios/GizwitsiOSSDK.framework/Headers/DDAbstractDatabaseLogger.h +0 -102
- package/ios/GizwitsiOSSDK.framework/Headers/DDContextFilterLogFormatter.h +0 -63
- package/ios/GizwitsiOSSDK.framework/Headers/DDDispatchQueueLogFormatter.h +0 -128
- package/ios/GizwitsiOSSDK.framework/Headers/DDFileLogger.h +0 -340
- package/ios/GizwitsiOSSDK.framework/Headers/DDLog+LOGV.h +0 -99
- package/ios/GizwitsiOSSDK.framework/Headers/DDLog.h +0 -632
- package/ios/GizwitsiOSSDK.framework/Headers/DDMultiFormatter.h +0 -30
- package/ios/GizwitsiOSSDK.framework/Headers/DDTTYLogger.h +0 -171
- package/ios/GizwitsiOSSDK.framework/Headers/ForegroundReconnection.h +0 -23
- package/ios/GizwitsiOSSDK.framework/Headers/GCDTimer.h +0 -19
- package/ios/GizwitsiOSSDK.framework/Headers/GizwitsiOSSDK-Swift.h +0 -313
- package/ios/GizwitsiOSSDK.framework/Headers/GizwitsiOSSDK.h +0 -21
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTClient.h +0 -39
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTInMemoryPersistence.h +0 -16
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTSSLSecurityPolicyDecoder.h +0 -19
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTSSLSecurityPolicyEncoder.h +0 -18
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTSessionLegacy.h +0 -112
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTSessionSynchron.h +0 -194
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTStrict.h +0 -33
- package/ios/GizwitsiOSSDK.framework/Headers/MQTTUntil.h +0 -14
- package/ios/GizwitsiOSSDK.framework/Headers/ReconnectTimer.h +0 -21
- package/ios/GizwitsiOSSDK.framework/Headers/_GCDAsyncSocket.h +0 -1226
- package/ios/GizwitsiOSSDK.framework/Headers/_GCDAsyncUdpSocket.h +0 -1036
- package/ios/GizwitsiOSSDK.framework/Headers/_GizwitsParser.h +0 -61
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCFSocketDecoder.h +0 -39
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCFSocketEncoder.h +0 -38
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCFSocketTransport.h +0 -79
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTCoreDataPersistence.h +0 -21
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTDecoder.h +0 -66
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTLog.h +0 -123
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTMessage.h +0 -233
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTPersistence.h +0 -124
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTProperties.h +0 -76
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSSLSecurityPolicy.h +0 -158
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSSLSecurityPolicyTransport.h +0 -30
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSession.h +0 -886
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTSessionManager.h +0 -237
- package/ios/GizwitsiOSSDK.framework/Headers/_MQTTTransport.h +0 -114
- package/ios/GizwitsiOSSDK.framework/Headers/common.h +0 -104
- package/ios/GizwitsiOSSDK.framework/Info.plist +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.abi.json +0 -9
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftmodule +0 -0
- package/ios/GizwitsiOSSDK.framework/Modules/module.modulemap +0 -11
|
@@ -1,237 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// MQTTSessionManager.h
|
|
3
|
-
// MQTTClient
|
|
4
|
-
//
|
|
5
|
-
// Created by Christoph Krey on 09.07.14.
|
|
6
|
-
// Copyright © 2013-2017 Christoph Krey. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
#if TARGET_OS_IPHONE == 1
|
|
11
|
-
#import <UIKit/UIKit.h>
|
|
12
|
-
#endif
|
|
13
|
-
#import "_MQTTSession.h"
|
|
14
|
-
#import "MQTTSessionLegacy.h"
|
|
15
|
-
#import "_MQTTSSLSecurityPolicy.h"
|
|
16
|
-
|
|
17
|
-
@class _MQTTSessionManager;
|
|
18
|
-
|
|
19
|
-
/** delegate gives your application access to received messages
|
|
20
|
-
*/
|
|
21
|
-
@protocol _MQTTSessionManagerDelegate <NSObject>
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
Enumeration of MQTTSessionManagerState values
|
|
25
|
-
*/
|
|
26
|
-
typedef NS_ENUM(int, _MQTTSessionManagerState) {
|
|
27
|
-
MQTTSessionManagerStateStarting,
|
|
28
|
-
MQTTSessionManagerStateConnecting,
|
|
29
|
-
MQTTSessionManagerStateError,
|
|
30
|
-
MQTTSessionManagerStateConnected,
|
|
31
|
-
MQTTSessionManagerStateClosing,
|
|
32
|
-
MQTTSessionManagerStateClosed
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
@optional
|
|
36
|
-
|
|
37
|
-
/** gets called when a new message was received
|
|
38
|
-
|
|
39
|
-
@param data the data received, might be zero length
|
|
40
|
-
@param topic the topic the data was published to
|
|
41
|
-
@param retained indicates if the data retransmitted from server storage
|
|
42
|
-
*/
|
|
43
|
-
- (void)handleMessage:(NSData *)data onTopic:(NSString *)topic retained:(BOOL)retained;
|
|
44
|
-
|
|
45
|
-
/** gets called when a new message was received
|
|
46
|
-
@param sessionManager the instance of MQTTSessionManager whose state changed
|
|
47
|
-
@param data the data received, might be zero length
|
|
48
|
-
@param topic the topic the data was published to
|
|
49
|
-
@param retained indicates if the data retransmitted from server storage
|
|
50
|
-
*/
|
|
51
|
-
- (void)sessionManager:(_MQTTSessionManager *)sessionManager
|
|
52
|
-
didReceiveMessage:(NSData *)data
|
|
53
|
-
onTopic:(NSString *)topic
|
|
54
|
-
retained:(BOOL)retained;
|
|
55
|
-
|
|
56
|
-
/** gets called when a published message was actually delivered
|
|
57
|
-
@param msgID the Message Identifier of the delivered message
|
|
58
|
-
@note this method is called after a publish with qos 1 or 2 only
|
|
59
|
-
*/
|
|
60
|
-
- (void)messageDelivered:(UInt16)msgID;
|
|
61
|
-
|
|
62
|
-
/** gets called when a published message was actually delivered
|
|
63
|
-
@param sessionManager the instance of MQTTSessionManager whose state changed
|
|
64
|
-
@param msgID the Message Identifier of the delivered message
|
|
65
|
-
@note this method is called after a publish with qos 1 or 2 only
|
|
66
|
-
*/
|
|
67
|
-
- (void)sessionManager:(_MQTTSessionManager *)sessionManager didDeliverMessage:(UInt16)msgID;
|
|
68
|
-
|
|
69
|
-
/** gets called when the connection status changes
|
|
70
|
-
@param sessionManager the instance of MQTTSessionManager whose state changed
|
|
71
|
-
@param newState the new connection state of the sessionManager. This will be identical to `sessionManager.state`.
|
|
72
|
-
*/
|
|
73
|
-
- (void)sessionManager:(_MQTTSessionManager *)sessionManager didChangeState:(_MQTTSessionManagerState)newState;
|
|
74
|
-
|
|
75
|
-
@end
|
|
76
|
-
|
|
77
|
-
/** SessionManager handles the MQTT session for your application
|
|
78
|
-
*/
|
|
79
|
-
@interface _MQTTSessionManager : NSObject <_MQTTSessionDelegate>
|
|
80
|
-
|
|
81
|
-
/** Underlying MQTTSession currently in use.
|
|
82
|
-
*/
|
|
83
|
-
@property (strong, nonatomic, readonly) _MQTTSession *session;
|
|
84
|
-
|
|
85
|
-
/** host an NSString containing the hostName or IP address of the Server
|
|
86
|
-
*/
|
|
87
|
-
@property (readonly) NSString *host;
|
|
88
|
-
|
|
89
|
-
/** port an unsigned 32 bit integer containing the IP port number of the Server
|
|
90
|
-
*/
|
|
91
|
-
@property (readonly) UInt32 port;
|
|
92
|
-
|
|
93
|
-
/** the delegate receiving incoming messages
|
|
94
|
-
*/
|
|
95
|
-
@property (weak, nonatomic) id<_MQTTSessionManagerDelegate> delegate;
|
|
96
|
-
|
|
97
|
-
/** indicates if manager requires tear down
|
|
98
|
-
*/
|
|
99
|
-
@property (readonly) BOOL requiresTearDown;
|
|
100
|
-
|
|
101
|
-
/** subscriptions is a dictionary of NSNumber instances indicating the MQTTQoSLevel.
|
|
102
|
-
* The keys are topic filters.
|
|
103
|
-
* The SessionManager subscribes to the given subscriptions after successfull (re-)connect
|
|
104
|
-
* according to the cleansession parameter and the state of the session as indicated by the broker.
|
|
105
|
-
* Setting a new subscriptions dictionary initiates SUBSCRIBE or UNSUBSCRIBE messages by SessionManager
|
|
106
|
-
* by comparing the old and new subscriptions.
|
|
107
|
-
*/
|
|
108
|
-
@property (strong, nonatomic) NSDictionary<NSString *, NSNumber *> *subscriptions;
|
|
109
|
-
|
|
110
|
-
/** effectiveSubscriptions s a dictionary of NSNumber instances indicating the granted MQTTQoSLevel, or 0x80 for subscription failure.
|
|
111
|
-
* The keys are topic filters.
|
|
112
|
-
* effectiveSubscriptions is observable and is updated everytime subscriptions change
|
|
113
|
-
* @code
|
|
114
|
-
...
|
|
115
|
-
MQTTSessionManager *manager = [[MQTTSessionManager alloc] init];
|
|
116
|
-
manager.delegate = self;
|
|
117
|
-
|
|
118
|
-
[manager addObserver:self
|
|
119
|
-
forKeyPath:@"effectiveSubscriptions"
|
|
120
|
-
options:NSKeyValueObservingOptionInitial | NSKeyValueObservingOptionNew
|
|
121
|
-
context:nil];
|
|
122
|
-
manager.subscriptions = [@{@"#": @(0)} mutableCopy];
|
|
123
|
-
[manager connectTo: ...
|
|
124
|
-
...
|
|
125
|
-
[manager removeObserver:self forKeyPath:@"effectiveSubscriptions"];
|
|
126
|
-
...
|
|
127
|
-
|
|
128
|
-
- (void)observeValueForKeyPath:(NSString *)keyPath
|
|
129
|
-
ofObject:(id)object
|
|
130
|
-
change:(NSDictionary<NSString *,id> *)change
|
|
131
|
-
context:(void *)context {
|
|
132
|
-
if ([keyPath isEqualToString:@"effectiveSubscriptions"]) {
|
|
133
|
-
MQTTSessionManager *manager = (MQTTSessionManager *)object;
|
|
134
|
-
DDLogVerbose(@"effectiveSubscriptions changed: %@", manager.effectiveSubscriptions);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
* @endcode
|
|
138
|
-
*/
|
|
139
|
-
@property (readonly, strong, nonatomic) NSDictionary<NSString *, NSNumber *> *effectiveSubscriptions;
|
|
140
|
-
|
|
141
|
-
/** SessionManager status
|
|
142
|
-
*/
|
|
143
|
-
@property (nonatomic, readonly) _MQTTSessionManagerState state;
|
|
144
|
-
|
|
145
|
-
/** SessionManager last error code when state equals MQTTSessionManagerStateError
|
|
146
|
-
*/
|
|
147
|
-
@property (nonatomic, readonly) NSError *lastErrorCode;
|
|
148
|
-
|
|
149
|
-
/** initWithPersistence sets the MQTTPersistence properties other than default
|
|
150
|
-
* @param persistent YES or NO (default) to establish file or in memory persistence.
|
|
151
|
-
* @param maxWindowSize (a positive number, default is 16) to control the number of messages sent before waiting for acknowledgement in Qos 1 or 2. Additional messages are stored and transmitted later.
|
|
152
|
-
* @param maxSize (a positive number of bytes, default is 64 MB) to limit the size of the persistence file. Messages published after the limit is reached are dropped.
|
|
153
|
-
* @param maxMessages (a positive number, default is 1024) to limit the number of messages stored. Additional messages published are dropped.
|
|
154
|
-
* @param maxRetryInterval The duration at which the connection-retry timer should be capped. When MQTTSessionManager receives a ClosedByBroker or an Error
|
|
155
|
-
event, it will attempt to reconnect to the broker. The time in between connection attempts is doubled each time, until it remains at maxRetryInterval.
|
|
156
|
-
Defaults to 64 seconds.
|
|
157
|
-
* @param connectInForeground Whether or not to connect the MQTTSession when the app enters the foreground, and disconnect when it becomes inactive. When NO, the caller is responsible for calling -connectTo: and -disconnect. Defaults to YES.
|
|
158
|
-
* @param streamSSLLevel an NSString containing the security level for read and write streams
|
|
159
|
-
* For list of possible values see:
|
|
160
|
-
* https://developer.apple.com/documentation/corefoundation/cfstream/cfstream_socket_security_level_constants
|
|
161
|
-
* Please also note that kCFStreamSocketSecurityLevelTLSv1_2 is not in a list
|
|
162
|
-
* and cannot be used as constant, but you can use it as a string value
|
|
163
|
-
* defaults to kCFStreamSocketSecurityLevelNegotiatedSSL
|
|
164
|
-
* @param queue Queue for MQTTSession.
|
|
165
|
-
* @return the initialized MQTTSessionManager object
|
|
166
|
-
*/
|
|
167
|
-
|
|
168
|
-
- (_MQTTSessionManager *)initWithPersistence:(BOOL)persistent
|
|
169
|
-
maxWindowSize:(NSUInteger)maxWindowSize
|
|
170
|
-
maxMessages:(NSUInteger)maxMessages
|
|
171
|
-
maxSize:(NSUInteger)maxSize
|
|
172
|
-
maxConnectionRetryInterval:(NSTimeInterval)maxRetryInterval
|
|
173
|
-
connectInForeground:(BOOL)connectInForeground
|
|
174
|
-
streamSSLLevel:(NSString *)streamSSLLevel
|
|
175
|
-
queue:(dispatch_queue_t)queue NS_DESIGNATED_INITIALIZER;
|
|
176
|
-
|
|
177
|
-
/** Connects to the MQTT broker and stores the parameters for subsequent reconnects
|
|
178
|
-
* @param host specifies the hostname or ip address to connect to. Defaults to @"localhost".
|
|
179
|
-
* @param port specifies the port to connect to
|
|
180
|
-
* @param tls specifies whether to use SSL or not
|
|
181
|
-
* @param keepalive 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.
|
|
182
|
-
* @param clean specifies if the server should discard previous session information.
|
|
183
|
-
* @param auth specifies the user and pass parameters should be used for authenthication
|
|
184
|
-
* @param user an NSString object containing the user's name (or ID) for authentication. May be nil.
|
|
185
|
-
* @param pass an NSString object containing the user's password. If userName is nil, password must be nil as well.
|
|
186
|
-
* @param will indicates whether a will shall be sent
|
|
187
|
-
* @param willTopic the Will Topic is a string, may be nil
|
|
188
|
-
* @param willMsg the Will Message, might be zero length or nil
|
|
189
|
-
* @param willQos specifies the QoS level to be used when publishing the Will Message.
|
|
190
|
-
* @param willRetainFlag indicates if the server should publish the Will Messages with retainFlag.
|
|
191
|
-
* @param clientId The Client Identifier identifies the Client to the Server. If nil, a random clientId is generated.
|
|
192
|
-
* @param securityPolicy A custom SSL security policy or nil.
|
|
193
|
-
* @param certificates An NSArray of the pinned certificates to use or nil.
|
|
194
|
-
* @param protocolLevel Protocol version of the connection.
|
|
195
|
-
* @param connectHandler Called when first connected or if error occurred. It is not called on subsequent internal reconnects.
|
|
196
|
-
*/
|
|
197
|
-
|
|
198
|
-
- (void)connectTo:(NSString *)host
|
|
199
|
-
port:(NSInteger)port
|
|
200
|
-
tls:(BOOL)tls
|
|
201
|
-
keepalive:(NSInteger)keepalive
|
|
202
|
-
clean:(BOOL)clean
|
|
203
|
-
auth:(BOOL)auth
|
|
204
|
-
user:(NSString *)user
|
|
205
|
-
pass:(NSString *)pass
|
|
206
|
-
will:(BOOL)will
|
|
207
|
-
willTopic:(NSString *)willTopic
|
|
208
|
-
willMsg:(NSData *)willMsg
|
|
209
|
-
willQos:(_MQTTQosLevel)willQos
|
|
210
|
-
willRetainFlag:(BOOL)willRetainFlag
|
|
211
|
-
withClientId:(NSString *)clientId
|
|
212
|
-
securityPolicy:(_MQTTSSLSecurityPolicy *)securityPolicy
|
|
213
|
-
certificates:(NSArray *)certificates
|
|
214
|
-
protocolLevel:(_MQTTProtocolVersion)protocolLevel
|
|
215
|
-
connectHandler:(_MQTTConnectHandler)connectHandler;
|
|
216
|
-
|
|
217
|
-
/** Re-Connects to the MQTT broker using the parameters for given in the connectTo method
|
|
218
|
-
*/
|
|
219
|
-
- (void)connectToLast:(_MQTTConnectHandler)connectHandler;
|
|
220
|
-
|
|
221
|
-
/** publishes data on a given topic at a specified QoS level and retain flag
|
|
222
|
-
|
|
223
|
-
@param data the data to be sent. length may range from 0 to 268,435,455 - 4 - _lengthof-topic_ bytes. Defaults to length 0.
|
|
224
|
-
@param topic the Topic to identify the data
|
|
225
|
-
@param retainFlag if YES, data is stored on the MQTT broker until overwritten by the next publish with retainFlag = YES
|
|
226
|
-
@param qos specifies the Quality of Service for the publish
|
|
227
|
-
qos can be 0, 1, or 2.
|
|
228
|
-
@return the Message Identifier of the PUBLISH message. Zero if qos 0. If qos 1 or 2, zero if message was dropped
|
|
229
|
-
@note returns immediately.
|
|
230
|
-
*/
|
|
231
|
-
- (UInt16)sendData:(NSData *)data topic:(NSString *)topic qos:(_MQTTQosLevel)qos retain:(BOOL)retainFlag;
|
|
232
|
-
|
|
233
|
-
/** Disconnects gracefully from the MQTT broker
|
|
234
|
-
*/
|
|
235
|
-
- (void)disconnectWithDisconnectHandler:(_MQTTDisconnectHandler)disconnectHandler;
|
|
236
|
-
|
|
237
|
-
@end
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// MQTTTransport.h
|
|
3
|
-
// MQTTClient
|
|
4
|
-
//
|
|
5
|
-
// Created by Christoph Krey on 06.12.15.
|
|
6
|
-
// Copyright © 2015-2017 Christoph Krey. All rights reserved.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
#import <Foundation/Foundation.h>
|
|
10
|
-
|
|
11
|
-
@protocol _MQTTTransportDelegate;
|
|
12
|
-
|
|
13
|
-
/** MQTTTransport is a protocol abstracting the underlying transport level for MQTTClient
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
16
|
-
@protocol _MQTTTransport <NSObject>
|
|
17
|
-
|
|
18
|
-
/** MQTTTransport state defines the possible state of an abstract transport
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
21
|
-
typedef NS_ENUM(NSInteger, _MQTTTransportState) {
|
|
22
|
-
|
|
23
|
-
/** MQTTTransportCreated indicates an initialized transport */
|
|
24
|
-
MQTTTransportCreated = 0,
|
|
25
|
-
|
|
26
|
-
/** MQTTTransportOpening indicates a transport in the process of opening a connection */
|
|
27
|
-
MQTTTransportOpening,
|
|
28
|
-
|
|
29
|
-
/** MQTTTransportCreated indicates a transport opened ready for communication */
|
|
30
|
-
MQTTTransportOpen,
|
|
31
|
-
|
|
32
|
-
/** MQTTTransportCreated indicates a transport in the process of closing */
|
|
33
|
-
MQTTTransportClosing,
|
|
34
|
-
|
|
35
|
-
/** MQTTTransportCreated indicates a closed transport */
|
|
36
|
-
MQTTTransportClosed
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
/** queue The queue where the streams are scheduled. */
|
|
40
|
-
@property (strong, nonatomic, nonnull) dispatch_queue_t queue;
|
|
41
|
-
|
|
42
|
-
/** streamSSLLevel an NSString containing the security level for read and write streams
|
|
43
|
-
* For list of possible values see:
|
|
44
|
-
* https://developer.apple.com/documentation/corefoundation/cfstream/cfstream_socket_security_level_constants
|
|
45
|
-
* Please also note that kCFStreamSocketSecurityLevelTLSv1_2 is not in a list
|
|
46
|
-
* and cannot be used as constant, but you can use it as a string value
|
|
47
|
-
* defaults to kCFStreamSocketSecurityLevelNegotiatedSSL
|
|
48
|
-
*/
|
|
49
|
-
@property (strong, nonatomic, nonnull) NSString *streamSSLLevel;
|
|
50
|
-
|
|
51
|
-
/** host an NSString containing the hostName or IP address of the host to connect to */
|
|
52
|
-
@property (strong, nonatomic, nonnull) NSString *host;
|
|
53
|
-
|
|
54
|
-
/** port an unsigned 32 bit integer containing the IP port number to connect to */
|
|
55
|
-
@property (nonatomic) UInt32 port;
|
|
56
|
-
|
|
57
|
-
/** MQTTTransportDelegate needs to be set to a class implementing th MQTTTransportDelegate protocol
|
|
58
|
-
* to receive delegate messages.
|
|
59
|
-
*/
|
|
60
|
-
@property (weak, nonatomic) _Nullable id<_MQTTTransportDelegate> delegate;
|
|
61
|
-
|
|
62
|
-
/** state contains the current MQTTTransportState of the transport */
|
|
63
|
-
@property (nonatomic) _MQTTTransportState state;
|
|
64
|
-
|
|
65
|
-
/** open opens the transport and prepares it for communication
|
|
66
|
-
* actual transports may require additional parameters to be set before opening
|
|
67
|
-
*/
|
|
68
|
-
- (void)open;
|
|
69
|
-
|
|
70
|
-
/** send transmits a data message
|
|
71
|
-
* @param data data to be send, might be zero length
|
|
72
|
-
* @result a boolean indicating if the data could be send or not
|
|
73
|
-
*/
|
|
74
|
-
- (BOOL)send:(nonnull NSData *)data;
|
|
75
|
-
|
|
76
|
-
/** close closes the transport */
|
|
77
|
-
- (void)close;
|
|
78
|
-
|
|
79
|
-
@end
|
|
80
|
-
|
|
81
|
-
/** MQTTTransportDelegate protocol
|
|
82
|
-
* Note: the implementation of the didReceiveMessage method is mandatory, the others are optional
|
|
83
|
-
*/
|
|
84
|
-
@protocol _MQTTTransportDelegate <NSObject>
|
|
85
|
-
|
|
86
|
-
/** didReceiveMessage gets called when a message was received
|
|
87
|
-
* @param mqttTransport the transport on which the message was received
|
|
88
|
-
* @param message the data received which may be zero length
|
|
89
|
-
*/
|
|
90
|
-
- (void)mqttTransport:(nonnull id<_MQTTTransport>)mqttTransport didReceiveMessage:(nonnull NSData *)message;
|
|
91
|
-
|
|
92
|
-
@optional
|
|
93
|
-
|
|
94
|
-
/** mqttTransportDidOpen gets called when a transport is successfully opened
|
|
95
|
-
* @param mqttTransport the transport which was successfully opened
|
|
96
|
-
*/
|
|
97
|
-
- (void)mqttTransportDidOpen:(_Nonnull id<_MQTTTransport>)mqttTransport;
|
|
98
|
-
|
|
99
|
-
/** didFailWithError gets called when an error was detected on the transport
|
|
100
|
-
* @param mqttTransport the transport which detected the error
|
|
101
|
-
* @param error available error information, might be nil
|
|
102
|
-
*/
|
|
103
|
-
- (void)mqttTransport:(_Nonnull id<_MQTTTransport>)mqttTransport didFailWithError:(nullable NSError *)error;
|
|
104
|
-
|
|
105
|
-
/** mqttTransportDidClose gets called when the transport closed
|
|
106
|
-
* @param mqttTransport the transport which was closed
|
|
107
|
-
*/
|
|
108
|
-
- (void)mqttTransportDidClose:(_Nonnull id<_MQTTTransport>)mqttTransport;
|
|
109
|
-
|
|
110
|
-
@end
|
|
111
|
-
|
|
112
|
-
@interface _MQTTTransport : NSObject <_MQTTTransport>
|
|
113
|
-
@end
|
|
114
|
-
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// const.h
|
|
3
|
-
// Protocol
|
|
4
|
-
//
|
|
5
|
-
// Created by danlypro on 2022/4/19.
|
|
6
|
-
//
|
|
7
|
-
|
|
8
|
-
#ifndef common_h
|
|
9
|
-
#define common_h
|
|
10
|
-
|
|
11
|
-
//************************命令字************************
|
|
12
|
-
#define _GizWifiSDKCMD_SOFTAP_CONFIG_REQ (0x0001)
|
|
13
|
-
#define _GizWifiSDKCMD_SOFTAP_CONFIG_RESP (0x0002)
|
|
14
|
-
#define _GizWifiSDKCMD_DISCOVER_DEVICE_REQ (0x0003)
|
|
15
|
-
#define _GizWifiSDKCMD_DISCOVER_DEVICE_RESP (0x0004)
|
|
16
|
-
#define _GizWifiSDKCMD_ONLINE_NOTIFY (0x0005)
|
|
17
|
-
#define _GizWifiSDKCMD_BIND_DEVICE_REQ (0x0006)
|
|
18
|
-
#define _GizWifiSDKCMD_BIND_DEVICE_RESP (0x0007)
|
|
19
|
-
#define _GizWifiSDKCMD_LOGIN_DEVICE_REQ (0x0008)
|
|
20
|
-
#define _GizWifiSDKCMD_LOGIN_DEVICE_RESP (0x0009)
|
|
21
|
-
#define _GizWifiSDKCMD_READ_DEVICE_INFO_REQ (0x0013)
|
|
22
|
-
#define _GizWifiSDKCMD_READ_DEVICE_INFO_RESP (0x0014)
|
|
23
|
-
#define _GizWifiSDKCMD_DEVICE_KEEPALIVE_REQ (0x0015)
|
|
24
|
-
#define _GizWifiSDKCMD_DEVICE_KEEPALIVE_RESP (0x0016)
|
|
25
|
-
#define _GizWifiSDKCMD_EXIT_PRODUCT_TEST_MODE_REQ (0x0017)
|
|
26
|
-
#define _GizWifiSDKCMD_EXIT_PRODUCT_TEST_MODE_RESP (0x0018)
|
|
27
|
-
#define _GizWifiSDKCMD_CONFIG_NOTIFY (0x0019)
|
|
28
|
-
#define _GizWifiSDKCMD_GET_DEVICE_UPDATE_STATUS_REQ (0x001E)
|
|
29
|
-
#define _GizWifiSDKCMD_GET_DEVICE_UPDATE_STATUS_RESP (0x001F)
|
|
30
|
-
#define _GizWifiSDKCMD_UPDATE_DEVICE_REQ (0x0020)
|
|
31
|
-
#define _GizWifiSDKCMD_UPDATE_DEVICE_RESP (0x0021)
|
|
32
|
-
|
|
33
|
-
#define _GizWifiSDKCMD_TRANS_DEVICE_LOG (0x0012)
|
|
34
|
-
#define _GizWifiSDKCMD_TRANS_BUSINESS (0x0090)
|
|
35
|
-
#define _GizWifiSDKCMD_RECV_BUSINESS (0x0091)
|
|
36
|
-
#define _GizWifiSDKCMD_ONLINE_STATUS_CHANGED (0x0092)
|
|
37
|
-
#define _GizWifiSDKCMD_TRANS_BUSINESS_REQ (0x0093)
|
|
38
|
-
#define _GizWifiSDKCMD_TRANS_BUSINESS_RESP (0x0094)
|
|
39
|
-
#define _GizWifiSDKCMD_BIND_STATUS_CHANGED (0x010D)
|
|
40
|
-
#define _GizWifiSDKCMD_LOG_ENABLED_STATUS_CHANGED (0x0111)
|
|
41
|
-
|
|
42
|
-
#define _GizWifi_PROTOCOL_VERSION (0x00000003)
|
|
43
|
-
#define _GizWifi_ENCRYPT_PROTOCOL_VERSION (0x00000004)
|
|
44
|
-
|
|
45
|
-
//************************常用宏************************
|
|
46
|
-
#define _SSID_BUF_LENGHT (32)
|
|
47
|
-
#define _MD5_BUF_LENGTH (32)
|
|
48
|
-
#define _MAC_BUF_LENGTH (32)
|
|
49
|
-
#define _DID_BUF_LENGTH (22)
|
|
50
|
-
#define _PASSCODE_BUF_LENGTH (32)
|
|
51
|
-
#define _PRODUCTKEY_BUF_LENGTH (32)
|
|
52
|
-
#define _BT_MESHID_BUF_LENGTH (256)
|
|
53
|
-
#define _DOMAIN_BUF_LENGTH (128)
|
|
54
|
-
#define _HARDWARE_VERSION_LENGTH (8)
|
|
55
|
-
#define _SOFTWARE_VERSION_LENGTH (8)
|
|
56
|
-
#define _MCU_HARDWARE_VERSION_LENGTH (8)
|
|
57
|
-
#define _MCU_SOFTWARE_VERSION_LENGTH (8)
|
|
58
|
-
#define _WIFI_FIRMWARE_VERSION_LENGTH (36)
|
|
59
|
-
#define _WIFI_FIRMWARE_ID_LENGTH (8)
|
|
60
|
-
#define _PROTOCOL_VERSION_LENGTH (16)
|
|
61
|
-
#define _BUSINESS_PROTOCOL_VERSION_LENGTH (8)
|
|
62
|
-
|
|
63
|
-
#define _DEVICE_SUPPORT_OTA_PROTOCOL_MIN_VERSION "4.1.2"
|
|
64
|
-
|
|
65
|
-
#define _DATAPOINT_TYPE_WRITABLE "status_writable" //可读写
|
|
66
|
-
#define _DATAPOINT_TYPE_READONLY "status_readonly" //只读
|
|
67
|
-
#define _DATAPOINT_TYPE_ALERT "alert" //报警
|
|
68
|
-
#define _DATAPOINT_TYPE_FAULT "fault" //故障
|
|
69
|
-
|
|
70
|
-
#define _DATAPOINT_DATATYPE_BOOL "bool" //布尔型
|
|
71
|
-
#define _DATAPOINT_DATATYPE_ENUM "enum" //枚举型
|
|
72
|
-
#define _DATAPOINT_DATATYPE_UINT8 "uint8" //8 bits 整型
|
|
73
|
-
#define _DATAPOINT_DATATYPE_UINT16 "uint16" //16 bits 整型
|
|
74
|
-
#define _DATAPOINT_DATATYPE_UINT32 "uint32" //32 bits 整型
|
|
75
|
-
#define _DATAPOINT_DATATYPE_BINARY "binary" //二进制数据
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
//************************错误码************************
|
|
79
|
-
#define _GIZ_SDK_SUCCESS (0) //操作成功
|
|
80
|
-
#define _GIZ_SDK_PARAM_INVALID (5001) //参数错误
|
|
81
|
-
#define _GIZ_SDK_PARAM_FORM_INVALID (5002) //json格式错误
|
|
82
|
-
#define _GIZ_SDK_MEMORY_MALLOC_FAILED (5003) //内存分配失败
|
|
83
|
-
#define _GIZ_SDK_BASE64_ENCODE_FAILED (5004) //base64编码错误
|
|
84
|
-
#define _GIZ_SDK_DATA_PARSE_FAILED (5005) //数据包解析失败
|
|
85
|
-
#define _GIZ_SDK_CMD_NOT_EXIST (5006) //命令字不存在
|
|
86
|
-
#define _GIZ_SDK_JSON_OBJECT_CREATE_FAILED (5007) //Json对象创建失败
|
|
87
|
-
#define _GIZ_SDK_DEVICE_PASSCODE_INVALID (5008) //设备PASSCODE无效
|
|
88
|
-
#define _GIZ_SDK_JSON_PARSE_FAILED (5009) //Json解析失败
|
|
89
|
-
#define _GIZ_SDK_OPEN_PRODUCT_FILE_FAILED (5010) //打开产品配置文件失败
|
|
90
|
-
#define _GIZ_SDK_READ_PRODUCT_FILE_FAILED (5011) //读产品配置文件失败
|
|
91
|
-
#define _GIZ_SITE_DATAPOINTS_NOT_DEFINED (5012) //数据点未定义
|
|
92
|
-
#define _GIZ_SITE_DATAPOINTS_NOT_MALFORME (5013) //数据点异常
|
|
93
|
-
#define _GIZ_SDK_DEVICE_CONTROL_WITH_INVALID_COMMAND (5014) //设备控制指令中包含无效指令
|
|
94
|
-
#define _GIZ_SDK_DEVICE_CONTROL_NOT_WRITABLE_COMMAND (5015) //设备控制指令中包含不可写指令
|
|
95
|
-
#define _GIZ_SDK_DEVICE_CONTROL_VALUE_OUT_OF_RANGE (5016) //设备控制指令参数值不在有效范围内
|
|
96
|
-
#define _GIZ_SDK_DEVICE_CONTROL_VALUE_TYPE_ERROR (5017) //设备控制指令参数类型错误
|
|
97
|
-
#define _GIZ_SDK__DATAPOINT_PARSE_FAILED (5018) //配置文件解析失败
|
|
98
|
-
#define _GIZ_SDK__DATAPOINT_FILE_IS_EMPTY (5019) //配置文件为空
|
|
99
|
-
#define _GIZ_SDK_BASE64_DECODE_FAILED (5020) //base64解码错误
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
#endif /* common_h */
|
|
Binary file
|
|
Binary file
|
package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftdoc
DELETED
|
Binary file
|
package/ios/GizwitsiOSSDK.framework/Modules/GizwitsiOSSDK.swiftmodule/arm64-apple-ios.swiftmodule
DELETED
|
Binary file
|