#ifndef _IKONKE_OPT_TUNNEL_H_
#define _IKONKE_OPT_TUNNEL_H_


#include "tl_common.h"
#include "ikk-module-def.h"

#define ZCL_FCC0_MAX_LENGTH								128


#define PRIV_CLUSTER_FCC0				0XFCC0

#define OPTTUNNEL_OPTDATA_ID			0x0000	// FCC0 Cluster Attribute 0x0000
#define OPTTUNNEL_OPTDATA_MAXLEN		128

#define OPTTUNNEL_CHUNK_MAXLEN			32


#define OPTTUNNEL_UNKNOW				0xFFFF

enum {
	ECA_OPTDATA  			= 0X0000,
	ECA_TTS		 			= 0X0001,
	ECA_MTORR_RR 			= 0X0002,
	ECA_ASSOCIATED_AOUNCE	= 0X0003,
	ECA_CMEI	 			= 0X0010,
	ECA_ISN		 			= 0X0011,
	ECA_INSTALL_CODE 		= 0X0012,
	ECA_CHUNK_N1 			= 0X0013,
	ECA_UNKNOW	 			= 0XFFFF,
};

enum OOD_GLOBAL_ERRNO {
	ERR_NO_NONE				= 0X00,
	ERR_NO_COMMAND_FORMAT 	= 0X80,
	ERR_NO_ENDPOINT 		= 0X81,
	ERR_NO_OPCODE 			= 0X82,
	ERR_NO_UNKNOW 			= 0XFF,
};
typedef struct
{              		 //!< number of attribute status in the list
	uint8_t  status;                //!< should be ZCL_STATUS_SUCCESS or error
	uint16_t attrID;                //!< attribute ID
	uint8_t  *data;
} zclOptWriteRspCmd_t;

typedef enum { EOM_READ = 0, EOM_WRITE }OptMethodEm;
/** @} end of group zcl_onoff_attrId */

typedef kk_err_t (*pFUNC_OPTDATA_MESSAGE_CALLBACK)(uint8_t channel, uint8_t opcode, uint8_t args_in_out[], uint8_t *length_in_out );


void Set2NwkJoiningCountdownCounter(u32 time_ms);
/*	DESP: Private protocol common report interface.
 * 	Auth: mengmengli_frc.20210527.
 * */
kk_err_t kOptTunnelCommonReport(uint16_t attribute_id );


/*	DESP: private clsuter protocol module init interface.
 * 	PARAM[pOptdataIncomingCallback]: private protocol optdata message incoming process callback.
 * 	Auth: mengmengli_frc.20210527.
 * */
kk_err_t kOptTunnelModuleInit(pFUNC_OPTDATA_MESSAGE_CALLBACK pOptdataIncomingCallback );
















#endif /* _SAMPLE_LIGHT_H_ */
