import subprocess
from HASvioletRF import HASrf
from HASvioletHID import HAShid

#
# VARIABLES
#

hasVIOLETcfg = "cfg/hasVIOLET.json"

#
# Initialise HASviolet
#

HASit = HASrf()
HAShat = HAShid()

#
# IMPORT ARGS
#

parser = argparse.ArgumentParser(description='HASviolet Beacon')
parser.add_argument('-c',
                    '--count',
                    type=int,
                    help='number of times to repeat the message',
                    required=True)
parser.add_argument('-t',
                    '--time',
                    type=int,
                    help='number of seconds between repeating message',
Esempio n. 2
0
    httpServer = tornado.httpserver.HTTPServer(
        app,
        ssl_options={
            "certfile": os.path.join("cfg/hasVIOLET.crt"),
            "keyfile": os.path.join("cfg/hasVIOLET.key"),
        })

    httpServer.listen(options.port)
    print(" ")
    print("HASviolet Websox Server started: listening on port:", options.port)
    print(" ")

    ##threadRX = threading.Thread(target=HASviolet, name=HASvRX)
    ##threadRX.start()
    threadRX = HASviolet()
    threadRX.start()

    tornado.ioloop.IOLoop.instance().start()


#
# MAIN
#

HASit = HASrf()
HAShat = HAShid()
HASsess = HASsession()
HASit.startradio()
main()