Exemplo n.º 1
0
bool IMasterTask::ValidateNoObjects(const openpal::RSlice& objects)
{
	if (objects.IsEmpty())
	{
		return true;
	}
	else
	{
		FORMAT_LOG_BLOCK(logger, flags::WARN, "Received unexpected response object headers for task: %s", this->Name());
		return false;
	}
}
Exemplo n.º 2
0
IMasterTask::ResponseResult RestartOperationTask::ProcessResponse(const opendnp3::APDUResponseHeader& header, const openpal::RSlice& objects)
{
	if (!(ValidateSingleResponse(header) && ValidateInternalIndications(header)))
	{
		return ResponseResult::ERROR_BAD_RESPONSE;
	}

	if (objects.IsEmpty())
	{
		return ResponseResult::ERROR_BAD_RESPONSE;
	}

	auto result = APDUParser::Parse(objects, *this, &logger);

	return (result == ParseResult::OK) ? ResponseResult::OK_FINAL : ResponseResult::ERROR_BAD_RESPONSE;
}