UniPRT 軟體開發套件 v1.0.0.0-pyd (Python)
 
載入中...
搜尋中...
無符合項目
JsonSDK.JsonSDK 類別 參考文件

公開方法(Public Methods)

 __init__ (self)
 
 MessengerGet (self, Any ptrComm, COMM_TYP commTyp, int maxInputMsgCapacity, bool usingDataPort)
 建立一個頻道,用於發送/接收管理訊息,並指定最大容量。
 
 MessengerRelease (self)
 釋放訊息傳輸介面資源
 
 MessengerSendMsg (self, str strCommand, str strContent)
 向印表機發送管理指令和資料/內容。
 
 MessengerReadNextMsg (self, strNextMsg)
 讀取已經從印表機非同步接收的下一則訊息。
 
 MessengerSendMsgAndWaitForResponse (self, strCommand, strContent, maxWaitTimeSecs, strResponse)
 將管理命令和數據/內容發送到印表機,並等待 maxWaitTimeSecs 秒的回應。
 
 MessengerUnreadMsgCount (self)
 獲取未讀消息的數量。
 
 RfidMonitorConnection (self, lpAddress)
 使用網路介面 (NET Interface) 連接印表機以啟用 RFID 監控功能。
 
 OdvMonitorConnection (self, lpAddress)
 使用網路介面 (NET Interface) 連接印表機以啟用 ODV 監控功能。
 
 PrinterMonitorConnection (self, lpAddress, InfoTyp)
 使用網路介面 (NET Interface) 連接印表機以啟用印表機監控功能。
 
 GetPrinterInfo (self, pPrtInfo, InfoTyp)
 獲取印表機功能的相關信息。
 
 GetRfidReportListening (self)
 獲取 RFID 報告監聽的標誌。
 
 SetRfidReportListening (self, value)
 設置 RFID 報告監聽的標誌。
 
 GetOdvReportListening (self)
 獲取 ODV 報告監聽的標誌。
 
 SetOdvReportListening (self, value)
 設置 ODV 報告監聽的標誌。
 
 RfidMonitorDispose (self)
 釋放 RFID 監控資源。
 
 OdvMonitorDispose (self)
 釋放 ODV 監控資源。
 
 PrinterMonitorDispose (self, InfoTyp)
 釋放印表機監控資源。
 
 SetRfidReportCallback (self, callback)
 設置一個回調函數來獲取 RFID 報告。
 
 SetOdvReportCallback (self, callback)
 設置一個回調函數來獲取 ODV 報告。
 
 SetEngineStatusListening (self, value)
 設置印表機報告監聽引擎狀態的標誌。
 
 SetDisplayStatusListening (self, value)
 設置印表機報告監聽螢幕狀態的標誌。
 
 SetAlertStatusListening (self, value)
 設置印表機報告監聽警報狀態的標誌。
 
 GetEngineStatusListening (self)
 獲取引擎狀態監聽的標誌。
 
 GetDisplayStatusListening (self)
 獲取顯示狀態監聽的標誌。
 
 GetAlertStatusListening (self)
 獲取警報狀態監聽的標誌。
 
 SetEngineStatusCallback (self, callback)
 設置印表機報告監聽警報狀態的標誌。
 
 SetDisplayStatusCallback (self, callback)
 設置印表機報告監聽螢幕狀態的標誌。
 
 SetAlertStatusCallback (self, callback)
 設置印表機報告監聽警報狀態的標誌。
 
 GetPrinterAllValues (self, ptrComm, COMM_TYP commTyp, bool usingDataPort)
 獲取印表機的所有設置。
 
 GetPrinterValue (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, key)
 獲取印表機的單一設置。
 
 GetPrinterValues (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, keys)
 獲取印表機的多個設置。
 
 SetPrinterValue (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, key, value)
 設定印表機的單一設置。
 
 SetPrinterValues (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, keysToSet)
 設定印表機的多個設置。
 
 GetPrinterProperties (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, key)
 獲取印表機的單一屬性。
 
 GetPrinterPropertiesEx (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, keys)
 獲取印表機的多個屬性。
 
 GetPrinterAllProperties (self, ptrComm, COMM_TYP commTyp, bool usingDataPort)
 獲取印表機的所有屬性。
 
 GetPrinterConfig (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, CfgNumber)
 獲取印表機的單一組態設定。
 
 SetPrinterConfig (self, ptrComm, COMM_TYP commTyp, bool usingDataPort, Config)
 設定印表機的單一組態設定。
 
 GetPrinterAllConfig (self, ptrComm, COMM_TYP commTyp, bool usingDataPort)
 獲取印表機的所有組態設定。
 

