Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int SetDeviceData(HANDLE handle,const char *TableName, const char *Data, const char *Options)
- from ctypes import cdll
- import ctypes
- params = b"protocol=TCP,ipaddress=192.168.100.178,port=4370,timeout=2000,passwd="
- zk = cdll.LoadLibrary("C:/Windows/System32/plcommpro.dll")
- conv = ctypes.create_string_buffer(params)
- handler = zk.Connect(conv)
- print(handler)
- zk.SetDeviceData.argtypes = ctypes.c_void_p, ctypes.c_char_p, ctypes.c_char_p, ctypes.c_char_p
- table = b"user"
- data = b"Pin=1234ttPassword=1tName=Test"
- options = b''
- p_table = ctypes.create_string_buffer(table)
- str_buf = ctypes.create_string_buffer(data)
- opt_buf = ctypes.create_string_buffer(options)
- ret = zk.SetDeviceData(handler, p_table, str_buf, opt_buf)
- table = "user"
- data = "Pin=19999tCardNo=13375401tPassword=1rnPin=2tCardNo=14128058tPassword=1"
- p_table = create_string_buffer(table)
- str_buf = create_string_buffer(data)
- ret = self.commpro.SetDeviceData(self.hcommpro, p_table, str_buf, "")
Add Comment
Please, Sign In to add comment