DeviceFindFactory constructor

DeviceFindFactory({
  1. OnStateListener? onState,
  2. dynamic type = DEVICE_FOUND_BROADCAST_SSDP,
  3. bool? showLog,
})

Implementation

DeviceFindFactory(
    {OnStateListener? onState, type = DEVICE_FOUND_BROADCAST_SSDP, bool? showLog}) {
  switch (type) {
    case DEVICE_FOUND_BROADCAST:
      mDeviceFindList.add(BroadcastDeviceFind(stateListener: onState, showLog: showLog));
      break;
    case DEVICE_FOUND_SSDP:
      mDeviceFindList.add(SSDPDeviceFind(stateListener: onState, showLog: showLog));
      break;
    case DEVICE_FOUND_BROADCAST_SSDP:
      mDeviceFindList.add(BroadcastDeviceFind(stateListener: onState, showLog: showLog));
      mDeviceFindList.add(SSDPDeviceFind(stateListener: onState, showLog: showLog));
      break;
  }
}