mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 06:33:34 +08:00
Added runtime checks for server and client
This commit is contained in:
@@ -88,13 +88,14 @@ private:
|
||||
handleFatalError("Invalid caller callback");
|
||||
}
|
||||
|
||||
void handleReceivedDataStruct(ReceivedDataStructure<ResponseType>& request)
|
||||
void handleReceivedDataStruct(ReceivedDataStructure<ResponseType>& response)
|
||||
{
|
||||
assert(response.getTransferType() == TransferTypeServiceResponse);
|
||||
const TransferListenerType* const listener = SubscriberType::getTransferListener();
|
||||
if (listener)
|
||||
{
|
||||
const typename TransferListenerType::ExpectedResponseParams erp = listener->getExpectedResponseParams();
|
||||
ServiceCallResultType result(ServiceCallResultType::Success, erp.src_node_id, request);
|
||||
ServiceCallResultType result(ServiceCallResultType::Success, erp.src_node_id, response);
|
||||
cancel();
|
||||
invokeCallback(result);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ private:
|
||||
|
||||
void handleReceivedDataStruct(ReceivedDataStructure<RequestType>& request)
|
||||
{
|
||||
assert(request.getTransferType() == TransferTypeServiceRequest);
|
||||
if (try_implicit_cast<bool>(callback_, true))
|
||||
{
|
||||
response_ = ResponseType(); // The application needs newly initialized structure
|
||||
|
||||
Reference in New Issue
Block a user