Browse Source

Change mDNS text attributes

fastled
Xose Pérez 7 years ago
parent
commit
2e6d0ab704
3 changed files with 19 additions and 13 deletions
  1. +3
    -3
      code/espurna/ota.ino
  2. +8
    -5
      code/ota_flash.sh
  3. +8
    -5
      code/ota_list.sh

+ 3
- 3
code/espurna/ota.ino View File

@ -56,9 +56,9 @@ void otaSetup() {
ArduinoOTA.begin();
// Public ESPurna related txt for OTA discovery
MDNS.addServiceTxt("arduino", "tcp", "firmware", APP_NAME);
MDNS.addServiceTxt("arduino", "tcp", "espurna_version", APP_VERSION);
MDNS.addServiceTxt("arduino", "tcp", "espurna_board", DEVICE_NAME);
MDNS.addServiceTxt("arduino", "tcp", "app_name", APP_NAME);
MDNS.addServiceTxt("arduino", "tcp", "app_version", APP_VERSION);
MDNS.addServiceTxt("arduino", "tcp", "target_board", DEVICE_NAME);
}


+ 8
- 5
code/ota_flash.sh View File

@ -24,11 +24,12 @@ useAvahi() {
echo_pad "#" 4
echo_pad "HOSTNAME" 20
echo_pad "IP" 20
echo_pad "APP" 15
echo_pad "VERSION" 15
echo_pad "DEVICE" 30
echo_pad "VERSION" 10
echo
printf -v line '%*s\n' 84
printf -v line '%*s\n' 104
echo ${line// /-}
counter=0
@ -48,8 +49,9 @@ useAvahi() {
hostname=`echo $line | cut -d ';' -f4`
ip=`echo $line | cut -d ';' -f8`
txt=`echo $line | cut -d ';' -f10`
board=`echo $txt | sed -n "s/.*espurna_board=\([^\"]*\).*/\1/p"`
version=`echo $txt | sed -n "s/.*espurna_version=\([^\"]*\).*/\1/p"`
app_name=`echo $txt | sed -n "s/.*app_name=\([^\"]*\).*/\1/p"`
app_version=`echo $txt | sed -n "s/.*app_version=\([^\"]*\).*/\1/p"`
board=`echo $txt | sed -n "s/.*target_board=\([^\"]*\).*/\1/p"`
echo -n "$ip;" >> $ip_file
echo -n "$board;" >> $board_file
@ -57,8 +59,9 @@ useAvahi() {
echo_pad "$counter" 4
echo_pad "$hostname" 20
echo_pad "$ip" 20
echo_pad "$app_name" 15
echo_pad "$app_version" 15
echo_pad "$board" 30
echo_pad "$version" 10
echo


+ 8
- 5
code/ota_list.sh View File

@ -16,11 +16,12 @@ useAvahi() {
echo_pad "#" 4
echo_pad "HOSTNAME" 20
echo_pad "IP" 20
echo_pad "APP" 15
echo_pad "VERSION" 15
echo_pad "DEVICE" 30
echo_pad "VERSION" 10
echo
printf -v line '%*s\n' 84
printf -v line '%*s\n' 104
echo ${line// /-}
counter=0
@ -32,14 +33,16 @@ useAvahi() {
hostname=`echo $line | cut -d ';' -f4`
ip=`echo $line | cut -d ';' -f8`
txt=`echo $line | cut -d ';' -f10`
board=`echo $txt | sed -n "s/.*espurna_board=\([^\"]*\).*/\1/p"`
version=`echo $txt | sed -n "s/.*espurna_version=\([^\"]*\).*/\1/p"`
app_name=`echo $txt | sed -n "s/.*app_name=\([^\"]*\).*/\1/p"`
app_version=`echo $txt | sed -n "s/.*app_version=\([^\"]*\).*/\1/p"`
board=`echo $txt | sed -n "s/.*target_board=\([^\"]*\).*/\1/p"`
echo_pad "$counter" 4
echo_pad "$hostname" 20
echo_pad "$ip" 20
echo_pad "$app_name" 15
echo_pad "$app_version" 15
echo_pad "$board" 30
echo_pad "$version" 10
echo
done


Loading…
Cancel
Save