公開屬性

 AllMsg
 

建構子與解構子說明文件

◆ __init__()

JsonSDK.JsonSDK.__init__ ( self)

函式成員說明文件

◆ GetAlertStatusListening()

JsonSDK.JsonSDK.GetAlertStatusListening ( self)

獲取警報狀態監聽的標誌。

傳回值
bool

◆ GetDisplayStatusListening()

JsonSDK.JsonSDK.GetDisplayStatusListening ( self)

獲取顯示狀態監聽的標誌。

傳回值
bool

◆ GetEngineStatusListening()

JsonSDK.JsonSDK.GetEngineStatusListening ( self)

獲取引擎狀態監聽的標誌。

傳回值
bool

◆ GetOdvReportListening()

JsonSDK.JsonSDK.GetOdvReportListening ( self)

獲取 ODV 報告監聽的標誌。

傳回值
bool

◆ GetPrinterAllConfig()

JsonSDK.JsonSDK.GetPrinterAllConfig ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort )

獲取印表機的所有組態設定。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
傳回值
str
程式碼
AllConfig = GetPrinterAllConfig(comm_ptr, COMM_TYP.TCP_COMM, False)

◆ GetPrinterAllProperties()

JsonSDK.JsonSDK.GetPrinterAllProperties ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort )

獲取印表機的所有屬性。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
傳回值
str
程式碼
AllProperties = GetPrinterAllProperties(comm_ptr, COMM_TYP.TCP_COMM, False)

◆ GetPrinterAllValues()

JsonSDK.JsonSDK.GetPrinterAllValues ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort )

獲取印表機的所有設置。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
傳回值
str
程式碼
AllValues = GetPrinterAllValues(comm_ptr, COMM_TYP.TCP_COMM, False)

◆ GetPrinterConfig()

JsonSDK.JsonSDK.GetPrinterConfig ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
CfgNumber )

獲取印表機的單一組態設定。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
[in]CfgNumber: 組態設定索引值, 範圍是 0~8
傳回值
str
程式碼
Config = GetPrinterConfig(comm_ptr, COMM_TYP.TCP_COMM, False, 2)

◆ GetPrinterInfo()

JsonSDK.JsonSDK.GetPrinterInfo ( self,
pPrtInfo,
InfoTyp )

獲取印表機功能的相關信息。

參數
[out]pPrtInfo: 用來存儲印表機信息的結構體
[in]InfoTyp: 設置 RFID 或 ODV 信息的類型
傳回值
程式碼
prt_info = PrinterInfo()
GetPrinterInfo(prt_info, INFO_TYP.RFID_TYP)

◆ GetPrinterProperties()

JsonSDK.JsonSDK.GetPrinterProperties ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
key )

獲取印表機的單一屬性。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
[in]key印表機設置的一個鍵值
傳回值
str
程式碼
key_ = "Speed.Print-mmps"
properties = GetPrinterProperties(comm_ptr, COMM_TYP.TCP_COMM, False, key_)

◆ GetPrinterPropertiesEx()

JsonSDK.JsonSDK.GetPrinterPropertiesEx ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
keys )

獲取印表機的多個屬性。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
[in]keys印表機設置的多個鍵值
傳回值
str
程式碼
keys = ["Speed", "Label.Sensor"]
properties = GetPrinterPropertiesEx(comm_ptr, COMM_TYP.TCP_COMM, False, keys)

◆ GetPrinterValue()

JsonSDK.JsonSDK.GetPrinterValue ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
key )

獲取印表機的單一設置。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
[in]key印表機設置的一個鍵值
傳回值
str
程式碼
key = "Ethernet.MAC";
value = GetPrinterValue(commPtr, commTyp, false, key.c_str());

◆ GetPrinterValues()

JsonSDK.JsonSDK.GetPrinterValues ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
keys )

獲取印表機的多個設置。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
[in]keys印表機設置的多個鍵值
傳回值
str
程式碼
keys = ["Ethernet.IP", "Ethernet.MAC", "Ethernet.Speed"]
values = GetPrinterValues(comm_ptr, COMM_TYP.TCP_COMM, False, keys)

◆ GetRfidReportListening()

JsonSDK.JsonSDK.GetRfidReportListening ( self)

獲取 RFID 報告監聽的標誌。

傳回值
bool

◆ MessengerGet()

JsonSDK.JsonSDK.MessengerGet ( self,
Any ptrComm,
COMM_TYP commTyp,
int maxInputMsgCapacity,
bool usingDataPort )

建立一個頻道,用於發送/接收管理訊息,並指定最大容量。

