/* =========================================================================

DESCRIPTION
   Netease && Xunfei speech processing main program
   Cae voice process

Copyright (c) 2017 by Netease, Co,LTD.  All Rights Reserved.
============================================================================ */

/* =========================================================================

                             REVISION

when                       who why
--------                    ---------
-------------------------------------------
2017/06/28          wangzijiao                                  Created.
============================================================================ */

#ifndef __BASE_H__
#define __BASE_H__

#ifdef __cplusplus
extern "C" {
#endif /* C++ */

#include <stdlib.h>

/* ------------------------------------------------------------------------
** Defines
** ------------------------------------------------------------------------ */

#define BOARD_DMIC
#define ENABLE_YUNXIN

/* ------------------------------------------------------------------------
** Types
** ------------------------------------------------------------------------ */
#define LEN_UUID 50
#define LEN_TOKEN 100
#define LEN_SONGINFO 2048
#define LEN_UNIXMS 30

void BaseInit();

void BaseLock();
void BaseUnlock();

typedef enum {
    VadStatus_NULL = 0,
    VadStatus_Begin = 1,
    VadStatus_Finish = 2
} VadStatus;

typedef enum {
    VoiceSession_Init = 0,
    VoiceSession_Creating = 1,
    VoiceSession_Created = 2
} VoiceSessionStatus;

typedef enum {
    WorkMode_R311_PV1 = 0
} WorkMode;

void setVss(VoiceSessionStatus st);
VoiceSessionStatus getVss();

int getVadStatus();
void setVadStatus(VadStatus status); // 0 null 1 start 2 end

void setUuid(char *uuid, size_t len);
char *getUuid();
char *getChipId();

void setSongInfo(char *songInfo, size_t len);
char *getSongInfo();

void setBindUser(char *user, size_t len);
char *getBindUser();

void setYxToken(char *token, size_t len);
char *getYxToken();

void setAng(int ang);
int getAng();

void setVoiceWakeupword(char *word);
char *getVoiceWakeupword();

void setVoiceMajor(int major);
int getVoiceMajor();

void setVoiceStatus(int status);
int getVoiceStatus();

void setVoiceConfidence(double voiceConfidence);
double getVoiceConfidence();

void resetAdc();
void setWorkMode(WorkMode mode);
WorkMode getWorkMode();

#ifdef __cplusplus
} /* extern "C" */
#endif /* C++ */

#endif /* __BASE_H__ */
