Example #1
0
    def __init__(self, connectionString=""):
        '''
        Constructor.
        
        Opens connection to the remote serial-to-TCP port specified by connectionString
        '''
        if connectionString != "":
            self.connString = connectionString
        else:
            self.connString = Config.getLS30ConnectionString()

        Config.getLogger().info("Opening serial connection to " +
                                self.connString)
        self.connection = serial_for_url(self.connString)

        if not self.connection.isOpen():
            raise SerialException()

        Config.getLogger().info("Connection to " + self.connString +
                                " established")
Example #2
0
from bottle import Bottle, run, SimpleTemplate, static_file, redirect, error

from LS30Connector import ReqRsnp
from LS30Util import Commands, Config
from LS30Web import Util
from LS30Data import DeviceLog, DeviceStatus, CodeTable

import pprint
from pprint import pformat

webHost = "0.0.0.0"
webPort = 8080

# connString  = "socket://192.168.1.220:1681"
connString = Config.getLS30ConnectionString()

app = Bottle()
isInitialized = False

reqRsnp = None


def init(host="localhost", port=8080):
    global webHost, webPort, isInitialized
    webHost = host
    webPort = port
    isInitialized = True


def start():