mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-13 07:43:33 +08:00
Service caller: Server Node ID validation before call
This commit is contained in:
@@ -12,6 +12,15 @@ int ServiceClientBase::prepareToCall(INode& node, const char* dtname, NodeID ser
|
||||
{
|
||||
pending_ = true;
|
||||
|
||||
/*
|
||||
* Making sure we're not going to get transport error because of invalid input data
|
||||
*/
|
||||
if (!server_node_id.isUnicast() || (server_node_id == node.getNodeID()))
|
||||
{
|
||||
UAVCAN_TRACE("ServiceClient", "Invalid Server Node ID");
|
||||
return -ErrInvalidParam;
|
||||
}
|
||||
|
||||
/*
|
||||
* Determining the Data Type ID
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user