MCPcopy Create free account
hub / github.com/FreeformRobotics/OTS / register_slave

Method register_slave

lib/nn/modules/comm.py:78–94  ·  view source on GitHub ↗

Register an slave device. Args: identifier: an identifier, usually is the device id. Returns: a `SlavePipe` object which can be used to communicate with the master device.

(self, identifier)

Source from the content-addressed store, hash-verified

76 self._activated = False
77
78 def register_slave(self, identifier):
79 """
80 Register an slave device.
81
82 Args:
83 identifier: an identifier, usually is the device id.
84
85 Returns: a `SlavePipe` object which can be used to communicate with the master device.
86
87 """
88 if self._activated:
89 assert self._queue.empty(), 'Queue is not clean before next initialization.'
90 self._activated = False
91 self._registry.clear()
92 future = FutureResult()
93 self._registry[identifier] = _MasterRegistry(future)
94 return SlavePipe(identifier, self._queue, future)
95
96 def run_master(self, master_msg):
97 """

Callers 1

Calls 2

FutureResultClass · 0.85
SlavePipeClass · 0.85

Tested by

no test coverage detected