if (substr($v,0,2) == "L:") { $data["meta"]["DevCount"]=5; $v = substr($v,2,strlen($v)); $str = base64_decode($v); $pos = 0; for($j = 1 ; $j <= $data["meta"]["DevCount"]; $j++) { unset($hilf); $hilf["ReadLength"] = htmlentities(ord(substr($str,$pos,1))); $pos += 1; for($i = $pos; $i < (3+$pos) ; $i++) $hilf["RFAdress"] .= str_pad(dechex(ord(substr($str,$i,1))),2,"0",STR_PAD_LEFT); $pos += 5; $hilf["Data2"] .= str_pad(decbin(ord(substr($str,$pos,1))),8,"0",STR_PAD_LEFT).""; $deviceconf[$hilf["RFAdress"]]["LowBatt"] = substr($hilf["Data2"],0,1); $pos += 1; if($hilf["ReadLength"] == 11) { $pos += 1; $deviceconf[$hilf["RFAdress"]]["Temperature"] = (ord(substr($str,$pos,1))/2).""; $pos += 4; } switch (substr($hilf["Data2"],6,2)) { case "00" : $deviceconf[$hilf["RFAdress"]]["Mode"] = "auto"; break; case "01" : $deviceconf[$hilf["RFAdress"]]["Mode"] = "manu"; break; case "10" : $deviceconf[$hilf["RFAdress"]]["Mode"] = "vacation"; break; case "11" : $deviceconf[$hilf["RFAdress"]]["Mode"] = "boost"; break; } } }