bobjacobsen / python-openlcb

MIT License
2 stars 1 forks source link

receiveListener doesn't have a handler for a bad value #22

Closed Poikilos closed 7 months ago

Poikilos commented 7 months ago

Add else (formerly would have been case _) and determine some other course of action, maybe:

+        else:
+            logging.warning("Invalid control frame format 0x{:08X}"
+                            "".format(self.decodeControlFrameFormat(frame)))

@bobjacobsen I can fix this in my python-3.8-backport branch and upcoming pull request. Can you advise as to whether this code above is a good course of action? I'm not sure if the formatting used above is ok.

bobjacobsen commented 7 months ago

Thanks!

I read the Standard as saying that "All others" are "... shall be ignored upon receipt". So logging and ignoring sounds like the right approach. Thanks for fixing this.