void PacketCreator::addError(DEPacket& message, type cmdVal, string text) { message.set_type(DEPacket::P_ACKNOWLEDGE); SingleAcknowledge* ack = message.add_acknowledge(); ack->set_command_id(cmdVal); ack->set_error(true); ack->set_error_message(text); if (!this->_persistent) this->clear(); }
void PacketCreator::addSingleAcknowledge(DEPacket& message, type cmdVal) { message.set_type(DEPacket::P_ACKNOWLEDGE); SingleAcknowledge * ack = message.add_acknowledge(); ack->set_command_id(cmdVal); ack->set_error(false); vector<Param>::iterator it; for (it = this->_params.begin(); it != this->_params.end(); it++) { AnyParameter* param = ack->add_parameter(); this->setAnyParameter(param, *it); } if (!this->_persistent) this->clear(); }