Contenu principal

setRetry

R2026b

Set microservice retry count

Since R2026b

    Description

    setRetry(microservice,retryCount) sets the retry count of the microservice object. The retry count controls how many times the microservice resends a message after a timeout before declaring the operation failed.

    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:

    Retry count of the microservice object, specified as a nonnegative integer. When the microservice sends a message that requires an acknowledgment, the microservice starts a countdown timer. If the expected response does not arrive before the timer expires, the microservice assumes the network lost the original request or the response in transit, and resends the message. This resend cycle repeats up to retryCount times. If the microservice exhausts all retries without receiving a response, the operation fails. A higher retry count increases robustness on unreliable connections.

    Version History

    Introduced in R2026b