Support for reading and writing printer settings. More...
#include <SettingsReadWrite.h>
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. | |
Support for reading and writing printer settings.
For list of valid keys and values refer to: Settings Key/Value Items.
| - (NSDictionary< NSString *, Setting * > *) getAllPropertiesWithTimeout: | (int) | timeout |
Read all settings as Setting objects.
Implemented in SettingsReadWrite.
| timeout | The maximum time to wait (in milliseconds). |
| - (NSDictionary< NSString *, NSString * > *) getAllValuesWithTimeout: | (int) | timeout |
Read all settings key/value pairs.
Implemented in SettingsReadWrite.
| timeout | The maximum time to wait (in milliseconds). |
| - (Setting *) getPropertiesForKey: | (NSString *) | key | |
| timeout: | (int) | timeout |
Read properties for a given key.
Implemented in SettingsReadWrite.
| key | The key for which to get the properties. |
| timeout | The maximum time to wait (in milliseconds). |
| - (NSDictionary< NSString *, Setting * > *) getPropertiesForKeys: | (NSArray< NSString * > *) | keys | |
| timeout: | (int) | timeout |
Read properties for multiple keys.
Implemented in SettingsReadWrite.
| keys | An array of keys for which to get the properties. |
| timeout | The maximum time to wait (in milliseconds). |
| - (NSString *) getValueForKey: | (NSString *) | key | |
| timeout: | (int) | timeout |
Read setting associated with given key.
Implemented in SettingsReadWrite.
| key | The key for which to get the value. |
| timeout | The maximum time to wait (in milliseconds). |
| - (NSDictionary< NSString *, NSString * > *) getValuesForKeys: | (NSArray< NSString * > *) | keys | |
| timeout: | (int) | timeout |
Read multiple settings associated with given list of keys.
Implemented in SettingsReadWrite.
| keys | An array of keys for which to get the values. |
| timeout | The maximum time to wait (in milliseconds). |
| - (instancetype) initWithBleComm: | (BleComm *) | connection | |
| usingDataPort: | (BOOL) | usingDataPort |
Initializes a SettingsReadWrite instance using a BleComm connection.
| connection | The BLE (Bluetooth Low Energy) communication object. |
| usingDataPort | Whether the data port is being used for communication. |
| - (instancetype) initWithBtComm: | (BtComm *) | connection | |
| usingDataPort: | (BOOL) | usingDataPort |
Initializes a SettingsReadWrite instance using a BtComm connection.
| connection | The Bluetooth communication object. |
| usingDataPort | Whether the data port is being used for communication. |
| - (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 | |
| 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.
| connection | The TCP communication object. |
| usingDataPort | Whether the data port is being used for communication. |
| - (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.
| value | The value to set. |
| key | The key for which to set the value. |
| timeout | The maximum time to wait (in milliseconds). |
| - (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.
| keysToSet | A dictionary containing the keys and values to set. |
| timeout | The maximum time to wait (in milliseconds). |