#ifndef _SRTM_CAMERA_SERVICE_H_
#define _SRTM_CAMERA_SERVICE_H_
#include "srtm_service.h"
/*******************************************************************************
* Definitions
******************************************************************************/
/* Protocol definition for the custom Camera Service Client */
#define SRTM_CAMERA_CATEGORY (0x7FU)
#define SRTM_CAMERA_VERSION (0x0100U)
/* Command IDs matching the reverse logic architecture */
#define SRTM_CAMERA_CMD_START (0x01U)
#define SRTM_CAMERA_CMD_STOP (0x02U)
/* Execution status flags handled by the remote Linux server */
#define SRTM_CAMERA_RETURN_CODE_SUCCESS (0x0U)
#define SRTM_CAMERA_RETURN_CODE_FAIL (0x1U)
#define SRTM_CAMERA_RETURN_CODE_UNSUPPORTED (0x2U)
/* Payload data mapping structure (packed for strict alignment validation) */
struct _srtm_camera_payload
{
uint8_t cameraID; /* Target hardware interface index parameter */
uint8_t retCode; /* Status byte populated during Linux execution phase */
uint16_t reserved; /* Context tracking block structural alignment padding */
} __attribute__((packed));
/* Callback function structure used within asynchronous processing logic loops */
typedef void (*srtm_camera_cmd_cb_t)(srtm_service_t service,
uint8_t cameraID,
uint8_t cmd,
uint8_t retCode,
void *param);
/*******************************************************************************
* API Definitions
******************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/* Allocates instance memory and registers structural properties */
srtm_service_t SRTM_CameraClient_Create(void);
/* Free operational handle allocations */
void SRTM_CameraClient_Destroy(srtm_service_t service);
/* Resets state machine configurations */
void SRTM_CameraClient_Reset(srtm_service_t service, srtm_peercore_t core);
/* Synchronous blocking invocation method */
srtm_status_t SRTM_CameraClient_SendCommandSync(srtm_service_t service,
uint8_t cameraID,
uint8_t cmd,
uint32_t timeout_ms);
/* Asynchronous callback-driven invocation method */
srtm_status_t SRTM_CameraClient_SendCommandAsync(srtm_service_t service,
uint8_t cameraID,
uint8_t cmd,
srtm_camera_cmd_cb_t callback,
void *param);
#ifdef __cplusplus
}
#endif
#endif /* _SRTM_CAMERA_SERVICE_H_ */