parameters: (self)
return_statement: return discovered_modules
docstring: Scan for connected modules and return list of
          tuples of serial ports and device names
docstring_summary: Scan for connected modules and return list of
          tuples of serial ports and device names
docstring_tokens: Scan for connected modules and return list of tuples of serial ports and device names
function: def scan(self) -> List[modules.ModuleAtPort]:
          """Scan for connected modules and return list of
          tuples of serial ports and device names
          """
          if IS_ROBOT and IS_LINUX:
              devices = glob("/dev/ot_module*")
          else:
              devices = []
  
          discovered_modules = []
  
          for port in devices:
              symlink_port = port.split("dev/")[1]
              module_at_port = self.get_module_at_port(symlink_port)
              if module_at_port:
                  discovered_modules.append(module_at_port)
  
          log.debug("Discovered modules: {}".format(discovered_modules))
          return discovered_modules
function_tokens: def scan ( self ) -> List [ modules . ModuleAtPort ] : if IS_ROBOT and IS_LINUX : devices = glob ( "/dev/ot_module*" ) else : devices = [ ] discovered_modules = [ ] for port in devices : symlink_port = port . split ( "dev/" ) [ 1 ] module_at_port = self . get_module_at_port ( symlink_port ) if module_at_port : discovered_modules . append ( module_at_port ) log . debug ( "Discovered modules: {}" . format ( discovered_modules ) ) return discovered_modules