예제 #1
0
파일: device.py 프로젝트: Karelkat/mercury
    def enumerateSessions(self):
        """
        Send a request to the Agent, asking it to enumerate all sessions.

        The response will be intercepted by a message handler, and the Sessions
        collection updated at some point in the future.
        """
        self.write(SystemRequestFactory.listSessions().setId(999).build())
예제 #2
0
파일: device.py 프로젝트: Karelkat/mercury
    def ping(self):
        """
        Send a ping request to the Agent.

        The response will be intercepted by a message handler, and the
        last_pong identifier updated at some point in the future.
        """

        self.last_ping += 1
        
        self.write(SystemRequestFactory.ping().setId(self.last_ping).build())
예제 #3
0
파일: server.py 프로젝트: Karelkat/mercury
    def startSession(self, device_id):
        """
        Start a new Session with a Device known to the Server.
        """

        return self.sendAndReceive(SystemRequestFactory.startSession(device_id))
예제 #4
0
파일: server.py 프로젝트: Karelkat/mercury
    def listSessions(self):
        """
        Get a list of active sessions on the Server.
        """

        return self.sendAndReceive(SystemRequestFactory.listSessions())
예제 #5
0
파일: server.py 프로젝트: Karelkat/mercury
    def listDevices(self):
        """
        Get a list of Devices boud to the Server.
        """

        return self.sendAndReceive(SystemRequestFactory.listDevices())
예제 #6
0
파일: server.py 프로젝트: Karelkat/mercury
    def stopSession(self, session_id):
        """
        Stop an active Session, known to the Server.
        """

        return self.sendAndReceive(SystemRequestFactory.stopSessionId(session_id))