示例#1
0
    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
    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
    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
    def listSessions(self):
        """
        Get a list of active sessions on the Server.
        """

        return self.sendAndReceive(SystemRequestFactory.listSessions())
示例#5
0
    def listDevices(self):
        """
        Get a list of Devices boud to the Server.
        """

        return self.sendAndReceive(SystemRequestFactory.listDevices())
示例#6
0
    def stopSession(self, session_id):
        """
        Stop an active Session, known to the Server.
        """

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