Data layer read and println

Hello,

I am trying to read values from the data layer and print them.

The println function defined in datalayerclient.cpp has a commented line, which would print the actual value in the node.

 

void DataLayerClient::println(std::string text, comm::datalayer::DlResult result, comm::datalayer::Variant *data)
{
std::cout << text << " " << result.toString();
// std::cout << (std::string)*data.getData();
std::cout << " " << std::endl;
}

 

But if i uncommment the line, i have a class type error:

"message": "expression must have class type but it has type \"comm::datalayer::Variant *\""

 

Please let me know how to solve this issue.

Adam

Best reply by saa1box

Fixed it by using,

std::cout << (std::double)*data.getData();

instead of string.

View original
1 reply