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())
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())
def startSession(self, device_id): """ Start a new Session with a Device known to the Server. """ return self.sendAndReceive(SystemRequestFactory.startSession(device_id))
def listSessions(self): """ Get a list of active sessions on the Server. """ return self.sendAndReceive(SystemRequestFactory.listSessions())
def listDevices(self): """ Get a list of Devices boud to the Server. """ return self.sendAndReceive(SystemRequestFactory.listDevices())
def stopSession(self, session_id): """ Stop an active Session, known to the Server. """ return self.sendAndReceive(SystemRequestFactory.stopSessionId(session_id))