From 32ba1265af889be591e1e9c67f1de1572b587957 Mon Sep 17 00:00:00 2001 From: Neradoc Date: Sat, 4 Feb 2023 22:06:11 +0100 Subject: [PATCH] Add the RawTextPacket class to the documentation, and mention its use in Packet.from_stream() --- adafruit_bluefruit_connect/packet.py | 5 ++++- docs/api.rst | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/adafruit_bluefruit_connect/packet.py b/adafruit_bluefruit_connect/packet.py index b3b8d3c..3808b34 100644 --- a/adafruit_bluefruit_connect/packet.py +++ b/adafruit_bluefruit_connect/packet.py @@ -81,7 +81,10 @@ def from_stream(cls, stream): set on stream, using its own preset timeout. Return None if there was no input, otherwise return an instance of one of the packet classes registered with ``Packet``. - Raise an Error if the packet was not recognized or was malformed + Raise an Error if the packet was not recognized or was malformed. + + If a packet of type "RT" (like ``RawTextPacket``) is registered, it will be + used to return the raw data line when no packet type was recognized. :param stream stream: an input stream that provides standard stream read operations, such as ``ble.UARTServer`` or ``busio.UART``. diff --git a/docs/api.rst b/docs/api.rst index c32ec68..d1a7bf0 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -30,3 +30,6 @@ .. automodule:: adafruit_bluefruit_connect.quaternion_packet :members: + +.. automodule:: adafruit_bluefruit_connect.raw_text_packet + :members: