tencentyun / iot-device-java Goto Github PK
View Code? Open in Web Editor NEWIoT Hub & Explorer 设备端 SDK (Java & Android)
Home Page: https://cloud.tencent.com/product/iotexplorer
IoT Hub & Explorer 设备端 SDK (Java & Android)
Home Page: https://cloud.tencent.com/product/iotexplorer
Hello tencent,
我按照这个指引:
https://github.com/tencentyun/iot-device-java/blob/master/hub/hub-device-android/docs/zh/%E7%BC%96%E8%AF%91%E7%8E%AF%E5%A2%83%E5%8F%8ASDK%E6%8E%A5%E5%85%A5%E8%AF%B4%E6%98%8E.md
提到的方式:
gradle 工程正式版 SDK 远程构建
在应用模块的 build.gradle 中配置,具体版本号可参考 Latest release 版本
dependencies {
implementation 'com.tencent.iot.hub:hub-device-android:3.3.21'
}
可以编译过;
问题: 除了APP部分的Setting.gradle填写上述指引的部分, 这个SDK的引用还需要设置其他地方吗?
你好,请问如何使用IOT CENTRAL DEMO,产品是什么类型的?没有找到有_sys_access_token属性的产品,手动添加提示系统属性,无法添加。
com.tencent.iot.hub.device.android.core.mqtt.TXMqttConnection#publishRRPCToCloud
private Status publishRRPCToCloud(Object userContext, String processId, Map<String, String> replyMsg) {
// 应答topic格式: $rrpc/txd/${ProductId}/${DeviceName}/${messageid}
String topic = String.format("$rrpc/txd/%s/%s/%s", mProductId, mDeviceName, processId);
//TODO 通过replyMsg构建mqtt messge
MqttMessage message = new MqttMessage();
JSONObject jsonObject = new JSONObject();
try {
jsonObject.put("test-key", "test-value"); // for test
for (Map.Entry<String, String> entrys : replyMsg.entrySet()) {
jsonObject.put(entrys.getKey(), entrys.getValue());
}
} catch (JSONException e) {
TXLog.e(TAG, e, "pack json data failed!");
}
message.setQos(TXMqttConstants.QOS0);
message.setPayload(jsonObject.toString().getBytes());
return publish(topic, message ,userContext);
}
主要是这段代码,这段测试代码是表示当前接口还不可用吗 还是基于什么考虑呢
在setMqttConnectOptions
中,无论传入的mqttConnectOptions
是否设置了用户名和密码都会被覆盖掉,导致使用过程中输入与输出的不对等,文档和注释中并无此方面描述,需要补充或者修改
/**
* 设置连接配置
*
* @param mqttConnectOptions {@link MqttConnectOptions}
*/
public void setMqttConnectOptions(MqttConnectOptions mqttConnectOptions) {
this.conOptions = mqttConnectOptions;
if(conOptions.getUserName() != null && conOptions.getUserName().length() != 0){// 如果已经设置了用户名和密钥则不会继续创建
// 设置密钥之后可以进行 mqtt 连接
String userName = generateUsername();
conOptions.setUserName(userName);
if (secretKey != null && secretKey.length() != 0) {
try {
conOptions.setPassword(generatePwd(userName).toCharArray());
} catch (IllegalArgumentException e) {
Loggor.debug(TAG, "Failed to set password");
}
}
}
conOptions.setMqttVersion(MqttConnectOptions.MQTT_VERSION_3_1_1);
}
起因是我没有关闭连接,而这个时候网络异常了,平台反应时间太久,这对于测试上下线问题不及时
An attempt was made to call a method that does not exist. The attempt was made from the following location:
com.tencent.iot.hub.device.java.utils.Loggor.openConsoleLog(Loggor.java:44)
The following method did not exist:
org.apache.log4j.PatternLayout.setConversionPattern(Ljava/lang/String;)V
Hi, @SundoggyNew , @archurcode , I'd like to report a vulnerability issue in com.tencent.iot.thirdparty.android:ai-face-sdk_6.3.2.156.
com.tencent.iot.thirdparty.android:ai-face-sdk_6.3.2.156 directly or transitively depends on 54 C libraries (.so) cross many platforms(such as arm64-v8a, armeabi-v7a). However, I noticed that some C libraries are vulnerable, containing the following CVEs:
libYTUtils.so
from C project libjpeg-turbo(version:1.5.0) exposed 1 vulnerabilities:
CVE-2018-14498
libimisensor.so
from C project libpng(version:1.5.12) exposed 9 vulnerabilities:
CVE-2014-9495, CVE-2013-7354, CVE-2013-7353, CVE-2017-12652, CVE-2015-8472, CVE-2016-10087, CVE-2016-3751, CVE-2015-0973, CVE-2015-8540
libjpeg-turbo has fixed the vulnerabilities in versions >=2.1.0
libpng has fixed the vulnerabilities in versions >=1.6.37
Java build tools cannot report vulnerable C libraries, which may induce potential security issues to many downstream Java projects.
Could you please upgrade the above shared libraries to their patch versions?
Thanks for your help~
Best regards,
Helen Parr
implementation 'com.tencent.iot.hub:hub-device-android:3.3.22'
Duplicate class org.slf4j.impl.StaticMarkerBinder found in modules jetified-logback-android-3.0.0-runtime (com.github.tony19:logback-android:3.0.0) and jetified-slf4j-reload4j-1.7.36 (org.slf4j:slf4j-reload4j:1.7.36)
Cloning into 'hub-device-java'...
fatal: repository 'https://github.com/tencentyun/iot-device-java/tree/master/hub-device-java/' not found
可以升级到最新的1.2.5嘛?
iot-device-java引用了log4j,帮忙升级下咯
hi ,之前公司android设备上用了这个iot sdk(Cloud应用),客户自己也开发了一个应用(应该是用到了同一个sdk),导致客户的程序受到影响,具体表现为网络隔一段时间刷新了客户的应用程序,除此之外没什么其他异常,现在我们的应用无法和客户的应用共存,这对我们来说很重要,这个mqtt服务在设备固有参数不变的情况下,存在了这样的问题,经过了多次测试
网络隔一段时间刷新了客户的应用程序,是否是收到了下发Topic消息时刷新的,这里建议判断一下是自己订阅的Topic的消息才做对应业务上的刷新处理。
客户自己开发的程序我不清楚 我这里呢也定义了一个topic,但是基于这个协议,我不可能去干涉别人的topic吧,如果他一直保持现在topic,没有对其他topic进行区分,那么我改了,似乎也没什么用,因为每个应用应该对自己的tipic进行处理,不处理别人的
有没有可能是客户订阅了你们的topic
这个就不得而知了
Originally posted by @archurcode in #5 (comment)
hi ,之前公司android设备上用了这个iot sdk(Cloud应用),客户自己也开发了一个应用(应该是用到了同一个sdk),导致客户的程序受到影响,具体表现为网络隔一段时间刷新了客户的应用程序,除此之外没什么其他异常,现在我们的应用无法和客户的应用共存,这对我们来说很重要,这个mqtt服务在设备固有参数不变的情况下,存在了这样的问题,经过了多次测试
implementation 建议更改为这种可支持的方式引用
网络连接状态下,把网线拔掉,或者4G掉线了,物联网平台显示离线之后,再恢复网络,这时候就会频繁上下线
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.