1 Reply Latest reply on Aug 27, 2018 11:13 PM by rroy

    wifi design framework for automation testing

    srikrishna.pelluru_ext_3628341

      Hi ,

           Thank you for giving answers. I got it .I need to One command with arguments or parameters with python script that is very helpful one eg.

      for example  scan command  will under come parameters like association time , unassociation time,passive time.like that please give example as like as above script. or not required to pass arguments? and some commands have  wl join <ssid> [key <xxxxx>] [imode bss|infra|ibss|adhoc] ,where we can mentioned parameters or arguments in the script.

      #######################################################

      def wwd_wifi_set_scan_params(self,

         assoc_time,

         unassoc_time,

         passive_time,

         home_time,

         nprobes
         ):

      ########################################################

      import sys, string , os ,argparse

       

      parser = argparse.ArgumentParser()

      parser.add_argument("-l","--location",help="absolute path to your wl utility,(note the slash) eg:<location>/43xxx_Wi-Fi/libraries/test/wl_tool/ ")

      parser.add_argument("-c","--commands",help="location of the commands file, note the slash eg: C:/home/test/test_command.txt")

      parser.add_argument("-p","--port",help="com port Number")

      args = parser.parse_args()

      if args.location and args.port and args.commands:

         print("Running wl utility at " + args.location)

         type(args.location)

        clist = []

        file = open(args.commands, 'r')

         for line in file:

        clist.append(line.strip('\n'))

        os.chdir(args.location)

         #add your list of commands here inside
        
         for i in range(0,len(clist)):

        os.system(args.location + "wl43909B0.exe --serial " + args.port + " " + clist[i])

       

      else:

         print("incorrect usage, type -h for help")

      ##################################################

      Thanks ,

      Srikrishna