주요 콘텐츠

setTimeout

R2026b

Set microservice timeout value

Since R2026b

    Description

    setTimeout(microservice,timeout) sets the timeout value of the microservice object. The timeout controls how long the microservice waits for a response before retrying an operation.

    example

    Examples

    collapse all

    Create a mavlinkdialect object using the common.xml file.

    dialect = mavlinkdialect("common.xml");

    Create a local MAVLink client by using the mavlinkio object.

    gcs = mavlinkio(dialect);

    Create a mission microservice object.

    mission = mavlinkmicroservice(gcs,"mission");

    Set the timeout value of the mission microservice object to 5 seconds.

    setTimeout(mission,5)

    Set the retry count of the mission microservice object to 7.

    setRetry(mission,7)

    Input Arguments

    collapse all

    Microservice object, specified as one of these microservice objects:

    Timeout value of the microservice object, specified as a positive scalar in seconds. When the microservice sends a message that requires an acknowledgment, it starts a countdown timer. If the expected response arrives before the timer expires, the microservice clears the timer and the operation succeeds. If the timer reaches zero without a response, the microservice assumes the network lost the original request or the response in transit. The microservice then retries the operation. A larger timeout gives the remote client more time to respond.

    Version History

    Introduced in R2026b