Skip to content
Snippets Groups Projects
wifi.radio.md 18.1 KiB
Newer Older
  • Learn to ignore specific revisions
  • Jakob Olsson's avatar
    Jakob Olsson committed
    # wifi.radio.<name> Schema
    
    ```
    https://www.iopsys.eu/wifi.radio.json
    ```
    
    WiFi Radio Object
    
    | Custom Properties | Additional Properties |
    | ----------------- | --------------------- |
    | Forbidden         | Forbidden             |
    
    # wifi.radio.<name>
    
    | List of Methods             |
    | --------------------------- |
    
    | [add_iface](#add_iface)     | Method | wifi.radio.<name> (this schema) |
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    | [autochannel](#autochannel) | Method | wifi.radio.<name> (this schema) |
    
    | [del_iface](#del_iface)     | Method | wifi.radio.<name> (this schema) |
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    | [get](#get)                 | Method | wifi.radio.<name> (this schema) |
    | [scan](#scan)               | Method | wifi.radio.<name> (this schema) |
    | [scanresults](#scanresults) | Method | wifi.radio.<name> (this schema) |
    | [stats](#stats)             | Method | wifi.radio.<name> (this schema) |
    | [status](#status)           | Method | wifi.radio.<name> (this schema) |
    
    
    ## add_iface
    
    `add_iface`
    
    - type: `Method`
    
    ### add_iface Type
    
    `object` with following properties:
    
    | Property | Type   | Required |
    | -------- | ------ | -------- |
    | `input`  | object | Optional |
    | `output` | object | Optional |
    
    #### input
    
    `input`
    
    - is optional
    - type: `object`
    
    ##### input Type
    
    `object` with following properties:
    
    | Property | Type    | Required |
    | -------- | ------- | -------- |
    | `args`   | object  | Optional |
    | `config` | boolean | Optional |
    
    #### args
    
    `args`
    
    - is optional
    - type: `object`
    
    ##### args Type
    
    `object` with following properties:
    
    | Property | Type | Required |
    | -------- | ---- | -------- |
    | None     | None | None     |
    
    #### config
    
    `config`
    
    - is optional
    - type: `boolean`
    
    ##### config Type
    
    `boolean`
    
    ### Ubus CLI Example
    
    ```
    ubus call wifi.radio.<name> add_iface {"args":{},"config":true}
    ```
    
    ### JSONRPC Example
    
    ```json
    {
      "jsonrpc": "2.0",
      "id": 0,
      "method": "call",
      "params": ["<SID>", "wifi.radio.<name>", "add_iface", { "args": {}, "config": true }]
    }
    ```
    
    #### output
    
    `output`
    
    - is optional
    - type: `object`
    
    ##### output Type
    
    `object` with following properties:
    
    | Property | Type | Required |
    | -------- | ---- | -------- |
    | None     | None | None     |
    
    ### Output Example
    
    ```json
    {}
    ```
    
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    ## autochannel
    
    `autochannel`
    
    - type: `Method`
    
    ### autochannel Type
    
    `object` with following properties:
    
    | Property | Type   | Required |
    | -------- | ------ | -------- |
    | `input`  | object | Optional |
    | `output` | object | Optional |
    
    #### input
    
    `input`
    
    - is optional
    - type: `object`
    
    ##### input Type
    
    `object` with following properties:
    
    | Property   | Type    | Required |
    | ---------- | ------- | -------- |
    | `algo`     | integer | Optional |
    | `interval` | integer | Optional |
    | `scans`    | integer | Optional |
    
    #### algo
    
    `algo`
    
    - is optional
    - type: `integer`
    
    ##### algo Type
    
    `integer`
    
    #### interval
    
    `interval`
    
    - is optional
    - type: `integer`
    
    ##### interval Type
    
    `integer`
    
    #### scans
    
    `scans`
    
    - is optional
    - type: `integer`
    
    ##### scans Type
    
    `integer`
    
    ### Ubus CLI Example
    
    ```
    
    ubus call wifi.radio.<name> autochannel {"interval":42230905,"algo":-63796592,"scans":80502357}
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    ```
    
    ### JSONRPC Example
    
    ```json
    {
      "jsonrpc": "2.0",
      "id": 0,
      "method": "call",
      "params": [
        "<SID>",
        "wifi.radio.<name>",
        "autochannel",
    
        { "interval": 42230905, "algo": -63796592, "scans": 80502357 }
    
    Jakob Olsson's avatar
    Jakob Olsson committed
      ]
    }
    ```
    
    #### output
    
    ##### wifi.radio.autochannel
    
    Auto channel selection
    
    `output`
    
    - is optional
    - type: `object`
    
    ##### output Type
    
    `object` with following properties:
    
    | Property      | Type    | Required     |
    | ------------- | ------- | ------------ |
    | `code`        | integer | **Required** |
    | `new_channel` | oneOf   | **Required** |
    | `status`      | string  | **Required** |
    
    #### code
    
    `code`
    
    - is **required**
    - type: `integer`
    
    ##### code Type
    
    `integer`
    
    #### new_channel
    
    `new_channel`
    
    - is **required**
    - type: complex
    
    ##### new_channel Type
    
    **One** of the following _conditions_ need to be fulfilled.
    
    #### Condition 1
    
    `integer`
    
    - minimum value: `1`
    - maximum value: `14`
    
    #### Condition 2
    
    `integer`
    
    - minimum value: `32`
    - maximum value: `200`
    
    #### status
    
    `status`
    
    - is **required**
    - type: `string`
    
    ##### status Type
    
    `string`
    
    ### Output Example
    
    ```json
    
    { "code": 2357742, "new_channel": 132, "status": "est in ad ex culpa" }
    ```
    
    ## del_iface
    
    `del_iface`
    
    - type: `Method`
    
    ### del_iface Type
    
    `object` with following properties:
    
    | Property | Type   | Required |
    | -------- | ------ | -------- |
    | `input`  | object | Optional |
    | `output` | object | Optional |
    
    #### input
    
    `input`
    
    - is optional
    - type: `object`
    
    ##### input Type
    
    `object` with following properties:
    
    | Property | Type    | Required     |
    | -------- | ------- | ------------ |
    | `config` | boolean | Optional     |
    | `ifname` | string  | **Required** |
    
    #### config
    
    `config`
    
    - is optional
    - type: `boolean`
    
    ##### config Type
    
    `boolean`
    
    #### ifname
    
    `ifname`
    
    - is **required**
    - type: `string`
    
    ##### ifname Type
    
    `string`
    
    - maximum length: 16 characters
    
    ### Ubus CLI Example
    
    ```
    ubus call wifi.radio.<name> del_iface {"ifname":"adipi","config":true}
    ```
    
    ### JSONRPC Example
    
    ```json
    {
      "jsonrpc": "2.0",
      "id": 0,
      "method": "call",
      "params": ["<SID>", "wifi.radio.<name>", "del_iface", { "ifname": "adipi", "config": true }]
    }
    ```
    
    #### output
    
    `output`
    
    - is optional
    - type: `object`
    
    ##### output Type
    
    `object` with following properties:
    
    | Property | Type | Required |
    | -------- | ---- | -------- |
    | None     | None | None     |
    
    ### Output Example
    
    ```json
    {}
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    ```
    
    ## get
    
    `get`
    
    - type: `Method`
    
    ### get Type
    
    `object` with following properties:
    
    | Property | Type   | Required |
    | -------- | ------ | -------- |
    | `input`  | object | Optional |
    | `output` | object | Optional |
    
    #### input
    
    `input`
    
    - is optional
    - type: `object`
    
    ##### input Type
    
    `object` with following properties:
    
    | Property | Type   | Required |
    | -------- | ------ | -------- |
    | `param`  | string | Optional |
    
    #### param
    
    `param`
    
    - is optional
    - type: `string`
    
    ##### param Type
    
    `string`
    
    ### Ubus CLI Example
    
    ```
    
    ubus call wifi.radio.<name> get {"param":"esse anim Duis minim laborum"}
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    ```
    
    ### JSONRPC Example
    
    ```json
    
    {
      "jsonrpc": "2.0",
      "id": 0,
      "method": "call",
      "params": ["<SID>", "wifi.radio.<name>", "get", { "param": "esse anim Duis minim laborum" }]
    }
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    ```
    
    #### output
    
    `output`
    
    - is optional
    - type: `object`
    
    ##### output Type
    
    `object` with following properties:
    
    | Property | Type    | Required |
    | -------- | ------- | -------- |
    | `status` | integer | Optional |
    | `values` | integer | Optional |
    
    #### status
    
    `status`
    
    - is optional
    - type: `integer`
    
    ##### status Type
    
    `integer`
    
    #### values
    
    `values`
    
    - is optional
    - type: `integer`
    
    ##### values Type
    
    `integer`
    
    ### Output Example
    
    ```json
    
    { "status": 7971921, "values": -22899543 }
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    ```
    
    ## scan
    
    `scan`
    
    - type: `Method`
    
    ### scan Type
    
    `object` with following properties:
    
    | Property | Type   | Required |
    | -------- | ------ | -------- |
    | `input`  | object | Optional |
    | `output` | object | Optional |
    
    #### input
    
    `input`
    
    - is optional
    - type: `object`
    
    ##### input Type
    
    `object` with following properties:
    
    | Property  | Type   | Required |
    | --------- | ------ | -------- |
    | `bssid`   | string | Optional |
    | `channel` | oneOf  | Optional |
    | `ssid`    | string | Optional |
    
    #### bssid
    
    ##### MAC Address
    
    `bssid`
    
    - is optional
    - type: reference
    
    ##### bssid Type
    
    `string`
    
    - minimum length: 17 characters
    - maximum length: 17 characters All instances must conform to this regular expression (test examples
      [here](<https://regexr.com/?expression=%5E(%5B0-9a-fA-F%5D%5B0-9a-fA-F%5D%3A)%7B5%7D%5B0-9a-fA-F%5D%5B0-9a-fA-F%5D%24>)):
    
    ```regex
    ^([0-9a-fA-F][0-9a-fA-F]:){5}[0-9a-fA-F][0-9a-fA-F]$
    ```
    
    #### channel
    
    `channel`
    
    - is optional
    - type: complex
    
    ##### channel Type
    
    **One** of the following _conditions_ need to be fulfilled.
    
    #### Condition 1
    
    `integer`
    
    - minimum value: `1`
    - maximum value: `14`
    
    #### Condition 2
    
    `integer`
    
    - minimum value: `32`
    - maximum value: `200`
    
    #### ssid
    
    ##### SSID
    
    `ssid`
    
    - is optional
    - type: reference
    
    ##### ssid Type
    
    `string`
    
    - maximum length: 32 characters
    
    ### Ubus CLI Example
    
    ```
    
    ubus call wifi.radio.<name> scan {"ssid":"non","bssid":"Fe:e5:56:E7:78:bb","channel":11}
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    ```
    
    ### JSONRPC Example
    
    ```json
    {
      "jsonrpc": "2.0",
      "id": 0,
      "method": "call",
    
      "params": ["<SID>", "wifi.radio.<name>", "scan", { "ssid": "non", "bssid": "Fe:e5:56:E7:78:bb", "channel": 11 }]
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    }
    ```
    
    #### output
    
    Trigger a scan
    
    `output`
    
    - is optional
    - type: `object`
    
    ##### output Type
    
    `object` with following properties:
    
    | Property | Type | Required |
    | -------- | ---- | -------- |
    | None     | None | None     |
    
    ### Output Example
    
    ```json
    {}
    ```
    
    ## scanresults
    
    `scanresults`
    
    - type: `Method`
    
    ### scanresults Type
    
    `object` with following properties:
    
    | Property | Type   | Required |
    | -------- | ------ | -------- |
    | `input`  | object | Optional |
    
    | `output` | oneOf  | Optional |
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    
    #### input
    
    `input`
    
    - is optional
    - type: `object`
    
    ##### input Type
    
    `object` with following properties:
    
    | Property | Type | Required |
    | -------- | ---- | -------- |
    | None     | None | None     |
    
    ### Ubus CLI Example
    
    ```
    ubus call wifi.radio.<name> scanresults {}
    ```
    
    ### JSONRPC Example
    
    ```json
    { "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["<SID>", "wifi.radio.<name>", "scanresults", {}] }
    ```
    
    #### output
    
    Show scan results
    
    `output`
    
    - is optional
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    
    ##### output Type
    
    
    **One** of the following _conditions_ need to be fulfilled.
    
    #### Condition 1
    
    #### Condition 2
    
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    `object` with following properties:
    
    
    | Property           | Type    | Required     |
    | ------------------ | ------- | ------------ |
    | `band`             | string  | **Required** |
    | `bssid`            | string  | **Required** |
    | `encryption`       | string  | **Required** |
    | `load_available`   | integer | **Required** |
    | `load_stas`        | integer | **Required** |
    | `load_utilization` | integer | **Required** |
    | `rssi`             | integer | **Required** |
    | `ssid`             | string  | **Required** |
    
    #### band
    
    ##### WiFi Band
    
    `band`
    
    - is **required**
    - type: reference
    
    ##### band Type
    
    `string`
    
    The value of this property **must** be equal to one of the [known values below](#-known-values).
    
    ##### band Known Values
    
    | Value |
    | ----- |
    | 2GHz  |
    | 5GHz  |
    
    #### bssid
    
    ##### MAC Address
    
    `bssid`
    
    - is **required**
    - type: reference
    
    ##### bssid Type
    
    `string`
    
    - minimum length: 17 characters
    - maximum length: 17 characters All instances must conform to this regular expression (test examples
      [here](<https://regexr.com/?expression=%5E(%5B0-9a-fA-F%5D%5B0-9a-fA-F%5D%3A)%7B5%7D%5B0-9a-fA-F%5D%5B0-9a-fA-F%5D%24>)):
    
    ```regex
    ^([0-9a-fA-F][0-9a-fA-F]:){5}[0-9a-fA-F][0-9a-fA-F]$
    ```
    
    #### encryption
    
    `encryption`
    
    - is **required**
    - type: `string`
    
    ##### encryption Type
    
    `string`
    
    #### load_available
    
    `load_available`
    
    - is **required**
    - type: `integer`
    
    ##### load_available Type
    
    `integer`
    
    - minimum value: `0`
    
    #### load_stas
    
    `load_stas`
    
    - is **required**
    - type: `integer`
    
    ##### load_stas Type
    
    `integer`
    
    - minimum value: `0`
    
    #### load_utilization
    
    `load_utilization`
    
    - is **required**
    - type: `integer`
    
    ##### load_utilization Type
    
    `integer`
    
    - minimum value: `0`
    - maximum value: `100`
    
    #### rssi
    
    ##### RSSI
    
    `rssi`
    
    - is **required**
    - type: reference
    
    ##### rssi Type
    
    `integer`
    
    - minimum value: `-128`
    - maximum value: `0`
    
    #### ssid
    
    ##### SSID
    
    `ssid`
    
    - is **required**
    - type: reference
    
    ##### ssid Type
    
    `string`
    
    - maximum length: 32 characters
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    
    ### Output Example
    
    ```json
    
    {
      "ssid": "sit mi",
      "bssid": "eF:96:af:66:13:4D",
      "encryption": "labore velit",
      "band": "2GHz",
      "rssi": -6,
      "load_stas": 17584500,
      "load_utilization": 65,
      "load_available": 75311380,
      "standard": 22195874,
      "bandwidth": "et ullamco",
      "channel": 48960927
    }
    
    Jakob Olsson's avatar
    Jakob Olsson committed
    ```
    
    ## stats
    
    `stats`
    
    - type: `Method`
    
    ### stats Type
    
    `object` with following properties:
    
    | Property | Type   | Required |
    | -------- | ------ | -------- |
    | `input`  | object | Optional |
    | `output` | object | Optional |
    
    #### input
    
    `input`
    
    - is optional
    - type: `object`
    
    ##### input Type
    
    `object` with following properties:
    
    | Property | Type | Required |
    | -------- | ---- | -------- |
    | None     | None | None     |
    
    ### Ubus CLI Example
    
    ```
    ubus call wifi.radio.<name> stats {}
    ```
    
    ### JSONRPC Example
    
    ```json
    { "jsonrpc": "2.0", "id": 0, "method": "call", "params": ["<SID>", "wifi.radio.<name>", "stats", {}] }
    ```
    
    #### output
    
    ##### wifi.radio.iface
    
    Radio statistics
    
    `output`
    
    - is optional
    - type: `object`
    
    ##### output Type
    
    `object` with following properties:
    
    | Property               | Type    | Required     |
    | ---------------------- | ------- | ------------ |
    | `rx_bytes`             | integer | **Required** |
    | `rx_dropped_packets`   | integer | **Required** |
    | `rx_error_packets`     | integer | **Required** |
    | `rx_fcs_error_packets` | integer | **Required** |
    | `rx_packets`           | integer | **Required** |
    | `tx_bytes`             | integer | **Required** |
    | `tx_dropped_packets`   | integer | **Required** |
    | `tx_error_packets`     | integer | **Required** |
    | `tx_packets`           | integer | **Required** |
    
    #### rx_bytes
    
    `rx_bytes`
    
    - is **required**
    - type: reference
    
    ##### rx_bytes Type
    
    `integer`
    
    - minimum value: `0`
    
    #### rx_dropped_packets
    
    `rx_dropped_packets`
    
    - is **required**
    - type: reference
    
    ##### rx_dropped_packets Type
    
    `integer`
    
    - minimum value: `0`
    
    #### rx_error_packets
    
    `rx_error_packets`
    
    - is **required**
    - type: reference
    
    ##### rx_error_packets Type
    
    `integer`
    
    - minimum value: `0`
    
    #### rx_fcs_error_packets
    
    `rx_fcs_error_packets`
    
    - is **required**
    - type: reference
    
    ##### rx_fcs_error_packets Type
    
    `integer`
    
    - minimum value: `0`
    
    #### rx_packets
    
    `rx_packets`
    
    - is **required**
    - type: reference
    
    ##### rx_packets Type
    
    `integer`
    
    - minimum value: `0`
    
    #### tx_bytes
    
    `tx_bytes`
    
    - is **required**
    - type: reference
    
    ##### tx_bytes Type
    
    `integer`
    
    - minimum value: `0`
    
    #### tx_dropped_packets
    
    `tx_dropped_packets`
    
    - is **required**
    - type: reference
    
    ##### tx_dropped_packets Type
    
    `integer`
    
    - minimum value: `0`
    
    #### tx_error_packets
    
    `tx_error_packets`
    
    - is **required**
    - type: reference
    
    ##### tx_error_packets Type
    
    `integer`
    
    - minimum value: `0`
    
    #### tx_packets
    
    `tx_packets`