You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.6 KiB
Bash

#!/bin/bash
F="$1"
echo -ne "$F Checksum:"
echo $(xxd -ps -s 0x44 -l 4 -u $F)
echo
echo -n "Identities Count: "
echo $(xxd -ps -s 0x12C2 -l 1 -u $F)
echo
echo -n "Display>Language: "
xxd -ps -s 0x003B -l 1 -u $F
echo -n "Display>StartupTextLine1: "
echo $(xxd -s 0x009 -l 16 -u $F | cut -d ' ' -f 11-)
echo -n "Display>StartupTextLine2: "
echo $(xxd -s 0x12AA -l 16 -u $F | cut -d ' ' -f 11-)
#LoRa Settings
echo
echo "LoRa>Settings: "
LoRa_NetworkID=$(xxd -ps -s 0x43C3 -l 4 -u $F)
LoRa_DevAddr=$(xxd -ps -s 0x43C7 -l 4 -u $F)
LoRa_NwkSKey=$(xxd -ps -s 0x43CB -l 16 -u $F)
LoRa_AppSKey=$(xxd -ps -s 0x43DB -l 16 -u $F)
echo -e "LoRa Network ID:\t$LoRa_NetworkID"
echo -e "LoRa DevAddr:\t\t$LoRa_DevAddr"
echo -e "LoRa NwkSKey:\t\t$LoRa_NwkSKey"
echo -e "LoRa AppSKey:\t\t$LoRa_AppSKey"
# Recipients
echo
LoRa_R1=$(xxd -s 0x42AA -l 13 -u $F | cut -d ' ' -f 11-)
LoRa_R1_Port=$(xxd -ps -s 0x42B8 -l 1 -u $F)
echo "LoRa Recipient 1: $LoRa_R1 [fPort=$LoRa_R1_Port]"
LoRa_R2=$(xxd -s 0x42BA -l 13 -u $F | cut -d ' ' -f 11-)
LoRa_R2_Port=$(xxd -ps -s 0x42C8 -l 1 -u $F)
echo "LoRa Recipient 2: $LoRa_R2 [fPort=$LoRa_R2_Port]"
LoRa_R3=$(xxd -s 0x42CA -l 13 -u $F | cut -d ' ' -f 11-)
LoRa_R3_Port=$(xxd -ps -s 0x42D8 -l 1 -u $F)
echo "LoRa Recipient 3: $LoRa_R3 [fPort=$LoRa_R3_Port]"
LoRa_R4=$(xxd -s 0x42DA -l 13 -u $F | cut -d ' ' -f 11-)
LoRa_R4_Port=$(xxd -ps -s 0x42E8 -l 1 -u $F)
echo "LoRa Recipient 4: $LoRa_R4 [fPort=$LoRa_R4_Port]"
LoRa_R5=$(xxd -s 0x42EA -l 13 -u $F | cut -d ' ' -f 11-)
LoRa_R5_Port=$(xxd -ps -s 0x42F8 -l 1 -u $F)
echo "LoRa Recipient 4: $LoRa_R5 [fPort=$LoRa_R5_Port]"
echo "Ringtone #21"
xxd -ps -s 0x1240 -l 32 -u $F