UniPRT SDK v1.0.0.0
 
Loading...
Searching...
No Matches
SettingsReadWrite Class Reference

Support for reading and writing printer settings. More...

#include <SettingsReadWrite.h>

Inheritance diagram for SettingsReadWrite:

Instance Methods

(instancetype) - initWithTcpComm:
 Must pass an opened TcpComm connection that can remain opened if listening for unsolicited msgs from printer.
 
(instancetype) - initWithJsonComm:
 Initializes a new instance with the given JSON communication object.
 
(instancetype) - initWithCommDescriptor:
 Constructor called when creating a connection managed by the SDK.
 
(NSDictionary< NSString *, NSString * > *) - getAllValues
 Read all settings key/value pairs.
 
(NSString *) - getValueForKey:
 Read setting associated with given key.
 
(NSDictionary< NSString *, NSString * > *) - getValuesForKeys:
 Read multiple settings associated with given list of keys.
 
(BOOL) - setValue:forKey:
 Write a setting value associated with given key. Returns true if write successful.
 
(BOOL) - setValues:
 Write multiple settings associated with given keys. Returns true if write successful.
 
(Setting *) - getPropertiesForKey:
 Read multiple settings associated with given list of keys.
 
(NSDictionary< NSString *, Setting * > *) - getPropertiesForKeys:
 Read settings associated with given list of keys.
 
(NSDictionary< NSString *, Setting * > *) - getAllProperties
 Read all settings.
 

Detailed Description

Support for reading and writing printer settings.

For list of valid keys and values refer to: Settings Key/Value Items.

Method Documentation

◆ getAllProperties

- (NSDictionary< NSString *, Setting * > *) getAllProperties

Read all settings.

Implemented in SettingsReadWrite.

Returns
A dictionary containing all keys and their corresponding Setting objects.

◆ getAllValues

- (NSDictionary< NSString *, NSString * > *) getAllValues

Read all settings key/value pairs.

Implemented in SettingsReadWrite.

Returns
A dictionary containing all settings keys and their corresponding values.

◆ getPropertiesForKey:

- (Setting *) getPropertiesForKey: (NSString *) key

Read multiple settings associated with given list of keys.

Implemented in SettingsReadWrite.

Parameters
keyThe key for which to get the properties.
Returns
A Setting object containing the properties for the specified key.

◆ getPropertiesForKeys:

- (NSDictionary< NSString *, Setting * > *) getPropertiesForKeys: (NSArray< NSString * > *) keys

Read settings associated with given list of keys.

Implemented in SettingsReadWrite.

Parameters
keysAn array of keys for which to get the properties.
Returns
A dictionary containing the specified keys and their corresponding Setting objects.

◆ getValueForKey:

- (NSString *) getValueForKey: (NSString *) key

Read setting associated with given key.

Implemented in SettingsReadWrite.

Parameters
keyThe key for which to get the value.
Returns
The value associated with the specified key.

◆ getValuesForKeys:

- (NSDictionary< NSString *, NSString * > *) getValuesForKeys: (NSArray< NSString * > *) keys

Read multiple settings associated with given list of keys.

Implemented in SettingsReadWrite.

Parameters
keysAn array of keys for which to get the values.
Returns
A dictionary containing the specified keys and their corresponding values.

◆ initWithCommDescriptor:

- (instancetype) initWithCommDescriptor: (NSString *) commDescriptor

Constructor called when creating a connection managed by the SDK.

commDescriptor is descriptor for the communication used to connect with printer.

TCP descriptor format: "ip" or "ip:port"

e.g. "127.0.0.1" or "127.0.0.1:3007"

If port is not provided, default value is used.

Parameters
commDescriptorThe communication descriptor.
Returns
An initialized instance of SettingsReadWrite, or nil if the object could not be created.

◆ initWithJsonComm:

- (instancetype) initWithJsonComm: (JsonComm *) mgmtComm

Initializes a new instance with the given JSON communication object.

Parameters
mgmtCommThe JSON communication object.
Returns
An initialized instance of SettingsReadWrite, or nil if the object could not be created.

◆ initWithTcpComm:

- (instancetype) initWithTcpComm: (TcpComm *) connection

Must pass an opened TcpComm connection that can remain opened if listening for unsolicited msgs from printer.

A connection is necessary to send/receive printer status msgs.

Parameters
connectionThe TCP communication object.
Returns
An initialized instance of SettingsReadWrite, or nil if the object could not be created.

◆ setValue:forKey:

- (BOOL) setValue: (NSString *) value
forKey: (NSString *) key 

Write a setting value associated with given key. Returns true if write successful.

Note: A value that is intended to be processed as strings should be quoted. e.g. value = SomeString and value = "SomeString" will be sent exactly as received but may be handled differently by printer.

Implemented in SettingsReadWrite.

Parameters
valueThe value to set.
keyThe key for which to set the value.
Returns
YES if the value was successfully set, NO otherwise.

◆ setValues:

- (BOOL) setValues: (NSDictionary< NSString *, NSString * > *) keysToSet

Write multiple settings associated with given keys. Returns true if write successful.

Note: Values that are intended to be processed as strings should be quoted. e.g. value = SomeString and value = "SomeString" will be sent exactly as received but may be handled differently by printer.

Implemented in SettingsReadWrite.

Parameters
keysToSetA dictionary containing the keys and values to set.
Returns
YES if the values were successfully set, NO otherwise.

The documentation for this class was generated from the following file: