docs: def on_connect(self, client, userdata, flags, rc):
          '''
          Callback for when the client receives a ``CONNACK`` response from the
          broker.
  
          Parameters
          ----------
          client : paho.mqtt.client.Client
              The client instance for this callback.
          userdata : object
              The private user data as set in :class:`paho.mqtt.client.Client`
              constructor or :func:`paho.mqtt.client.Client.userdata_set`.
          flags : dict
              Response flags sent by the broker.
  
              The flag ``flags['session present']`` is useful for clients that
              are using clean session set to 0 only.
  
              If a client with clean session=0, that reconnects to a broker that
              it has previously connected to, this flag indicates whether the
              broker still has the session information for the client.
  
              If 1, the session still exists.
          rc : int
              The connection result.
  
              The value of rc indicates success or not:
  
                - 0: Connection successful
                - 1: Connection refused - incorrect protocol version
                - 2: Connection refused - invalid client identifier
                - 3: Connection refused - server unavailable
                - 4: Connection refused - bad username or password
                - 5: Connection refused - not authorised
                - 6-255: Currently unused.
  
          Notes
          -----
  
          Subscriptions should be defined in this method to ensure subscriptions
          will be renewed upon reconnecting after a loss of connection.
          '''
          super(SerialDeviceManager, self).on_connect(client, userdata, flags, rc)
  
          if rc == 0:
              self.mqtt_client.subscribe('serial_device/+/connect')
              self.mqtt_client.subscribe('serial_device/+/send')
              self.mqtt_client.subscribe('serial_device/+/close')
              self.mqtt_client.subscribe('serial_device/refresh_comports')
              self.refresh_comports()