/** * Send the specified object through the telemetry link. * \param[in] obj Object to send * \param[in] acked Selects if an ack is required * \param[in] allInstances If set true then all instances will be updated * \return Success (true), Failure (false) */ bool UAVTalk::sendObject(UAVObject* obj, bool acked, bool allInstances) { QMutexLocker locker(mutex); if (acked) { return objectTransaction(obj, TYPE_OBJ_ACK, allInstances); } else { return objectTransaction(obj, TYPE_OBJ, allInstances); } }
/** * Send the specified object through the telemetry link with a timestamp. * \param[in] connection UAVTalkConnection to be used * \param[in] obj Object to send * \param[in] instId The instance ID or UAVOBJ_ALL_INSTANCES for all instances. * \param[in] acked Selects if an ack is required (1:ack required, 0: ack not required) * \param[in] timeoutMs Time to wait for the ack, when zero it will return immediately * \return 0 Success * \return -1 Failure */ int32_t UAVTalkSendObjectTimestamped(UAVTalkConnection connectionHandle, UAVObjHandle obj, uint16_t instId, uint8_t acked, int32_t timeoutMs) { UAVTalkConnectionData *connection; CHECKCONHANDLE(connectionHandle, connection, return -1); // Send object if (acked == 1) { return objectTransaction(connection, UAVTALK_TYPE_OBJ_ACK_TS, obj, instId, timeoutMs); } else { return objectTransaction(connection, UAVTALK_TYPE_OBJ_TS, obj, instId, timeoutMs); } }
/** * Send the specified object through the telemetry link. * \param[in] connection UAVLinkConnection to be used * \param[in] obj Object to send * \param[in] instId The instance ID or UAVOBJ_ALL_INSTANCES for all instances. * \param[in] acked Selects if an ack is required (1:ack required, 0: ack not required) * \param[in] timeoutMs Time to wait for the ack, when zero it will return immediately * \return 0 Success * \return -1 Failure */ int32_t UAVLinkSendObject(UAVLinkConnection connectionHandle, UAVObjHandle obj, uint16_t instId, uint8_t acked, int32_t timeoutMs) { UAVLinkConnectionData *connection; CHECKCONHANDLE(connectionHandle,connection,return -1); // Send object if (acked == 1) { return objectTransaction(connection, obj, instId, UAVLINK_TYPE_OBJ_ACK, timeoutMs); } else { return objectTransaction(connection, obj, instId, UAVLINK_TYPE_OBJ, timeoutMs); } }
/** * Request an update for the specified object, on success the object data would have been * updated by the GCS. * \param[in] connection UAVTalkConnection to be used * \param[in] obj Object to update * \param[in] instId The instance ID or UAVOBJ_ALL_INSTANCES for all instances. * \param[in] timeout Time to wait for the response, when zero it will return immediately * \return 0 Success * \return -1 Failure */ int32_t UAVTalkSendObjectRequest(UAVTalkConnection connectionHandle, UAVObjHandle obj, uint16_t instId, int32_t timeout) { UAVTalkConnectionData *connection; CHECKCONHANDLE(connectionHandle, connection, return -1); return objectTransaction(connection, UAVTALK_TYPE_OBJ_REQ, obj, instId, timeout); }
/** * Request an update for the specified object, on success the object data would have been * updated by the GCS. * \param[in] obj Object to update * \param[in] allInstances If set true then all instances will be updated * \return Success (true), Failure (false) */ bool UAVTalk::sendObjectRequest(UAVObject* obj, bool allInstances) { QMutexLocker locker(mutex); return objectTransaction(obj, TYPE_OBJ_REQ, allInstances); }