From 583b5bb2b962253cb83b9b1bdea7c7c6841a098c Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Thu, 4 Nov 2021 23:01:21 +0100 Subject: [PATCH] Added data_streamer constructor with byte order --- byte_order_stuff.cpp | 2 ++ libscio.hpp | 1 + 2 files changed, 3 insertions(+) diff --git a/byte_order_stuff.cpp b/byte_order_stuff.cpp index 3ee9070..acc13d0 100644 --- a/byte_order_stuff.cpp +++ b/byte_order_stuff.cpp @@ -15,6 +15,8 @@ using namespace sc::io; // data_streamer --------------------------------------------------------------- +data_streamer::data_streamer(byte_order bo) : _target_byte_order(bo) {} + byte_order data_streamer::cur_byte_order() { uint8_t ch[2] = {0x12, 0x34}; uint16_t* p = reinterpret_cast(ch); diff --git a/libscio.hpp b/libscio.hpp index 6b707a2..36f49cd 100644 --- a/libscio.hpp +++ b/libscio.hpp @@ -223,6 +223,7 @@ namespace sc { } data_streamer() = default; + data_streamer(byte_order bo); byte_order target_byte_order() const { return _target_byte_order; } void target_byte_order(byte_order new_byte_order) { _target_byte_order = new_byte_order; }