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

A class for managing configuration through JSON communication. More...

#include <JsonConfig.h>

Inheritance diagram for JsonConfig:

Instance Methods

(instancetype) - initWithTcpComm:
 Must pass an opened TcpComm connection that can remain opened if listening for unsolicited messages 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.
 
(NSArray< Config * > *) - getAllConfig
 Destructor for the JsonConfig object.
 
(Config *) - getConfigWithNumber:
 Gets the configuration with the specified number.
 
(BOOL) - setConfig:
 Sets the specified configuration.
 

Detailed Description

A class for managing configuration through JSON communication.

Method Documentation

◆ getAllConfig

- (NSArray< Config * > *) getAllConfig

Destructor for the JsonConfig object.

Gets all configurations.

Returns
An array of Config objects representing all configurations.

◆ getConfigWithNumber:

- (Config *) getConfigWithNumber: (int) cfgNumber

Gets the configuration with the specified number.

Parameters
cfgNumberThe number of the configuration to retrieve.
Returns
The configuration object with the specified number.

◆ initWithCommDescriptor:

- (instancetype) initWithCommDescriptor: (NSString *) commDescriptor

Constructor called when creating a connection managed by the SDK.

Parameters
commDescriptorDescriptor 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.
Returns
An initialized instance of JsonConfig, 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 JsonConfig, or nil if the object could not be created.

◆ initWithTcpComm:

- (instancetype) initWithTcpComm: (id) connection

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

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

◆ setConfig:

- (BOOL) setConfig: (Config *) pCfg

Sets the specified configuration.

Parameters
pCfgThe Config object representing the configuration to set.
Returns
YES if the configuration was successfully set, NO otherwise.

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