UniPRT SDK v1.0.0.0-DLL (C++)
 
Loading...
Searching...
No Matches
JsonSDK.cpp File Reference
#include "pch.h"
#include "framework.h"
#include "JsonSDK.h"
#include "JsonMng.h"
#include "RfidMonitor.h"
#include "OdvMonitor.h"
#include "PrinterMonitor.h"
Include dependency graph for JsonSDK.cpp:

Enumerations

enum  INFO_TYP { ODV_TYP = 0 , RFID_TYP , PRINTER_TYP }
 

Functions

DLLEXVOID MessengerGet (CObject *ptrComm, COMM_TYP commTyp, int maxInputMsgCapacity, bool usingDataPort)
 Creates a channel for sending/receiving management messages with a maximum capacity specified.
 
DLLEXVOID MessengerRelease ()
 Release the Messenger resource.
 
DLLEXVOID MessengerSendMsg (char *strCommand, char *strContent)
 Send a management command and data/content to printer.
 
DLLEXVOID MessengerReadNextMsg (const char **strNextMsg)
 Read next message that may have been received asynchronously from printer.
 
DLLEXVOID MessengerSendMsgAndWaitForResponse (char *strCommand, char *strContent, int maxWaitTimeSecs, const char **strResponse)
 Send a management command and data/content to printer and wait for response maxWaitTimeSecs time.
 
DLLEXINT MessengerUnreadMsgCount ()
 Get the count for the unread messages.
 
DLLEXVOID RfidMonitorConnection (char *lpAddress)
 Use NET I/F to connect the printer for RFID monitor function.
 
DLLEXVOID OdvMonitorConnection (char *lpAddress)
 Use NET I/F to connect the printer for ODV monitor function.
 
DLLEXVOID PrinterMonitorConnection (char *lpAddress, INFO_TYP InfoTyp)
 Use NET I/F to connect the printer for the status of printer monitor.
 
DLLEXVOID GetPrinterInfo (stPrinterInfo *pPrtInfo, INFO_TYP InfoTyp)
 Get the information for printer function.
 
DLLEXBOOL GetRfidReportListening ()
 Get the flag of RFID report listening.
 
DLLEXVOID SetRfidReportListening (bool value)
 Set the flag of RFID report listening.
 
DLLEXBOOL GetOdvReportListening ()
 Get the flag of ODV report listening.
 
DLLEXVOID SetOdvReportListening (bool value)
 Set the flag of ODV report listening.
 
DLLEXVOID RfidMonitorDispose ()
 Release RFID monitor resource.
 
DLLEXVOID OdvMonitorDispose ()
 Release ODV monitor resource.
 
DLLEXVOID PrinterMonitorDispose (INFO_TYP InfoTyp)
 Release printer monitor resource.
 
DLLEXVOID SetRfidReportCallback (void callback(const RfidReport &report))
 Set a callback function to get RFID report.
 
DLLEXVOID SetOdvReportCallback (void callback(const OdvReport &report))
 Set a callback function to get ODV report.
 
DLLEXVOID SetEngineStatusListening (bool value)
 Set the flag of printer report listening for engine status.
 
DLLEXVOID SetDisplayStatusListening (bool value)
 Set the flag of printer report listening for display status.
 
DLLEXVOID SetAlertStatusListening (bool value)
 Set the flag of printer report listening for alert status.
 
DLLEXBOOL GetEngineStatusListening ()
 Get the flag of engine status listening.
 
DLLEXBOOL GetDisplayStatusListening ()
 Get the flag of display status listening.
 
DLLEXBOOL GetAlertStatusListening ()
 Get the flag of alert status listening.
 
DLLEXVOID SetEngineStatusCallback (void callback(const std::string &engineState))
 Set a callback function to get engine status.
 
DLLEXVOID SetDisplayStatusCallback (void callback(const std::vector< std::string > &newDisplayText))
 Set a callback function to get display status.
 
DLLEXVOID SetAlertStatusCallback (void callback(const std::vector< std::string > &alert))
 Set a callback function to get alert status.
 
DLLEXPCHAR GetPrinterAllValues (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort)
 Get all settings of printer.
 
