2017-04-20 17:54:10 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-04-24 15:56:28 -04:00
|
|
|
function download_s132_nrf52_2_0_1
|
|
|
|
{
|
|
|
|
echo ""
|
|
|
|
echo "####################################"
|
|
|
|
echo "### Downloading s132_nrf52_2.0.1 ###"
|
|
|
|
echo "####################################"
|
|
|
|
echo ""
|
|
|
|
|
2018-04-12 21:43:23 -04:00
|
|
|
mkdir -p "${1}/s132_nrf52_2.0.1"
|
|
|
|
cd "${1}/s132_nrf52_2.0.1"
|
2017-04-24 15:56:28 -04:00
|
|
|
wget https://www.nordicsemi.com/eng/nordic/download_resource/51479/6/84640562/95151
|
|
|
|
mv 95151 temp.zip
|
|
|
|
unzip -u temp.zip
|
|
|
|
rm temp.zip
|
|
|
|
cd -
|
|
|
|
}
|
|
|
|
|
2017-12-21 07:49:14 -05:00
|
|
|
function download_s132_nrf52_5_0_0
|
|
|
|
{
|
|
|
|
echo ""
|
|
|
|
echo "####################################"
|
|
|
|
echo "### Downloading s132_nrf52_5.0.0 ###"
|
|
|
|
echo "####################################"
|
|
|
|
echo ""
|
|
|
|
|
2018-04-12 21:43:23 -04:00
|
|
|
mkdir -p "${1}/s132_nrf52_5.0.0"
|
|
|
|
cd "${1}/s132_nrf52_5.0.0"
|
2017-12-21 07:49:14 -05:00
|
|
|
|
|
|
|
wget http://www.nordicsemi.com/eng/nordic/download_resource/58987/11/7198220/116068
|
|
|
|
mv 116068 temp.zip
|
|
|
|
unzip -u temp.zip
|
|
|
|
rm temp.zip
|
|
|
|
cd -
|
|
|
|
}
|
2017-04-26 13:18:27 -04:00
|
|
|
|
2018-06-18 17:11:30 -04:00
|
|
|
function download_s140_nrf52_6_0_0
|
2018-01-31 18:17:05 -05:00
|
|
|
{
|
|
|
|
echo ""
|
2018-06-18 17:11:30 -04:00
|
|
|
echo "####################################"
|
|
|
|
echo "### Downloading s140_nrf52_6.0.0 ###"
|
|
|
|
echo "####################################"
|
2018-01-31 18:17:05 -05:00
|
|
|
echo ""
|
|
|
|
|
2018-06-18 17:11:30 -04:00
|
|
|
mkdir -p "${1}/s140_nrf52_6.0.0"
|
|
|
|
cd "${1}/s140_nrf52_6.0.0"
|
2018-01-31 18:17:05 -05:00
|
|
|
|
2018-06-18 17:11:30 -04:00
|
|
|
wget https://www.nordicsemi.com/eng/nordic/download_resource/60624/20/49271410/116072
|
2018-01-31 18:17:05 -05:00
|
|
|
mv 116072 temp.zip
|
|
|
|
unzip -u temp.zip
|
|
|
|
rm temp.zip
|
|
|
|
cd -
|
|
|
|
}
|
|
|
|
|
2017-04-26 13:18:27 -04:00
|
|
|
SCRIPT_DIR="$(cd -P "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
|
|
|
2017-12-21 07:49:14 -05:00
|
|
|
if [ $# -eq 0 ]; then
|
2017-04-20 17:54:10 -04:00
|
|
|
echo "No Bluetooth LE stack defined, downloading all."
|
2018-04-12 21:43:23 -04:00
|
|
|
download_s132_nrf52_2_0_1 "${SCRIPT_DIR}"
|
|
|
|
download_s132_nrf52_5_0_0 "${SCRIPT_DIR}"
|
2018-06-18 17:11:30 -04:00
|
|
|
download_s140_nrf52_6_0_0 "${SCRIPT_DIR}"
|
2017-12-21 07:49:14 -05:00
|
|
|
else
|
2017-04-20 17:54:10 -04:00
|
|
|
case $1 in
|
2017-04-24 15:56:28 -04:00
|
|
|
"s132_nrf52_2_0_1" )
|
2018-04-12 21:43:23 -04:00
|
|
|
download_s132_nrf52_2_0_1 "${SCRIPT_DIR}" ;;
|
2017-12-21 07:49:14 -05:00
|
|
|
"s132_nrf52_5_0_0" )
|
2018-04-12 21:43:23 -04:00
|
|
|
download_s132_nrf52_5_0_0 "${SCRIPT_DIR}" ;;
|
2018-06-18 17:11:30 -04:00
|
|
|
"s140_nrf52_6_0_0" )
|
|
|
|
download_s140_nrf52_6_0_0 "${SCRIPT_DIR}" ;;
|
2017-04-20 17:54:10 -04:00
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit 0
|