參數
[out]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]maxInputMsgCapacity: 最大訊息輸入容量, 預設 MAX_INPUT_MSG_CAPACITY(20)
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
傳回值
程式碼
comm_typ = COMM_TYP.TCP_COMM
commPtr = None
MessengerGet(commPtr, comm_typ, MAX_INPUT_MSG_CAPACITY, False)

◆ MessengerReadNextMsg()

JsonSDK.JsonSDK.MessengerReadNextMsg ( self,
strNextMsg )

讀取已經從印表機非同步接收的下一則訊息。

參數
[out]strNextMsg: 用來存儲下一個返回消息的緩衝區
傳回值
程式碼
str_next_msg = (c_char_p * 1)()
MessengerReadNextMsg(str_next_msg)

◆ MessengerRelease()

JsonSDK.JsonSDK.MessengerRelease ( self)

釋放訊息傳輸介面資源

傳回值
程式碼
MessengerRelease();

◆ MessengerSendMsg()

JsonSDK.JsonSDK.MessengerSendMsg ( self,
str strCommand,
str strContent )

向印表機發送管理指令和資料/內容。

參數
[in]strCommand: 管理指令字串
[in]strContent: 管理資料/內容字串
傳回值
程式碼
pCmdStr = "Cfg.Item"
content = "{\r\n"
content += "\"Speed\" : null,\r\n"
content += "\"ODV.Symbol\" : null,\r\n"
content += "\"Label.Sensor\":null\r\n"
content += "}\r\n"
pContentStr = content
MessengerSendMsg(pCmdStr, pContentStr)

◆ MessengerSendMsgAndWaitForResponse()

JsonSDK.JsonSDK.MessengerSendMsgAndWaitForResponse ( self,
strCommand,
strContent,
maxWaitTimeSecs,
strResponse )

將管理命令和數據/內容發送到印表機,並等待 maxWaitTimeSecs 秒的回應。

參數
[in]strCommand: 一個管理命令字符串
[in]strContent: 一個管理數據/內容字符串
[in]maxWaitTimeSecs: 最大等待時間
[out]strResponse: 用來存儲 JSON 字符串回應的緩衝區
傳回值
程式碼
MAX_WAIT_TIME_SECS = 5
pCmdStr = "Cfg.Item"
content = "{\r\n"
content += "\"Speed\" : null,\r\n"
content += "\"ODV.Symbol\" : null,\r\n"
content += "\"Label.Sensor\":null\r\n"
content += "}\r\n"
pContentStr = content
strResponse = None
MessengerSendMsgAndWaitForResponse(pCmdStr, pContentStr, MAX_WAIT_TIME_SECS, strResponse)

◆ MessengerUnreadMsgCount()

JsonSDK.JsonSDK.MessengerUnreadMsgCount ( self)

獲取未讀消息的數量。

傳回值
int
程式碼
int iUnreadMsgCount = MessengerUnreadMsgCount();

◆ OdvMonitorConnection()

JsonSDK.JsonSDK.OdvMonitorConnection ( self,
lpAddress )

使用網路介面 (NET Interface) 連接印表機以啟用 ODV 監控功能。

參數
[in]lpAddress: IP 位址
傳回值
程式碼
ptr_ip_odv = "10.0.10.171"
OdvMonitorConnection(ptr_ip_odv)

◆ OdvMonitorDispose()

JsonSDK.JsonSDK.OdvMonitorDispose ( self)

釋放 ODV 監控資源。

傳回值

◆ PrinterMonitorConnection()

JsonSDK.JsonSDK.PrinterMonitorConnection ( self,
lpAddress,
InfoTyp )

使用網路介面 (NET Interface) 連接印表機以啟用印表機監控功能。

參數
[in]lpAddress: IP 位址
傳回值
程式碼
ptr_ip_rfid = "10.0.10.178"
rfid_monitor_connection(ptr_ip_rfid)
PrinterMonitorConnection(ptr_ip_rfid, INFO_TYP.RFID_TYP)

◆ PrinterMonitorDispose()

JsonSDK.JsonSDK.PrinterMonitorDispose ( self,
InfoTyp )

釋放印表機監控資源。

傳回值

◆ RfidMonitorConnection()

JsonSDK.JsonSDK.RfidMonitorConnection ( self,
lpAddress )

使用網路介面 (NET Interface) 連接印表機以啟用 RFID 監控功能。

參數
[in]lpAddress: IP 位址
傳回值
程式碼
ptr_ip_rfid = "10.0.10.178"
RfidMonitorConnection(ptr_ip_rfid)

◆ RfidMonitorDispose()

JsonSDK.JsonSDK.RfidMonitorDispose ( self)

釋放 RFID 監控資源。

傳回值

