JavaLikeCalc.JavaScript
if(f_start) {
	recThr_ = recThr; scrBright_ = scrBright; scrTm_ = scrTm;

	isBound = -1;
	if(dev.match("^[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}:[0-9a-fA-F]{2}$").length &&
			(tVl=transport.match("/dev/rfcomm(\\d)")).length && SYS.system("rfcomm bind "+tVl[1]+" "+dev,true) == 0)
		isBound = tVl[1];
}

tErr = "";
wTm = 0.2;	//Waiting time after commands

if(!(tr=SYS.Transport.outAt(transport)) || !tr.start(true))
	tErr = "1:"+tr("Output transport '%1' error.").replace("%1",transport);
else {
	if(f_stop) {
		tr.start(false);
		if(isBound >= 0)	SYS.system("rfcomm release "+isBound, true);
		return;
	}

	for(resp = tr.messIO(SYS.strFromCharCode(0xF0)); resp.length < 130 && (respTail=tr.messIO("")).length; )
		resp += respTail;

	if(!resp.length)	tErr = "2:"+tr("No response.");
	else if(resp.length < 130 || !((tVl=resp.charCodeAt(0,"UTF-16BE")) == 0x0963 || tVl == 0x0d4c) || 
			!((tVl=resp.charCodeAt(resp.length-2,"UTF-16BE")) == 0xFFF1 || tVl == 0x8068))
		tErr = "2:"+tr("Not whole or not mine response.");
	else {
		// Setting
		if(scrNext) {
			if(scrNext == true) { tr.messIO(SYS.strFromCharCode(0xF1), 0, 0); SYS.sleep(wTm); }
			scrNext = false;
		}
		if(scrRot) {
			if(scrRot == true) { tr.messIO(SYS.strFromCharCode(0xF2), 0, 0); SYS.sleep(wTm); }
			scrRot = false;
		}
		if(grpNext) {
			if(grpNext == true)	{ tr.messIO(SYS.strFromCharCode(0xF3), 0, 0); SYS.sleep(wTm); }
			grpNext = false;
		}
		if(grpClear) {
			if(grpClear == true) { tr.messIO(SYS.strFromCharCode(0xF4,0xF4), 0, 0); SYS.sleep(wTm); }
			grpClear = false;
		}
		if(recThr != recThr_) {
			if(!recThr.isEVal()) { tr.messIO(SYS.strFromCharCode(tVl=0xB0+max(0,min(0.3,recThr))*100,tVl), 0, 0); SYS.sleep(wTm); }
			recThr_ = recThr;
		}
		if(scrBright != scrBright_) {
			if(!scrBright.isEVal()) { tr.messIO(SYS.strFromCharCode(tVl=0xD0+max(0,min(5,scrBright)),tVl), 0, 0); SYS.sleep(wTm); }
			scrBright_ = scrBright;
		}
		if(scrTm != scrTm_) {
			if(!scrTm.isEVal()) { tr.messIO(SYS.strFromCharCode(tVl=0xE0+max(0,min(9,scrTm)),tVl), 0, 0); SYS.sleep(wTm); }
			scrTm_ = scrTm;
		}

		// Reading all data
		io = Special.FLibSYS.IO(resp, "", "b");
		io.pos = 2;
		V = io.read("uint16", 1)/100;
		A = io.read("uint16", 1)/1000;
		W = io.read("uint32", 1)/1000;
		T = io.read("uint16", 1);
		io.read("uint16", 1);	//T, °F
		dG = io.read("uint16", 1);
		for(grps = "", iG = 0; iG < 10; iG++)
			grps += (grps.length?"\n":"") + ((iG==dG)?"> ":"  ") + iG.toString() + ": " +
						(io.read("uint32",1)/1000) + " Ah, " + (io.read("uint32",1)/1000) + " Wh;";
		io.read("uint16", 1);	//data_line_positive_volts/100
		io.read("uint16", 1);	//data_line_negative_volts/100
		chMode_ = io.read("uint16", 1);
		if(chMode_ == 1)	chMode = "Quick Charge 2.0";
		else if(chMode_ == 2)	chMode = "Quick Charge 3.0";
		else if(chMode_ == 3)	chMode = "Apple 2.4A";
		else if(chMode_ == 4)	chMode = "Apple 2.1A";
		else if(chMode_ == 5)	chMode = "Apple 1.0A";
		else if(chMode_ == 6)	chMode = "Apple 0.5A";
		else if(chMode_ == 7)	chMode = "DCP 1.5A";
		else if(chMode_ == 8)	chMode = "Samsung";
		else chMode = "Unknown / Normal";
		chMode += " ("+chMode_+")";
		recAh = io.read("uint32", 1)/1000;
		recWh = io.read("uint32", 1)/1000;
		recThr = recThr_ = io.read("uint16", 1)/100;
		recTm = recTm_ = io.read("uint32", 1);
		rec = io.read("uint16", 1);
		scrTm = scrTm_ = io.read("uint16", 1);
		scrBright = scrBright_ = io.read("uint16", 1);
		R = io.read("uint32", 1)/10;
		scr = io.read("uint16", 1);
	}
}

if(tErr.length) {
	f_err = tErr;
	V = A = W = T = dG = chMode = recAh = recWh = recThr = recTm = rec = scrTm = scrBright = R = scr = EVAL;
	grps = EVAL;
}
else f_err = "0";