diff --git a/binaries/AP_FW_Pack.bin b/binaries/AP_FW_Pack.bin new file mode 100644 index 00000000..cc8fb707 Binary files /dev/null and b/binaries/AP_FW_Pack.bin differ diff --git a/binaries/Tag_FW_Pack.bin b/binaries/Tag_FW_Pack.bin new file mode 100644 index 00000000..0b9af583 Binary files /dev/null and b/binaries/Tag_FW_Pack.bin differ diff --git a/zbs243_AP_FW/buildfw.sh b/zbs243_AP_FW/buildfw.sh index f91368c5..08bd4a3c 100755 --- a/zbs243_AP_FW/buildfw.sh +++ b/zbs243_AP_FW/buildfw.sh @@ -16,3 +16,5 @@ echo -e "\n\nBuilding 1.54 version..." make BUILD=zbs154v033 CPU=8051 SOC=zbs243 > /dev/null mv main.bin ../binaries/AP_FW_1.54.bin -v make clean > /dev/null + +php packagebinaries.php diff --git a/zbs243_AP_FW/packagebinaries.php b/zbs243_AP_FW/packagebinaries.php new file mode 100644 index 00000000..285ffc76 --- /dev/null +++ b/zbs243_AP_FW/packagebinaries.php @@ -0,0 +1,50 @@ + $typefile){ + if($typefile == $file){ + $type = $typeid; + } + } + if($type==-1)die("We don't recognize filetype <$file>, sorry...\n"); + $binary = file_get_contents($binpath.$file); + $length = strlen($binary); + $offset = strlen($output); + $subarr['type']=$type; + $subarr['version']=$version; + $subarr['name']=$file; + $subarr['offset']=$offset; + $subarr['length']=$length; + $toc[] = $subarr; + $output.=$binary; +} + +$jtoc = json_encode($toc); +$tocsize = strlen($jtoc); +if($tocsize>$tocmaxsize)die("TOC is too big! adjust size and try again\n"); +$output = substr_replace($output,$jtoc,0,strlen($jtoc)); +file_put_contents($binpath."AP_FW_Pack.bin", $output); +print_r($toc); +echo "All done.\n"; + + diff --git a/zbs243_Tag_FW/buildfw.sh b/zbs243_Tag_FW/buildfw.sh index ecd94cef..88ad3c75 100755 --- a/zbs243_Tag_FW/buildfw.sh +++ b/zbs243_Tag_FW/buildfw.sh @@ -20,3 +20,5 @@ echo -e "\n\nBuilding 2.9 (UC8151) version..." make BUILD=zbs29_uc8151 CPU=8051 SOC=zbs243 > /dev/null mv main.bin ../binaries/Tag_FW_2.9-uc8151.bin -v make clean > /dev/null + +php packagebinaries.php diff --git a/zbs243_Tag_FW/packagebinaries.php b/zbs243_Tag_FW/packagebinaries.php new file mode 100644 index 00000000..3fd22bce --- /dev/null +++ b/zbs243_Tag_FW/packagebinaries.php @@ -0,0 +1,53 @@ + $typefile){ + if($typefile == $file){ + $type = $typeid; + } + } + if($type==-1)die("We don't recognize filetype <$file>, sorry...\n"); + $binary = file_get_contents($binpath.$file); + $length = strlen($binary); + $offset = strlen($output); + $subarr['type']=$type; + $subarr['version']=$version; + $subarr['name']=$file; + $subarr['offset']=$offset; + $subarr['length']=$length; + $toc[]=$subarr; + $output.=$binary; +} + +$jtoc = json_encode($toc); +$tocsize = strlen($jtoc); +if($tocsize>$tocmaxsize)die("TOC is too big! adjust size and try again\n"); +$output = substr_replace($output,$jtoc,0,strlen($jtoc)); +file_put_contents($binpath."Tag_FW_Pack.bin", $output); +print_r($toc); +echo "All done.\n"; +