Skip to content
This repository was archived by the owner on Dec 18, 2024. It is now read-only.

Get/Set Attribute #274

Conversation

nayakned
Copy link
Contributor

  • Implemented generic handling to get/set attributes
  • Currently limited to "targetValue" in the JSON Schema
  • Adapted the Python Kuksa VISS Client to use the same.

Signed-off-by: nayakned naresh.nayak@de.bosch.com

… to targetValue. Also adapted the kuksa_viss_client to use the same.

Signed-off-by: nayakned <naresh.nayak@de.bosch.com>
@SebastianSchildt
Copy link
Contributor

Some tests

  • PR server, master client: Works
  • PR server, PR client: Works
  • Master server, PR client
    • works, of course setTargetValue errors out (as expected), unfortunately getTaregtValue works, but just gives the value (becuase the old JSON schema just ignores the extra field I guess). I think we can live with that.

Observation: When setting targetValue on something not an actor, the error message is misleading:

Test Client> setTargetValue Vehicle/Speed 200
{
    "action": "set", 
    "error": {
        "message": "Can not set path:Vehicle/Speed with attribute:targetValue.", 
        "number": "403", 
        "reason": "Forbidden"
    }, 
    "requestId": "175fb023-d429-40db-9bbe-a406f80bebdd", 
    "ts": "2022-05-18T11:58:14.1652875094Z"
}

It hsould either say that it is only allowed for actuators, OR it should set it anyway (considering later we may have arbitrary attributes, some of them might apply to sensors as well). For now maybe the first option is better?

nayakned added 4 commits May 19, 2022 15:37
- Modified the hashing function for the subscription_key_t.
- Allow IsPathAttributable() to return true when multiple values are requested for get.

Signed-off-by: nayakned <naresh.nayak@de.bosch.com>
Signed-off-by: nayakned <naresh.nayak@de.bosch.com>
Signed-off-by: nayakned <naresh.nayak@de.bosch.com>
Signed-off-by: nayakned <naresh.nayak@de.bosch.com>
Copy link
Contributor

@SebastianSchildt SebastianSchildt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging this as basis for the GRPC refactoring.

We will still need some Readmes/exmaples once that is done

@SebastianSchildt SebastianSchildt merged commit 9c41bb3 into eclipse-archived:master May 23, 2022
@SebastianSchildt SebastianSchildt deleted the feature/set_get_attributes branch May 27, 2022 19:55
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants