Types¶
Description¶
Module: geocompy.gsi.gsitypes
The GSI Online types module provides type definitions and general constants, that are relevant to the GSI Online protocol.
Types¶
GsiOnlineResponseGsiOnlineTypeGsiOnlineSubsystem
Definitions¶
-
class GsiOnlineResponse(desc: str, cmd: str, response: str, value: _T | None, comment: str =
'')[source]¶ Container class for parsed GSI Online responses.
- Parameters:
- desc: str¶
Description of the GSI Online command, that invoked this response.
- cmd: str¶
Full, serialized command, that invoked this response.
- response: str¶
Full, received response.
- value: _T | None¶
Parsed response value. The content is dependent on the executed command.
- comment: str =
''¶ Additional comment (e.g. explanation of an error).
- map_value(transformer: collections.abc.Callable[[_T | None], _P | None]) GsiOnlineResponse[_P][source]¶
Returns a new response object with the metadata maintained, but the value transformed with the supplied function.
- Parameters:
- transformer: collections.abc.Callable[[_T | None], _P | None]¶
Function to transform the value to a new value.
- Returns:
Response with transformed value.
- Return type:
- class GsiOnlineSubsystem(parent: GsiOnlineType)[source]¶
Base class for GSI Online subsystems.
- Parameters:
- parent: GsiOnlineType¶
The parent protocol instance of this subsystem.
- class GsiOnlineType[source]¶
Interface definition for the GSI Online protocol handler type.
- abstractmethod confrequest(param: int, parser: collections.abc.Callable[[str], _T]) GsiOnlineResponse[_T][source]¶
- abstractmethod putrequest(word: _G) GsiOnlineResponse[bool][source]¶