DLLEXPCHAR GetPrinterValue (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const char *key)
 Get a single setting of printer.
 
DLLEXPCHAR GetPrinterValues (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const std::vector< std::string > &keys)
 Get multiple settings of printer.
 
DLLEXBOOL SetPrinterValue (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const char *key, const char *value)
 Set a single setting of printer.
 
DLLEXBOOL SetPrinterValues (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, std::map< std::string, std::string > *keysToSet)
 Set multiple settings of printer.
 
DLLEXPCHAR GetPrinterProperties (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const char *key)
 Get a single property of printer.
 
DLLEXPCHAR GetPrinterPropertiesEx (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const char *keys[], size_t count)
 Get multiple properties of printer.
 
DLLEXPCHAR GetPrinterAllProperties (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort)
 Get all properties of printer.
 
DLLEXVOID FreeString (char *str)
 Release string resource.
 
DLLEXPCHAR GetPrinterConfig (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, int CfgNumber)
 Get a single configuration of printer.
 
DLLEXBOOL SetPrinterConfig (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, char *pConfig)
 Set a single configuration of printer.
 
DLLEXPCHAR GetPrinterAllConfig (CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort)
 Get all configurations of printer.
 

Variables

CJsonSDKApp theApp
 
JsonMessenger gJsonMessenger
 
RfidMonitor gRfidMonitor
 
RfidReport gRfidReport
 
OdvMonitor gOdvMonitor
 
PrinterMonitor gPrinterMonitor_Rfid
 
PrinterMonitor gPrinterMonitor_Odv
 
PrinterMonitor gPrinterMonitor
 
static std::string AllMsg
 

Enumeration Type Documentation

◆ INFO_TYP

enum INFO_TYP
Enumerator
ODV_TYP 
RFID_TYP 
PRINTER_TYP 

Function Documentation

◆ FreeString()

DLLEXVOID FreeString ( char * str)

Release string resource.

Parameters
[in]str: a string resource
Returns
void
Sample
FreeString(AllProperties);
DLLEXVOID FreeString(char *str)
Release string resource.
Definition JsonSDK.cpp:1941

◆ GetAlertStatusListening()

DLLEXBOOL GetAlertStatusListening ( )

Get the flag of alert status listening.

Returns
bool

◆ GetDisplayStatusListening()

DLLEXBOOL GetDisplayStatusListening ( )

Get the flag of display status listening.

Returns
bool

◆ GetEngineStatusListening()

DLLEXBOOL GetEngineStatusListening ( )

Get the flag of engine status listening.

Returns
bool

◆ GetOdvReportListening()

DLLEXBOOL GetOdvReportListening ( )

Get the flag of ODV report listening.

Returns
bool

◆ GetPrinterAllConfig()

DLLEXPCHAR GetPrinterAllConfig ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort )

Get all configurations of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
Returns
char*
Sample
char* pAllConfig = pGetPrinterAllConfig(commPtr, commTyp, false);

◆ GetPrinterAllProperties()

DLLEXPCHAR GetPrinterAllProperties ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort )

Get all properties of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
Returns
char*
Sample
char* AllProperties = GetPrinterAllProperties(commPtr, commTyp, false);
DLLEXPCHAR GetPrinterAllProperties(CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort)
Get all properties of printer.
Definition JsonSDK.cpp:1871

◆ GetPrinterAllValues()

DLLEXPCHAR GetPrinterAllValues ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort )

Get all settings of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
Returns
char*
Sample
char* values = GetPrinterAllValues(commPtr, commTyp, false);
DLLEXPCHAR GetPrinterAllValues(CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort)
Get all settings of printer.
Definition JsonSDK.cpp:1311

◆ GetPrinterConfig()

DLLEXPCHAR GetPrinterConfig ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
int CfgNumber )

Get a single configuration of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
[in]CfgNumber: an index of the configuration, the range is 0 ~ 8
Returns
char*
Sample
char* pConfig = pGetPrinterConfig(commPtr, commTyp, false, 2);

◆ GetPrinterInfo()

DLLEXVOID GetPrinterInfo ( stPrinterInfo * pPrtInfo,
INFO_TYP InfoTyp )

