Beispiel #1
0
    def __init__(self, api_def, maxQSize=100):

        # log
        log.info("creating object")

        # store params
        self.api_def = api_def

        # initialize parent class
        ApiConnector.__init__(self, maxQSize)

        # local variables
        self.waitForResp = False  ##< flag to indicate whether we are waiting for an ACK
        self.waitForRespEvent = threading.Event(
        )  ##< semaphore used when waiting for a command to be acknowledged
        self.paramLock = threading.Lock(
        )  ##< lock to ensure atomic access to parameters
        self.RxPacketId = None  ##< running id for packets received from device
        self.TxPacketId = 0  ##< running id for packets sent to device
        self.hdlcLock = threading.Lock()  ##< lock for the HDLC module
        self.hdlc = None  ##< HDLC module (includes CRC)
        self.syncNeeded = True  ##< True iff we need to sync to the device
        self.requestSendLock = threading.Lock(
        )  ##< lock to prevent concurrent requests to be sent
        self.tsDataSent = 0  ##< timestamp when sent data
        self.tsDataReceived = 0  ##< timestamp when received data
 def __init__(self):
     # TODO: init super?
     ApiConnector.__init__(self) # TODO: maxQSize
     self.apidef = HartMgrDefinition.HartMgrDefinition()
     self.manager = None
     self.login_token = None
     self.notif_token = None
     self.notif_thread = None
 def __init__(self):
     # TODO: init super?
     ApiConnector.__init__(self)  # TODO: maxQSize
     self.apidef = HartMgrDefinition.HartMgrDefinition()
     self.manager = None
     self.login_token = None
     self.notif_token = None
     self.notif_thread = None
 def __init__(self):
     
     # local variables
     self.waitForResponse      = threading.Event()
     
     # initialize parent classes
     ApiConnector.__init__(self)
     threading.Thread.__init__(self)
     self.name                 = 'HartMoteConnector'
Beispiel #5
0
    def __init__(self):

        # local variables
        self.waitForResponse = threading.Event()

        # initialize parent classes
        ApiConnector.__init__(self)
        threading.Thread.__init__(self)
        self.name = 'IpMoteConnector'
 def __init__(self, maxQSize=100):
     log.debug("creating object")
     
     # init the parent
     ApiConnector.__init__(self,maxQSize)
     
     # variables
     self.varLock         = threading.Lock()
     self._updateStatus(self.STATUS_DISCONNECTED)
     self.prefix          = None
     
     # reset stats
     self._resetStats()
Beispiel #7
0
 def __init__(self, api_def, maxQSize=100) :
     
     # log
     log.info("creating object")
     
     # store params
     self.api_def         = api_def
     
     # initialize parent class
     ApiConnector.__init__(self, maxQSize)
     
     # local variables
     self.waitForResp     = False                  ##< flag to indicate whether we are waiting for an ACK
     self.waitForRespEvent  = threading.Event()    ##< semaphore used when waiting for a command to be acknowledged
     self.paramLock       = threading.Lock()       ##< lock to ensure atomic access to parameters
     self.RxPacketId      = None                   ##< running id for packets received from device
     self.TxPacketId      = 0                      ##< running id for packets sent to device
     self.hdlcLock        = threading.Lock()       ##< lock for the HDLC module
     self.hdlc            = None                   ##< HDLC module (includes CRC)
     self.syncNeeded      = True                   ##< True iff we need to sync to the device
     self.requestSendLock = threading.Lock()       ##< lock to prevent concurrent requests to be sent
     self.tsDataSent      = 0                      ##< timestamp when sent data
     self.tsDataReceived  = 0                      ##< timestamp when received data