sendCommands method

Future<bool> sendCommands(
  1. ScanwedgeChannel scanWedge
)

Implementation

Future<bool> sendCommands(ScanwedgeChannel scanWedge) async {
  final json = {
    'PROFILE_NAME': profileName,
    'PROFILE_ENABLED': 'true',
    'CONFIG_MODE': configMode,
    'PLUGIN_CONFIG': [
      {
        'PARAM_LIST': {'keystroke_output_enabled': (!disableKeystroke).toString()},
        'PLUGIN_NAME': 'KEYSTROKE'
      },
      if (barcodePlugin != null) barcodePlugin!.toMap,
      if (optionalMap != null) optionalMap!,
      if (profileIntentAction != null)
        {
          'PARAM_LIST': {
            'intent_output_enabled': 'true',
            'intent_action': profileIntentAction,
            'intent_delivery': '2',
          },
          'PLUGIN_NAME': 'INTENT',
          'RESET_CONFIG': 'true'
        }
    ],
    'APP_LIST': packageNames
        .map((e) => {
              'PACKAGE_NAME': e,
              'ACTIVITY_LIST': ['*']
            })
        .toList(),
    'RESET_CONFIG': 'true'
  };
  final result = await scanWedge.sendCommandBundle(command: ScanCommands.datawedgeSendSetConfig, parameter: json, sendResult: true);
  log('ScanProfile: ${jsonEncode(json)}-$result');
  return result;
}