UniPRT SDK  v1.0.0.0
IMgmtMessenger Interface Reference
Inheritance diagram for IMgmtMessenger:
Messenger

Public Member Functions

MgmtMsg ReadNextMsg ()
 Read next message that may have been received asynchronously from printer.
 
String SendMsg (String command, String content)
 
String SendMsg (String command, String content, String TrackNo)
 Send a management command and data/content to printer. More...
 
MgmtMsg SendMsgAndWaitForResponse (String command, String content)
 
MgmtMsg SendMsgAndWaitForResponse (String command, String content, int maxWaitTimeSecs)
 Send a management command and data/content to printer and wait for response maxWaitTimeSecs time. More...
 
void SendMsgRaw (String dataToSend)
 Sends contents without any message formatting directly to printer. More...
 
int UnreadMsgCount ()
 Get number of unread messages received and waiting to be read.
 

Member Function Documentation

◆ SendMsg()

String SendMsg ( String  command,
String  content,
String  TrackNo 
)

Send a management command and data/content to printer.

The optional TrackNo is the field used in the JSON command structure sent to printer and can be used by caller to check for response from printer. If no TrackNo is provided, one is generated.

The return string is the TrackNo field used in the JSON message sent to the printer to allow caller to differentiate any response associated with the message sent by comparing the TrackNo field of any response received from printer.

Implemented in Messenger.

◆ SendMsgAndWaitForResponse()

MgmtMsg SendMsgAndWaitForResponse ( String  command,
String  content,
int  maxWaitTimeSecs 
)

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

Null object returned if no response received before timeout expired.
All messages are discarded until the response to the specific message sent is received. The discarded messages may include any unread/old messages waiting to be read prior to the call to this method.

Implemented in Messenger.

◆ SendMsgRaw()

void SendMsgRaw ( String  dataToSend)

Sends contents without any message formatting directly to printer.

This is for cases where data needs to be sent without any added management message formatting. If there is a special management message or data need to be sent in a port that is shared for both data and management, this would be used to send data directly to printer.

Implemented in Messenger.