/*
 * Copyright (c) 2016-2017 Satlab Aps <satlab@satlab.com>
 * All rights reserved. Do not distribute without permission.
 */

#ifndef _SL_SRS3_CLIENT_PROTO_H_
#define _SL_SRS3_CLIENT_PROTO_H_

#include <stdint.h>

/* Default CSP address */
#define SL_SRS3_DEFAULT_ADDRESS		21

/* CSP ports */
#define SL_SRS3_PORT_SHELL		26

/** Error codes */
#define SL_SRS3_ERR_NONE		0
#define SL_SRS3_ERR_INVAL		1
#define SL_SRS3_ERR_IO			2
#define SL_SRS3_ERR_NOMEM		3
#define SL_SRS3_ERR_BUSY		4

/*
 * SL_SRS3_PORT_SHELL
 */

/* Types */
#define SL_SRS3_SHELL_RUN_REQ		1
#define SL_SRS3_SHELL_RUN_REP		2

/* Keys */
#define SL_SRS3_SHELL_RUN_KEY		0x3fb95c30

#define SL_SRS3_SHELL_RUN_MAX		100
typedef struct {
	/** Must be SL_SRS3_SHELL_RUN_REQ */
	uint8_t type;
	/** Flags, currently unused - set to zero */
	uint8_t flags;
	/** Must be SL_SRS3_SHELL_RUN_KEY */
	uint32_t key;
	/** Command to execute */
	uint8_t cmd[SL_SRS3_SHELL_RUN_MAX];
} __attribute__ ((packed)) sl_srs3_shell_run_req_t;

typedef struct {
	/** Must be SL_SRS3_SHELL_RUN_REP */
	uint8_t type;
	/** Error code */
	uint8_t error;
} __attribute__ ((packed)) sl_srs3_shell_run_rep_t;

#endif /* _SL_SRS3_CLIENT_PROTO_H_ */
