7 target_os = env.get('TARGET_OS')
8 transport = env.get('TARGET_TRANSPORT')
9 build_sample = env.get('BUILD_SAMPLE')
10 with_ra = env.get('WITH_RA')
11 with_tcp = env.get('WITH_TCP')
12 disable_tcp_server = env.get('DISABLE_TCP_SERVER')
13 disable_ble_server = env.get('DISABLE_BLE_SERVER')
14 with_mq = env.get('WITH_MQ')
15 ble_custom_adv = env.get('BLE_CUSTOM_ADV')
17 print "Given Transport is %s" % transport
18 print "Given OS is %s" % target_os
19 print "BUILD_SAMPLE is %s" % build_sample
20 print "MQ flag is %s" % with_mq
22 targets_disallow_multitransport = ['arduino']
24 if target_os in targets_disallow_multitransport:
25 if ('ALL' in transport) or (len(transport) != 1):
26 print "*** Error invalid option values: TARGET_TRANSPORT"
27 print "%s disallowed until testing can validate use of multiple transports on %s %d" % (transport, target_os, len(transport))
30 if 'ALL' in transport:
32 env.AppendUnique(CPPDEFINES = ['RA_ADAPTER'])
34 env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER'])
35 if disable_tcp_server == True:
36 env.AppendUnique(CPPDEFINES = ['DISABLE_TCP_SERVER'])
37 if disable_ble_server == True:
38 if target_os in ['tizen']:
39 env.AppendUnique(CPPDEFINES = ['DISABLE_BLE_SERVER'])
40 if target_os in ['linux']:
41 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','LE_ADAPTER'])
42 elif target_os == 'tizen':
43 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
44 elif target_os == 'android':
45 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER', 'NFC_ADAPTER'])
46 elif target_os in['darwin','ios']:
47 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','NO_LE_ADAPTER'])
48 elif target_os in ['msys_nt', 'windows']:
49 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','NO_EDR_ADAPTER','NO_LE_ADAPTER'])
51 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER','EDR_ADAPTER','LE_ADAPTER'])
52 print "CA Transport is ALL"
55 if target_os in ['linux']:
56 print "CA Transport BT is not supported in Linux"
59 env.AppendUnique(CPPDEFINES = ['EDR_ADAPTER'])
60 print "CA Transport is BT"
62 env.AppendUnique(CPPDEFINES = ['NO_EDR_ADAPTER'])
64 if 'BLE' in transport:
65 env.AppendUnique(CPPDEFINES = ['LE_ADAPTER'])
66 print "CA Transport is BLE"
67 if ble_custom_adv in ['True']:
68 env.AppendUnique(CPPDEFINES = ['BLE_CUSTOM_ADVERTISE'])
69 print "BLE Custom advertisement supported"
71 print "BLE Custom advertisement not supported"
72 if disable_ble_server == True:
73 if target_os in ['tizen']:
74 env.AppendUnique(CPPDEFINES = ['DISABLE_BLE_SERVER'])
75 print "BLE Server Disabled"
77 env.AppendUnique(CPPDEFINES = ['NO_LE_ADAPTER'])
80 env.AppendUnique(CPPDEFINES = ['IP_ADAPTER'])
81 print "CA Transport is IP"
83 env.AppendUnique(CPPDEFINES = ['NO_IP_ADAPTER'])
86 if target_os in ['linux', 'tizen', 'android', 'arduino', 'ios', 'tizenrt']:
87 env.AppendUnique(CPPDEFINES = ['TCP_ADAPTER', 'WITH_TCP'])
88 print "CA Transport is TCP"
90 print "CA Transport TCP is not supported "
93 env.AppendUnique(CPPDEFINES = ['NO_TCP_ADAPTER'])
95 if disable_tcp_server == True:
96 if target_os in ['linux', 'tizen', 'android', 'arduino', 'ios', 'tizenrt']:
97 env.AppendUnique(CPPDEFINES = ['DISABLE_TCP_SERVER'])
99 if 'NFC' in transport:
100 if target_os in['android']:
101 env.AppendUnique(CPPDEFINES = ['NFC_ADAPTER'])
102 print "CA Transport is NFC"
104 print "CA Transport NFC is not supported "
107 env.AppendUnique(CPPDEFINES = ['NO_NFC_ADAPTER'])
110 env.AppendUnique(CPPDEFINES = ['MQ_SUBSCRIBER', 'WITH_MQ'])
111 print "MQ SUB support"
114 env.AppendUnique(CPPDEFINES = ['MQ_PUBLISHER', 'WITH_MQ'])
115 print "MQ PUB support"
117 if 'BROKER' in with_mq:
118 env.AppendUnique(CPPDEFINES = ['MQ_BROKER', 'WITH_MQ'])
119 print "MQ Broker support"
121 env.SConscript('./src/SConscript')