diff --git a/drv/sample/close.include.sh b/drv/sample/close.include.sh deleted file mode 100644 index c86bb21..0000000 --- a/drv/sample/close.include.sh +++ /dev/null @@ -1,11 +0,0 @@ -# -# Questa funzione viene richiamata da "ev_close" di piGarden -# -# $1 identificativo relè da chiudere -# -function drv_sample_close { - - echo "$(date) drv_sample_close $1" >> /tmp/piGarden.drv.sample - -} - diff --git a/drv/sample/open.include.sh b/drv/sample/open.include.sh deleted file mode 100644 index 06ebb82..0000000 --- a/drv/sample/open.include.sh +++ /dev/null @@ -1,11 +0,0 @@ -# -# Questa funzione viene richiamata da "ev_open" di piGarden -# -# $1 identificativo relè da aprire -# -function drv_sample_open { - - echo "$(date) drv_sample_open $1" >> /tmp/piGarden.drv.sample - -} - diff --git a/drv/sample/releopenclose.include.sh b/drv/sample/releopenclose.include.sh new file mode 100644 index 0000000..3547b02 --- /dev/null +++ b/drv/sample/releopenclose.include.sh @@ -0,0 +1,22 @@ +# +# Apertura rele +# +# $1 identificativo relè da aprire +# +function drv_sample_rele_open { + + echo "$(date) drv_sample_rele_open $1" >> /tmp/piGarden.drv.sample + +} + +# +# Chiusura rele +# +# $1 identificativo relè da chiudere +# +function drv_sample_rele_close { + + echo "$(date) drv_sample_rele_close $1" >> /tmp/piGarden.drv.sample + +} + diff --git a/include/.drv.include.sh.swp b/include/.drv.include.sh.swp deleted file mode 100644 index 997484f..0000000 Binary files a/include/.drv.include.sh.swp and /dev/null differ diff --git a/include/drv.include.sh b/include/drv.include.sh index ade5c2e..66f68e9 100644 --- a/include/drv.include.sh +++ b/include/drv.include.sh @@ -1,3 +1,5 @@ +declare -A drv_avalible + function setup_drv { declare -a list_drv @@ -21,10 +23,12 @@ function setup_drv { local file_drv for drv in "${list_drv[@]}" do - for callback in init open close status + for callback in init releopenclose status do file_drv="$DIR_SCRIPT/drv/$drv/$callback.include.sh" if [ -f "$file_drv" ]; then + drv_avalible[$drv]="${drv_avalible[$drv]}#$callback#" + #echo ${drv_avalible[$drv]} . "$file_drv" fi done