Add delay between frame send retries
Introduced a delay between retries to allow the bus to stabilize
and ongoing transactions to complete. The delay increases
exponentially, calculated as 30 ms multiplied by 2 raised to the
power of the number of retries.
Change-Id: Ibbfd202118a69c270cbb4f047ef44f15ebf72bd6
Signed-off-by: Cosmo Chou <cosmo.chou@quantatw.com>
diff --git a/ipmbbridged.hpp b/ipmbbridged.hpp
index b8f708a..6805efc 100644
--- a/ipmbbridged.hpp
+++ b/ipmbbridged.hpp
@@ -300,6 +300,7 @@
private:
boost::asio::posix::stream_descriptor i2cTargetDescriptor;
+ boost::asio::steady_timer retryTimer;
int ipmbi2cTargetFd;
@@ -322,6 +323,9 @@
void makeRequestInvalid(IpmbRequest& request);
void makeRequestValid(std::shared_ptr<IpmbRequest> request);
+
+ void scheduleFrameResend(std::shared_ptr<std::vector<uint8_t>> buffer,
+ size_t retryCount);
};
/**