@quec/rn-device-module 1.9.13 → 2.16.1
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/.vscode/settings.json +3 -0
- package/QuecRNDeviceModule.podspec +54 -0
- package/README.md +1535 -1043
- package/android/build.gradle +119 -0
- package/android/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/android/gradle.properties +23 -0
- package/android/gradlew +185 -0
- package/android/gradlew.bat +89 -0
- package/android/old-info.properties +2 -0
- package/android/proguard-rules.pro +21 -0
- package/android/publishInfo.properties +4 -0
- package/android/settings.gradle +3 -0
- package/android/src/main/AndroidManifest.xml +6 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/IQuecRNDeviceModuleSpec.java +1352 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/QuecRNDeviceModule.java +2423 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/QuecRNDeviceModulePackage.java +23 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/bean/DataInfo.java +25 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/bean/DataRes.java +31 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/bean/DeviceDpsUpdateModel.java +18 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/bean/ModelBridgeBasic.java +86 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/bean/OtaUpgradePlanModel.java +292 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/bean/ShareInfo.java +166 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/bean/UserInfo.java +137 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/bean/WriteCmdWithId.java +10 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/AnalysisChannelDataUtils.java +82 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/DataConvertUtils.kt +130 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/ErrorCode.java +26 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/ErrorUtils.java +11 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/IpcUtil.java +75 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/NetUtils.java +85 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/OnConnectListener.java +22 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/ParamsValueUtils.java +79 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/QuecIotChannelMode.java +8 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/ReactNativeJson.java +199 -0
- package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/ResponseUtils.java +156 -0
- package/android/src/main/res/values/strings.xml +4 -0
- package/android/src/main/res/values-en/strings.xml +4 -0
- package/android/src/main/res/values-zh/strings.xml +4 -0
- package/android/src/test/java/com/quectel/smart/template/ExampleUnitTest.java +17 -0
- package/build.gradle +1 -0
- package/gradle/wrapper/gradle-wrapper.jar +0 -0
- package/gradle/wrapper/gradle-wrapper.properties +6 -0
- package/ios/Example/Podfile +17 -0
- package/ios/Example/QuecRNDeviceModule/AppDelegate.h +13 -0
- package/ios/Example/QuecRNDeviceModule/AppDelegate.m +46 -0
- package/ios/Example/QuecRNDeviceModule/Base.lproj/LaunchScreen.storyboard +31 -0
- package/ios/Example/QuecRNDeviceModule/Base.lproj/Main.storyboard +31 -0
- package/ios/Example/QuecRNDeviceModule/Images.xcassets/AppIcon.appiconset/Contents.json +98 -0
- package/ios/Example/QuecRNDeviceModule/QuecRNDeviceModule-Info.plist +40 -0
- package/ios/Example/QuecRNDeviceModule/QuecRNDeviceModule-Prefix.pch +16 -0
- package/ios/Example/QuecRNDeviceModule/ViewController.h +12 -0
- package/ios/Example/QuecRNDeviceModule/ViewController.m +29 -0
- package/ios/Example/QuecRNDeviceModule/en.lproj/InfoPlist.strings +2 -0
- package/ios/Example/QuecRNDeviceModule/main.m +15 -0
- package/ios/Example/QuecRNDeviceModule.xcodeproj/project.pbxproj +583 -0
- package/ios/Example/QuecRNDeviceModule.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/ios/Example/QuecRNDeviceModule.xcodeproj/xcshareddata/xcschemes/QuecRNDeviceModule-Example.xcscheme +101 -0
- package/ios/Example/QuecRNDeviceModule.xcworkspace/contents.xcworkspacedata +10 -0
- package/ios/Example/QuecRNDeviceModule.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/ios/LICENSE +4 -0
- package/ios/QuecRNDeviceModule/Assets/.gitkeep +0 -0
- package/ios/QuecRNDeviceModule/Classes/QuecRNDeviceModule+Ext.h +27 -0
- package/ios/QuecRNDeviceModule/Classes/QuecRNDeviceModule+Impl.h +1137 -0
- package/ios/QuecRNDeviceModule/Classes/QuecRNDeviceModule+Impl.m +1524 -0
- package/ios/QuecRNDeviceModule/Classes/QuecRNDeviceModule.h +157 -0
- package/ios/QuecRNDeviceModule/Classes/QuecRNDeviceModule.m +721 -0
- package/ios/README.md +20 -0
- package/{.prettierrc.js → js/.prettierrc.js} +11 -11
- package/js/README.md +1535 -0
- package/js/package.json +25 -0
- package/{src → js/src}/index.ts +12 -12
- package/{src → js/src}/module.ts +1332 -939
- package/{src → js/src}/viewCommon.ts +3 -3
- package/js/tsconfig.json +26 -0
- package/js/yarn.lock +4 -0
- package/package.json +10 -26
- package/plugin.ts +1180 -0
- package/settings.gradle +2 -0
- package/tsconfig.json +9 -0
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
package com.quectel.smart.rnplugin.quecrndevicemodule.utils;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.ReadableArray;
|
|
4
|
+
import com.facebook.react.bridge.ReadableMap;
|
|
5
|
+
import com.facebook.react.bridge.ReadableMapKeySetIterator;
|
|
6
|
+
import com.facebook.react.bridge.WritableArray;
|
|
7
|
+
import com.facebook.react.bridge.WritableMap;
|
|
8
|
+
import com.facebook.react.bridge.WritableNativeArray;
|
|
9
|
+
import com.facebook.react.bridge.WritableNativeMap;
|
|
10
|
+
|
|
11
|
+
import org.json.JSONArray;
|
|
12
|
+
import org.json.JSONException;
|
|
13
|
+
import org.json.JSONObject;
|
|
14
|
+
|
|
15
|
+
import java.util.Iterator;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* React Native json 方法类
|
|
19
|
+
*
|
|
20
|
+
* @author : king.pan
|
|
21
|
+
* @e-mail : king.pan@quectel.com
|
|
22
|
+
* @date : 2022/7/23 17:26
|
|
23
|
+
*/
|
|
24
|
+
public class ReactNativeJson {
|
|
25
|
+
/**
|
|
26
|
+
* json实体类转WritableMap
|
|
27
|
+
*
|
|
28
|
+
* @param jsonObject json实体类
|
|
29
|
+
* @return WritableMap
|
|
30
|
+
* @throws JSONException json转换异常
|
|
31
|
+
*/
|
|
32
|
+
public static WritableMap convertJsonToMap(JSONObject jsonObject) throws JSONException {
|
|
33
|
+
WritableMap map = new WritableNativeMap();
|
|
34
|
+
if(jsonObject==null)return map;
|
|
35
|
+
Iterator<String> iterator = jsonObject.keys();
|
|
36
|
+
if(iterator==null)return map;
|
|
37
|
+
while (iterator.hasNext()) {
|
|
38
|
+
String key = iterator.next();
|
|
39
|
+
Object value = null;
|
|
40
|
+
value = jsonObject.get(key);
|
|
41
|
+
if (value instanceof JSONObject) {
|
|
42
|
+
map.putMap(key, convertJsonToMap((JSONObject) value));
|
|
43
|
+
} else if (value instanceof JSONArray) {
|
|
44
|
+
map.putArray(key, convertJsonToArray((JSONArray) value));
|
|
45
|
+
} else if (value instanceof Boolean) {
|
|
46
|
+
map.putBoolean(key, (Boolean) value);
|
|
47
|
+
} else if (value instanceof Integer) {
|
|
48
|
+
map.putInt(key, (Integer) value);
|
|
49
|
+
} else if (value instanceof Long) {
|
|
50
|
+
map.putDouble(key, (Long) value);
|
|
51
|
+
} else if (value instanceof Float) {
|
|
52
|
+
map.putDouble(key, (Float) value);
|
|
53
|
+
} else if (value instanceof Double) {
|
|
54
|
+
map.putDouble(key, (Double) value);
|
|
55
|
+
} else if (value instanceof String) {
|
|
56
|
+
map.putString(key, (String) value);
|
|
57
|
+
} else if ("null".equals(value.toString())) {
|
|
58
|
+
map.putNull(key);
|
|
59
|
+
} else {
|
|
60
|
+
map.putString(key, value.toString());
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return map;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* json实体类 转 WritableArray
|
|
68
|
+
*
|
|
69
|
+
* @param jsonArray json实体类
|
|
70
|
+
* @return WritableArray
|
|
71
|
+
* @throws JSONException json转换异常
|
|
72
|
+
*/
|
|
73
|
+
public static WritableArray convertJsonToArray(JSONArray jsonArray) throws JSONException {
|
|
74
|
+
WritableArray array = new WritableNativeArray();
|
|
75
|
+
|
|
76
|
+
for (int i = 0; i < jsonArray.length(); i++) {
|
|
77
|
+
Object value = null;
|
|
78
|
+
|
|
79
|
+
value = jsonArray.get(i);
|
|
80
|
+
if (value instanceof JSONObject) {
|
|
81
|
+
array.pushMap(convertJsonToMap((JSONObject) value));
|
|
82
|
+
} else if (value instanceof JSONArray) {
|
|
83
|
+
array.pushArray(convertJsonToArray((JSONArray) value));
|
|
84
|
+
} else if (value instanceof Boolean) {
|
|
85
|
+
array.pushBoolean((Boolean) value);
|
|
86
|
+
} else if (value instanceof Integer) {
|
|
87
|
+
array.pushInt((Integer) value);
|
|
88
|
+
} else if (value instanceof Long) {
|
|
89
|
+
array.pushDouble((Long) value);
|
|
90
|
+
} else if (value instanceof Float) {
|
|
91
|
+
array.pushDouble((Float) value);
|
|
92
|
+
} else if (value instanceof Double) {
|
|
93
|
+
array.pushDouble((Double) value);
|
|
94
|
+
} else if (value instanceof String) {
|
|
95
|
+
array.pushString((String) value);
|
|
96
|
+
} else if (value == null || "null".equals(value.toString())) {
|
|
97
|
+
array.pushNull();
|
|
98
|
+
} else {
|
|
99
|
+
array.pushString(value.toString());
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
return array;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* ReadableMap 转 JSONObject
|
|
107
|
+
*
|
|
108
|
+
* @param readableMap ReadableMap
|
|
109
|
+
* @return JSONObject
|
|
110
|
+
* @throws JSONException json转换异常
|
|
111
|
+
*/
|
|
112
|
+
public static JSONObject convertMapToJson(ReadableMap readableMap) throws JSONException {
|
|
113
|
+
JSONObject object = new JSONObject();
|
|
114
|
+
ReadableMapKeySetIterator iterator = readableMap.keySetIterator();
|
|
115
|
+
while (iterator.hasNextKey()) {
|
|
116
|
+
String key = iterator.nextKey();
|
|
117
|
+
switch (readableMap.getType(key)) {
|
|
118
|
+
case Null:
|
|
119
|
+
object.put(key, JSONObject.NULL);
|
|
120
|
+
break;
|
|
121
|
+
case Boolean:
|
|
122
|
+
object.put(key, readableMap.getBoolean(key));
|
|
123
|
+
break;
|
|
124
|
+
case Number:
|
|
125
|
+
double value = readableMap.getDouble(key);
|
|
126
|
+
try {
|
|
127
|
+
if (value % 1 == 0) {
|
|
128
|
+
if (value > Integer.MAX_VALUE) {
|
|
129
|
+
object.put(key, (long) value);
|
|
130
|
+
} else {
|
|
131
|
+
object.put(key, (int) value);
|
|
132
|
+
}
|
|
133
|
+
} else {
|
|
134
|
+
object.put(key, value);
|
|
135
|
+
}
|
|
136
|
+
} catch (Exception e) {
|
|
137
|
+
object.put(key, value);
|
|
138
|
+
}
|
|
139
|
+
break;
|
|
140
|
+
case String:
|
|
141
|
+
object.put(key, readableMap.getString(key));
|
|
142
|
+
break;
|
|
143
|
+
case Map:
|
|
144
|
+
object.put(key, convertMapToJson(readableMap.getMap(key)));
|
|
145
|
+
break;
|
|
146
|
+
case Array:
|
|
147
|
+
object.put(key, convertArrayToJson(readableMap.getArray(key)));
|
|
148
|
+
break;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return object;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* ReadableArray 转 JSONObject
|
|
156
|
+
*
|
|
157
|
+
* @param readableArray ReadableArray
|
|
158
|
+
* @return JSONObject
|
|
159
|
+
* @throws JSONException json转换异常
|
|
160
|
+
*/
|
|
161
|
+
public static JSONArray convertArrayToJson(ReadableArray readableArray) throws JSONException {
|
|
162
|
+
JSONArray array = new JSONArray();
|
|
163
|
+
for (int i = 0; i < readableArray.size(); i++) {
|
|
164
|
+
switch (readableArray.getType(i)) {
|
|
165
|
+
case Null:
|
|
166
|
+
break;
|
|
167
|
+
case Boolean:
|
|
168
|
+
array.put(readableArray.getBoolean(i));
|
|
169
|
+
break;
|
|
170
|
+
case Number:
|
|
171
|
+
double value = readableArray.getDouble(i);
|
|
172
|
+
try {
|
|
173
|
+
if (value % 1 == 0) {
|
|
174
|
+
if (value > Integer.MAX_VALUE) {
|
|
175
|
+
array.put((long) value);
|
|
176
|
+
} else {
|
|
177
|
+
array.put((int) value);
|
|
178
|
+
}
|
|
179
|
+
} else {
|
|
180
|
+
array.put(value);
|
|
181
|
+
}
|
|
182
|
+
} catch (Exception e) {
|
|
183
|
+
array.put(value);
|
|
184
|
+
}
|
|
185
|
+
break;
|
|
186
|
+
case String:
|
|
187
|
+
array.put(readableArray.getString(i));
|
|
188
|
+
break;
|
|
189
|
+
case Map:
|
|
190
|
+
array.put(convertMapToJson(readableArray.getMap(i)));
|
|
191
|
+
break;
|
|
192
|
+
case Array:
|
|
193
|
+
array.put(convertArrayToJson(readableArray.getArray(i)));
|
|
194
|
+
break;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
return array;
|
|
198
|
+
}
|
|
199
|
+
}
|
package/android/src/main/java/com/quectel/smart/rnplugin/quecrndevicemodule/utils/ResponseUtils.java
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
package com.quectel.smart.rnplugin.quecrndevicemodule.utils;
|
|
2
|
+
|
|
3
|
+
import com.facebook.react.bridge.Arguments;
|
|
4
|
+
import com.facebook.react.bridge.Promise;
|
|
5
|
+
import com.facebook.react.bridge.WritableArray;
|
|
6
|
+
import com.facebook.react.bridge.WritableMap;
|
|
7
|
+
import com.quectel.basic.common.entity.QuecBaseModel;
|
|
8
|
+
import com.quectel.basic.common.entity.QuecResult;
|
|
9
|
+
import com.quectel.basic.common.utils.QuecGsonUtil;
|
|
10
|
+
import com.quectel.basic.queclog.QLog;
|
|
11
|
+
import com.quectel.sdk.mvvm.QuecBaseViewModel;
|
|
12
|
+
|
|
13
|
+
import org.json.JSONArray;
|
|
14
|
+
import org.json.JSONException;
|
|
15
|
+
import org.json.JSONObject;
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* 响应数据处理类
|
|
19
|
+
*
|
|
20
|
+
* @author : king.pan
|
|
21
|
+
* @e-mail : king.pan@quectel.com
|
|
22
|
+
* @date : 2022/7/25 09:41
|
|
23
|
+
*/
|
|
24
|
+
public class ResponseUtils {
|
|
25
|
+
private static final String TAG = "ResponseUtils";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* 处理没有data字段的返回数据
|
|
29
|
+
*
|
|
30
|
+
* @param promise 回调方法
|
|
31
|
+
* @param result json格式的返回数据
|
|
32
|
+
* @param viewModel QuecBaseViewModel
|
|
33
|
+
*/
|
|
34
|
+
public static void handlerResponseWithoutData(Promise promise, String result, QuecBaseViewModel viewModel) {
|
|
35
|
+
try {
|
|
36
|
+
JSONObject obj = new JSONObject(result);
|
|
37
|
+
int code = obj.getInt("code");
|
|
38
|
+
if (code == 200) {
|
|
39
|
+
WritableMap writableMap = Arguments.createMap();
|
|
40
|
+
writableMap.putMap("data", Arguments.createMap());
|
|
41
|
+
promise.resolve(writableMap);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
handlerError(promise, code, obj.getString("msg"), viewModel);
|
|
45
|
+
|
|
46
|
+
} catch (Exception e) {
|
|
47
|
+
e.printStackTrace();
|
|
48
|
+
promise.reject(ErrorCode.ERROR_CODE_JSON_EXCEPTION, e);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* 处理带有data字段的返回数据
|
|
54
|
+
*
|
|
55
|
+
* @param promise 回调方法
|
|
56
|
+
* @param result json格式的返回数据
|
|
57
|
+
* @param viewModel QuecBaseViewModel
|
|
58
|
+
*/
|
|
59
|
+
public static boolean handlerResponse(Promise promise, String result, QuecBaseViewModel viewModel) {
|
|
60
|
+
try {
|
|
61
|
+
JSONObject obj = new JSONObject(result);
|
|
62
|
+
int code = obj.getInt("code");
|
|
63
|
+
if (code == 200) {
|
|
64
|
+
WritableMap writableMap = getMapForHandlerJSONObject(obj);
|
|
65
|
+
promise.resolve(writableMap);
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
handlerError(promise, code, obj.getString("msg"), viewModel);
|
|
69
|
+
|
|
70
|
+
} catch (Exception e) {
|
|
71
|
+
e.printStackTrace();
|
|
72
|
+
promise.reject(ErrorCode.ERROR_CODE_JSON_EXCEPTION, e);
|
|
73
|
+
}
|
|
74
|
+
return false;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
public static boolean handlerResponse(Promise promise, QuecResult<?> result, QuecBaseViewModel viewModel) {
|
|
78
|
+
boolean ret = false;
|
|
79
|
+
try {
|
|
80
|
+
if (result.isSuccess()) {
|
|
81
|
+
WritableMap writableMap = getMapForHandlerJSONObject(new JSONObject(QuecGsonUtil.INSTANCE.gsonString(new Content(result.getData()))));
|
|
82
|
+
promise.resolve(writableMap);
|
|
83
|
+
|
|
84
|
+
ret = true;
|
|
85
|
+
} else {
|
|
86
|
+
handlerError(promise, result.getCode(), result.getMsg(), viewModel);
|
|
87
|
+
}
|
|
88
|
+
} catch (Exception e) {
|
|
89
|
+
QLog.e(TAG, e);
|
|
90
|
+
promise.reject(ErrorCode.ERROR_CODE_JSON_EXCEPTION, e);
|
|
91
|
+
}
|
|
92
|
+
return ret;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* 处理错误
|
|
97
|
+
*
|
|
98
|
+
* @param promise 回调方法
|
|
99
|
+
* @param code 错误码
|
|
100
|
+
* @param msg 错误提示语
|
|
101
|
+
* @param viewModel QuecBaseViewModel
|
|
102
|
+
*/
|
|
103
|
+
public static void handlerError(Promise promise, int code, String msg, QuecBaseViewModel viewModel) {
|
|
104
|
+
promise.reject(String.valueOf(code), viewModel.getErrorMsg(code, msg));
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
public static WritableMap getMapForHandlerJSONObject(JSONObject obj) throws JSONException {
|
|
108
|
+
WritableMap writableMap = Arguments.createMap();
|
|
109
|
+
Object data = obj.get("data");
|
|
110
|
+
if (data instanceof JSONObject) {
|
|
111
|
+
writableMap.putMap("data", ReactNativeJson.convertJsonToMap((JSONObject) data));
|
|
112
|
+
} else if (data instanceof JSONArray) {
|
|
113
|
+
writableMap.putArray("data", ReactNativeJson.convertJsonToArray((JSONArray) data));
|
|
114
|
+
} else if (data instanceof Boolean) {
|
|
115
|
+
writableMap.putBoolean("data", (Boolean) data);
|
|
116
|
+
} else if (data instanceof Integer) {
|
|
117
|
+
writableMap.putInt("data", (Integer) data);
|
|
118
|
+
} else if (data instanceof Long) {
|
|
119
|
+
writableMap.putDouble("data", (Long) data);
|
|
120
|
+
} else if (data instanceof Float) {
|
|
121
|
+
writableMap.putDouble("data", (Float) data);
|
|
122
|
+
} else if (data instanceof Double) {
|
|
123
|
+
writableMap.putDouble("data", (Double) data);
|
|
124
|
+
} else if (data instanceof String) {
|
|
125
|
+
writableMap.putString("data", (String) data);
|
|
126
|
+
} else {
|
|
127
|
+
writableMap.putString("data", data.toString());
|
|
128
|
+
}
|
|
129
|
+
return writableMap;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
public static WritableArray getWritableArray(String json) throws JSONException {
|
|
133
|
+
JSONArray jsonArray = new JSONArray(json);
|
|
134
|
+
return ReactNativeJson.convertJsonToArray(jsonArray);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
public static class Content implements QuecBaseModel {
|
|
139
|
+
private Object data;
|
|
140
|
+
|
|
141
|
+
public Content() {
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
public Content(Object data) {
|
|
145
|
+
this.data = data;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
public Object getData() {
|
|
149
|
+
return data;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
public void setData(Object data) {
|
|
153
|
+
this.data = data;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
package com.quectel.smart.template;
|
|
2
|
+
|
|
3
|
+
import org.junit.Test;
|
|
4
|
+
|
|
5
|
+
import static org.junit.Assert.*;
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Example local unit test, which will execute on the development machine (host).
|
|
9
|
+
*
|
|
10
|
+
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
|
|
11
|
+
*/
|
|
12
|
+
public class ExampleUnitTest {
|
|
13
|
+
@Test
|
|
14
|
+
public void addition_isCorrect() {
|
|
15
|
+
assertEquals(4, 2 + 2);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/build.gradle
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
// Top-level build file where you can add configuration options common to all sub-projects/modules.
|
|
Binary file
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
source 'ssh://git@gitlab.quectel.com:8061/frontend/QuecPublicSpecs.git'
|
|
2
|
+
source 'https://cdn.cocoapods.org/'
|
|
3
|
+
|
|
4
|
+
use_frameworks! :linkage => :static
|
|
5
|
+
platform :ios, '13.0'
|
|
6
|
+
|
|
7
|
+
target 'QuecRNDeviceModule_Example' do
|
|
8
|
+
pod 'QuecRNDeviceModule', :path => '../'
|
|
9
|
+
pod 'QuecOTAUpgradeKit', :git => 'ssh://git@gitlab.quectel.com:8061/frontend/app/iOS/SDK/QuecOTAUpgradeKit.git'
|
|
10
|
+
pod 'QuecDeviceKit', :git => 'ssh://git@gitlab.quectel.com:8061/frontend/app/iOS/SDK/QuecDeviceKit.git', :branch=>'develop-2.11.0'
|
|
11
|
+
|
|
12
|
+
target 'QuecRNDeviceModule_Tests' do
|
|
13
|
+
inherit! :search_paths
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
end
|
|
17
|
+
end
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
//
|
|
2
|
+
// AppDelegate.m
|
|
3
|
+
// quectel
|
|
4
|
+
//
|
|
5
|
+
// Created by quectel on 08/30/2022.
|
|
6
|
+
// Copyright (c) 2022 quectel. All rights reserved.
|
|
7
|
+
//
|
|
8
|
+
|
|
9
|
+
#import "AppDelegate.h"
|
|
10
|
+
|
|
11
|
+
@implementation AppDelegate
|
|
12
|
+
|
|
13
|
+
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
|
|
14
|
+
{
|
|
15
|
+
// Override point for customization after application launch.
|
|
16
|
+
return YES;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
- (void)applicationWillResignActive:(UIApplication *)application
|
|
20
|
+
{
|
|
21
|
+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
|
|
22
|
+
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
- (void)applicationDidEnterBackground:(UIApplication *)application
|
|
26
|
+
{
|
|
27
|
+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
|
|
28
|
+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
- (void)applicationWillEnterForeground:(UIApplication *)application
|
|
32
|
+
{
|
|
33
|
+
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
- (void)applicationDidBecomeActive:(UIApplication *)application
|
|
37
|
+
{
|
|
38
|
+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
- (void)applicationWillTerminate:(UIApplication *)application
|
|
42
|
+
{
|
|
43
|
+
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@end
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
|
|
3
|
+
<device id="retina4_7" orientation="portrait">
|
|
4
|
+
<adaptation id="fullscreen"/>
|
|
5
|
+
</device>
|
|
6
|
+
<dependencies>
|
|
7
|
+
<deployment identifier="iOS"/>
|
|
8
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
|
9
|
+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
|
10
|
+
</dependencies>
|
|
11
|
+
<scenes>
|
|
12
|
+
<!--View Controller-->
|
|
13
|
+
<scene sceneID="EHf-IW-A2E">
|
|
14
|
+
<objects>
|
|
15
|
+
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
|
|
16
|
+
<layoutGuides>
|
|
17
|
+
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
|
|
18
|
+
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
|
|
19
|
+
</layoutGuides>
|
|
20
|
+
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
|
|
21
|
+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
|
22
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
23
|
+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
24
|
+
</view>
|
|
25
|
+
</viewController>
|
|
26
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
|
27
|
+
</objects>
|
|
28
|
+
<point key="canvasLocation" x="53" y="375"/>
|
|
29
|
+
</scene>
|
|
30
|
+
</scenes>
|
|
31
|
+
</document>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="whP-gf-Uak">
|
|
3
|
+
<device id="retina4_7" orientation="portrait">
|
|
4
|
+
<adaptation id="fullscreen"/>
|
|
5
|
+
</device>
|
|
6
|
+
<dependencies>
|
|
7
|
+
<deployment identifier="iOS"/>
|
|
8
|
+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
|
|
9
|
+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
|
10
|
+
</dependencies>
|
|
11
|
+
<scenes>
|
|
12
|
+
<!--View Controller-->
|
|
13
|
+
<scene sceneID="wQg-tq-qST">
|
|
14
|
+
<objects>
|
|
15
|
+
<viewController id="whP-gf-Uak" customClass="ViewController" sceneMemberID="viewController">
|
|
16
|
+
<layoutGuides>
|
|
17
|
+
<viewControllerLayoutGuide type="top" id="uEw-UM-LJ8"/>
|
|
18
|
+
<viewControllerLayoutGuide type="bottom" id="Mvr-aV-6Um"/>
|
|
19
|
+
</layoutGuides>
|
|
20
|
+
<view key="view" contentMode="scaleToFill" id="TpU-gO-2f1">
|
|
21
|
+
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
|
|
22
|
+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
|
23
|
+
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
|
|
24
|
+
</view>
|
|
25
|
+
</viewController>
|
|
26
|
+
<placeholder placeholderIdentifier="IBFirstResponder" id="tc2-Qw-aMS" userLabel="First Responder" sceneMemberID="firstResponder"/>
|
|
27
|
+
</objects>
|
|
28
|
+
<point key="canvasLocation" x="305" y="433"/>
|
|
29
|
+
</scene>
|
|
30
|
+
</scenes>
|
|
31
|
+
</document>
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
{
|
|
2
|
+
"images" : [
|
|
3
|
+
{
|
|
4
|
+
"idiom" : "iphone",
|
|
5
|
+
"size" : "20x20",
|
|
6
|
+
"scale" : "2x"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"idiom" : "iphone",
|
|
10
|
+
"size" : "20x20",
|
|
11
|
+
"scale" : "3x"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"idiom" : "iphone",
|
|
15
|
+
"size" : "29x29",
|
|
16
|
+
"scale" : "2x"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"idiom" : "iphone",
|
|
20
|
+
"size" : "29x29",
|
|
21
|
+
"scale" : "3x"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"idiom" : "iphone",
|
|
25
|
+
"size" : "40x40",
|
|
26
|
+
"scale" : "2x"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"idiom" : "iphone",
|
|
30
|
+
"size" : "40x40",
|
|
31
|
+
"scale" : "3x"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"idiom" : "iphone",
|
|
35
|
+
"size" : "60x60",
|
|
36
|
+
"scale" : "2x"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"idiom" : "iphone",
|
|
40
|
+
"size" : "60x60",
|
|
41
|
+
"scale" : "3x"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"idiom" : "ipad",
|
|
45
|
+
"size" : "20x20",
|
|
46
|
+
"scale" : "1x"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"idiom" : "ipad",
|
|
50
|
+
"size" : "20x20",
|
|
51
|
+
"scale" : "2x"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"idiom" : "ipad",
|
|
55
|
+
"size" : "29x29",
|
|
56
|
+
"scale" : "1x"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"idiom" : "ipad",
|
|
60
|
+
"size" : "29x29",
|
|
61
|
+
"scale" : "2x"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"idiom" : "ipad",
|
|
65
|
+
"size" : "40x40",
|
|
66
|
+
"scale" : "1x"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"idiom" : "ipad",
|
|
70
|
+
"size" : "40x40",
|
|
71
|
+
"scale" : "2x"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"idiom" : "ipad",
|
|
75
|
+
"size" : "76x76",
|
|
76
|
+
"scale" : "1x"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"idiom" : "ipad",
|
|
80
|
+
"size" : "76x76",
|
|
81
|
+
"scale" : "2x"
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
"idiom" : "ipad",
|
|
85
|
+
"size" : "83.5x83.5",
|
|
86
|
+
"scale" : "2x"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"idiom" : "ios-marketing",
|
|
90
|
+
"size" : "1024x1024",
|
|
91
|
+
"scale" : "1x"
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
"info" : {
|
|
95
|
+
"version" : 1,
|
|
96
|
+
"author" : "xcode"
|
|
97
|
+
}
|
|
98
|
+
}
|