Загрузка данных


#ifndef _SRTM_CAMERA_CLIENT_H_
#define _SRTM_CAMERA_CLIENT_H_

#include "srtm_service.h"

/* Custom category ID for Camera Service (Must match Linux side) */
#define SRTM_CAMERA_CATEGORY (0x7FU)
#define SRTM_CAMERA_VERSION  (0x0100U)

/* Command IDs sent from M7 to A55 */
#define SRTM_CAMERA_CMD_START (0x01U)
#define SRTM_CAMERA_CMD_STOP  (0x02U)

/* Return codes received from Linux in the response payload */
#define SRTM_CAMERA_RETURN_CODE_SUCCESS     (0x0U)
#define SRTM_CAMERA_RETURN_CODE_FAIL        (0x1U)
#define SRTM_CAMERA_RETURN_CODE_UNSUPPORTED (0x2U)

/* Message payload structure for data exchange (packed for 32/64-bit compatibility) */
struct _srtm_camera_payload
{
    uint8_t cameraID;  /* ID of the target camera (e.g., 0 for front, 1 for rear) */
    uint8_t retCode;   /* Status code filled by Linux and read by M7 */
    uint16_t reserved; /* Alignment padding */
} __attribute__((packed));

/* Exported API Functions */
srtm_service_t SRTM_CameraClient_Create(void);
srtm_status_t SRTM_CameraClient_SendStart(srtm_service_t service, srtm_peercore_t core, uint8_t cameraID);
srtm_status_t SRTM_CameraClient_SendStop(srtm_service_t service, srtm_peercore_t core, uint8_t cameraID);

#endif /* _SRTM_CAMERA_CLIENT_H_ */