parameters: ()
return_statement: return interfaces
docstring: helper function to scan USB interfaces
      returns a list of SuitableSerialInterface objects with name and id attributes
docstring_summary: helper function to scan USB interfaces
      returns a list of SuitableSerialInterface objects with name and id attributes
docstring_tokens: helper function to scan USB interfaces returns a list of SuitableSerialInterface objects with name and id attributes
function: def scan_interfaces():
      """
      helper function to scan USB interfaces
      returns a list of SuitableSerialInterface objects with name and id attributes
      """
      interfaces = []
      for service in GetIOServicesByType('IOSerialBSDClient'):
          device = get_string_property(service, "IOCalloutDevice")
          if device:
              usb_device = GetParentDeviceByType(service, "IOUSBInterface")
              if usb_device:
                  name = get_string_property(usb_device, "USB Interface Name") or None
                  locationID = get_int_property(usb_device, "locationID", kCFNumberSInt32Type) or ''
                  i = SuitableSerialInterface()
                  i.id = locationID
                  i.name = name
                  interfaces.append(i)
      return interfaces
function_tokens: def scan_interfaces ( ) : interfaces = [ ] for service in GetIOServicesByType ( 'IOSerialBSDClient' ) : device = get_string_property ( service , "IOCalloutDevice" ) if device : usb_device = GetParentDeviceByType ( service , "IOUSBInterface" ) if usb_device : name = get_string_property ( usb_device , "USB Interface Name" ) or None locationID = get_int_property ( usb_device , "locationID" , kCFNumberSInt32Type ) or '' i = SuitableSerialInterface ( ) i . id = locationID i . name = name interfaces . append ( i ) return interfaces