mirror of
https://github.com/kawasaki/pyscrlink.git
synced 2025-09-05 17:20:20 +02:00
BLESession: Add debug prints for Lego Boost
Signed-off-by: Shin'ichiro Kawasaki <kawasaki@juno.dti.ne.jp>
This commit is contained in:
@@ -353,8 +353,12 @@ class BLESession(Session):
|
||||
if not delegate.restart_notification_event.is_set():
|
||||
delegate.restart_notification_event.wait()
|
||||
try:
|
||||
logger.debug("getting lock for waitForNotification")
|
||||
with self.session.lock:
|
||||
logger.debug("before waitForNotification")
|
||||
self.session.perip.waitForNotifications(1.0)
|
||||
logger.debug("after waitForNotification")
|
||||
logger.debug("released lock for waitForNotification")
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
self.session.close()
|
||||
@@ -550,8 +554,10 @@ class BLESession(Session):
|
||||
"yet supported: ", params['encoding'])
|
||||
msg_bstr = params['message'].encode('ascii')
|
||||
data = base64.standard_b64decode(msg_bstr)
|
||||
logger.debug("getting lock for c.write()")
|
||||
with self.lock:
|
||||
c.write(data)
|
||||
logger.debug("released lock for c.write()")
|
||||
res['result'] = len(data)
|
||||
|
||||
logger.debug(res)
|
||||
|
Reference in New Issue
Block a user