Skip to content

Commit

Permalink
SmartMesh SDK 1.3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
twatteyneadi committed Feb 28, 2018
1 parent 0180536 commit 979b23e
Show file tree
Hide file tree
Showing 11 changed files with 420 additions and 335 deletions.
2 changes: 1 addition & 1 deletion PKG-INFO
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: SmartMeshSDK
Version: 1.1.2.4
Version: 1.3.0.1
Summary: UNKNOWN
Home-page: UNKNOWN
Author: Linear Technology
Expand Down
20 changes: 10 additions & 10 deletions app/HrListener/HrListener.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,14 @@ def emit(self, record):

#============================ setup/teardown ==================================

# logging
def setup_module(function):

# setup logging
for loggerName in LOG_MODULES:
temp = logging.getLogger(loggerName)
temp.setLevel(logging.DEBUG)
temp.addHandler(logHandler)

# global

AppUtils.configureLogging()

# HR logs (do last)
Expand Down Expand Up @@ -100,12 +98,12 @@ def __init__(self, connector, disconnectedCallback):

# variables
self.data = []
self.data.append(['mac' , '# Device HRs', '# Neighbors HRs', '# Discovered HRs']) # header
self.data.append(['mac' , '# Device HRs', '# Neighbors HRs', '# Discovered HRs', '# RSSI HRs']) # header
self.dataLock = threading.Lock()
self.hrParser = HrParser.HrParser()

# log
hrlog.info("============= START LOGGING HEALTH REPORTS ==============")
hrlog.info("========= START LOGGING HEALTH REPORTS =========")

# subscriber
self.subscriber = IpMgrSubscribe.IpMgrSubscribe(self.connector)
Expand Down Expand Up @@ -136,7 +134,7 @@ def getData(self):
def disconnect(self):

# log
hrlog.info("============== STOP LOGGING HEALTH REPORTS =============")
hrlog.info("========= STOP LOGGING HEALTH REPORTS ==========")

self.connector.disconnect()

Expand All @@ -161,9 +159,9 @@ def _notifCallback(self, notifName, notifParams):
with self.dataLock:
# format of data:
# [
# ['' , 'Device', 'Neighbors', 'Discovered'],
# ['11-11-11-11-11-11-11-11' , 0, 3, 2],
# ['22-22-22-22-22-22-22-22' , 0, 3, 2],
# ['' , 'Device', 'Neighbors', 'Discovered', 'RSSI'],
# ['11-11-11-11-11-11-11-11' , 0, 3, 2, 4],
# ['22-22-22-22-22-22-22-22' , 0, 3, 2, 5],
# ]

# find notifName row
Expand All @@ -175,7 +173,7 @@ def _notifCallback(self, notifName, notifParams):

# create row if needed
if not found:
self.data.append([mac,0,0,0])
self.data.append([mac,0,0,0,0])
row = self.data[-1]

# increment counters
Expand All @@ -185,6 +183,8 @@ def _notifCallback(self, notifName, notifParams):
row[2] += 1
if 'Discovered' in hr:
row[3] += 1
if 'Extended' in hr:
row[4] += 1

except Exception as err:
print type(err)
Expand Down
Loading

0 comments on commit 979b23e

Please sign in to comment.