use new share script

Signed-off-by: Michel-FK <michel.stempin@funkey-project.com>
This commit is contained in:
Michel-FK 2021-06-07 22:34:57 +02:00
parent 67ee9f1520
commit 8ba4b07964
4 changed files with 25 additions and 22 deletions

View File

@ -1,20 +0,0 @@
#!/bin/sh
# Uncomment the following line to get debug info
#set -x
# Get USB state
usb_present=$(cat /sys/class/power_supply/axp20x-usb/present)
# Get udc state
udc_state=$(cat /sys/class/udc/musb-hdrc.1.auto/state)
if [[ x"$udc_state" == "xconfigured" -a "$usb_present" == "1" ]]; then
# Connected succesfully to a host
echo "yes"
exit 0
else
echo "no"
exit 1
fi

View File

@ -127,6 +127,25 @@ is_share_started () {
return $res return $res
} }
is_usb_data_connected () {
# Get USB state
local usb_present=$(cat /sys/class/power_supply/axp20x-usb/present)
# Get udc state
local udc_state=$(cat /sys/class/udc/musb-hdrc.1.auto/state)
if [ "x${udc_state}" = "xconfigured" -a "${usb_present}" -eq 1 ]; then
# Connected succesfully to a host
echo "yes"
return 0
else
echo "no"
return 1
fi
}
case "$1" in case "$1" in
init) init)
@ -145,6 +164,9 @@ case "$1" in
is_share_started is_share_started
;; ;;
is_usb_data_connected)
is_usb_data_connected
;;
*) *)
die 15 "Usage $0 {init|start|stop|is_sharing}" die 15 "Usage $0 {init|start|stop|is_sharing}"

View File

@ -3,7 +3,8 @@
# gmenu2x # gmenu2x
# #
############################################################# #############################################################
GMENU2X_VERSION = 737b86e
GMENU2X_VERSION = 9f83250
GMENU2X_SITE_METHOD = git GMENU2X_SITE_METHOD = git
GMENU2X_SITE = https://github.com/FunKey-Project/gmenu2x.git GMENU2X_SITE = https://github.com/FunKey-Project/gmenu2x.git
GMENU2X_LICENSE = GPL-2.0 GMENU2X_LICENSE = GPL-2.0

View File

@ -4,7 +4,7 @@
# #
################################################################################ ################################################################################
RETROFE_VERSION = 9184665 RETROFE_VERSION = f162704
RETROFE_SITE_METHOD = git RETROFE_SITE_METHOD = git
RETROFE_SITE = https://github.com/FunKey-Project/RetroFE.git RETROFE_SITE = https://github.com/FunKey-Project/RetroFE.git
RETROFE_DEPENDENCIES = gstreamer1 gst1-plugins-base sdl sdl_image sdl_mixer sdl_sound sdl_ttf libglib2 sqlite zlib RETROFE_DEPENDENCIES = gstreamer1 gst1-plugins-base sdl sdl_image sdl_mixer sdl_sound sdl_ttf libglib2 sqlite zlib