You are correct. The BULKIO data port for char takes a vector of chars. Below you'll find a code snippet that uses a bulkio char output port to send a string and a bulkio char input port to receive the data.
From a pushString component's service function:
std::string str = "hello_world";
data = std::vector<char>(str.begin(), str.end());
stringOut->pushPacket(this->data, tstamp, false, this->stream_id);
From a receiveString component's service function:
bulkio::InCharPort::dataTransfer *tmp = stringIn->getPacket(-1);
if (not tmp) { // No data is available
return NOOP;
}
std::string outputString(tmp->dataBuffer.begin(), tmp->dataBuffer.end());
std::cout << outputString << std::endl;
fflush(stdout);
However, the bulkio port types are generally used for streaming data transfer. If you intend to use the string as a means of command and control, you may want to reconsider your choice of the bulkio char port in favor of the messaging API (http://redhawksdr.github.io/Documentation/mainch17.html).
Using the messaging API also allows you to take advantage of the IDE's Event Viewer: http://redhawksdr.github.io/Documentation/mainch19.html#x21-32900019.4.7