Get the information for printer function.

Parameters
[out]pPrtInfo: a struct to storage the printer information
[in]InfoTyp: Set the type for RFID or ODV information
Returns
void
Sample
PrinterInfo PrtInfo;
@ PRINTER_TYP
Definition JsonSDK.cpp:85
DLLEXVOID GetPrinterInfo(stPrinterInfo *pPrtInfo, INFO_TYP InfoTyp)
Get the information for printer function.
Definition JsonSDK.cpp:677

◆ GetPrinterProperties()

DLLEXPCHAR GetPrinterProperties ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
const char * key )

Get a single property of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
[in]keya key value for properties of printer
Returns
char*
Sample
std::string key = "Speed.Print-mmps";
char* Properties = GetPrinterProperties(commPtr, commTyp, false, key.c_str());
DLLEXPCHAR GetPrinterProperties(CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const char *key)
Get a single property of printer.
Definition JsonSDK.cpp:1703

◆ GetPrinterPropertiesEx()

DLLEXPCHAR GetPrinterPropertiesEx ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
const char * keys[],
size_t count )

Get multiple properties of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
[in]keyPropskey values for properties of printer
[in]keyCountthe count of key values
Returns
char*
Sample
const char* keyProps[] = { "Speed", "Label.Sensor" };
size_t keyCount = sizeof(keyProps) / sizeof(keyProps[0]);
char* PropertiesEx = GetPrinterPropertiesEx(commPtr, commTyp, false, keyProps, keyCount);
DLLEXPCHAR GetPrinterPropertiesEx(CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const char *keys[], size_t count)
Get multiple properties of printer.
Definition JsonSDK.cpp:1792

◆ GetPrinterValue()

DLLEXPCHAR GetPrinterValue ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
const char * key )

Get a single setting of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
[in]keya key value for setting of printer
Returns
char*
Sample
const std::string& key = "Ethernet.MAC";
char* value = GetPrinterValue(commPtr, commTyp, false, key.c_str());
DLLEXPCHAR GetPrinterValue(CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const char *key)
Get a single setting of printer.
Definition JsonSDK.cpp:1391

◆ GetPrinterValues()

DLLEXPCHAR GetPrinterValues ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
const std::vector< std::string > & keys )

Get multiple settings of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
[in]keysmultiple key values for setting of printer
Returns
char*
Sample
std::vector<std::string> keys = { "Ethernet.IP", "Ethernet.MAC", "Ethernet.Speed" };
char* values = GetPrinterValues(commPtr, commTyp, false, keys);
DLLEXPCHAR GetPrinterValues(CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const std::vector< std::string > &keys)
Get multiple settings of printer.
Definition JsonSDK.cpp:1468

◆ GetRfidReportListening()

DLLEXBOOL GetRfidReportListening ( )

Get the flag of RFID report listening.

Returns
bool

◆ MessengerGet()

DLLEXVOID MessengerGet ( CObject * ptrComm,
COMM_TYP commTyp,
int maxInputMsgCapacity,
bool usingDataPort )

Creates a channel for sending/receiving management messages with a maximum capacity specified.

Parameters
[out]ptrComm: a pointer to storage communicating I/F
[in]commTyp: set the type of interface enum COMM_TYP { TCP_COMM = 1 };
[in]maxInputMsgCapacity: the default value is MAX_INPUT_MSG_CAPACITY(20)
[in]usingDataPort: the default value is false
Returns
void
Sample
COMM_TYP commTyp = COMM_TYP::TCP_COMM;
CObject* commPtr = NULL;
MessengerGet(commPtr, commTyp, MAX_INPUT_MSG_CAPACITY, false);
DLLEXVOID MessengerGet(CObject *ptrComm, COMM_TYP commTyp, int maxInputMsgCapacity, bool usingDataPort)
Creates a channel for sending/receiving management messages with a maximum capacity specified.
Definition JsonSDK.cpp:153

◆ MessengerReadNextMsg()

DLLEXVOID MessengerReadNextMsg ( const char ** strNextMsg)

Read next message that may have been received asynchronously from printer.

