Class: MistApi::WlanDatarates
- Defined in:
- lib/mist_api/models/wlan_datarates.rb
Overview
Data rates wlan settings
Instance Attribute Summary collapse
-
#eht ⇒ String
If ‘template`==`custom`.
-
#he ⇒ String
If ‘template`==`custom`.
-
#ht ⇒ String
If ‘template`==`custom`.
-
#legacy ⇒ Array[WlanDataratesLegacyItemEnum]
If ‘template`==`custom`.
-
#min_rssi ⇒ Integer
Minimum RSSI for client to connect, 0 means not enforcing.
-
#template ⇒ WlanDataratesTemplateEnum
Data Rates template to apply.
-
#vht ⇒ String
If ‘template`==`custom`.
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
-
.names ⇒ Object
A mapping from model property names to API property names.
-
.nullables ⇒ Object
An array for nullable fields.
-
.optionals ⇒ Object
An array for optional fields.
-
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
Instance Method Summary collapse
-
#initialize(eht = SKIP, he = SKIP, ht = SKIP, legacy = SKIP, min_rssi = 0, template = WlanDataratesTemplateEnum::COMPATIBLE, vht = SKIP) ⇒ WlanDatarates
constructor
A new instance of WlanDatarates.
-
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
-
#to_s ⇒ Object
Provides a human-readable string representation of the object.
Methods inherited from BaseModel
#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json
Constructor Details
#initialize(eht = SKIP, he = SKIP, ht = SKIP, legacy = SKIP, min_rssi = 0, template = WlanDataratesTemplateEnum::COMPATIBLE, vht = SKIP) ⇒ WlanDatarates
Returns a new instance of WlanDatarates.
95 96 97 98 99 100 101 102 103 104 105 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 95 def initialize(eht = SKIP, he = SKIP, ht = SKIP, legacy = SKIP, min_rssi = 0, template = WlanDataratesTemplateEnum::COMPATIBLE, vht = SKIP) @eht = eht unless eht == SKIP @he = he unless he == SKIP @ht = ht unless ht == SKIP @legacy = legacy unless legacy == SKIP @min_rssi = min_rssi unless min_rssi == SKIP @template = template unless template == SKIP @vht = vht unless vht == SKIP end |
Instance Attribute Details
#eht ⇒ String
If ‘template`==`custom`. EHT MCS bitmasks for 4 streams (16-bit for each stream, MCS0 is least significant bit)
15 16 17 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 15 def eht @eht end |
#he ⇒ String
If ‘template`==`custom`. HE MCS bitmasks for 4 streams (16-bit for each stream, MCS0 is least significant bit
20 21 22 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 20 def he @he end |
#ht ⇒ String
If ‘template`==`custom`. MCS bitmasks for 4 streams (16-bit for each stream, MCS0 is least significant bit), e.g. 00ff 00f0 001f limits HT rates to MCS 0-7 for 1 stream, MCS 4-7 for 2 stream (i.e. MCS 12-15), MCS 1-5 for 3 stream (i.e. MCS 16-20)
27 28 29 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 27 def ht @ht end |
#legacy ⇒ Array[WlanDataratesLegacyItemEnum]
If ‘template`==`custom`. List of supported rates (IE=1) and extended supported rates (IE=50) for custom template, append ‘b’ at the end to indicate a rate being basic/mandatory. If `template`==`custom` is configured and legacy does not define at least one basic rate, it will use `no-legacy` default values
35 36 37 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 35 def legacy @legacy end |
#min_rssi ⇒ Integer
Minimum RSSI for client to connect, 0 means not enforcing
39 40 41 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 39 def min_rssi @min_rssi end |
#template ⇒ WlanDataratesTemplateEnum
Data Rates template to apply. enum:
* `no-legacy`: no 11b
* `compatible`: all, like before, default setting that Broadcom/Atheros
used
* `legacy-only`: disable 802.11n and 802.11ac
* `high-density`: no 11b, no low rates
* `custom`: user defined
49 50 51 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 49 def template @template end |
#vht ⇒ String
If ‘template`==`custom`. MCS bitmasks for 4 streams (16-bit for each stream, MCS0 is least significant bit), e.g. 03ff 01ff 00ff limits VHT rates to MCS 0-9 for 1 stream, MCS 0-8 for 2 streams, and MCS 0-7 for 3 streams.
56 57 58 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 56 def vht @vht end |
Class Method Details
.from_hash(hash) ⇒ Object
Creates an instance of the object from a hash.
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 108 def self.from_hash(hash) return nil unless hash # Extract variables from the hash. eht = hash.key?('eht') ? hash['eht'] : SKIP he = hash.key?('he') ? hash['he'] : SKIP ht = hash.key?('ht') ? hash['ht'] : SKIP legacy = hash.key?('legacy') ? hash['legacy'] : SKIP min_rssi = hash['min_rssi'] ||= 0 template = hash['template'] ||= WlanDataratesTemplateEnum::COMPATIBLE vht = hash.key?('vht') ? hash['vht'] : SKIP # Create object from extracted values. WlanDatarates.new(eht, he, ht, legacy, min_rssi, template, vht) end |
.names ⇒ Object
A mapping from model property names to API property names.
59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 59 def self.names @_hash = {} if @_hash.nil? @_hash['eht'] = 'eht' @_hash['he'] = 'he' @_hash['ht'] = 'ht' @_hash['legacy'] = 'legacy' @_hash['min_rssi'] = 'min_rssi' @_hash['template'] = 'template' @_hash['vht'] = 'vht' @_hash end |
.nullables ⇒ Object
An array for nullable fields
85 86 87 88 89 90 91 92 93 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 85 def self.nullables %w[ eht he ht template vht ] end |
.optionals ⇒ Object
An array for optional fields
72 73 74 75 76 77 78 79 80 81 82 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 72 def self.optionals %w[ eht he ht legacy min_rssi template vht ] end |
.validate(value) ⇒ Object
Validates an instance of the object from a given value.
132 133 134 135 136 137 138 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 132 def self.validate(value) return true if value.instance_of? self return false unless value.instance_of? Hash true end |
Instance Method Details
#inspect ⇒ Object
Provides a debugging-friendly string with detailed object information.
148 149 150 151 152 153 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 148 def inspect class_name = self.class.name.split('::').last "<#{class_name} eht: #{@eht.inspect}, he: #{@he.inspect}, ht: #{@ht.inspect}, legacy:"\ " #{@legacy.inspect}, min_rssi: #{@min_rssi.inspect}, template: #{@template.inspect}, vht:"\ " #{@vht.inspect}>" end |
#to_s ⇒ Object
Provides a human-readable string representation of the object.
141 142 143 144 145 |
# File 'lib/mist_api/models/wlan_datarates.rb', line 141 def to_s class_name = self.class.name.split('::').last "<#{class_name} eht: #{@eht}, he: #{@he}, ht: #{@ht}, legacy: #{@legacy}, min_rssi:"\ " #{@min_rssi}, template: #{@template}, vht: #{@vht}>" end |