3 Copies the initialization from the DLL to wrapper 7 import corelink_exception
11 CALLBACK_UPDATE =
None 12 CALLBACK_UPDATE_M =
None 13 CALLBACK_SETONSTALE =
None 14 CALLBACK_SETONSTALE_M =
None 25 corelink_const.LIB.DLLInit()
26 corelink_const.LIB.setDroppedCallbackHandler(
None)
27 corelink_const.LIB.setStaleCallbackHandler(
None)
28 corelink_const.LIB.setSubscribeCallbackHandler(
None)
29 corelink_const.LIB.setUpdateCallbackHandler(
None)
36 state_c = ctypes.c_int(state)
37 error_id = ctypes.c_int()
38 corelink_const.LIB.setInitState(state_c,ctypes.byref(error_id))
44 Set Server Credentials 46 username_c = username.encode(
'utf-8')
47 password_c = password.encode(
'utf-8')
48 corelink_const.LIB.setServerCredentials.argtypes = [ctypes.c_char_p, ctypes.c_char_p]
49 corelink_const.LIB.setServerCredentials(username_c,password_c)
56 global CALLBACK_SETONSTALE,CALLBACK_SETONSTALE_M
57 CALLBACK_SETONSTALE_M = func
58 CALLBACK_SETONSTALE = ctypes.CFUNCTYPE(
None,
59 ctypes.POINTER(ctypes.c_int))(DLLInit.set_on_stale_temp)
60 corelink_const.LIB.setStaleCallbackHandler(CALLBACK_SETONSTALE)
65 Helper function for setOn stale 67 global CALLBACK_SETONSTALE_M
74 global CALLBACK_UPDATE,CALLBACK_UPDATE_M
75 CALLBACK_UPDATE_M = func
76 CALLBACK_UPDATE = ctypes.CFUNCTYPE(
None,
77 ctypes.POINTER(ctypes.c_int),
78 ctypes.POINTER(ctypes.c_int))(DLLInit.set_on_update_temp)
79 corelink_const.LIB.setUpdateCallbackHandler(CALLBACK_UPDATE)
84 Set on Update helper function 86 global CALLBACK_UPDATE_M
def set_on_stale_temp(send_id)
def get_dll_exception(error_id_ctypes)
def set_server_credentials(username, password)
def set_on_update_temp(recv_id, send_id)
def set_init_state(state)