continua modifiche per gestione driver

This commit is contained in:
lejubila
2017-08-03 23:43:06 +02:00
parent 867b4e4374
commit 426ccab0d2
5 changed files with 27 additions and 23 deletions

View File

@@ -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
}

View File

@@ -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
}

View File

@@ -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
}

Binary file not shown.

View File

@@ -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