mirror of
https://github.com/kawasaki/pyscrlink.git
synced 2025-09-06 17:50: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():
|
if not delegate.restart_notification_event.is_set():
|
||||||
delegate.restart_notification_event.wait()
|
delegate.restart_notification_event.wait()
|
||||||
try:
|
try:
|
||||||
|
logger.debug("getting lock for waitForNotification")
|
||||||
with self.session.lock:
|
with self.session.lock:
|
||||||
|
logger.debug("before waitForNotification")
|
||||||
self.session.perip.waitForNotifications(1.0)
|
self.session.perip.waitForNotifications(1.0)
|
||||||
|
logger.debug("after waitForNotification")
|
||||||
|
logger.debug("released lock for waitForNotification")
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
logger.error(e)
|
logger.error(e)
|
||||||
self.session.close()
|
self.session.close()
|
||||||
@@ -550,8 +554,10 @@ class BLESession(Session):
|
|||||||
"yet supported: ", params['encoding'])
|
"yet supported: ", params['encoding'])
|
||||||
msg_bstr = params['message'].encode('ascii')
|
msg_bstr = params['message'].encode('ascii')
|
||||||
data = base64.standard_b64decode(msg_bstr)
|
data = base64.standard_b64decode(msg_bstr)
|
||||||
|
logger.debug("getting lock for c.write()")
|
||||||
with self.lock:
|
with self.lock:
|
||||||
c.write(data)
|
c.write(data)
|
||||||
|
logger.debug("released lock for c.write()")
|
||||||
res['result'] = len(data)
|
res['result'] = len(data)
|
||||||
|
|
||||||
logger.debug(res)
|
logger.debug(res)
|
||||||
|
Reference in New Issue
Block a user