Skip to content

Commit

Permalink
add stop funtion to version servicer
Browse files Browse the repository at this point in the history
  • Loading branch information
atiderko committed Nov 30, 2023
1 parent ad682e9 commit 333d3c6
Show file tree
Hide file tree
Showing 4 changed files with 745 additions and 472 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -501,3 +501,6 @@ class DaemonVersion:
def __init__(self, version: str, date: str) -> None:
self.version = version
self.date = date

def __repr__(self) -> str:
return f"DaemonVersion<version: {self.version}, date: {self.date}>"
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,19 @@


class VersionServicer(CrossbarBaseSession):

def __init__(self, loop: asyncio.AbstractEventLoop, realm: str = 'ros', port: int = 11911):
def __init__(
self, loop: asyncio.AbstractEventLoop, realm: str = "ros", port: int = 11911
):
Log.info("Create ROS2 version servicer")
CrossbarBaseSession.__init__(self, loop, realm, port)
self._version, self._date = version.detect_version(
nmd.ros_node, 'fkie_node_manager_daemon')
nmd.ros_node, "fkie_node_manager_daemon"
)

def stop(self):
self.shutdown()

@wamp.register('ros.daemon.get_version')
@wamp.register("ros.daemon.get_version")
def get_version(self) -> DaemonVersion:
Log.info(f"{self.__class__.__name__}: get daemon version ")
reply = DaemonVersion(f"{self._version}", f"{self._date}")
Expand Down
Loading

0 comments on commit 333d3c6

Please sign in to comment.