* GEN3: Invalid Contact Info Msg Fixes #191 * introduce ifc with FIFOs * add object factory * use AsyncIfc class with FIFO * declare more methods as classmethods * - refactoring - remove _forward_buffer - make async_write private * remove _forward_buffer * refactoring * avoid mqtt handling for invalid serial numbers * add two more callbacks * FIX update_header_cb handling * split AsyncStream in two classes * split ConnectionG3(P) in server and client class * update class diagramm * refactor server creation * remove duplicated imports * reduce code duplication * move StremPtr instances into Inverter class * resolution of connection classes - remove ConnectionG3Client - remove ConnectionG3Server - remove ConnectionG3PClient - remove ConnectionG3PServer * fix server connections * fix client loop closing * don't overwrite self.remote in constructor * update class diagramm * fixes - fixes null pointer accesses - initalize AsyncStreamClient with proper StreamPtr instance * add close callback * refactor close handling * remove connection classes * move more code into InverterBase class * remove test_inverter_base.py * add abstract inverter interface class * initial commit * fix sonar qube warnings * rename class Inverter into Proxy * fix typo * move class InverterIfc into a separate file * add more testcases * use ProtocolIfc class * add unit tests for AsyncStream class * icrease test coverage * reduce cognitive complexity * increase test coverage * increase tes coverage * simplify heartbeat handler * remove obsolete tx_get method * add more unittests * update changelog * remove __del__ method for proper gc runs * check releasing of ModbusConn instances * call garbage collector to release unreachable objs * decrease ref counter after the with block
22 lines
596 B
Python
22 lines
596 B
Python
from abc import abstractmethod
|
|
|
|
if __name__ == "app.src.protocol_ifc":
|
|
from app.src.iter_registry import AbstractIterMeta
|
|
from app.src.async_ifc import AsyncIfc
|
|
else: # pragma: no cover
|
|
from iter_registry import AbstractIterMeta
|
|
from async_ifc import AsyncIfc
|
|
|
|
|
|
class ProtocolIfc(metaclass=AbstractIterMeta):
|
|
_registry = []
|
|
|
|
@abstractmethod
|
|
def __init__(self, addr, ifc: "AsyncIfc", server_side: bool,
|
|
client_mode: bool = False, id_str=b''):
|
|
pass # pragma: no cover
|
|
|
|
@abstractmethod
|
|
def close(self):
|
|
pass # pragma: no cover
|