2 @file corelink_const.py 3 Copies the constants from the DLL to wrapper 6 from sys
import platform
11 DLL_PATH = config.DLL_PATH
20 initialize State Codes 22 global LIB,STATE_CODES
23 arr = [
"STREAM_STATE_NONE",
24 "STREAM_STATE_SEND_UDP",
25 "STREAM_STATE_SEND_TCP",
26 "STREAM_STATE_RECV_UDP",
27 "STREAM_STATE_RECV_TCP",
34 STATE_CODES[string] = ctypes.c_int.in_dll(LIB, string).value
38 Initialize Error Codes 42 arr = [
"ERROR_CODE_NONE",
47 "ERROR_CODE_NO_TOKEN",
50 ERROR_CODES[string] = ctypes.c_int.in_dll(LIB,string).value
54 Initialize CallBack Codes 57 arr = [
"CALLBACK_DROPPED",
63 CALL_BACK[string] = ctypes.c_int.in_dll(LIB,string).value
70 arr = [
"DATA_FUNCTION_LIST",
78 DATA_CODES[string] = ctypes.c_int.in_dll(LIB,string).value
82 get stream_state_to_bit_index 84 return LIB.stream_state_to_bit_index(state)
91 length = LIB.stream_state_nameLen(state)
94 buffer = ctypes.create_string_buffer(length)
95 LIB.stream_state_nameStr(state, buffer)
97 name = name.decode(
'UTF-8')
108 length = LIB.errorCodeNameLen(error_code)
111 buffer = ctypes.create_string_buffer(length)
112 LIB.errorCodeNameStr(error_code, buffer)
114 name = name.decode(
'UTF-8')
122 Initialize LIB depending on Operating Sysytem 128 if platform.startswith(
'win'):
129 LIB = ctypes.CDLL(DLL_PATH+
"Corelink.dll")
130 if platform.startswith(
'linux'):
131 LIB = ctypes.CDLL(DLL_PATH+
"libCorelink.so")
132 if platform.startswith(
'darwin'):
133 LIB = ctypes.CDLL(DLL_PATH+
"libCorelink.dylib")
def stream_state_to_bit_index(state)
def stream_state_name(state)
def error_code_name(error_code)