Parameters
[0ut]strNextMsg : a buffer to storage the next returned message
Returns
void
Sample
const char* strNextMsg = new char[MAX_BUFSIZE];
MessengerReadNextMsg(&strNextMsg);
if (!_bAsyncListening)
break;
if (strNextMsg != NULL)
{
std::string str(strNextMsg);
currentText += str;
std::cout << std::endl;
std::cout << std::endl;
std::cout << "Response:";
std::cout << currentText << std::endl;
}
delete[] strNextMsg;
DLLEXVOID MessengerReadNextMsg(const char **strNextMsg)
Read next message that may have been received asynchronously from printer.
Definition JsonSDK.cpp:344

◆ MessengerRelease()

DLLEXVOID MessengerRelease ( )

Release the Messenger resource.

Returns
void
Sample
DLLEXVOID MessengerRelease()
Release the Messenger resource.
Definition JsonSDK.cpp:194

◆ MessengerSendMsg()

DLLEXVOID MessengerSendMsg ( char * strCommand,
char * strContent )

Send a management command and data/content to printer.

Parameters
[in]strCommand: a management command string
[in]strContent: a management data/content string
Returns
void
Sample
char* pCmdStr = (char*)"Cfg.Item";
std::string content;
content += "{\r\n";
content += "\"Speed\" : null,\r\n";
content += "\"ODV.Symbol\" : null,\r\n";
content += "\"Label.Sensor\":null\r\n";
content += "}\r\n";
const char* pContentStr = content.c_str();
MessengerSendMsg(pCmdStr, (char*)pContentStr);
DLLEXVOID MessengerSendMsg(char *strCommand, char *strContent)
Send a management command and data/content to printer.
Definition JsonSDK.cpp:260

◆ MessengerSendMsgAndWaitForResponse()

DLLEXVOID MessengerSendMsgAndWaitForResponse ( char * strCommand,
char * strContent,
int maxWaitTimeSecs,
const char ** strResponse )

Send a management command and data/content to printer and wait for response maxWaitTimeSecs time.

Parameters
[in]strCommand: a management command string
[in]strContent: a management data/content string
[in]maxWaitTimeSecs: a maximum waiting time
[out]strResponse: a buffer to storage for JSON string response
Returns
void
Sample
#define MAX_WAIT_TIME_SECS 5
char* pCmdStr = (char*)"Cfg.Item";
std::string content;
content += "{\r\n";
content += "\"Speed\" : null,\r\n";
content += "\"ODV.Symbol\" : null,\r\n";
content += "\"Label.Sensor\":null\r\n";
content += "}\r\n";
const char* pContentStr = content.c_str();
const char* strResponse = NULL;
MessengerSendMsgAndWaitForResponse(pCmdStr, (char*)pContentStr, MAX_WAIT_TIME_SECS, &strResponse);
DLLEXVOID MessengerSendMsgAndWaitForResponse(char *strCommand, char *strContent, int maxWaitTimeSecs, const char **strResponse)
Send a management command and data/content to printer and wait for response maxWaitTimeSecs time.
Definition JsonSDK.cpp:443

◆ MessengerUnreadMsgCount()

DLLEXINT MessengerUnreadMsgCount ( )

Get the count for the unread messages.

Returns
int
Sample
int iUnreadMsgCount = MessengerUnreadMsgCount();
DLLEXINT MessengerUnreadMsgCount()
Get the count for the unread messages.
Definition JsonSDK.cpp:498

◆ OdvMonitorConnection()

DLLEXVOID OdvMonitorConnection ( char * lpAddress)

Use NET I/F to connect the printer for ODV monitor function.

Parameters
[in]lpAddress: IP address
Returns
void
Sample
std::string ptrIpOdv = "10.0.10.171";
pOdvMonitorConnection((char*)ptrIpOdv.c_str());

◆ OdvMonitorDispose()

DLLEXVOID OdvMonitorDispose ( )

Release ODV monitor resource.

Returns
void

◆ PrinterMonitorConnection()

DLLEXVOID PrinterMonitorConnection ( char * lpAddress,
INFO_TYP InfoTyp )

