Commit d5e1c257 authored by Brendan Long's avatar Brendan Long

Change AllJoynHelper to use a vector<uint8_t> instead of vector<bool> when...

Change AllJoynHelper to use a vector<uint8_t> instead of vector<bool> when setting ajn::MsgArg, since vector<bool> is a specialization that doesn't allow us to access the underlying array.
parent 1ac20987
......@@ -99,7 +99,10 @@ bridge::AllJoynHelper::SetMsgArg(IAdapterValue const& adapterValue, ajn::MsgArg&
break;
case common::Variant::DataType::BooleanArray:
st = SetMsgArg<bool>(m, sig.c_str(), val.ToBooleanArray());
/* Using vector<uint8_t> instead of vector<bool>, since vector<bool> is a
* bitfield and we can't access the underlying array easily.
* http://en.cppreference.com/w/cpp/container/vector_bool */
st = SetMsgArg<uint8_t>(m, sig.c_str(), val.ToUInt8Array());
break;
case common::Variant::DataType::UInt8Array:
......
......@@ -46,9 +46,7 @@ namespace bridge
if (!arr.empty())
{
T const& ref = arr.front();
T const* p = &ref;
st = msg.Set(sig.c_str(), arr.size(), p);
st = msg.Set(sig.c_str(), arr.size(), arr.data());
msg.Stabilize();
}
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment