You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: lib/canUds.js
+18-10
Original file line number
Diff line number
Diff line change
@@ -394,10 +394,14 @@ class uds {
394
394
// ======================
395
395
if(id.includes(this.userReadByDidId)){
396
396
// User requests ReadByDid
397
-
constdids=JSON.parse(state.val);
398
-
awaitctx.log.debug('User command UDS ReadByDid on '+this.config.stateBase+'. Dids='+JSON.stringify(dids));
399
-
awaitthis.pushCmnd(ctx,'read',dids);
400
-
awaitctx.setStateAsync(id,{val: JSON.stringify(dids),ack: true});// Acknowlegde user command
397
+
try{
398
+
constdids=JSON.parse(state.val);
399
+
awaitctx.log.debug('User command UDS ReadByDid on '+this.config.stateBase+'. Dids='+JSON.stringify(dids));
400
+
awaitthis.pushCmnd(ctx,'read',dids);
401
+
awaitctx.setStateAsync(id,{val: JSON.stringify(dids),ack: true});// Acknowlegde user command
402
+
}catch(e){
403
+
ctx.log.error('ReadByDid(): Parsing of list of DIDs failed on '+this.config.stateBase+'; err='+JSON.stringify(e)+' - You have to provide a list of numerical values.');
ctx.setTimeout(function(ctxWorker,did){ctxWorker.cmndsQueue.push({'mode':'read','did': did});},2500,this,did);// Read value after 2500 ms
451
+
}else{
452
+
ctx.log.error('User command UDS WriteByDid on '+this.config.stateBase+': Encoding of data failed.');
453
+
}
454
+
}catch(e){
455
+
ctx.log.error('WriteByDid(): Encoding of data failed on '+this.config.stateBase+'.'+String(did)+'; err='+JSON.stringify(e)+' - You have to provide JSON formatted data.');
0 commit comments