◆ SetAlertStatusCallback()

JsonSDK.JsonSDK.SetAlertStatusCallback ( self,
callback )

設置印表機報告監聽警報狀態的標誌。

參數
[in]callback:回調函數
傳回值
程式碼
SetAlertStatusCallback(PtrAlertNoticeListener);

◆ SetAlertStatusListening()

JsonSDK.JsonSDK.SetAlertStatusListening ( self,
value )

設置印表機報告監聽警報狀態的標誌。

參數
[in]value: 用來設置印表機報告監聽的標誌
傳回值
程式碼
SetAlertStatusListening(True);

◆ SetDisplayStatusCallback()

JsonSDK.JsonSDK.SetDisplayStatusCallback ( self,
callback )

設置印表機報告監聽螢幕狀態的標誌。

參數
[in]callback:回調函數
傳回值
程式碼
SetEngineStatusCallback(PtrEngineStatusNoticeListener);

◆ SetDisplayStatusListening()

JsonSDK.JsonSDK.SetDisplayStatusListening ( self,
value )

設置印表機報告監聽螢幕狀態的標誌。

參數
[in]value: 用來設置印表機報告監聽的標誌
傳回值
程式碼
SetDisplayStatusListening(True);

◆ SetEngineStatusCallback()

JsonSDK.JsonSDK.SetEngineStatusCallback ( self,
callback )

設置印表機報告監聽警報狀態的標誌。

參數
[in]callback:回調函數
傳回值
程式碼
SetEngineStatusCallback(PtrEngineStatusNoticeListener);

◆ SetEngineStatusListening()

JsonSDK.JsonSDK.SetEngineStatusListening ( self,
value )

設置印表機報告監聽引擎狀態的標誌。

參數
[in]value: 用來設置印表機報告監聽的標誌
傳回值
程式碼
SetEngineStatusListening(True);

◆ SetOdvReportCallback()

JsonSDK.JsonSDK.SetOdvReportCallback ( self,
callback )

設置一個回調函數來獲取 ODV 報告。

參數
[in]callback:回調函數
傳回值
程式碼
SetOdvReportCallback(OdvReportCallback);

◆ SetOdvReportListening()

JsonSDK.JsonSDK.SetOdvReportListening ( self,
value )

設置 ODV 報告監聽的標誌。

參數
[in]value: 用來設置 ODV 報告監聽的標誌
傳回值
程式碼
SetRfidReportListening(True);

◆ SetPrinterConfig()

JsonSDK.JsonSDK.SetPrinterConfig ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
Config )

設定印表機的單一組態設定。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
[in]Config: 組態設定
傳回值
bool
程式碼
result = SetPrinterConfig(comm_ptr, COMM_TYP.TCP_COMM, False, Config)

◆ SetPrinterValue()

JsonSDK.JsonSDK.SetPrinterValue ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
key,
value )

設定印表機的單一設置。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
[in]key印表機設置的一個鍵值
[in]value一個印表機設置值
傳回值
bool
程式碼
key = "Ethernet.Speed"
value = "eAutomatic"
result = SetPrinterValue(comm_ptr, COMM_TYP.TCP_COMM, False, key, value)
if result:
print(f"Successfully set {key} to {value}")
else:
print(f"Failed to set {key}")

◆ SetPrinterValues()

JsonSDK.JsonSDK.SetPrinterValues ( self,
ptrComm,
COMM_TYP commTyp,
bool usingDataPort,
keysToSet )

設定印表機的多個設置。

參數
[in]ptrComm: 介面指標
[in]commTyp: 介面種類
[in]usingDataPort: 使用資料埠傳輸, 預設是 false
[in]keysToSet印表機設置的多個鍵值
傳回值
bool
程式碼
key_values = {
"Ethernet.Speed": "eAutomatic",
"Image.Width-in": "3.5"
}
result = SetPrinterValues(comm_ptr, COMM_TYP.TCP_COMM, False, key_values)
if result:
print("Successfully set values.")
else:
print("Failed to set values.")

◆ SetRfidReportCallback()

JsonSDK.JsonSDK.SetRfidReportCallback ( self,
callback )

設置一個回調函數來獲取 RFID 報告。

參數
[in]callback:回調函數
傳回值
程式碼
SetRfidReportCallback(RfidReportCallback);

◆ SetRfidReportListening()

JsonSDK.JsonSDK.SetRfidReportListening ( self,
value )

設置 RFID 報告監聽的標誌。

參數
[in]value: 用來設置 RFID 報告監聽的標誌
傳回值
程式碼
SetRfidReportListening(True);

資料成員說明文件

◆ AllMsg

JsonSDK.JsonSDK.AllMsg