def GET(self, setvol=''): scanner = pyuniden.Unidenrc() scanner.openserial(PORT, SPEED) status, volume = scanner.volume(setvol) scanner.closeserial() return status, volume
def GET(self): scanner = pyuniden.Unidenrc() scanner.openserial(PORT, SPEED) status, volume = scanner.mute() scanner.closeserial() return status, volume
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'
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()
#!/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()