支持读取和写入印表机设置。 更多...
#include <SettingsReadWrite.h>
构造函数 | |
(instancetype) | - initWithTcpComm: |
必须传递一个已打开的 TcpComm 连接,如果监听来自印表机的非请求讯息,该连接可以保持打开状态。 | |
(instancetype) | - initWithJsonComm: |
使用给定的 JSON 通信对象初始化一个新实例。 | |
(instancetype) | - initWithCommDescriptor: |
创建由 SDK 管理的连接时调用的构造函数。 | |
(NSDictionary< NSString *, NSString * > *) | - getAllValues |
读取所有设置的键/值对。 | |
(NSString *) | - getValueForKey: |
读取与给定键关联的设置。 | |
(NSDictionary< NSString *, NSString * > *) | - getValuesForKeys: |
读取与给定键列表关联的多个设置。 | |
(BOOL) | - setValue:forKey: |
写入与给定键关联的设置值。如果写入成功,则返回 true。 | |
(BOOL) | - setValues: |
写入与给定键关联的多个设置。如果写入成功,则返回 true。 | |
(Setting *) | - getPropertiesForKey: |
读取与给定键列表关联的多个设置。 | |
(NSDictionary< NSString *, Setting * > *) | - getPropertiesForKeys: |
读取与给定键列表关联的设置。 | |
(NSDictionary< NSString *, Setting * > *) | - getAllProperties |
读取所有设置。 | |
支持读取和写入印表机设置。
有关有效键和值的列表,请参阅:Settings Key/Value Items。
- (NSDictionary< NSString *, Setting * > *) getAllProperties |
- (NSDictionary< NSString *, NSString * > *) getAllValues |
- (Setting *) getPropertiesForKey: | (NSString *) | key |
- (NSDictionary< NSString *, Setting * > *) getPropertiesForKeys: | (NSArray< NSString * > *) | keys |
- (NSString *) getValueForKey: | (NSString *) | key |
- (NSDictionary< NSString *, NSString * > *) getValuesForKeys: | (NSArray< NSString * > *) | keys |
- (instancetype) initWithCommDescriptor: | (NSString *) | commDescriptor |
创建由 SDK 管理的连接时调用的构造函数。
commDescriptor 是用于连接印表机的通信描述符。
TCP 描述符格式:"ip" 或 "ip:port"
例如 "127.0.0.1" 或 "127.0.0.1:3007"
如果未提供端口,则使用默认值。
commDescriptor | 通信描述符。 |
- (instancetype) initWithJsonComm: | (JsonComm *) | mgmtComm |
- (instancetype) initWithTcpComm: | (TcpComm *) | connection |
必须传递一个已打开的 TcpComm 连接,如果监听来自印表机的非请求讯息,该连接可以保持打开状态。
发送/接收印表机状态讯息需要连接。
connection | TCP 通信对象。 |
- (BOOL) setValue: | (NSString *) | value | |
forKey: | (NSString *) | key |
写入与给定键关联的设置值。如果写入成功,则返回 true。
注意:要作为字符串处理的值应加引号。例如,value = SomeString 和 value = "SomeString" 将按接收到的内容发送,但印表机可能会以不同方式处理。
在 SettingsReadWrite 中实现。
value | 要设置的值。 |
key | 要设置值的键。 |
- (BOOL) setValues: | (NSDictionary< NSString *, NSString * > *) | keysToSet |
写入与给定键关联的多个设置。如果写入成功,则返回 true。
注意:要作为字符串处理的值应加引号。例如,value = SomeString 和 value = "SomeString" 将按接收到的内容发送,但印表机可能会以不同方式处理。
在 SettingsReadWrite 中实现。
keysToSet | 包含要设置的键和值的字典。 |