From 620164975a968c4404c96f3e9ed1a7b9a63d6cb6 Mon Sep 17 00:00:00 2001 From: Tobias Jahnke Date: Wed, 23 Aug 2017 10:53:41 +0200 Subject: implements value retransmit and reload on failure --- HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_value.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'HAL-afb/HAL_MOST_UNICENS/ucs2-vol/inc/device_value.h') 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 6311346..bc8f142 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 @@ -73,23 +73,28 @@ public: 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;} + void SetAvailable(bool active){this->_is_available = active; _actual_value = 0x01u;} 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[]); + void HandleI2cResult(uint8_t result); + static void OnI2cResult(uint8_t result, void *obj_ptr); - bool _is_initial; // ensure first update - bool _is_available; // related node is available + bool _is_available; // related node is available + bool _is_busy; // do not update while busy DeviceValueType _type; // determines the remote i2c command uint16_t _key; // lookup key uint16_t _address; // target node/group address uint8_t _target_value; // desired value + uint8_t _transmitted_value;// value pending during transmission uint8_t _actual_value; // value set and confirmed via network uint8_t _tx_payload[20]; uint8_t _tx_payload_sz; + + lib_most_volume_writei2c_result_cb_t _result_fptr; + void *_result_user_ptr; }; #endif /* DEVICEPROPERTY_H */ -- cgit 1.2.3-korg