__all__ = (
"Stream",
"class_by_prefix",
+ "enframe",
+ "exposed_protos",
"inline_response",
"proto_handled",
"parse_message",
def class_by_prefix(
prefix: str,
-) -> Union[Type[GPS303Pkt], List[Tuple[str, int]]]:
+) -> Union[Type[GPS303Pkt], List[str]]:
if prefix.startswith(PROTO_PREFIX):
pname = prefix[len(PROTO_PREFIX) :]
else:
if name.upper().startswith(prefix.upper())
]
if len(lst) != 1:
- return lst
+ return [name for name, _ in lst]
_, proto = lst[0]
return CLASSES[proto]
retobj.PROTO = proto # Override class attr with object attr
retobj.cause = cause
return retobj
+
+
+def exposed_protos() -> List[Tuple[str, bool]]:
+ return [
+ (proto_name(GPS_POSITIONING), True),
+ (proto_name(WIFI_POSITIONING), False),
+ (proto_name(STATUS), True),
+ ]