Changes between Version 5 and Version 6 of 802.11/wlan_exp/Extending
- Timestamp:
- Dec 14, 2015, 5:59:21 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
802.11/wlan_exp/Extending
v5 v6 92 92 This 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. 93 93 94 To use this function:95 96 {{{97 98 #Assume n0 is a wlan_exp node object that has already been initialized99 q_stat = get_tx_queue_status(n0)100 101 #Print the queue status response102 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 113 94 Each 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. 114 95 115 96 In this example the custom command will query the lengths of Tx queues. 116 97 Modify the {{{wlan_exp_user_ap_process_cmd()}}} function in {{{wlan_mac_ap.c}}}. 117 {{{#! c98 {{{#!C 118 99 #define USER_CMDID_TX_QUEUE_STATUS 100 119 100 int i; … … 126 107 Add a new case for the new command ID to the {{{switch(cmd_id)}}} statement: 127 108 128 {{{#! c109 {{{#!C 129 110 case USER_CMDID_TX_QUEUE_STATUS: 130 111 xil_printf("Got Tx queue status cmd\n"); … … 200 181 201 182 183 Finally, 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 188 q_stat = get_tx_queue_status(n0) 189 190 #Print the queue status response 191 if(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)) 197 else: 198 print('No Tx Queue Status received for {0}'.format(n0_str)) 199 }}} 200 201 202 202 203 == Low Params == 203 204 The User Command flow described above is can configure and reading state in CPU High. Some applications will also require interacting with CPU Low.