Support for reading and writing printer settings. More...
#include <SettingsReadWrite.h>
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. | |
Support for reading and writing printer settings.
For list of valid keys and values refer to: Settings Key/Value Items.
- (NSDictionary< NSString *, Setting * > *) getAllProperties |
Read all settings.
Implemented in SettingsReadWrite.
- (NSDictionary< NSString *, NSString * > *) getAllValues |
Read all settings key/value pairs.
Implemented in SettingsReadWrite.
- (Setting *) getPropertiesForKey: | (NSString *) | key |
Read multiple settings associated with given list of keys.
Implemented in SettingsReadWrite.
key | The key for which to get the properties. |
- (NSDictionary< NSString *, Setting * > *) getPropertiesForKeys: | (NSArray< NSString * > *) | keys |
Read settings associated with given list of keys.
Implemented in SettingsReadWrite.
keys | An array of keys for which to get the properties. |
- (NSString *) getValueForKey: | (NSString *) | key |
Read setting associated with given key.
Implemented in SettingsReadWrite.
key | The key for which to get the value. |
- (NSDictionary< NSString *, NSString * > *) getValuesForKeys: | (NSArray< NSString * > *) | keys |
Read multiple settings associated with given list of keys.
Implemented in SettingsReadWrite.
keys | An array of keys for which to get the values. |
- (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.
commDescriptor | The communication descriptor. |
- (instancetype) initWithJsonComm: | (JsonComm *) | mgmtComm |
Initializes a new instance with the given JSON communication object.
mgmtComm | The JSON communication object. |
- (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.
connection | The TCP communication object. |
- (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.
value | The value to set. |
key | The key for which to set the value. |
- (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.
keysToSet | A dictionary containing the keys and values to set. |