eclipse-kuksa / kuksa-databroker

A modern in-vehicle VSS (Vehicle Signal Specification) server written in RUST
https://eclipse-kuksa.github.io/kuksa-website/
Apache License 2.0
16 stars 13 forks source link

Query about StreamUpdate grpc #55

Open Athvaith2828 opened 2 weeks ago

Athvaith2828 commented 2 weeks ago

Is StreamUpadate grpc functionality is available in 0.4.6 (latest) release ? and is python-sdk supports StreamUpdate ?

lukasmittag commented 2 weeks ago

1st part yes. 2nd part not yet but there is a branch for it here https://github.com/boschglobal/kuksa-python-sdk/tree/feature/StreamedSet

Athvaith2828 commented 2 weeks ago

Thank you for the quick response, @lukasmittag . I'm happy to test the Stream Update functionality—just wanted to check if it's ready for testing from a functionality standpoint ?, Additionally, I have one more question: is sdv/databroker/v1 also supported by the Python SDK?

lukasmittag commented 2 weeks ago

no the python sdk only supports the kuksa.val.v1 interface. In past versions it supported sdv.databroker.v1.

Athvaith2828 commented 2 weeks ago

@lukasmittag , I am able to access the client.StreamGenerator() function and I understand that it requires a queue to be passed in. Could you provide a simple example of how to use this function to update Vehicle.Speed? That would be very helpful.

lukasmittag commented 2 weeks ago

I have no example at my hands as of now. But basically you can do the following:

async def __stream_generator() -> AsyncIterator[StreamedUpdateRequest]:
            updates: List[EntryUpdate] = <create an EntryUpdate>
            yield StreamedUpdateRequest(updates=updates)
call = StreamedUpdate(self.__stream_generator())

this will once do update it. If you want to update it more often you need to either do a loop in stream generator or use self.queue and another component that provides speed values to the queue by doing queue.put() and queue.get() for creating an entryUpdate you can have a look at prepare_streamed_set_request() here https://github.com/boschglobal/kuksa-python-sdk/blob/8a0b494b85d01a70f79cb82d77d9c810a0edddf1/kuksa-client/kuksa_client/grpc/__init__.py#L628