From cd6317236a160b7ad6689080c6419adfe79e575a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Fri, 6 Mar 2020 21:04:46 +0000 Subject: FreeStyle: fix keepalive message handling for non-Libre devices. Message type 0x22 is a keepalive message, which has usually one 0x05 or 0x03 byte. But don't expect a certain value, just ignore the message. This fixes issue #73. --- glucometerutils/support/freestyle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py index bdb4efd..d48ac04 100644 --- a/glucometerutils/support/freestyle.py +++ b/glucometerutils/support/freestyle.py @@ -47,7 +47,7 @@ def _create_matcher(message_type, content): return _matcher _is_init_reply = _create_matcher(_INIT_RESPONSE, b'\x01') -_is_keepalive_response = _create_matcher(_KEEPALIVE_RESPONSE, b'\x05') +_is_keepalive_response = _create_matcher(_KEEPALIVE_RESPONSE, None) _is_unknown_message_error = _create_matcher(_UNKNOWN_MESSAGE_RESPONSE, b'\x85') _is_encryption_missing_error = _create_matcher( _ENCRYPTION_SETUP_RESPONSE, b'\x15') -- cgit v1.2.3