|
@@ -109,7 +109,7 @@ this.encode = function (service,device) {
|
|
|
var method="thing.service.";
|
|
|
var topic="/sys/"+service.productKey+"/"+service.deviceName+"/c/service/";
|
|
|
var params={};
|
|
|
-
|
|
|
+
|
|
|
//透传下发
|
|
|
if(device.transparent){
|
|
|
var rst=component.transparentEncode(service,device);
|
|
@@ -152,12 +152,29 @@ this.encode = function (service,device) {
|
|
|
method+=identifier;
|
|
|
topic="/sys/"+service.productKey+"/"+service.deviceName+"/c/deregister";
|
|
|
}
|
|
|
-
|
|
|
- for(var p in service.params){
|
|
|
+ if(type=="property" && identifier=="get" ){
|
|
|
+ var listParams = []
|
|
|
+ for(var p in service.params){
|
|
|
+ listParams.push(service.params[p]);
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ productKey:service.productKey,
|
|
|
+ deviceName:service.deviceName,
|
|
|
+ mid:deviceMid,
|
|
|
+ content:{
|
|
|
+ topic:topic,
|
|
|
+ payload:JSON.stringify({
|
|
|
+ id:deviceMid,
|
|
|
+ method:method,
|
|
|
+ params: listParams
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ for(var p in service.params){
|
|
|
params[p]=service.params[p];
|
|
|
}
|
|
|
-
|
|
|
- return {
|
|
|
+ return {
|
|
|
productKey:service.productKey,
|
|
|
deviceName:service.deviceName,
|
|
|
mid:deviceMid,
|
|
@@ -170,4 +187,8 @@ this.encode = function (service,device) {
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
};
|