diff options
author | Tobias Jahnke <tjahnk@users.noreply.github.com> | 2017-08-21 17:01:54 +0200 |
---|---|---|
committer | Tobias Jahnke <tjahnk@users.noreply.github.com> | 2017-08-23 13:12:01 +0200 |
commit | c3d250fbc63c05d7f0ad5c4d95d725a16f3cece4 (patch) | |
tree | c900da6adf7299870ae67c1406d60eb7482cb653 /HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc | |
parent | d0dae04c2ae6e4219e0ebac205dd05fa7e9427cf (diff) |
forwarding node availability to volume lib
Diffstat (limited to 'HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc')
4 files changed, 14 insertions, 0 deletions
diff --git a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_container.h b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_container.h index 5e3b753..b7f373c 100644 --- a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_container.h +++ b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_container.h @@ -39,6 +39,7 @@ public: void SetValue(uint16_t key, uint8_t value); void ClearValues(); void Update(); + void ChangeNodeAvailable(uint16_t address, bool available); private: void RequestService(uint16_t timeout); diff --git a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_value.h b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_value.h index 5364662..6311346 100644 --- a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_value.h +++ b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_value.h @@ -72,12 +72,17 @@ public: bool FireUpdateMessage(lib_most_volume_writei2c_cb_t writei2c_fptr, lib_most_volume_writei2c_result_cb_t result_fptr, void *result_user_ptr);// fires message & updates actual value + + void SetAvailable(bool active){this->_is_available = active;} + bool IsAvailable() {return this->_is_available;} + uint16_t GetAddress() {return this->_address;} private: void HandleI2cResult(uint8_t result); void ApplyMostValue(uint8_t value, DeviceValueType type, uint8_t tx_payload[]); bool _is_initial; // ensure first update + bool _is_available; // related node is available DeviceValueType _type; // determines the remote i2c command uint16_t _key; // lookup key uint16_t _address; // target node/group address diff --git a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/libmostvolume.h b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/libmostvolume.h index 94d5a1c..1147993 100644 --- a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/libmostvolume.h +++ b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/libmostvolume.h @@ -90,6 +90,13 @@ extern uint8_t lib_most_volume_exit(void); */ extern uint8_t lib_most_volume_set(enum lib_most_volume_channel_t channel, uint8_t volume); +/** Must be called when the availability of a node has changed + * \param address The node address + * \param available Availability: 0 - not available, 1 - available + * \return '0' on success, otherwise value >'0'. + */ +extern uint8_t lib_most_volume_node_available(uint16_t address, uint8_t available); + /** Shall be called either cyclically (e.g. 50ms -> polling) or after "timeout" * when "service_fptr" is fired (-> event triggered). * \return '0' on success, otherwise value >'0'. diff --git a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/setup.h b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/setup.h index 63bc0e2..e7cda01 100644 --- a/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/setup.h +++ b/HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/setup.h @@ -37,6 +37,7 @@ public: void Configure(lib_most_volume_init_t *init_ptr); void SetVolume(enum lib_most_volume_channel_t channel, uint8_t volume); void Update(); + void SetNodeAvailable(uint16_t address, bool available); private: CDeviceValue _volume_amp_270_m; |