ClientServiceInstance

class someipy.ClientServiceInstance(daemon, service, instance_id, endpoint_ip, endpoint_port, client_id=0)

Client-side representation of a SOME/IP service instance.

This class provides methods to call SOME/IP methods and to subscribe to SOME/IP events.

Parameters:
  • daemon (SomeIpDaemonClient) –

  • service (Service) –

  • instance_id (int) –

  • endpoint_ip (str) –

  • endpoint_port (int) –

  • client_id (int) –

async call_method(method_id, payload)
Parameters:
  • method_id (int) –

  • payload (bytes) –

Return type:

MethodResult

property endpoint: Tuple[str, int]

Return the (IP, port) endpoint for this client instance.

property instance_id: int

Return the instance ID for this client service instance.

async is_available()
Return type:

bool

register_callback(callback)

Register a callback for received SOME/IP events.

The registered callback will be invoked with (event_id, payload) when an event is received.

Parameters

callbackCallable[[int, bytes], None]

Callback function invoked when an event is received.

Parameters:

callback (Callable[[int, bytes], None]) –

Return type:

None

property service: Service

Return the associated Service object for this client instance.

someip_message_received(someip_message, addr)
Parameters:
  • someip_message (SomeIpMessage) –

  • addr (Tuple[str, int]) –

Return type:

None

subscribe_eventgroup(eventgroup, ttl_subscription_seconds)
Parameters:
  • eventgroup (EventGroup) –

  • ttl_subscription_seconds (int) –

unsubscribe_eventgroup(eventgroup)
Parameters:

eventgroup (EventGroup) –