/**
 * \file communication.h
**/
#ifndef COMMUNICATION_H_
#define COMMUNICATION_H_

#include "pw_handle.h"
#include <stdint.h>

#define HANDLE_MAX_LEN 1024

typedef enum {
    ERR_NONE = 0,
    ERR_INVALID = 1,
    ERR_RETRY = 2,
    ERR_UNKNOWN = 3
} gk_err_t;

typedef  struct __attribute__ ((__packed__)) {
    uint32_t uid;
    int32_t result;
    uint32_t len;
    uint32_t retry_timeout;
    uint8_t buff[HANDLE_MAX_LEN];
} cmd_enroll_t;

typedef struct __attribute__ ((__packed__)) {
    uint64_t challenge;
    uint32_t uid;
    int32_t result;
    uint32_t retry_timeout;
    bool request_reenroll;
    uint32_t len;
    uint8_t buff[HANDLE_MAX_LEN];
} cmd_verify_t;

typedef enum {
   CMD_ENROLL,
   CMD_VERIFY
} gk_cmd_t;

#endif /* COMMUNICATION_H_ */
