deepracer_systems_pkg/deepracer_systems_pkg/network_monitor_module/network_monitor_node.py [112:157]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.led_cb_group = MutuallyExclusiveCallbackGroup()
        self.led_blink_service = self.create_client(SetStatusLedBlinkSrv,
                                                    constants.LED_BLINK_SERVICE_NAME,
                                                    callback_group=self.led_cb_group)
        self.led_solid_service = self.create_client(SetStatusLedSolidSrv,
                                                    constants.LED_SOLID_SERVICE_NAME,
                                                    callback_group=self.led_cb_group)
        while not self.led_blink_service.wait_for_service(timeout_sec=1.0):
            self.get_logger().info("Led blink service not available, waiting again...")
        while not self.led_solid_service.wait_for_service(timeout_sec=1.0):
            self.get_logger().info("Led solid service not available, waiting again...")
        self.led_blink_request = SetStatusLedBlinkSrv.Request()
        self.led_solid_request = SetStatusLedSolidSrv.Request()

        # Client to USB File system subscription service that allows the node to connect to WiFi
        # based on the contents in the WiFi configuration file in the USB. The usb_monitor_node
        # will trigger notification if it finds the WiFi configuration file from the watchlist
        # in the USB drive.
        self.usb_sub_cb_group = ReentrantCallbackGroup()
        self.usb_file_system_subscribe_client = self.create_client(USBFileSystemSubscribeSrv,
                                                                   constants.USB_FILE_SYSTEM_SUBSCRIBE_SERVICE_NAME,
                                                                   callback_group=self.usb_sub_cb_group)
        while not self.usb_file_system_subscribe_client.wait_for_service(timeout_sec=1.0):
            self.get_logger().info("File System Subscribe not available, waiting again...")

        # Client to USB Mount point manager service to indicate that the usb_monitor_node can safely
        # decrement the counter for the mount point once the action function for the WiFi configuration
        # file being watched by network_monitor_node is succesfully executed.
        self.usb_mpm_cb_group = ReentrantCallbackGroup()
        self.usb_mount_point_manager_client = self.create_client(USBMountPointManagerSrv,
                                                                 constants.USB_MOUNT_POINT_MANAGER_SERVICE_NAME,
                                                                 callback_group=self.usb_mpm_cb_group)
        while not self.usb_mount_point_manager_client.wait_for_service(timeout_sec=1.0):
            self.get_logger().info("USB mount point manager service not available, waiting again...")

        # Subscriber to USB File system notification publisher to recieve the broadcasted messages
        # with file/folder details, whenever a watched file is identified in the USB connected.
        self.usb_notif_cb_group = ReentrantCallbackGroup()
        self.usb_file_system_notification_sub = self.create_subscription(USBFileSystemNotificationMsg,
                                                                         constants.USB_FILE_SYSTEM_NOTIFICATION_TOPIC,
                                                                         self.usb_file_system_notification_cb,
                                                                         10,
                                                                         callback_group=self.usb_notif_cb_group)

        # Add the "wifi-creds.txt" file to the watchlist.
        usb_file_system_subscribe_request = USBFileSystemSubscribeSrv.Request()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



deepracer_systems_pkg/deepracer_systems_pkg/software_update_module/software_update_node.py [181:226]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        self.led_cb_group = MutuallyExclusiveCallbackGroup()
        self.led_blink_service = self.create_client(SetStatusLedBlinkSrv,
                                                    constants.LED_BLINK_SERVICE_NAME,
                                                    callback_group=self.led_cb_group)
        self.led_solid_service = self.create_client(SetStatusLedSolidSrv,
                                                    constants.LED_SOLID_SERVICE_NAME,
                                                    callback_group=self.led_cb_group)
        while not self.led_blink_service.wait_for_service(timeout_sec=1.0):
            self.get_logger().info("Led blink service not available, waiting again...")
        while not self.led_solid_service.wait_for_service(timeout_sec=1.0):
            self.get_logger().info("Led solid service not available, waiting again...")
        self.led_blink_request = SetStatusLedBlinkSrv.Request()
        self.led_solid_request = SetStatusLedSolidSrv.Request()

        # Client to USB File system subscription service that allows the node to install
        # signed software packages(*.deb.gpg) present in the USB. The usb_monitor_node
        # will trigger notification if it finds the "update" folder from the watchlist
        # in the USB drive.
        self.usb_sub_cb_group = ReentrantCallbackGroup()
        self.usb_file_system_subscribe_client = self.create_client(USBFileSystemSubscribeSrv,
                                                                   constants.USB_FILE_SYSTEM_SUBSCRIBE_SERVICE_NAME,
                                                                   callback_group=self.usb_sub_cb_group)
        while not self.usb_file_system_subscribe_client.wait_for_service(timeout_sec=1.0):
            self.get_logger().info("File System Subscribe not available, waiting again...")

        # Client to USB Mount point manager service to indicate that the usb_monitor_node can safely
        # decrement the counter for the mount point once the action function for the "update" folder
        # file being watched by software_update_node is succesfully executed.
        self.usb_mpm_cb_group = ReentrantCallbackGroup()
        self.usb_mount_point_manager_client = self.create_client(USBMountPointManagerSrv,
                                                                 constants.USB_MOUNT_POINT_MANAGER_SERVICE_NAME,
                                                                 callback_group=self.usb_mpm_cb_group)
        while not self.usb_mount_point_manager_client.wait_for_service(timeout_sec=1.0):
            self.get_logger().info("USB mount point manager service not available, waiting again...")

        # Subscriber to USB File system notification publisher to recieve the broadcasted messages
        # with file/folder details, whenever a watched file is identified in the USB connected.
        self.usb_notif_cb_group = ReentrantCallbackGroup()
        self.usb_file_system_notification_sub = self.create_subscription(USBFileSystemNotificationMsg,
                                                                         constants.USB_FILE_SYSTEM_NOTIFICATION_TOPIC,
                                                                         self.usb_file_system_notification_cb,
                                                                         10,
                                                                         callback_group=self.usb_notif_cb_group)

        # Add the "update" folder to the watchlist.
        usb_file_system_subscribe_request = USBFileSystemSubscribeSrv.Request()
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



