Method

class someipy.Method(id, protocol, method_handler=None)

Class representing a SOME/IP method with a method id and a method handler.

Parameters

idint

Method identifier.

protocolTransportLayerProtocol

Transport protocol for the method.

method_handlerMethodHandler, optional

Optional method which is called on server side when an offered service is invoked. The handler shall return a MethodResult.

__eq__(_Method__value)

Check equality with another Method based on id and protocol.

Parameters

__valueobject

Another Method instance.

Returns

bool

True if ids and protocols match, False otherwise.

Parameters:

_Method__value (object) –

Return type:

bool

__hash__()

Hashes object.

Returns

int

Hash of object

classmethod from_json(json_str)

Create a Method from a JSON string.

Parameters

json_strstr

JSON representation of a Method.

Returns

Method

The constructed Method instance.

Parameters:

json_str (str) –

Return type:

_T

id: int
method_handler: Callable[[bytes, Tuple[str, int]], MethodResult]
protocol: TransportLayerProtocol
to_json()

Serialize this Method to a JSON string.

Returns

str

JSON representation of the method.

Return type:

str

Parameters: