コード例 #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))