diff options
author | Diego Elio Pettenò <flameeyes@flameeyes.com> | 2020-01-25 12:05:54 +0100 |
---|---|---|
committer | Diego Elio Pettenò <flameeyes@flameeyes.com> | 2020-01-25 12:05:54 +0100 |
commit | 37d3712dc7e1e91c49733a8ad40d4cc719b1e3d3 (patch) | |
tree | 332f24a35b6df61e99f9447cf025610134baa84a | |
parent | freestyle: simplify the code for initialization further. (diff) | |
download | glucometerutils-37d3712dc7e1e91c49733a8ad40d4cc719b1e3d3.tar glucometerutils-37d3712dc7e1e91c49733a8ad40d4cc719b1e3d3.tar.gz glucometerutils-37d3712dc7e1e91c49733a8ad40d4cc719b1e3d3.tar.bz2 glucometerutils-37d3712dc7e1e91c49733a8ad40d4cc719b1e3d3.tar.lz glucometerutils-37d3712dc7e1e91c49733a8ad40d4cc719b1e3d3.tar.xz glucometerutils-37d3712dc7e1e91c49733a8ad40d4cc719b1e3d3.tar.zst glucometerutils-37d3712dc7e1e91c49733a8ad40d4cc719b1e3d3.zip |
-rw-r--r-- | glucometerutils/support/freestyle.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/glucometerutils/support/freestyle.py b/glucometerutils/support/freestyle.py index ea2ac14..c94a92b 100644 --- a/glucometerutils/support/freestyle.py +++ b/glucometerutils/support/freestyle.py @@ -132,6 +132,13 @@ class FreeStyleHidDevice(hiddevice.HidDevice): if message_type == 0x22 and message_length == 1: return self._read_response() + if message_type == 0x30 and message_content == b'\x85': + raise exceptions.CommandError('Invalid command') + + if message_type == 0x33 and message_content == b'\x15': + raise exceptions.CommandError( + 'Device encryption initialization failed.') + # hidapi module returns a list of bytes rather than a bytes object. return (message_type, bytes(message_content)) |