summaryrefslogtreecommitdiff
path: root/test_general/integration/cp_beacon-dp/src/max_ucco.py
blob: 168da91897fb31ff8e0d6dc9e0ea2f1746327483 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/env python

import sys
sys.path.append('../../../maximus/python/obj');
sys.path.append('../../../maximus/python/');

from interface import *
from maximus import *
from struct import *

maximus = Maximus()
maximus.init (sys.argv)

# TEI of station 1 will be 1
station1 = maximus.create_sta()
#station1.debug()

# TEI of station 2 will be 2
station2 = maximus.create_sta()
#station2.debug()

sta1_mac = 0x23456789abcd
sta1_mac_str = pack ('>Q', sta1_mac)[2:8]

sta2_mac = 0x123456789abc
sta2_mac_str = pack('>Q', sta2_mac)[2:8]

fc1 = maximus.create_fcall ("fc_station_init_config")
fc1.set_sta (station1)
fc1.add_param_ushort ("snid", 1)
fc1.add_param_ushort ("tei", 1)
fc1.add_param_ushort ("auto_sched", 0)
fc1.add_param_ushort ("cco", 1)
fc1.add_param_ushort ("authenticated", 1)
fc1.send()

fc2 = maximus.create_fcall ("fc_station_init_config")
fc2.set_sta (station2)
fc2.add_param_ushort ("snid", 1)
fc2.add_param_ushort ("tei", 2)
fc2.add_param_ushort ("auto_sched", 0)
fc2.add_param_ushort ("cco", 0)
fc2.add_param_ushort ("authenticated", 0)
fc2.send()

#neighbour discovery
fc1 = maximus.create_fcall ("fc_station_discover")
fc1.set_sta (station1)
fc1.add_param_ushort ("qte", 2)
fc1.add_param_ushort ("tei0", 2)
fc1.add_param ("mac0", sta2_mac_str)
fc1.add_param_ushort ("tei1", 1)
fc1.add_param ("mac1", sta1_mac_str)
fc1.send()

fc2 = maximus.create_fcall ("fc_station_discover")
fc2.set_sta (station2)
fc2.add_param_ushort ("qte", 2)
fc2.add_param_ushort ("tei0", 1)
fc2.add_param ("mac0", sta1_mac_str)
fc2.add_param_ushort ("tei1", 2)
fc2.add_param ("mac1", sta2_mac_str)
fc2.send()

#Don't remove and don't modify the value !!!
maximus.wait(10000000);

## Send a beacon
fc2 = maximus.create_fcall ("fc_station_pbproc_activate")
fc2.set_sta (station2)
fc2.send()


## Send a beacon
fc1 = maximus.create_fcall ("fc_beacon_send_discover_beacon")
fc1.set_sta (station1)
fc1.send()

maximus.wait (1900000)

print "\nEnding the test\n"

#print the traces of the HLE
print "\n\n ************** Station 1 Traces *******************\n"
#fc1 = maximus.create_fcall ("fc_hle_print_trace")
#fc1.set_sta (station1)
#fc1.send()

#print ""
#fc1 = maximus.create_fcall ("fc_cl_print_trace")
#fc1.set_sta (station1)
#fc1.send()

#print ""
#fc1 = maximus.create_fcall ("fc_sar_print_trace")
#fc1.set_sta (station1)
#fc1.send()

print ""
fc1 = maximus.create_fcall ("fc_cp_beacon_print_trace")
fc1.set_sta (station1)
fc1.send()

print "\n\n ************ Station 1 Traces END ******************\n"

station1.remove()

#print the traces of the HLE
print "\n\n ************** Station 2 Traces *******************\n"
#fc1 = maximus.create_fcall ("fc_hle_print_trace")
#fc1.set_sta (station2)
#fc1.send()

#print ""
#fc1 = maximus.create_fcall ("fc_cl_print_trace")
#fc1.set_sta (station2)
#fc1.send()

#print ""
#fc1 = maximus.create_fcall ("fc_sar_print_trace")
#fc1.set_sta (station2)
#fc1.send()

print ""
fc2 = maximus.create_fcall ("fc_cp_beacon_print_trace")
fc2.set_sta (station2)
fc2.send()

print "\n\n ************ Station 2 Traces END ******************\n"

station2.remove()