Class: MistApi::RrmChannelScore

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/mist_api/models/rrm_channel_score.rb

Overview

RrmChannelScore Model.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(channel = nil, util_score = nil, util_score_noise_floor = nil, util_score_non_wifi = nil, util_score_other = nil, util_score_radar = nil, util_score_undecodable_wifi = nil, util_score_unknown_wifi = nil) ⇒ RrmChannelScore

Returns a new instance of RrmChannelScore.



71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/mist_api/models/rrm_channel_score.rb', line 71

def initialize(channel = nil, util_score = nil,
               util_score_noise_floor = nil, util_score_non_wifi = nil,
               util_score_other = nil, util_score_radar = nil,
               util_score_undecodable_wifi = nil,
               util_score_unknown_wifi = nil)
  @channel = channel
  @util_score = util_score
  @util_score_noise_floor = util_score_noise_floor
  @util_score_non_wifi = util_score_non_wifi
  @util_score_other = util_score_other
  @util_score_radar = util_score_radar
  @util_score_undecodable_wifi = util_score_undecodable_wifi
  @util_score_unknown_wifi = util_score_unknown_wifi
end

Instance Attribute Details

#channelInteger

Channel number

Returns:

  • (Integer)


14
15
16
# File 'lib/mist_api/models/rrm_channel_score.rb', line 14

def channel
  @channel
end

#util_scoreFloat

Utilization score for the channel, 0-1, lower means cleaner RF

Returns:

  • (Float)


18
19
20
# File 'lib/mist_api/models/rrm_channel_score.rb', line 18

def util_score
  @util_score
end

#util_score_noise_floorFloat

Score contribution from noise, 0-1, lower means cleaner RF

Returns:

  • (Float)


22
23
24
# File 'lib/mist_api/models/rrm_channel_score.rb', line 22

def util_score_noise_floor
  @util_score_noise_floor
end

#util_score_non_wifiFloat

Score contribution from non-wifi utilization, 0-1, lower means cleaner RF

Returns:

  • (Float)


26
27
28
# File 'lib/mist_api/models/rrm_channel_score.rb', line 26

def util_score_non_wifi
  @util_score_non_wifi
end

#util_score_otherFloat

Score contribution from RxOtherBss utilization (wifi packets destined for other radios), 0-1, lower means cleaner RF

Returns:

  • (Float)


31
32
33
# File 'lib/mist_api/models/rrm_channel_score.rb', line 31

def util_score_other
  @util_score_other
end

#util_score_radarFloat

Score contribution from radar detections, 0-1, lower means cleaner RF

Returns:

  • (Float)


35
36
37
# File 'lib/mist_api/models/rrm_channel_score.rb', line 35

def util_score_radar
  @util_score_radar
end

#util_score_undecodable_wifiFloat

Score contribution from undecodable wifi utilization (wifi packets which can’t be decoded), 0-1, lower means cleaner RF

Returns:

  • (Float)


40
41
42
# File 'lib/mist_api/models/rrm_channel_score.rb', line 40

def util_score_undecodable_wifi
  @util_score_undecodable_wifi
end

#util_score_unknown_wifiFloat

Score contribution from unknown wifi utilization (wifi packets of unknown type), 0-1, lower means cleaner RF

Returns:

  • (Float)


45
46
47
# File 'lib/mist_api/models/rrm_channel_score.rb', line 45

def util_score_unknown_wifi
  @util_score_unknown_wifi
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# File 'lib/mist_api/models/rrm_channel_score.rb', line 87

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  channel = hash.key?('channel') ? hash['channel'] : nil
  util_score = hash.key?('util_score') ? hash['util_score'] : nil
  util_score_noise_floor =
    hash.key?('util_score_noise_floor') ? hash['util_score_noise_floor'] : nil
  util_score_non_wifi =
    hash.key?('util_score_non_wifi') ? hash['util_score_non_wifi'] : nil
  util_score_other =
    hash.key?('util_score_other') ? hash['util_score_other'] : nil
  util_score_radar =
    hash.key?('util_score_radar') ? hash['util_score_radar'] : nil
  util_score_undecodable_wifi =
    hash.key?('util_score_undecodable_wifi') ? hash['util_score_undecodable_wifi'] : nil
  util_score_unknown_wifi =
    hash.key?('util_score_unknown_wifi') ? hash['util_score_unknown_wifi'] : nil

  # Create object from extracted values.
  RrmChannelScore.new(channel,
                      util_score,
                      util_score_noise_floor,
                      util_score_non_wifi,
                      util_score_other,
                      util_score_radar,
                      util_score_undecodable_wifi,
                      util_score_unknown_wifi)
end

.namesObject

A mapping from model property names to API property names.



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/mist_api/models/rrm_channel_score.rb', line 48

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['channel'] = 'channel'
  @_hash['util_score'] = 'util_score'
  @_hash['util_score_noise_floor'] = 'util_score_noise_floor'
  @_hash['util_score_non_wifi'] = 'util_score_non_wifi'
  @_hash['util_score_other'] = 'util_score_other'
  @_hash['util_score_radar'] = 'util_score_radar'
  @_hash['util_score_undecodable_wifi'] = 'util_score_undecodable_wifi'
  @_hash['util_score_unknown_wifi'] = 'util_score_unknown_wifi'
  @_hash
end

.nullablesObject

An array for nullable fields



67
68
69
# File 'lib/mist_api/models/rrm_channel_score.rb', line 67

def self.nullables
  []
end

.optionalsObject

An array for optional fields



62
63
64
# File 'lib/mist_api/models/rrm_channel_score.rb', line 62

def self.optionals
  []
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



128
129
130
131
132
133
134
135
136
# File 'lib/mist_api/models/rrm_channel_score.rb', line 128

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} channel: #{@channel.inspect}, util_score: #{@util_score.inspect},"\
  " util_score_noise_floor: #{@util_score_noise_floor.inspect}, util_score_non_wifi:"\
  " #{@util_score_non_wifi.inspect}, util_score_other: #{@util_score_other.inspect},"\
  " util_score_radar: #{@util_score_radar.inspect}, util_score_undecodable_wifi:"\
  " #{@util_score_undecodable_wifi.inspect}, util_score_unknown_wifi:"\
  " #{@util_score_unknown_wifi.inspect}>"
end

#to_sObject

Provides a human-readable string representation of the object.



118
119
120
121
122
123
124
125
# File 'lib/mist_api/models/rrm_channel_score.rb', line 118

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} channel: #{@channel}, util_score: #{@util_score}, util_score_noise_floor:"\
  " #{@util_score_noise_floor}, util_score_non_wifi: #{@util_score_non_wifi},"\
  " util_score_other: #{@util_score_other}, util_score_radar: #{@util_score_radar},"\
  " util_score_undecodable_wifi: #{@util_score_undecodable_wifi}, util_score_unknown_wifi:"\
  " #{@util_score_unknown_wifi}>"
end