aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/utils/eeprom_utils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'host/lib/utils/eeprom_utils.cpp')
-rw-r--r--host/lib/utils/eeprom_utils.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/host/lib/utils/eeprom_utils.cpp b/host/lib/utils/eeprom_utils.cpp
index 6999827c0..2cb1c7571 100644
--- a/host/lib/utils/eeprom_utils.cpp
+++ b/host/lib/utils/eeprom_utils.cpp
@@ -7,16 +7,15 @@
#include <uhdlib/utils/eeprom_utils.hpp>
#include <boost/lexical_cast.hpp>
-uhd::byte_vector_t string_to_uint16_bytes(const std::string &num_str){
- const uint16_t num = boost::lexical_cast<uint16_t>(num_str);
- const std::vector<uint8_t> lsb_msb = {
- uint8_t(num >> 0),
- uint8_t(num >> 8)
- };
+uhd::byte_vector_t string_to_uint16_bytes(const std::string& num_str)
+{
+ const uint16_t num = boost::lexical_cast<uint16_t>(num_str);
+ const std::vector<uint8_t> lsb_msb = {uint8_t(num >> 0), uint8_t(num >> 8)};
return lsb_msb;
}
-std::string uint16_bytes_to_string(const uhd::byte_vector_t &bytes){
+std::string uint16_bytes_to_string(const uhd::byte_vector_t& bytes)
+{
const uint16_t num = (uint16_t(bytes.at(0)) << 0) | (uint16_t(bytes.at(1)) << 8);
- return (num == 0 or num == 0xffff)? "" : std::to_string(num);
+ return (num == 0 or num == 0xffff) ? "" : std::to_string(num);
}