#ifndef __AL_BLUETOOTH_CTRL_H__
#define __AL_BLUETOOTH_CTRL_H__

#include "al_basictypes.h"

//**********************************************************************
//module
//**********************************************************************
/**
UART_CMD_Definition
Head | Len | CMD | DATA0 | DATA1 | ... | CheckSum
Head:0x18
Len:sizeof(Head+Len+CMD+DATA0+....CheckSum)
CheckSum = (Len+CMD+Data0+Data1+...)&0xFF
**/

#define CMD_STB_HEADER		0x18

#define BT_NAME_LEN_MAX 40

typedef enum {
    STB_CMD_SET_LANGUAGE 	= 0x1,
	STB_CMD_STB,
	STB_CMD_TV,
	STB_CMD_ACK,
	STB_CMD_REQ,
	
	STB_CMD_EVENT_END,	
    STB_CMD_MAX,    
} AL_Enum_STB_Cmd;

typedef enum {
	STB_CMD_KEY_1 		= 0x1,
	STB_CMD_KEY_2 		= 0x2,
	STB_CMD_KEY_3 		= 0x3,
	STB_CMD_KEY_4 		= 0x4,
	STB_CMD_KEY_5 		= 0x5,
	STB_CMD_KEY_6 		= 0x6,
	STB_CMD_KEY_7 		= 0x7,
	STB_CMD_KEY_8 		= 0x8,
	STB_CMD_KEY_9 		= 0x9,
	STB_CMD_KEY_UP 		= 0xA,
	STB_CMD_KEY_DOWN		= 0xB,
	STB_CMD_KEY_LEFT		= 0xC,
	STB_CMD_KEY_RIGHT		= 0xD,
	STB_CMD_KEY_ENTER		= 0xE,
	STB_CMD_KEY_MUTE		= 0xF,
	STB_CMD_KEY_VOL_UP	= 0x10,
	STB_CMD_KEY_VOL_DOWN	= 0x11,
	STB_CMD_KEY_EXIT		= 0x12,
	STB_CMD_KEY_GOTO		= 0x13,
	STB_CMD_KEY_AB		= 0x14,
	STB_CMD_KEY_STOP		= 0x15,
	STB_CMD_KEY_PLAY		= 0x16,
	STB_CMD_KEY_PAUSE		= 0x17,
	STB_CMD_KEY_SLOW		= 0x18,
	STB_CMD_KEY_FF		= 0x19,
	STB_CMD_KEY_FR		= 0x1A,
	STB_CMD_KEY_NEXT		= 0x1B,
	STB_CMD_KEY_PREV		= 0x1C,
	STB_CMD_KEY_PLAY_PAUSE= 0x1D,
	STB_CMD_KEY_INFO		= 0x1E,
	STB_CMD_KEY_SETUP		= 0x1F,
	STB_CMD_KEY_HOME		= 0x20,
	STB_CMD_KEY_RED		= 0x21,
	STB_CMD_KEY_BLUE		= 0x22,
	STB_CMD_KEY_GREEN		= 0x23,
	STB_CMD_KEY_YELLOW	= 0x24,
	STB_CMD_KEY_MOVIE		= 0x25,
	STB_CMD_KEY_FAVOURITE	= 0x26,
	STB_CMD_KEY_SUBTITLE	= 0x27,
	STB_CMD_KEY_NETFLIX	= 0x28,
	STB_CMD_KEY_YOUTUBE   = 0x29,
	STB_CMD_KEY_0		= 0x30,

    STB_CMD_KEY_MAX,    
}AL_Enum_STB_Key_Cmd;


typedef struct STB_MessageBody_t_ {
    al_uint8 dMessageCmd;
    al_uint8 dCmdSize;
    al_uint8 *pdata;
} STB_MessageBody_t;

typedef int (*STB_ModCbk_pf) (STB_MessageBody_t stEvt);

typedef struct STB_ModualCfg_t_ {
    STB_ModCbk_pf pfCallBack;
} STB_ModualCfg_t;

al_int Al_STB_Listener(void *argv);
al_int32 Al_STB_Set_Action(al_uint8 inCmd, al_uint8 * data, al_uint8 size);
al_int32 Al_STB_Get_Action(al_uint8 inCmd, void * data);

#endif
