code: def _searchservices(device, name=None, uuid=None, uuidbad=None):
      
      if not isinstance(device, _IOBluetooth.IOBluetoothDevice):
          raise ValueError("device must be IOBluetoothDevice, was %s" % \
              type(device))
  
      services = []
      allservices = device.getServices()
      if uuid:
          gooduuids = (uuid, )
      else:
          gooduuids = ()
      if uuidbad:
          baduuids = (uuidbad, )
      else:
          baduuids = ()
  
      if allservices is not None:
          for s in allservices:
              if gooduuids and not s.hasServiceFromArray_(gooduuids):
                  continue
              if baduuids and s.hasServiceFromArray_(baduuids):
                  continue
              if name is None or s.getServiceName() == name:
                  services.append(s)
      return services
docs: Searches the given IOBluetoothDevice using the specified parameters.
      Returns an empty list if the device has no services.
  
      uuid should be IOBluetoothSDPUUID object.