code: async def stop(self):
          
          await self._command_task.future_command(['_set_mode', 0, 0])  # Disable advertising
          await self._cleanup_old_connections()
  
          self._command_task.stop()
          self._stream.stop()
          self._serial_port.close()
  
          await super(BLED112Server, self).stop()
docs: Safely shut down this interface