Use NET I/F to connect the printer for the status of printer monitor.

Parameters
[in]lpAddress: IP address
[in]InfoTyp: Set the type for RFID or ODV information
Returns
void
Sample
std::string ptrIpRfid = "10.0.10.178";
RfidMonitorConnection((char*)ptrIpRfid.c_str());
PrinterMonitorConnection((char*)ptrIpRfid.c_str(), INFO_TYP::RFID_TYP);
DLLEXVOID RfidMonitorConnection(char *lpAddress)
Use NET I/F to connect the printer for RFID monitor function.
Definition JsonSDK.cpp:539
@ RFID_TYP
Definition JsonSDK.cpp:84
DLLEXVOID PrinterMonitorConnection(char *lpAddress, INFO_TYP InfoTyp)
Use NET I/F to connect the printer for the status of printer monitor.
Definition JsonSDK.cpp:624

◆ PrinterMonitorDispose()

DLLEXVOID PrinterMonitorDispose ( INFO_TYP InfoTyp)

Release printer monitor resource.

Parameters
[in]InfoTyp: Set the type for RFID/ODV/printer status information
Returns
void

◆ RfidMonitorConnection()

DLLEXVOID RfidMonitorConnection ( char * lpAddress)

Use NET I/F to connect the printer for RFID monitor function.

Parameters
[in]lpAddress: IP address
Returns
void
Sample
std::string ptrIpRfid = "10.0.10.178";
RfidMonitorConnection((char*)ptrIpRfid.c_str());

◆ RfidMonitorDispose()

DLLEXVOID RfidMonitorDispose ( )

Release RFID monitor resource.

Returns
void

◆ SetAlertStatusCallback()

DLLEXVOID SetAlertStatusCallback ( void callbackconst std::vector< std::string > &alert)

Set a callback function to get alert status.

Parameters
[in]callback:a callback function
Returns
void
Sample
SetAlertStatusCallback(PtrAlertNoticeListener);
DLLEXVOID SetAlertStatusCallback(void callback(const std::vector< std::string > &alert))
Set a callback function to get alert status.
Definition JsonSDK.cpp:1260

◆ SetAlertStatusListening()

DLLEXVOID SetAlertStatusListening ( bool value)

Set the flag of printer report listening for alert status.

Parameters
[in]value: a flag to set printer report listening
Returns
void
Sample
DLLEXVOID SetAlertStatusListening(bool value)
Set the flag of printer report listening for alert status.
Definition JsonSDK.cpp:1078

◆ SetDisplayStatusCallback()

DLLEXVOID SetDisplayStatusCallback ( void callbackconst std::vector< std::string > &newDisplayText)

Set a callback function to get display status.

Parameters
[in]callback:a callback function
Returns
void
Sample
SetDisplayStatusCallback(PtrDisplayStatusNoticeListener);
DLLEXVOID SetDisplayStatusCallback(void callback(const std::vector< std::string > &newDisplayText))
Set a callback function to get display status.
Definition JsonSDK.cpp:1221

◆ SetDisplayStatusListening()

DLLEXVOID SetDisplayStatusListening ( bool value)

Set the flag of printer report listening for display status.

Parameters
[in]value: a flag to set printer report listening
Returns
void
Sample
DLLEXVOID SetDisplayStatusListening(bool value)
Set the flag of printer report listening for display status.
Definition JsonSDK.cpp:1039

◆ SetEngineStatusCallback()

DLLEXVOID SetEngineStatusCallback ( void callbackconst std::string &engineState)

Set a callback function to get engine status.

Parameters
[in]callback:a callback function
Returns
void
Sample
SetEngineStatusCallback(PtrEngineStatusNoticeListener);
DLLEXVOID SetEngineStatusCallback(void callback(const std::string &engineState))
Set a callback function to get engine status.
Definition JsonSDK.cpp:1183

◆ SetEngineStatusListening()

DLLEXVOID SetEngineStatusListening ( bool value)

Set the flag of printer report listening for engine status.

Parameters
[in]value: a flag to set printer report listening
Returns
void
Sample
DLLEXVOID SetEngineStatusListening(bool value)
Set the flag of printer report listening for engine status.
Definition JsonSDK.cpp:1002

