#ifndef __XYSDK_PLATFORM_H__
#define __XYSDK_PLATFORM_H__


// #define XY_CLOUD_KEY "a7f3bfd09da54b028af45ee1f914e727"
// #define XY_CLOUD_SECRET "8CBDF0FA73B4F8F83CD8163C7940AB5B"
// #define XY_SN  "111075_00_1001075"


#define XY_CLOUD_KEY "405ff10b3e50472fa1600adbc7a6ee1f"
#define XY_CLOUD_SECRET "7AF50EE4B3837679E03EE7BA509C08D0"
#define XY_SN  "111096_00_1001096"

#define XY_DESKTOP_DEBUG



#ifdef XY_DESKTOP_DEBUG
// #include<pthread.h>
// #include<unistd.h>
// #include<stdint.h>

#define XYTaskRef           (pthread_t) 
#define XYTaskHandle        (pthread_t) 
#define XYMutexRef          (pthread_mutex_t)
#define XYTaskSleep(a)      sleep(a)
#define XY_SUSPEND          
#define XY_FIFO             
#define XYMutexCreate(a,b)	pthread_mutex_init(a,b)
#define XYMutexLock(a,b)	pthread_mutex_lock(a)
#define XYMutexUnlock(a)	pthread_mutex_unlock(a)
#define XYMutexDelete(a)	pthread_mutex_destory(a)
#define XYTaskDelete(a)		pthread_exit(a)

#else

#define XYTaskRef           
#define XYTaskHandle        
#define XYMutexRef          
#define XYTaskSleep(a)      
#define XY_SUSPEND          
#define XY_FIFO             
#define XYMutexCreate(a,b)	
#define XYMutexLock(a,b)	
#define XYMutexUnlock(a)	
#define XYMutexDelete(a)	
#define XYTaskDelete(a)		

#endif

#undef bool
typedef unsigned char   		u8, bool, BOOL;

enum
{
	OS_STATUS_FAIL = -1,
    OS_STATUS_SUCCESS = 0,
    OS_STATUS_MAX,
};

char *xy_api_get_appkey(void);
char *xy_api_get_appsecret(void);
char *xy_api_get_app_sn(void);


//获取系统时间,单位s
uint32_t xy_api_get_sys_time(void);

//通过时间戳转换为日期
void xy_api_timestamp_to_date(char *date_str, uint32_t timestamp);

//获取设备唯一标识码
char *xy_api_get_device_id(void);

//保存用户信息到文件（数据库）
int xy_api_write_user_data(char *user_info, uint32_t len);

//清除用户信息文件（数据库）
int xy_api_clear_user_data(void);

//读取用户信息
int xy_api_read_user_data(char *read_buf, uint16_t read_len);

//打印长数据
void xy_print_long_data(uint8_t *data, uint16_t len);

//用于大内存申请
void *xy_common_big_mem_malloc(uint32_t size);

//用于大内存释放
void xy_common_big_mem_free(void **src);

#endif // __XYSDK_PLATFORM_H__