Current iotivity doesn't support char datatype which makes transmitting binary data difficult.
Will char datatype be support in the future? diff --git a/resource/include/OCRepresentation.h b/resource/include/OCRepresentation.h index ef9d1a9..434286b 100644 --- a/resource/include/OCRepresentation.h +++ b/resource/include/OCRepresentation.h @@ -250,6 +251,7 @@ namespace OC std::is_same<T, int>::value || std::is_same<T, double>::value || std::is_same<T, bool>::value || + std::is_same<T, std::vector<char>>::value || std::is_same<T, std::string>::value || std::is_same<T, OCRepresentation>::value || std::is_same<T, std::vector<int>>::value || diff --git a/resource/include/AttributeValue.h b/resource/include/AttributeValue.h index 327bf13..9f333cd 100644 --- a/resource/include/AttributeValue.h +++ b/resource/include/AttributeValue.h @@ -36,6 +36,7 @@ #include <boost/variant.hpp> #include <iosfwd> #include <OCUtilities.h> + namespace OC { class OCRepresentation; @@ -59,8 +60,11 @@ namespace OC std::vector<int>, std::vector<double>, std::vector<bool>, + std::vector<char>, std::vector<std::string>, std::vector<OC::OCRepresentation>, + std::vector<std::vector<char>>, + std::vector<std::vector<std::vector<char>>>, // Nested sequences: std::vector<std::vector<int>>, @@ -77,6 +81,7 @@ namespace OC std::vector<std::vector<OC::OCRepresentation>>, std::vector<std::vector<std::vector<OC::OCRepresentation>>> + > AttributeValue; enum class AttributeType @@ -118,6 +123,12 @@ namespace OC }; template<> + struct AttributeTypeConvert<char> + { + constexpr static AttributeType type = AttributeType::Boolean; + }; + + template<> struct AttributeTypeConvert<std::string> { constexpr static AttributeType type = AttributeType::String;