continua modifiche per gestione driver
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
}
|
||||
|
||||
22
drv/sample/releopenclose.include.sh
Normal file
22
drv/sample/releopenclose.include.sh
Normal 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.
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user