22import os
33from ctypes import *
44
5-
65def get_lib_ext ():
76 system = platform .system ()
87 if system == 'Linux' :
@@ -12,34 +11,68 @@ def get_lib_ext():
1211 else :
1312 return '.dll'
1413
14+
15+ # def get_user_lib_path():
16+ # system = platform.system()
17+ # if system == 'Linux':
18+ # return '/usr/local/lib'
19+ # elif system == 'Darwin':
20+ # return '/usr/local/lib'
21+ # elif system in ['windows', 'Windows', 'win32']:
22+ # return os.environ['CDDS_HOME']
23+ # else:
24+ # return '/usr/local/lib'
25+
1526def get_user_lib_path ():
27+ system = platform .system ()
28+ if system == 'Linux' :
29+ return '/home/firas/cyclone/cyclonedds/bld/lib/'
30+ elif system == 'Darwin' :
31+ return '/usr/local/lib'
32+ elif system in ['windows' , 'Windows' , 'win32' ]:
33+ return os .environ ['CDDS_HOME' ]
34+ else :
35+ return '/home/firas/cyclone/cyclonedds/bld/lib/'
36+
37+ def get_user_bit_lib_path ():
1638 system = platform .system ()
1739 if system == 'Linux' :
18- return '/usr/local/lib '
40+ return '/home/firas/cyclone/cdds-python/bit/build '
1941 elif system == 'Darwin' :
2042 return '/usr/local/lib'
2143 elif system in ['windows' , 'Windows' , 'win32' ]:
2244 return os .environ ['CDDS_HOME' ]
2345 else :
24- return '/usr/local/lib'
25-
26-
46+ return '/home/firas/cyclone/cdds-python/bit/build'
47+
48+ # system = platform.system()
49+ # if system in ['windows', 'Windows', 'win32']:
50+ # cham_lib = 'ddsc' + get_lib_ext()
51+ # bit_lib = 'ddstubs' + get_lib_ext()
52+ # cham_lib_path = get_user_bit_lib_path() + os.sep + cham_lib
53+ # bit_lib_path = get_user_bit_lib_path() + os.sep + bit_lib
54+ # else:
55+ # cham_lib = 'libddsbit' + get_lib_ext()
56+ # bit_lib = 'libddstubs' + get_lib_ext()
57+ # cham_lib_path = get_user_bit_lib_path() + os.sep + cham_lib
58+ # bit_lib_path = get_user_bit_lib_path() + os.sep + bit_lib
59+
2760system = platform .system ()
2861if system in ['windows' , 'Windows' , 'win32' ]:
29- cham_lib = 'ddsc' + get_lib_ext ()
30- bit_lib = 'ddstubs' + get_lib_ext ()
31- cham_lib_path = get_user_lib_path () + os .sep + cham_lib
32- bit_lib_path = get_user_lib_path () + os .sep + bit_lib
62+ cham_lib = 'ddsc' + get_lib_ext ()
63+ bit_lib = 'ddstubs' + get_lib_ext ()
64+ cham_lib_path = get_user_lib_path () + os .sep + cham_lib
65+ bit_lib_path = get_user_bit_lib_path () + os .sep + bit_lib
3366else :
3467 cham_lib = 'libddsc' + get_lib_ext ()
35- bit_lib = 'libddstubs' + get_lib_ext ()
68+ bit_lib = 'libddstubs' + get_lib_ext ()
3669 helloworld_lib = 'libddshelloworld' + get_lib_ext ()
3770 cham_lib_path = get_user_lib_path () + os .sep + cham_lib
38- bit_lib_path = get_user_lib_path () + os .sep + bit_lib
39-
40- # Limits and Constants
41- MAX_SAMPLES = 256
71+ bit_lib_path = get_user_bit_lib_path () + os .sep + bit_lib
4272 helloworld_lib_path = get_user_bit_lib_path () + os .sep + helloworld_lib
73+
74+ # Limits and Constants
75+ MAX_SAMPLES = 100
4376
4477
4578#
@@ -121,6 +154,7 @@ def get_user_lib_path():
121154DDS_DESTINATIONORDER_BY_RECEPTION_TIMESTAMP = 0
122155DDS_DESTINATIONORDER_BY_SOURCE_TIMESTAMP = 1
123156
157+
124158def dds_secs (n ):
125159 return n * 1000000000
126160
@@ -133,7 +167,6 @@ def dds_micros(n):
133167def dds_nanos (n ):
134168 return n
135169
136-
137170#
138171# DDS Sample Info
139172#
@@ -173,7 +206,7 @@ def is_not_alive_instance(self):
173206dds_entity_t = c_int32
174207dds_time_t = c_int64
175208dds_duration_t = c_int64
176- dds_instance_handle_t = c_int64
209+ dds_instance_handle_t = c_uint64
177210dds_domainid_t = c_uint32
178211dds_sample_state_t = c_int
179212dds_view_state_t = c_int
@@ -242,4 +275,4 @@ class DDSKeyBValue(Structure):
242275
243276class KeyHolder (object ):
244277 def __init__ (self , k ):
245- self .key = k
278+ self .key = k
0 commit comments