#!/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", 1) 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_central_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()