代码拉取完成,页面将自动刷新
#!/bin/sh
# fw_gen.sh
# IntelBluetoothFirmware
#
# Created by qcwap on 2020/2/26.
# Copyright © 2020 钟先耀. All rights reserved.
target_file="${PROJECT_DIR}/IntelBluetoothFirmware/FwBinary.cpp"
fw_files=${PROJECT_DIR}/IntelBluetoothFirmware/fw/*.*
rm -rf $target_file
echo "// IntelBluetoothFirmware\n\n// Copyright © 2020 钟先耀. All rights reserved." >$target_file
echo "#include \"FwData.h\"">>$target_file
for fw in $fw_files; do
fw_file_name=`basename $fw`
fw_var_name=${fw_file_name//./_}
fw_var_name=${fw_var_name//-/_}
echo "">>$target_file
echo "const unsigned char ${fw_var_name}[] = {">>$target_file
xxd -i <$fw >>$target_file
echo "};">>$target_file
echo "">>$target_file
echo "const long int ${fw_var_name}_size = sizeof(${fw_var_name});">>$target_file
done
echo "">>$target_file
echo "const struct FwDesc fwList[] = {">>$target_file
i=0;
for fw in $fw_files; do
fw_file_name=`basename $fw`
fw_var_name=${fw_file_name//./_}
fw_var_name=${fw_var_name//-/_}
echo "{IBT_FW(\"$fw_file_name\", $fw_var_name, ${fw_var_name}_size)},">>$target_file
let i+=1
done
echo "};">>$target_file
echo "const int fwNumber = $i;">>$target_file
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。