device-automation-bus / dab-adapter-rs

Apache License 2.0
2 stars 8 forks source link

Align to DAB-2.0 specifications #40

Closed arun-madhavan-013 closed 10 months ago

arun-madhavan-013 commented 10 months ago

This change includes the following:

  1. Added poll for app state before sending response to the launch requests which is the requirement of DAB-2.0 spec. It will wait for 5 seconds to get the app state; else will return error.
  2. As per DAB-2.0 https://github.com/device-automation-bus/dab-specification-2.0/blob/main/DAB.md#request-parameters-9, voiceSystem must be enabled which is odd. If the system is already enabled; then there is no need to enable again unless the requested voiceSystem is not the enabled one. Added a check to get enabled status before calling enable function. (Enabling a voice system may require time to reconfigure or switch the voice system endpoint which would take setup time.)
  3. As per DAB-2.0 https://github.com/device-automation-bus/dab-specification-2.0/blob/main/DAB.md#request-parameters-10 the 'voiceSystem' is not an optional parameter; added check to return error if payload does not contain the same.