245 | | The User Command flow described above is can configure and reading state in CPU High. Some applications will also require interacting with CPU Low. |
| 246 | The second flow for extending the experiments framework provides a path for setting parameters in CPU Low. The default 802.11 Reference Design code uses this flow for setting low-level MAC and PHY parameters, such as the [//docs/mango-wlan-exp/node.html#wlan_exp.node.WlanExpNode.set_dcf_rts_thresh RTS Threshold] and [//docs/mango-wlan-exp/node.html#wlan_exp.node.WlanExpNode.set_dcf_cw_exp_min min/max Contention Window]. |
| 247 | |
| 248 | '''Write-Only'''[[BR]] |
| 249 | A Python script can only write parameters in CPU Low. The script cannot read any data directly from CPU Low. This is by design. The experiments framework C code runs in CPU High. CPU High communicates with CPU Low via the IPC Mailbox. This inter-CPU communication is asynchronous. CPU Low can take an arbitrarily long time to service any new mailbox message from CPU High. The experiments framework cannot block processing in CPU High waiting |
| 250 | |
| 251 | === Adding Parameters === |
| 252 | Adding new parameters to this flow requires modifying your Python script and the C code for CPU Low. |
| 253 | |
| 254 | Each parameter is identified by a unique 32-bit ID value. The Reference Design reserves some parameter IDs. These reserved values are defined in [browser: /ReferenceDesigns/w3_802.11/python/wlan_exp/cmds.py cmds.py] by constant values named with the prefix {{{CMD_PARAM_LOW_PARAM_}}}. User-defined parameters must not collide with any of the existing {{{CMD_PARAM_LOW_PARAM_}}} values. |
| 255 | |
| 256 | We suggest you set the 4 MSB of any new parameters to {{{0xF}}}. We will never use this range for parameters in the reference code. Do this by defining your new parameters with the form: |
| 257 | {{{ |
| 258 | //C code |
| 259 | #define CMD_PARAM_LOW_PARAM_NEW_PARAM0 0xF00000000 |
| 260 | #define CMD_PARAM_LOW_PARAM_NEW_PARAM1 0xF00000001 |
| 261 | //etc... |
| 262 | |
| 263 | #Python code |
| 264 | CMD_PARAM_LOW_PARAM_NEW_PARAM0 = 0xF00000000 |
| 265 | CMD_PARAM_LOW_PARAM_NEW_PARAM1 = 0xF00000001 |
| 266 | #etc... |
| 267 | }}} |
| 268 | |
| 269 | '''Python'''[[BR]] |