Untitled
raw download clone
TEXT
views 34
,
size 811 b
console.log(this.toHexString(rxUartBuffer));
this.analyzePCP(rxUartBuffer);
this.write_ACK_ONLY(rxUartBuffer);

		write_ACK_ONLY(data = new Array(20)){//SENDE NUR ACK ohne Daten, bzw. mit den Empfangen Daten
		gpiop.write(7, true);
		data[this.pcp.STATUS] = this.pcp.ACK_BIT ;

	    setTimeout(() => {
		    var crcCeckedBuffer = this.createCrcChecksum(data);
		   // console.log(crcCeckedBuffer);
		    this.port.write(crcCeckedBuffer, (err, result) => {
		    	console.log("Sende ACK");
		    	this.uartCounter=0;
		    	if (err) {
		    		console.log('Error while sending message : ' + err);
		    	}
		    	if (result) {
		    		console.log('Response received after sending message : ' + result);
		    	}
		    });
		},200);
		setTimeout(function(){ gpiop.write(7, false);},300);
	}
close fullscreen
Login or Register to edit or fork this paste. It's free.