Example #1
0
Parser = function ()
{// execute the received command
  var cmd = String.fromCharCode(RxCmd);

  /*debug
  var slotTime = Date.now()-RxTime;
  console.log("--RX cmd: " + cmd+"  "+(slotTime));
  if(slotTime < 10)
    {
      console.log("***********************ERROR");
    };
  debug*/
  
  RxTime = Date.now(); //debug
  
  RxStatus = 0;
  
  //console.log(ISODateString()+"<----- RX Cmd: "+cmd); //debug

  switch (cmd)
  {
      case 'b': // details on speed, current and position OUT
          parser.b_dsNavParam();
          break;

      case 'T': // GPS time parameters OUT
          parser.T_GpsTime();
          break;

      case 'G': // GPS service parameters OUT
          parser.G_GpsService();
          break;

      case 'K': // GPS & IMU (DCM) parameters OUT
          parser.K_GpsPos();
          break;

     case 'L': // values coming from Low Level Supervisor OUT
          parser.L_LLS();
          break;

     default:
          RxError(3); //	error: not a known command
          break;
  }
};
Example #2
0
				erg.forEach(function(key) {
					k = parser.parsePublicKey(key[1]);
						seek = new RegExp(search);
						var oldCount = count;
						for(i=0;i<k['uids'].length;i++) {
							if(k['uids'][i].name.match(seek)) {
								if(count == oldCount) {
								count++;
								keys.push(k);
								}
							}
						}
				});
Example #3
0
							gpg = child.exec('gpg2 ' + tmp + ip + ".asc","utf8",function(error,stdout,stderr) {
								if(!error) {
									file = parser.parsePUB(stdout);
									if(fs.renameSync(tmp + ip + ".asc",'./keys/' + file.fpr + '.asc')) {
									res.statusCode = 200;
									res.end();
									} else {
									res.statusCode = 500;
									res.write("Internal Server Error!");
									res.end();
									}
								} else {
									res.statusCode = 500;
									res.write("Internal Server Error!");
									res.end();
								}
							});