支援建立發送到印表機的 JSON 訊息。 更多...
靜態公開方法(Static Public Methods) | |
static string | CreateMsgFrame (string fromId, string trackId, string command, string content="", string toId="") |
Create JSON object message frame without checking for required fields. | |
static string | CreateMsgFrame_Json (string fromId, string trackId, string command, string content="", string toId="", bool usingDataPort=false) |
Create JSON object message that can be sent to printer. 更多... | |
static string | GetRandomId_Json () |
Returns random integer simply used to make sure each msg has unique ID. Use this to identify any msgs that will be sent infrequent. 更多... | |
static string | GetRandomObjectId_Json () |
Returns random integer in case want to use a dedicated object ID that can also be used to send/receive json messages with that ID as "TrackNo". 更多... | |
靜態公開屬性 | |
static string | DataPortPrefix = "!PTR_SETUP" + Environment.NewLine + "UPMC" + Environment.NewLine |
static string | DataPortSuffix = "PTR_END" + Environment.NewLine |
const int | MAX_RAND_MSG_ID = 4_000_000 |
呼叫 GetRandomId() 時隨機生成的最大 ID,可用於發送在請求訊息上的 ID。 | |
const int | MAX_RAND_OBJ_ID = 6_000_000 |
呼叫 GetRandomObjectId() 時隨機生成的最大 ID。 對於希望為其請求訊息使用 "物件 ID" 的類別/物件很有用。 | |
const int | MIN_RAND_MSG_ID = 1 |
呼叫 GetRandomId() 時隨機生成的最小 ID,可用於發送在請求訊息上的 ID。 | |
const int | MIN_RAND_OBJ_ID = 4_000_001 |
呼叫 GetRandomObjectId() 時隨機生成的最小 ID。 對於希望為其請求訊息使用 "物件 ID" 的類別/物件很有用。 | |
支援建立發送到印表機的 JSON 訊息。
|
static |
Create JSON object message that can be sent to printer.
fromId: required identifier of sender. Note this is used to route responses. This should be unique to each class/Object sending messages.
trackId: required identifier that can be used to track messages within the class/object sending the message. command: required command value content: optional content value. This could be a JSON object. Note that no check is made to ensure proper JSON format. \r
Note that since content could be a JSON object or a string, caller responsible for adding quotes if sending a JSON string value toId: optional identifier to differentiate intended recipient.
|
static |
Returns random integer simply used to make sure each msg has unique ID. Use this to identify any msgs that will be sent infrequent.
Random values returned between range MIN_RAND_MSG_ID and MAX_RAND_MSG_ID
|
static |
Returns random integer in case want to use a dedicated object ID that can also be used to send/receive json messages with that ID as "TrackNo".
Random values returned between range MIN_RAND_OBJ_ID and MAX_RAND_OBJ_ID
Use this if intent is to assign a msg id to an object for sending/receiving msgs. e.g. Object to send/receive ODV or RFID only msgs to/from printer