setSymbology method

Future<CommandResponse> setSymbology({
  1. required dynamic deviceId,
  2. required SymbologyType type,
  3. required bool enabled,
})

Toggles a specific symbology on the device based on the enabled flag.

deviceId is the ID of the device where the symbology should be enabled or disabled. type is the symbology to enable or disable. enabled is a boolean flag indicating whether to enable (true) or disable (false) the symbology.

Returns a CommandResponse indicating the success or failure of the operation.

Implementation

Future<CommandResponse> setSymbology(
    {required deviceId,
    required SymbologyType type,
    required bool enabled}) async {
  final String? command = enabled
      ? _enableSymbologyCommands[type]
      : _disableSymbologyCommands[type];

  if (command != null) {
    return sendCommand(deviceId, command);
  } else {
    final msg = 'Command not found for $type';
    _appLogger.error(msg);
    return CommandResponse.failed(msg);
  }
}