Changes between Version 5 and Version 6 of 802.11/wlan_exp/Extending


Ignore:
Timestamp:
Dec 14, 2015, 5:59:21 PM (8 years ago)
Author:
murphpo
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • 802.11/wlan_exp/Extending

    v5 v6  
    9292This method takes one node object as its argument, sends the {{{USER_CMDID_TX_QUEUE_STATUS}}} command to the node, then parses the response. If the response is valid it returns the list of queue id/occupancy values.
    9393
    94 To use this function:
    95 
    96 {{{
    97 
    98 #Assume n0 is a wlan_exp node object that has already been initialized
    99 q_stat = get_tx_queue_status(n0)
    100 
    101 #Print the queue status response
    102 if(q_stat):
    103   print('Tx Queue Status for node {0}'.format(n0.sn_str))
    104   print('ID Occupancy')
    105 
    106   for q_id,q_occ in q_stat:
    107       print('{0:2d} {1:3d}'.format(q_id, q_occ))
    108 else:
    109   print('No Tx Queue Status received for {0}'.format(n0_str))
    110 }}}
    111 
    112 
    11394Each upper-level MAC application implements its own callback function for handling application-specific user commands. By default these functions are empty. You must modify the C code to implement the behaviors required for your custom command.
    11495
    11596In this example the custom command will query the lengths of Tx queues.
    11697Modify the {{{wlan_exp_user_ap_process_cmd()}}} function in {{{wlan_mac_ap.c}}}.
    117 {{{#!c
     98{{{#!C
    11899    #define USER_CMDID_TX_QUEUE_STATUS 100
    119100    int i;
     
    126107Add a new case for the new command ID to the {{{switch(cmd_id)}}} statement:
    127108
    128 {{{#!c
     109{{{#!C
    129110    case USER_CMDID_TX_QUEUE_STATUS:
    130111        xil_printf("Got Tx queue status cmd\n");
     
    200181
    201182
     183Finally, to utilize this new command from your Python script:
     184
     185{{{#!python
     186
     187#Assume n0 is a wlan_exp node object that has already been initialized
     188q_stat = get_tx_queue_status(n0)
     189
     190#Print the queue status response
     191if(q_stat):
     192  print('Tx Queue Status for node {0}'.format(n0.sn_str))
     193  print('ID Occupancy')
     194
     195  for q_id,q_occ in q_stat:
     196      print('{0:2d} {1:3d}'.format(q_id, q_occ))
     197else:
     198  print('No Tx Queue Status received for {0}'.format(n0_str))
     199}}}
     200
     201
     202
    202203== Low Params ==
    203204The User Command flow described above is can configure and reading state in CPU High. Some applications will also require interacting with CPU Low.