Skip to content

Commit

Permalink
test: Fix AdvMonitor RSSI filter properties
Browse files Browse the repository at this point in the history
Update the creation of Advertisement Monitor object as per the
decoupled RSSIThresholdsAndTimers strucure.
More info: doc/advertisement-monitor-api.txt

Reviewed-by: [email protected]
Reviewed-by: [email protected]
Reviewed-by: [email protected]
Signed-off-by: Manish Mandlik <[email protected]>
  • Loading branch information
liveusr authored and Vudentz committed Mar 30, 2021
1 parent 820dfd1 commit 9f11632
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/example-adv-monitor
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,10 @@ class AdvMonitor(dbus.service.Object):
def get_properties(self):
properties = dict()
properties['Type'] = dbus.String(self.monitor_type)
properties['RSSIThresholdsAndTimers'] = dbus.Struct(self.rssi,
signature='nqnq')
properties['RSSIHighThreshold'] = dbus.Int16(self.rssi_h_thresh)
properties['RSSIHighTimeout'] = dbus.UInt16(self.rssi_h_timeout)
properties['RSSILowThreshold'] = dbus.Int16(self.rssi_l_thresh)
properties['RSSILowTimeout'] = dbus.UInt16(self.rssi_l_timeout)
properties['Patterns'] = dbus.Array(self.patterns, signature='(yyay)')
return {ADV_MONITOR_IFACE: properties}

Expand All @@ -72,11 +74,10 @@ class AdvMonitor(dbus.service.Object):


def _set_rssi(self, rssi):
h_thresh = dbus.Int16(rssi[self.RSSI_H_THRESH])
h_timeout = dbus.UInt16(rssi[self.RSSI_H_TIMEOUT])
l_thresh = dbus.Int16(rssi[self.RSSI_L_THRESH])
l_timeout = dbus.UInt16(rssi[self.RSSI_L_TIMEOUT])
self.rssi = (h_thresh, h_timeout, l_thresh, l_timeout)
self.rssi_h_thresh = rssi[self.RSSI_H_THRESH]
self.rssi_h_timeout = rssi[self.RSSI_H_TIMEOUT]
self.rssi_l_thresh = rssi[self.RSSI_L_THRESH]
self.rssi_l_timeout = rssi[self.RSSI_L_TIMEOUT]


def _set_patterns(self, patterns):
Expand Down

0 comments on commit 9f11632

Please sign in to comment.