Пример #1
0
    def GET(self, setvol=''):
        scanner = pyuniden.Unidenrc()
        scanner.openserial(PORT, SPEED)
        status, volume = scanner.volume(setvol)
        scanner.closeserial()

        return status, volume
Пример #2
0
    def GET(self):
        scanner = pyuniden.Unidenrc()
        scanner.openserial(PORT, SPEED)
        status, volume = scanner.mute()
        scanner.closeserial()

        return status, volume
Пример #3
0
    def GET(self, data):

        buttons = []
        buttons = data.split("/")

        if len(buttons) > 2:
            return web.internalerror()

        scanner = pyuniden.Unidenrc()
        scanner.openserial(PORT, SPEED)

        if 'F' in buttons:
            buttons.remove('F')
            scanner.pushbutton(buttons[0], "P", function=True)
        else:
            scanner.pushbutton(buttons[0], "P")

        scanner.closeserial()

        return 'OK'
Пример #4
0
def main():
    """ Main Routines """
    scanner = pyuniden.Unidenrc()
    scanner.openserial(PORT, SPEED)

    try:
        while True:
            screenoutput = scanner.getscreen()
            strength = scanner.getsignalstrength()
            vol = scanner.volume()[1]
            sql = scanner.squelch()[1]

            os.system('clear')

            print menu(screenoutput, strength=strength, vol=vol, sql=sql)

            time.sleep(1)

    except KeyboardInterrupt:
        print "W: interrupt received, stopping..."
        scanner.closeserial()

    finally:
        scanner.closeserial()
Пример #5
0
#!/usr/bin/which python3
# Mute Uniden BCT15X Scanner
#
# Author: Ben Mason
# Version: 0.1
#
import pyuniden

__author__ = "Ben Mason"
__version__ = "0.1"
__email__ = "*****@*****.**"
__status__ = "Development"

PORT = '/dev/ttyACM0'
SPEED = 115200

scanner = pyuniden.Unidenrc()
scanner.openserial(PORT, SPEED)
scanner.mute()
scanner.closeserial()