A class for managing configuration through JSON communication.
More...
#include <JsonConfig.h>
A class for managing configuration through JSON communication.
◆ getAllConfigWithTimeout:
| - (NSArray< Config * > *) getAllConfigWithTimeout: |
|
(int) | timeout |
|
Destructor for the JsonConfig object.
Cleans up resources when the JsonConfig object is deallocated.
Gets all configurations with a timeout.
This method retrieves all available configuration objects from the device within the specified timeout period.
- Parameters
-
| timeout | The maximum time to wait (in milliseconds). |
- Returns
- An array of Config objects representing all configurations.
◆ getConfigWithNumber:timeout:
| - (Config *) getConfigWithNumber: |
|
(int) | cfgNumber |
| timeout: |
|
(int) | timeout |
Gets the configuration with the specified number.
This method retrieves the configuration object corresponding to the given number within the specified timeout.
- Parameters
-
| cfgNumber | The number of the configuration to retrieve. |
| timeout | The maximum time to wait (in milliseconds). |
- Returns
- The configuration object with the specified number, or nil if not found.
◆ initWithBleComm:usingDataPort:
| - (instancetype) initWithBleComm: |
|
(BleComm *) | connection |
| usingDataPort: |
|
(BOOL) | usingDataPort |
Initializes with an opened BleComm connection.
- Parameters
-
| connection | The BLE communication object. |
| usingDataPort | Whether to use data port for communication. |
- Returns
- An initialized instance of JsonConfig.
◆ initWithBtComm:usingDataPort:
| - (instancetype) initWithBtComm: |
|
(BtComm *) | connection |
| usingDataPort: |
|
(BOOL) | usingDataPort |
Initializes with an opened BtComm connection.
- Parameters
-
| connection | The Bluetooth communication object. |
| usingDataPort | Whether to use data port for communication. |
- Returns
- An initialized instance of JsonConfig.
◆ initWithCommDescriptor:
| - (instancetype) initWithCommDescriptor: |
|
(NSString *) | commDescriptor |
|
Constructor called when creating a connection managed by the SDK.
- Parameters
-
| commDescriptor | 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. |
- 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
-
| mgmtComm | The JSON communication object. |
- Returns
- An initialized instance of JsonConfig, or nil if the object could not be created.
◆ initWithTcpComm:usingDataPort:
| - (instancetype) initWithTcpComm: |
|
(TcpComm *) | connection |
| usingDataPort: |
|
(BOOL) | usingDataPort |
Must pass an opened TcpComm connection that can remain opened if listening for unsolicited messages from printer.
- Parameters
-
| connection | The TCP communication object. |
| usingDataPort | Whether to use data port for communication. |
- Returns
- An initialized instance of JsonConfig, or nil if the object could not be created.
◆ setConfig:pCfg:
| - (BOOL) setConfig: |
|
(Config *) | |
| pCfg: |
|
(int) | timeout |
Sets the specified configuration.
This method updates the device with the given configuration object within the specified timeout.
- Parameters
-
| pCfg | The Config object representing the configuration to set. |
| timeout | The maximum time to wait (in milliseconds). |
- Returns
- YES if the configuration was successfully set, NO otherwise.
The documentation for this class was generated from the following file:
- /Users/bob_huang/Documents/Project/sdk_json_Objective-C_IOS/sdk_json_Objective-C_IOS/Json/JsonConfig.h