Libertas OS API Documentation
    Preparing search index...

    Function Libertas_DeviceCommandReq

    • Send an asynchronize command request to the device.

      Parameters

      Returns number

      The reference number of this request.

      Use Libertas_SetOnDevice to set up the callback function for the response.

      The callback will be triggered asynchronously with an LibertasCommandRsp and the reference number.

      IMPORTANT! If the task sends another command before the previous one is responded to, the previous one may be discarded by Libertas OS. As a general rule, a task shall always wait for the response to the previous interaction before sending another one or only expect the response to the latest request.

      If the task keeps sending commands while a previous command has not received a response, some commands will be automatically dropped because the Libertas engine can tell that only the last command matters.

      The request may never reach the recipient if, for example, there is a network problem. In that case, a LibertasDeviceAction.StatusResponse with a Matter.Status.Timeout will be received from the callback registered with Libertas_SetOnDevice.

      The Thing-App task shall not assume that it is the only process that sends requests. Other agents may also send requests. A task can only receive the LibertasCommandRsp to its command requests.

      To receive all changes to an attribute, use Libertas_AppSubscribeReq.