summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Joseph <tomjoseph@in.ibm.com>2017-04-26 10:13:03 +0530
committerTom Joseph <tomjoseph@in.ibm.com>2017-05-08 15:25:15 +0530
commit704f342fed3b1c1c5d5971140ca27d319205bd18 (patch)
tree25fbf7ac0ae68d6985bf6fcb19d1f680a9f5e87f
parent32f07b8e4aa1ac5160f085a96ae13861276b4793 (diff)
downloadphosphor-net-ipmid-704f342fed3b1c1c5d5971140ca27d319205bd18.tar.gz
phosphor-net-ipmid-704f342fed3b1c1c5d5971140ca27d319205bd18.zip
Change accumulateInterval and retryInterval to std::chrono units.
Change-Id: I5e1234ee141323a1feb6460a9424226f96bc7522 Signed-off-by: Tom Joseph <tomjoseph@in.ibm.com>
-rw-r--r--sol/sol_manager.cpp15
-rw-r--r--sol/sol_manager.hpp25
2 files changed, 16 insertions, 24 deletions
diff --git a/sol/sol_manager.cpp b/sol/sol_manager.cpp
index ee3ba0b..90ecffe 100644
--- a/sol/sol_manager.cpp
+++ b/sol/sol_manager.cpp
@@ -102,21 +102,10 @@ void Manager::startPayloadInstance(uint8_t payloadInstance,
auto context = std::make_unique<Context>(
retryCount, sendThreshold, payloadInstance, sessionID);
- /*
- * Start payload event instance
- *
- * Accumulate interval is in 5 ms(milli secs) increments, since
- * sd_event_add_time takes in micro secs, it is converted to micro secs.
- * The Retry interval is in 10 ms (milli secs) increments.
- */
- using namespace std::chrono_literals;
-
- auto accInterval = 5ms * accumulateInterval;
- auto retryInterval = 10ms * retryThreshold;
-
std::get<eventloop::EventLoop&>(singletonPool).startSOLPayloadInstance(
payloadInstance,
- std::chrono::duration_cast<eventloop::IntervalType>(accInterval),
+ std::chrono::duration_cast<eventloop::IntervalType>
+ (accumulateInterval),
std::chrono::duration_cast<eventloop::IntervalType>(retryInterval));
payloadMap.emplace(payloadInstance, std::move(context));
diff --git a/sol/sol_manager.hpp b/sol/sol_manager.hpp
index e756574..e853acf 100644
--- a/sol/sol_manager.hpp
+++ b/sol/sol_manager.hpp
@@ -44,6 +44,7 @@ struct CustomFD
int fd = -1;
};
+using namespace std::chrono_literals;
/** @class Manager
*
@@ -70,18 +71,19 @@ class Manager
/** @brief Host Console Buffer. */
ConsoleData dataBuffer;
-
/** @brief Character Accumulate Interval
*
- * Character Accumulate Interval in 5 ms increments, 1-based. This sets
- * the typical amount of time that the BMC will wait before
+ * This sets the typical amount of time that the BMC will wait before
* transmitting a partial SOL character data packet. (Where a partial
* packet is defined as a packet that has fewer characters to transmit
* than the number of characters specified by the character send
* threshold. This parameter can be modified by the set SOL
- * configuration parameters command.
+ * configuration parameters command. The SOL configuration parameter,
+ * Character Accumulate Interval is 5 ms increments, 1-based value. The
+ * parameter value is accumulateInterval/5. The accumulateInterval
+ * needs to be a multiple of 5.
*/
- uint8_t accumulateInterval = 20;
+ std::chrono::milliseconds accumulateInterval = 100ms;
/** @brief Character Send Threshold
*
@@ -108,13 +110,14 @@ class Manager
/** @brief Retry Interval
*
- * Retry Interval, 1-based. Retry Interval in 10 ms increments. Sets
- * the time that the BMC will wait before the first retry and the time
- * between retries when sending SOL packets to the remote console. 00h
- * indicates retries sent back-to-back. This parameter can be modified
- * by the set SOL configuration parameters command.
+ * Sets the time that the BMC will wait before the first retry and the
+ * time between retries when sending SOL packets to the remote console.
+ * This parameter can be modified by the set SOL configuration
+ * parameters command. The SOL configuration parameter Retry Interval
+ * is 10 ms increments, 1-based value. The parameter value is
+ * retryInterval/10. The retryInterval needs to be a multiple of 10.
*/
- uint8_t retryThreshold = 10;
+ std::chrono::milliseconds retryInterval = 100ms;
/** @brief Start a SOL payload instance.
*
OpenPOWER on IntegriCloud