Added LPP device ids in config file and added a script to generate binary for individual device (lora EUI/key parameters)

This commit is contained in:
2019-03-12 17:43:26 +01:00
parent 2e3ad42102
commit 80dedb1490
4 changed files with 59 additions and 16 deletions
+40
View File
@@ -0,0 +1,40 @@
#!/bin/sh
MASTERFILE=./BUILD/NUCLEO_L073RZ/GCC_ARM-RELEASE/waveofhoney-mbed5.bin
# patterns
DEVICEEUI=ABBAABBAABBAABBA
APPEUI=ACCAACCAACCAACCA
APPKEY=ADDAADDAADDAADDAADDAADDAADDAADDA
if [ $# -ne 2 ]; then
echo "gen_images <master_binary> <devices_file>\n"
echo "devices file must be in the form :\n"
echo "dev1name:dev1eui:dev1appeui:dev1appkey"
echo "dev2name:dev2eui:dev2appeui:dev2appkey\n"
exit 1;
fi
MASTER=$1
DEVICES=$2
if [ ! -e $MASTER ]; then
echo "The master file $MASTER doesn't exists"
exit 1;
fi
if [ ! -e $DEVICES ]; then
echo "The devices file $DEVICES doesn't exists"
exit 1;
fi
for DEVICE in $(cat $DEVICES); do
name=$(echo $DEVICE | cut -d : -f 1)
deviceeui=$(echo $DEVICE | cut -d : -f 2)
appeui=$(echo $DEVICE | cut -d : -f 3)
appkey=$(echo $DEVICE | cut -d : -f 4)
echo $name
hexdump -ve '1/1 "%.2X"' $MASTERFILE | sed "s/$DEVICEEUI/$deviceeui/; s/$APPEUI/$appeui/; s/$APPKEY/$appkey/" | xxd -r -p > waveofhoney-${name}.bin
done
exit;