termux-api: Add infrared and telephony api:s
This commit is contained in:
parent
bea93fbd7a
commit
d525dd2fc7
23
packages/termux-api/termux-infrared-frequencies
Executable file
23
packages/termux-api/termux-infrared-frequencies
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
SCRIPTNAME=termux-infrared-frequencies
|
||||||
|
show_usage () {
|
||||||
|
echo "Usage: $SCRIPTNAME"
|
||||||
|
echo "Query the infrared transmitter's supported carrier frequencies."
|
||||||
|
echo ""
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
while getopts :h option
|
||||||
|
do
|
||||||
|
case "$option" in
|
||||||
|
h) show_usage;;
|
||||||
|
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $(($OPTIND-1))
|
||||||
|
|
||||||
|
if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
|
||||||
|
|
||||||
|
@TERMUX_API@ InfraredFrequencies
|
30
packages/termux-api/termux-infrared-transmit
Executable file
30
packages/termux-api/termux-infrared-transmit
Executable file
@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
SCRIPTNAME=termux-infrared-transmit
|
||||||
|
show_usage () {
|
||||||
|
echo "Usage: $SCRIPTNAME -f frequency pattern"
|
||||||
|
echo "Transmit an infrared pattern. The pattern is specified in comma-separated on/off intervals, such as '20,50,20,30'. Only patterns shorter than 2 seconds will be transmitted."
|
||||||
|
echo ""
|
||||||
|
echo " -f frequency IR carrier frequency in Hertz"
|
||||||
|
echo ""
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
FREQUENCY=""
|
||||||
|
while getopts :hf: option
|
||||||
|
do
|
||||||
|
case "$option" in
|
||||||
|
h) show_usage;;
|
||||||
|
f) FREQUENCY="--ei frequency $OPTARG";;
|
||||||
|
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $(($OPTIND-1))
|
||||||
|
|
||||||
|
if [ -z "$FREQUENCY" ]; then echo "$SCRIPTNAME: No frequency specified"; exit 1; fi
|
||||||
|
|
||||||
|
if [ $# -lt 1 ]; then echo "$SCRIPTNAME: too few arguments"; exit 1; fi
|
||||||
|
if [ $# -gt 1 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
|
||||||
|
|
||||||
|
@TERMUX_API@ InfraredTransmit $FREQUENCY --eia pattern $1
|
23
packages/termux-api/termux-telephony-cellinfo
Executable file
23
packages/termux-api/termux-telephony-cellinfo
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
SCRIPTNAME=termux-telephony-cellinfo
|
||||||
|
show_usage () {
|
||||||
|
echo "Usage: $SCRIPTNAME"
|
||||||
|
echo "Get information about all observed cell information from all radios on the device including the primary and neighboring cells."
|
||||||
|
echo ""
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
while getopts :h option
|
||||||
|
do
|
||||||
|
case "$option" in
|
||||||
|
h) show_usage;;
|
||||||
|
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $(($OPTIND-1))
|
||||||
|
|
||||||
|
if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
|
||||||
|
|
||||||
|
@TERMUX_API@ TelephonyCellInfo
|
23
packages/termux-api/termux-telephony-deviceinfo
Executable file
23
packages/termux-api/termux-telephony-deviceinfo
Executable file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e -u
|
||||||
|
|
||||||
|
SCRIPTNAME=termux-telephony-deviceinfo
|
||||||
|
show_usage () {
|
||||||
|
echo "Usage: $SCRIPTNAME"
|
||||||
|
echo "Get information about the telephony device."
|
||||||
|
echo ""
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
while getopts :h option
|
||||||
|
do
|
||||||
|
case "$option" in
|
||||||
|
h) show_usage;;
|
||||||
|
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
shift $(($OPTIND-1))
|
||||||
|
|
||||||
|
if [ $# != 0 ]; then echo "$SCRIPTNAME: too many arguments"; exit 1; fi
|
||||||
|
|
||||||
|
@TERMUX_API@ TelephonyDeviceInfo
|
Loading…
Reference in New Issue
Block a user