◆ SetOdvReportCallback()

DLLEXVOID SetOdvReportCallback ( void callbackconst OdvReport &report)

Set a callback function to get ODV report.

Parameters
[in]callback:a callback function
Returns
void
Sample
SetOdvReportCallback(OdvReportCallback);
DLLEXVOID SetOdvReportCallback(void callback(const OdvReport &report))
Set a callback function to get ODV report.
Definition JsonSDK.cpp:963

◆ SetOdvReportListening()

DLLEXVOID SetOdvReportListening ( bool value)

Set the flag of ODV report listening.

Parameters
[in]value: a flag to set ODV report listening
Returns
void
Sample
DLLEXVOID SetOdvReportListening(bool value)
Set the flag of ODV report listening.
Definition JsonSDK.cpp:812

◆ SetPrinterConfig()

DLLEXBOOL SetPrinterConfig ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
char * pConfig )

Set a single configuration of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
[in]pConfig: a configuration
Returns
bool
Sample
char* pConfig = pGetPrinterConfig(commPtr, commTyp, false, 2);
bool result = pSetPrinterConfig(commPtr, commTyp, false, pConfig);

◆ SetPrinterValue()

DLLEXBOOL SetPrinterValue ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
const char * key,
const char * value )

Set a single setting of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
[in]keya key value for setting of printer
[in]valuea setting of printer
Returns
bool
Sample
const std::string _key = "Ethernet.Speed";
const std::string _value = "eAutomatic";
bool result = SetPrinterValue(commPtr, commTyp, false, _key.c_str(), _value.c_str());
DLLEXBOOL SetPrinterValue(CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, const char *key, const char *value)
Set a single setting of printer.
Definition JsonSDK.cpp:1551

◆ SetPrinterValues()

DLLEXBOOL SetPrinterValues ( CObject * ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
std::map< std::string, std::string > * keysToSet )

Set multiple settings of printer.

Parameters
[in]commPtr: a pointer to storage communicating I/F
[in]commTyp: set the type of interface
[in]usingDataPort: a flag to use data port
[in]keysToSetmultiple key values for setting of printer
Returns
bool
Sample
std::map<std::string, std::string> keyValues = {
{"Ethernet.Speed", "eAutomatic"},
{"Image.Width-in", "3.5"}
};
bool result = SetPrinterValues(commPtr, commTyp, false, &keyValues);
DLLEXBOOL SetPrinterValues(CObject *ptrComm, COMM_TYP commTyp, bool usingDataPort, std::map< std::string, std::string > *keysToSet)
Set multiple settings of printer.
Definition JsonSDK.cpp:1632

◆ SetRfidReportCallback()

DLLEXVOID SetRfidReportCallback ( void callbackconst RfidReport &report)

Set a callback function to get RFID report.

Parameters
[in]callback:a callback function
Returns
void
Sample
SetRfidReportCallback(RfidReportCallback);
DLLEXVOID SetRfidReportCallback(void callback(const RfidReport &report))
Set a callback function to get RFID report.
Definition JsonSDK.cpp:924

◆ SetRfidReportListening()

DLLEXVOID SetRfidReportListening ( bool value)

Set the flag of RFID report listening.

Parameters
[in]value: a flag to set RFID report listening
Returns
void
Sample
DLLEXVOID SetRfidReportListening(bool value)
Set the flag of RFID report listening.
Definition JsonSDK.cpp:754

Variable Documentation

◆ AllMsg

std::string AllMsg
static

◆ gJsonMessenger

JsonMessenger gJsonMessenger

◆ gOdvMonitor

OdvMonitor gOdvMonitor

◆ gPrinterMonitor

PrinterMonitor gPrinterMonitor

◆ gPrinterMonitor_Odv

PrinterMonitor gPrinterMonitor_Odv

◆ gPrinterMonitor_Rfid

PrinterMonitor gPrinterMonitor_Rfid

◆ gRfidMonitor

RfidMonitor gRfidMonitor

◆ gRfidReport

RfidReport gRfidReport

◆ theApp

CJsonSDKApp theApp