| 66 | |
| 67 | template <> |
| 68 | bool ChannelObserver<std::vector<uint8_t>>::GetSampleText( |
| 69 | uint64_t sample, std::string &value, uint64_t array_index) const { |
| 70 | const auto array_size = channel_.ArraySize(); |
| 71 | const auto sample_index = static_cast<size_t>( (sample * array_size) + array_index ); |
| 72 | // The value_list consist of byte arrays. Convert o |
| 73 | std::ostringstream s; |
| 74 | if (sample_index < value_list_.size()) { |
| 75 | const auto &list = value_list_[sample_index]; |
| 76 | for (const auto byte : list) { |
| 77 | s << std::setfill('0') << std::setw(2) << std::uppercase << std::hex |
| 78 | << static_cast<uint16_t>(byte); |
| 79 | } |
| 80 | } |
| 81 | value = s.str(); |
| 82 | return sample_index < valid_list_.size() && valid_list_[sample_index]; |
| 83 | } |
| 84 | |
| 85 | template <> |
| 86 | bool ChannelObserver<std::vector<uint8_t>>::GetSampleByteArray( |