UniPRT SDK v2.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:usingDataPort:
 Initializes a SettingsReadWrite instance using an open TcpComm connection.
 
(instancetype) - initWithBtComm:usingDataPort:
 Initializes a SettingsReadWrite instance using a BtComm connection.
 
(instancetype) - initWithBleComm:usingDataPort:
 Initializes a SettingsReadWrite instance using a BleComm connection.
 
(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 * > *) - getAllValuesWithTimeout:
 Read all settings key/value pairs.
 
(NSString *) - getValueForKey:timeout:
 Read setting associated with given key.
 
(NSDictionary< NSString *, NSString * > *) - getValuesForKeys:timeout:
 Read multiple settings associated with given list of keys.
 
(BOOL) - setValue:forKey:timeout:
 Write a setting value associated with given key.
 
(BOOL) - setValues:timeout:
 Write multiple settings associated with given keys.
 
(Setting *) - getPropertiesForKey:timeout:
 Read properties for a given key.
 
(NSDictionary< NSString *, Setting * > *) - getPropertiesForKeys:timeout:
 Read properties for multiple keys.
 
(NSDictionary< NSString *, Setting * > *) - getAllPropertiesWithTimeout:
 Read all settings as Setting objects.
 

Detailed Description

Support for reading and writing printer settings.

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

Method Documentation

◆ getAllPropertiesWithTimeout:

- (NSDictionary< NSString *, Setting * > *) getAllPropertiesWithTimeout: (int) timeout

Read all settings as Setting objects.

Implemented in SettingsReadWrite.

Parameters
timeoutThe maximum time to wait (in milliseconds).
Returns
A dictionary containing all keys and their corresponding Setting objects.

◆ getAllValuesWithTimeout:

- (NSDictionary< NSString *, NSString * > *) getAllValuesWithTimeout: (int) timeout

Read all settings key/value pairs.

Implemented in SettingsReadWrite.

Parameters
timeoutThe maximum time to wait (in milliseconds).
Returns
A dictionary containing all settings keys and their corresponding values.

◆ getPropertiesForKey:timeout:

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

Read properties for a given key.

Implemented in SettingsReadWrite.

Parameters
keyThe key for which to get the properties.
timeoutThe maximum time to wait (in milliseconds).
Returns
A Setting object containing the properties for the specified key.

◆ getPropertiesForKeys:timeout:

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

Read properties for multiple keys.

Implemented in SettingsReadWrite.

Parameters
keysAn array of keys for which to get the properties.
timeoutThe maximum time to wait (in milliseconds).
Returns
A dictionary containing the specified keys and their corresponding Setting objects.

◆ getValueForKey:timeout:

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

Read setting associated with given key.

Implemented in SettingsReadWrite.

Parameters
keyThe key for which to get the value.
timeoutThe maximum time to wait (in milliseconds).
Returns
The value associated with the specified key.

◆ getValuesForKeys:timeout:

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

Read multiple settings associated with given list of keys.

Implemented in SettingsReadWrite.

Parameters
keysAn array of keys for which to get the values.
timeoutThe maximum time to wait (in milliseconds).
Returns
A dictionary containing the specified keys and their corresponding values.

◆ initWithBleComm:usingDataPort:

- (instancetype) initWithBleComm: (BleComm *) connection
usingDataPort: (BOOL) usingDataPort 

Initializes a SettingsReadWrite instance using a BleComm connection.

Parameters
connectionThe BLE (Bluetooth Low Energy) communication object.
usingDataPortWhether the data port is being used for communication.
Returns
An initialized instance of SettingsReadWrite, or nil if the object could not be created.

◆ initWithBtComm:usingDataPort:

- (instancetype) initWithBtComm: (BtComm *) connection
usingDataPort: (BOOL) usingDataPort 

Initializes a SettingsReadWrite instance using a BtComm connection.

Parameters
connectionThe Bluetooth communication object.
usingDataPortWhether the data port is being used for communication.
Returns
An initialized instance of SettingsReadWrite, or nil if the object could not be created.

◆ 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:usingDataPort:

- (instancetype) initWithTcpComm: (TcpComm *) connection
usingDataPort: (BOOL) usingDataPort 

Initializes a SettingsReadWrite instance using an open TcpComm connection.

This connection must be open and can remain open if listening for unsolicited messages from the printer. A connection is necessary to send/receive printer status messages.

Parameters
connectionThe TCP communication object.
usingDataPortWhether the data port is being used for communication.
Returns
An initialized instance of SettingsReadWrite, or nil if the object could not be created.

◆ setValue:forKey:timeout:

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

Write a setting value associated with given key.

Returns YES if the write was successful.

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

Implemented in SettingsReadWrite.

Parameters
valueThe value to set.
keyThe key for which to set the value.
timeoutThe maximum time to wait (in milliseconds).
Returns
YES if the value was successfully set, NO otherwise.

◆ setValues:timeout:

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

Write multiple settings associated with given keys.

Returns YES if the write was successful.

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

Implemented in SettingsReadWrite.

Parameters
keysToSetA dictionary containing the keys and values to set.
timeoutThe maximum time to wait (in milliseconds).
Returns
YES if the values were successfully set, NO otherwise.

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