From 2e6d0ab70492ab1af21432e4cc02a4183e1f695b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xose=20P=C3=A9rez?= Date: Mon, 18 Sep 2017 22:11:23 +0200 Subject: [PATCH] Change mDNS text attributes --- code/espurna/ota.ino | 6 +++--- code/ota_flash.sh | 13 ++++++++----- code/ota_list.sh | 13 ++++++++----- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/code/espurna/ota.ino b/code/espurna/ota.ino index 6f649ad3..280c3b2f 100644 --- a/code/espurna/ota.ino +++ b/code/espurna/ota.ino @@ -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); } diff --git a/code/ota_flash.sh b/code/ota_flash.sh index cde96bcb..fe6c3ba3 100755 --- a/code/ota_flash.sh +++ b/code/ota_flash.sh @@ -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 diff --git a/code/ota_list.sh b/code/ota_list.sh index 355d373c..1276745c 100755 --- a/code/ota_list.sh +++ b/code/ota_list.sh @@ -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