--- /dev/null
+/* Copyright [the year of release] VE Starburst. All rights reserved.\r
+ *\r
+ * NOTICE:All information contained herein is, and remains the property of VE\r
+ * Starburst. The intellectual and technical concepts contained herein are\r
+ * proprietary to VE Starburst. and may be covered by patents, patents in process,\r
+ * and are protected by trade secret or copyright law. Dissemination of this\r
+ * information or reproduction of this material is strictly forbidden unless prior\r
+ * written permission is obtained from VE Starburst.\r
+ */\r
+\r
+#ifndef _STB_APP_H_\r
+#define _STB_APP_H_\r
+\r
+\r
+\r
+/*\r
+stb_app_init\r
+功能描述:初始化应用的底层 SDK,执行必要的初始化操作,如分配资源、设置初始状态等。\r
+返回值:0 表示成功,其他值表示失败。\r
+*/\r
+int stb_app_init(void);\r
+/*\r
+函数名:stb_app_deinit\r
+功能描述:初始化应用的底层 SDK,执行必要的初始化操作,如分配资源、设置初始状态等。\r
+返回值:0 表示成功,其他值表示失败。\r
+*/\r
+\r
+int stb_app_deinit(void);\r
+\r
+/*\r
+函数名:stb_app_device_init\r
+功能描述:初始化应用的底层 SDK,执行必要的初始化操作,如分配资源、设置初始状态等。\r
+参数: uint8_t *pk_str - 指向PK字符串,从火山团队获取\r
+ uint8_t *ps_str - 指向PS字符串,从火山团队获取\r
+ uint8_t *mac_str - 指向设备蓝牙MAC字符串\r
+返回值:0 表示成功,其他值表示失败。\r
+*/\r
+int stb_app_device_init(unsigned char *pk_str, unsigned char *ps_str, unsigned char *mac_str);\r
+\r
+\r
+/*\r
+函数名:stb_app_get_version\r
+功能描述:获取应用的版本信息。\r
+返回值:应用的版本信息字符串。\r
+*/\r
+char* stb_app_get_version(void);\r
+\r
+#endif
\ No newline at end of file
--- /dev/null
+/* Copyright [the year of release] VE Starburst. All rights reserved.\r
+ *\r
+ * NOTICE:All information contained herein is, and remains the property of VE\r
+ * Starburst. The intellectual and technical concepts contained herein are\r
+ * proprietary to VE Starburst. and may be covered by patents, patents in process,\r
+ * and are protected by trade secret or copyright law. Dissemination of this\r
+ * information or reproduction of this material is strictly forbidden unless prior\r
+ * written permission is obtained from VE Starburst.\r
+ */\r
+#include "ulink.h"\r
+#include <stdarg.h>\r
+\r
+//HAL层,接口,需要厂商实现\r
+uint8_t flash_test_buff[512] = {0};\r
+\r
+//FALSH存储接口,用于安全数据存储,大小为256字节;\r
+//需要厂商实现\r
+//要求恢复出厂设置不被清除,OTA也不能被清除,烧录更新也不能被清除\r
+//以下实现的是供测试使用,实际使用时需要厂商实现关联到FLASH的接口\r
+int32_t stb_secure_flash_init(void)\r
+{\r
+ return 0;\r
+}\r
+int32_t stb_secure_flash_read(uint32_t offset, uint8_t *buffer, uint32_t length)\r
+{\r
+ memcpy(buffer, flash_test_buff + offset, length);\r
+ return 0;\r
+}\r
+int32_t stb_secure_flash_write(uint32_t offset, const uint8_t *buffer, uint32_t length)\r
+{\r
+ memcpy(flash_test_buff + offset, buffer, length);\r
+\r
+ return 0;\r
+}\r
+int32_t stb_secure_flash_erase(uint32_t offset, uint32_t length)\r
+{\r
+ memset(flash_test_buff + offset, 0, length);\r
+ return 0;\r
+}\r
+\r
+//SDK打印函数,用于调试时打印SDK内部的日志使用\r
+int32_t stb_printf(const char *format, ...)\r
+{\r
+ va_list args;\r
+ va_start( args, format );\r
+ v_printf(format,args);\r
+ va_end( args ); \r
+ return 0;\r
+}\r
+\r
+uint32_t stb_strlen(const char *str)\r
+{\r
+ size_t len = 0;\r
+ while (*str!= '\0') {\r
+ len++;\r
+ str++;\r
+ }\r
+ return len;\r
+}\r
+\r
+//收到数据后丢给SDK处理,最大长度为64字节;如分包了,需要组包后再丢给SDK,这个收的数据对应了PC端SDK发送的数据\r
+int32_t stb_ble_hal_recv_data(uint8_t *data, uint32_t len)\r
+{\r
+ return stb_ulink_recv_data(data, len);\r
+}\r
+//SDK发送给PC SDK处理的数据,最大长度为64字节;如分包了,需要组包后再丢给PC,PC端组包后再丢给PC端SDK,这个发送的数据对应了PC端SDK收的数据\r
+int32_t stb_ble_hal_send_data(uint8_t *data, uint32_t data_len)\r
+{\r
+ stb_notify_data(data, data_len);\r
+ return 0;\r
+}
\ No newline at end of file
--- /dev/null
+/* Copyright [the year of release] VE Starburst. All rights reserved.\r
+ *\r
+ * NOTICE:All information contained herein is, and remains the property of VE\r
+ * Starburst. The intellectual and technical concepts contained herein are\r
+ * proprietary to VE Starburst. and may be covered by patents, patents in process,\r
+ * and are protected by trade secret or copyright law. Dissemination of this\r
+ * information or reproduction of this material is strictly forbidden unless prior\r
+ * written permission is obtained from VE Starburst.\r
+ */\r
+\r
+\r
+#ifndef _STB_HAL_H\r
+#define _STB_HAL_H\r
+\r
+\r
+\r
+//以下为HAL层接口,需要厂商实现\r
+/*\r
+函数名称:stb_secure_flash_init\r
+功能描述:初始化安全存储接口。\r
+返回值:0 表示成功,其他值表示失败。\r
+*/\r
+int32_t stb_secure_flash_init(void);\r
+\r
+/*\r
+函数名称:stb_secure_flash_read\r
+功能描述:读取安全存储接口\r
+参数:offset - 偏移量\r
+ buffer - 数据缓冲区\r
+ length - 数据长度\r
+返回值:0 表示成功,其他值表示失败。\r
+*/\r
+\r
+int32_t stb_secure_flash_read(uint32_t offset, uint8_t *buffer, uint32_t length);\r
+\r
+/*\r
+函数名称:stb_secure_flash_write\r
+功能描述:写入安全存储接口\r
+参数:offset - 偏移量\r
+ buffer - 数据缓冲区\r
+ length - 数据长度\r
+返回值:0 表示成功,其他值表示失败。\r
+*/\r
+int32_t stb_secure_flash_write(uint32_t offset, const uint8_t *buffer, uint32_t length);\r
+\r
+/*\r
+函数名称:stb_secure_flash_erase\r
+功能描述:擦除安全存储接口\r
+参数:offset - 偏移量\r
+ length - 数据长度\r
+返回值:0 表示成功,其他值表示失败。\r
+*/\r
+int32_t stb_secure_flash_erase(uint32_t offset, uint32_t length);\r
+\r
+/*\r
+函数名称:stb_printf\r
+功能描述:打印日志接口\r
+*/\r
+int32_t stb_printf(const char *format, ...);\r
+\r
+/*\r
+函数名称:stb_strlen\r
+功能描述:获取字符串长度\r
+*/\r
+uint32_t stb_strlen(const char *str);\r
+\r
+/*\r
+函数名称:stb_ble_hal_recv_data\r
+功能描述:SDK接收数据接口\r
+参数:data - 数据缓冲区\r
+ len - 数据长度\r
+*/\r
+int32_t stb_ble_hal_recv_data(uint8_t *data, uint32_t len);\r
+\r
+/*\r
+函数名称:stb_ble_hal_send_data\r
+功能描述:SDK发送数据接口\r
+参数:data - 数据缓冲区\r
+ len - 数据长度\r
+*/\r
+int32_t stb_ble_hal_send_data(uint8_t *data, uint32_t data_len);\r
+\r
+\r
+#endif
\ No newline at end of file
--- /dev/null
+/* Copyright [the year of release] VE Starburst. All rights reserved.
+ *
+ * NOTICE:All information contained herein is, and remains the property of VE
+ * Starburst. The intellectual and technical concepts contained herein are
+ * proprietary to VE Starburst. and may be covered by patents, patents in process,
+ * and are protected by trade secret or copyright law. Dissemination of this
+ * information or reproduction of this material is strictly forbidden unless prior
+ * written permission is obtained from VE Starburst.
+ */
+#ifndef _STB_APP_H_
+#define _STB_APP_H_
+#include <stdint.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
+#define DLL_EXPORTS __declspec(dllexport)
+#define STB_STDCALL __stdcall
+#else
+#define DLL_EXPORTS
+#define STB_STDCALL
+#endif
+
+//回调函数TYPE定义
+/* 激活相关TYPE*/
+#define STB_DYNREG_SUCCESS 0xFF000000
+#define STB_DYNREG_FAIL 0xFF000001
+/* MQTT连云相关TYPE*/
+#define STB_MQTT_CONNECT_SUCCESS 0xFF010000
+#define STB_MQTT_CONNECT_FAIL 0xFF010001
+#define STB_MQTT_CONNECT_TIMEOUT 0xFF010002
+#define STB_MQTT_CONNECT_OFFLINE 0xFF010003
+#define STB_MQTT_CONNECT_ONLINE 0xFF010004
+#define STB_MQTT_CONNECT_STOP 0xFF010005 //认证退出,待设备重新连接后需要重新调用stb_app_start_identify
+
+/*业务数据*/
+#define STB_DM_DATA_ARRIVED_TOKEN 0xFF020000
+#define STB_DM_DATA_ARRIVED_TOKEN_TIMEOUT 0xFF020001
+#define STB_DM_DATA_ARRIVED_HOST 0xFF020002
+#define STB_DM_DATA_ARRIVED_PARAMS_SIGN 0xFF020003
+
+
+/* 事件回调函数类型定义 */
+typedef void (STB_STDCALL *stb_event_callback_func)(uint32_t type,uint8_t *data, uint32_t data_len);
+/* 日志打印函数类型定义 */
+typedef void (STB_STDCALL *stb_debug_func)(const char *format,...);
+/* 日志打印函数类型定义 */
+typedef void(STB_STDCALL *stb_debug_only_str_func)(char *str);
+/* 数据发送函数类型定义 */
+typedef int32_t (STB_STDCALL *stb_data_send_to_device)(uint8_t *data, uint32_t len);
+
+
+/*
+ * 函数名称: stb_app_init
+ * 参数:
+ * - appid: 应用ID,字符串类型
+ * 返回值:
+ * - 返回一个整数,表示初始化结果
+ * 函数说明:
+ * - 该函数用于初始化应用,传入应用ID进行初始化操作,appid由字节火山提供。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_init(char*appid);
+
+/*
+ * 函数名称: stb_app_deinit
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数,表示反初始化结果
+ * 函数说明:
+ * - 该函数用于反初始化应用,释放资源并清理状态。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_deinit(void);
+
+/*
+ * 函数名称: stb_app_event_callback_register
+ * 参数:
+ * - callback: 事件回调函数指针
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - 该函数用于注册事件回调函数,当STB_XXX事件发生时,将调用该回调函数。
+ */
+
+DLL_EXPORTS int STB_STDCALL stb_app_event_callback_register(stb_event_callback_func callback);
+
+
+/*
+ * 函数名称: stb_app_printf_register
+ * 参数:
+ * - print_func: 自定义打印函数,stb_debug_func是带可变参数的
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - 指定日志输出注册函数
+ */
+
+DLL_EXPORTS int STB_STDCALL stb_app_printf_register(stb_debug_func print_func);
+/*
+ * 函数名称: stb_app_printf_str_register
+ * 参数:
+ * - print_func: 自定义打印函数,与stb_debug_func不同,stb_debug_only_str_func的参数只有char,无可变参数
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - 指定日志输出注册函数,与stb_app_printf_register类似,只需要实现一个函数即可
+ * - stb_debug_only_str_func 是解决某些平台或者语言可变参数兼容性问题
+ */
+
+DLL_EXPORTS int STB_STDCALL stb_app_printf_str_register(stb_debug_only_str_func print_str_func);
+
+/*
+ * 函数名称: stb_app_send_data_to_device_register
+ * 参数:
+ * - send_func: 自定义发送数据到蓝牙设备的函数
+
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - SDK需要发送给蓝牙设备的数据通过该API注册,SDK内部会调用该函数发送数据到设备端。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_send_data_to_device_register(stb_data_send_to_device send_func);
+
+/*
+* 函数名称: stb_app_recv_data_from_device
+* 参数:
+ * - data: 数据指针
+ * - len: 数据长度
+ * 返回值:
+ * - 返回0表示成功,返回-1表示失败
+ * 函数说明:
+ * - 该函数用于接收从蓝牙设备SDK发送过来的数据,由应用调用,前提是设备已经连上。
+
+*/
+DLL_EXPORTS int32_t STB_STDCALL stb_app_recv_data_from_device(uint8_t *data, uint32_t len);
+
+/*
+ * 函数名称: stb_app_start_identify
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数,表示设备识别启动结果
+ * 函数说明:
+ * - 该函数用于启动设备鉴权过程,由应用调用,前提是设备已经连上边,并且HAL层的收发函数已经对接。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_start_identify(void);
+
+
+/*
+ * 函数名称: stb_app_stop_identify
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数
+ * 函数说明:
+ * - 该函数用于停止已鉴权流程
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_stop_identify(void);
+
+
+/*
+ * 函数名称: stb_app_set_device_connect_status
+ * 参数:
+ * - 设备连接状态,1表示已连接,0表示断开。
+ * 返回值:
+ * - 返回0表示成功,返回-1表示失败
+ * 函数说明:
+ * - 该函数用于设置设备连接状态,由应用调用,用来通知SDK设备连接状态。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_set_device_connect_status(uint8_t status);
+
+/*
+ * 函数名称: stb_app_get_token_async
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数,表示异步获取令牌结果
+ * 函数说明:
+ * - 该函数用于异步获取令牌,用于访问AI应用使用。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_get_token_async();
+
+
+//测试函数,无需调用
+DLL_EXPORTS int STB_STDCALL stb_app_identify_test(uint8_t *pk, uint8_t *dn, uint8_t *ps);
+
+
+//如需使用产线激活,使用该接口
+DLL_EXPORTS char* STB_STDCALL device_register(char* product_key, char* device_name, char* product_secret);
+//如需使用产线激活,使用该接口
+DLL_EXPORTS int STB_STDCALL device_active(char*product_key, char* device_name, char*device_secret);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
+
--- /dev/null
+/* Copyright [the year of release] VE Starburst. All rights reserved.
+ *
+ * NOTICE:All information contained herein is, and remains the property of VE
+ * Starburst. The intellectual and technical concepts contained herein are
+ * proprietary to VE Starburst. and may be covered by patents, patents in process,
+ * and are protected by trade secret or copyright law. Dissemination of this
+ * information or reproduction of this material is strictly forbidden unless prior
+ * written permission is obtained from VE Starburst.
+ */
+#ifndef _STB_APP_H_
+#define _STB_APP_H_
+#include <stdint.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
+#define DLL_EXPORTS __declspec(dllexport)
+#define STB_STDCALL __stdcall
+#else
+#define DLL_EXPORTS
+#define STB_STDCALL
+#endif
+
+//回调函数TYPE定义
+/* 激活相关TYPE*/
+#define STB_DYNREG_SUCCESS 0xFF000000
+#define STB_DYNREG_FAIL 0xFF000001
+/* MQTT连云相关TYPE*/
+#define STB_MQTT_CONNECT_SUCCESS 0xFF010000
+#define STB_MQTT_CONNECT_FAIL 0xFF010001
+#define STB_MQTT_CONNECT_TIMEOUT 0xFF010002
+#define STB_MQTT_CONNECT_OFFLINE 0xFF010003
+#define STB_MQTT_CONNECT_ONLINE 0xFF010004
+#define STB_MQTT_CONNECT_STOP 0xFF010005 //认证退出,待设备重新连接后需要重新调用stb_app_start_identify
+
+/*业务数据*/
+#define STB_DM_DATA_ARRIVED_TOKEN 0xFF020000
+#define STB_DM_DATA_ARRIVED_TOKEN_TIMEOUT 0xFF020001
+#define STB_DM_DATA_ARRIVED_HOST 0xFF020002
+#define STB_DM_DATA_ARRIVED_PARAMS_SIGN 0xFF020003
+
+
+/* 事件回调函数类型定义 */
+typedef void (STB_STDCALL *stb_event_callback_func)(uint32_t type,uint8_t *data, uint32_t data_len);
+/* 日志打印函数类型定义 */
+typedef void (STB_STDCALL *stb_debug_func)(const char *format,...);
+/* 日志打印函数类型定义 */
+typedef void(STB_STDCALL *stb_debug_only_str_func)(char *str);
+/* 数据发送函数类型定义 */
+typedef int32_t (STB_STDCALL *stb_data_send_to_device)(uint8_t *data, uint32_t len);
+
+
+/*
+ * 函数名称: stb_app_init
+ * 参数:
+ * - appid: 应用ID,字符串类型
+ * 返回值:
+ * - 返回一个整数,表示初始化结果
+ * 函数说明:
+ * - 该函数用于初始化应用,传入应用ID进行初始化操作,appid由字节火山提供。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_init(char*appid);
+
+/*
+ * 函数名称: stb_app_deinit
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数,表示反初始化结果
+ * 函数说明:
+ * - 该函数用于反初始化应用,释放资源并清理状态。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_deinit(void);
+
+/*
+ * 函数名称: stb_app_event_callback_register
+ * 参数:
+ * - callback: 事件回调函数指针
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - 该函数用于注册事件回调函数,当STB_XXX事件发生时,将调用该回调函数。
+ */
+
+DLL_EXPORTS int STB_STDCALL stb_app_event_callback_register(stb_event_callback_func callback);
+
+
+/*
+ * 函数名称: stb_app_printf_register
+ * 参数:
+ * - print_func: 自定义打印函数,stb_debug_func是带可变参数的
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - 指定日志输出注册函数
+ */
+
+DLL_EXPORTS int STB_STDCALL stb_app_printf_register(stb_debug_func print_func);
+/*
+ * 函数名称: stb_app_printf_str_register
+ * 参数:
+ * - print_func: 自定义打印函数,与stb_debug_func不同,stb_debug_only_str_func的参数只有char,无可变参数
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - 指定日志输出注册函数,与stb_app_printf_register类似,只需要实现一个函数即可
+ * - stb_debug_only_str_func 是解决某些平台或者语言可变参数兼容性问题
+ */
+
+DLL_EXPORTS int STB_STDCALL stb_app_printf_str_register(stb_debug_only_str_func print_str_func);
+
+/*
+ * 函数名称: stb_app_send_data_to_device_register
+ * 参数:
+ * - send_func: 自定义发送数据到蓝牙设备的函数
+
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - SDK需要发送给蓝牙设备的数据通过该API注册,SDK内部会调用该函数发送数据到设备端。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_send_data_to_device_register(stb_data_send_to_device send_func);
+
+/*
+* 函数名称: stb_app_recv_data_from_device
+* 参数:
+ * - data: 数据指针
+ * - len: 数据长度
+ * 返回值:
+ * - 返回0表示成功,返回-1表示失败
+ * 函数说明:
+ * - 该函数用于接收从蓝牙设备SDK发送过来的数据,由应用调用,前提是设备已经连上。
+
+*/
+DLL_EXPORTS int32_t STB_STDCALL stb_app_recv_data_from_device(uint8_t *data, uint32_t len);
+
+/*
+ * 函数名称: stb_app_start_identify
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数,表示设备识别启动结果
+ * 函数说明:
+ * - 该函数用于启动设备鉴权过程,由应用调用,前提是设备已经连上边,并且HAL层的收发函数已经对接。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_start_identify(void);
+
+
+/*
+ * 函数名称: stb_app_stop_identify
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数
+ * 函数说明:
+ * - 该函数用于停止已鉴权流程
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_stop_identify(void);
+
+
+/*
+ * 函数名称: stb_app_set_device_connect_status
+ * 参数:
+ * - 设备连接状态,1表示已连接,0表示断开。
+ * 返回值:
+ * - 返回0表示成功,返回-1表示失败
+ * 函数说明:
+ * - 该函数用于设置设备连接状态,由应用调用,用来通知SDK设备连接状态。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_set_device_connect_status(uint8_t status);
+
+/*
+ * 函数名称: stb_app_get_token_async
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数,表示异步获取令牌结果
+ * 函数说明:
+ * - 该函数用于异步获取令牌,用于访问AI应用使用。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_get_token_async();
+
+
+//测试函数,无需调用
+DLL_EXPORTS int STB_STDCALL stb_app_identify_test(uint8_t *pk, uint8_t *dn, uint8_t *ps);
+
+
+//如需使用产线激活,使用该接口
+DLL_EXPORTS char* STB_STDCALL device_register(char* product_key, char* device_name, char* product_secret);
+//如需使用产线激活,使用该接口
+DLL_EXPORTS int STB_STDCALL device_active(char*product_key, char* device_name, char*device_secret);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
+
--- /dev/null
+/* Copyright [the year of release] VE Starburst. All rights reserved.
+ *
+ * NOTICE:All information contained herein is, and remains the property of VE
+ * Starburst. The intellectual and technical concepts contained herein are
+ * proprietary to VE Starburst. and may be covered by patents, patents in process,
+ * and are protected by trade secret or copyright law. Dissemination of this
+ * information or reproduction of this material is strictly forbidden unless prior
+ * written permission is obtained from VE Starburst.
+ */
+#ifndef _STB_APP_H_
+#define _STB_APP_H_
+#include <stdint.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#if (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))
+#define DLL_EXPORTS __declspec(dllexport)
+#define STB_STDCALL __stdcall
+#else
+#define DLL_EXPORTS
+#define STB_STDCALL
+#endif
+
+//回调函数TYPE定义
+/* 激活相关TYPE*/
+#define STB_DYNREG_SUCCESS 0xFF000000
+#define STB_DYNREG_FAIL 0xFF000001
+/* MQTT连云相关TYPE*/
+#define STB_MQTT_CONNECT_SUCCESS 0xFF010000
+#define STB_MQTT_CONNECT_FAIL 0xFF010001
+#define STB_MQTT_CONNECT_TIMEOUT 0xFF010002
+#define STB_MQTT_CONNECT_OFFLINE 0xFF010003
+#define STB_MQTT_CONNECT_ONLINE 0xFF010004
+#define STB_MQTT_CONNECT_STOP 0xFF010005 //认证退出,待设备重新连接后需要重新调用stb_app_start_identify
+
+/*业务数据*/
+#define STB_DM_DATA_ARRIVED_TOKEN 0xFF020000
+#define STB_DM_DATA_ARRIVED_TOKEN_TIMEOUT 0xFF020001
+#define STB_DM_DATA_ARRIVED_HOST 0xFF020002
+#define STB_DM_DATA_ARRIVED_PARAMS_SIGN 0xFF020003
+
+
+/* 事件回调函数类型定义 */
+typedef void (STB_STDCALL *stb_event_callback_func)(uint32_t type,uint8_t *data, uint32_t data_len);
+/* 日志打印函数类型定义 */
+typedef void (STB_STDCALL *stb_debug_func)(const char *format,...);
+/* 日志打印函数类型定义 */
+typedef void(STB_STDCALL *stb_debug_only_str_func)(char *str);
+/* 数据发送函数类型定义 */
+typedef int32_t (STB_STDCALL *stb_data_send_to_device)(uint8_t *data, uint32_t len);
+
+
+/*
+ * 函数名称: stb_app_init
+ * 参数:
+ * - appid: 应用ID,字符串类型
+ * 返回值:
+ * - 返回一个整数,表示初始化结果
+ * 函数说明:
+ * - 该函数用于初始化应用,传入应用ID进行初始化操作,appid由字节火山提供。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_init(char*appid);
+
+/*
+ * 函数名称: stb_app_deinit
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数,表示反初始化结果
+ * 函数说明:
+ * - 该函数用于反初始化应用,释放资源并清理状态。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_deinit(void);
+
+/*
+ * 函数名称: stb_app_event_callback_register
+ * 参数:
+ * - callback: 事件回调函数指针
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - 该函数用于注册事件回调函数,当STB_XXX事件发生时,将调用该回调函数。
+ */
+
+DLL_EXPORTS int STB_STDCALL stb_app_event_callback_register(stb_event_callback_func callback);
+
+
+/*
+ * 函数名称: stb_app_printf_register
+ * 参数:
+ * - print_func: 自定义打印函数,stb_debug_func是带可变参数的
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - 指定日志输出注册函数
+ */
+
+DLL_EXPORTS int STB_STDCALL stb_app_printf_register(stb_debug_func print_func);
+/*
+ * 函数名称: stb_app_printf_str_register
+ * 参数:
+ * - print_func: 自定义打印函数,与stb_debug_func不同,stb_debug_only_str_func的参数只有char,无可变参数
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - 指定日志输出注册函数,与stb_app_printf_register类似,只需要实现一个函数即可
+ * - stb_debug_only_str_func 是解决某些平台或者语言可变参数兼容性问题
+ */
+
+DLL_EXPORTS int STB_STDCALL stb_app_printf_str_register(stb_debug_only_str_func print_str_func);
+
+/*
+ * 函数名称: stb_app_send_data_to_device_register
+ * 参数:
+ * - send_func: 自定义发送数据到蓝牙设备的函数
+
+ * 返回值:
+ * - 返回一个整数,表示注册结果
+ * 函数说明:
+ * - SDK需要发送给蓝牙设备的数据通过该API注册,SDK内部会调用该函数发送数据到设备端。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_send_data_to_device_register(stb_data_send_to_device send_func);
+
+/*
+* 函数名称: stb_app_recv_data_from_device
+* 参数:
+ * - data: 数据指针
+ * - len: 数据长度
+ * 返回值:
+ * - 返回0表示成功,返回-1表示失败
+ * 函数说明:
+ * - 该函数用于接收从蓝牙设备SDK发送过来的数据,由应用调用,前提是设备已经连上。
+
+*/
+DLL_EXPORTS int32_t STB_STDCALL stb_app_recv_data_from_device(uint8_t *data, uint32_t len);
+
+/*
+ * 函数名称: stb_app_start_identify
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数,表示设备识别启动结果
+ * 函数说明:
+ * - 该函数用于启动设备鉴权过程,由应用调用,前提是设备已经连上边,并且HAL层的收发函数已经对接。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_start_identify(void);
+
+
+/*
+ * 函数名称: stb_app_stop_identify
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数
+ * 函数说明:
+ * - 该函数用于停止已鉴权流程
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_stop_identify(void);
+
+
+/*
+ * 函数名称: stb_app_set_device_connect_status
+ * 参数:
+ * - 设备连接状态,1表示已连接,0表示断开。
+ * 返回值:
+ * - 返回0表示成功,返回-1表示失败
+ * 函数说明:
+ * - 该函数用于设置设备连接状态,由应用调用,用来通知SDK设备连接状态。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_set_device_connect_status(uint8_t status);
+
+/*
+ * 函数名称: stb_app_get_token_async
+ * 参数:
+ * - 无
+ * 返回值:
+ * - 返回一个整数,表示异步获取令牌结果
+ * 函数说明:
+ * - 该函数用于异步获取令牌,用于访问AI应用使用。
+ */
+DLL_EXPORTS int STB_STDCALL stb_app_get_token_async();
+
+
+//测试函数,无需调用
+DLL_EXPORTS int STB_STDCALL stb_app_identify_test(uint8_t *pk, uint8_t *dn, uint8_t *ps);
+
+
+//如需使用产线激活,使用该接口
+DLL_EXPORTS char* STB_STDCALL device_register(char* product_key, char* device_name, char* product_secret);
+//如需使用产线激活,使用该接口
+DLL_EXPORTS int STB_STDCALL device_active(char*product_key, char* device_name, char*device_secret);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif
+
--- /dev/null
+/* Copyright [the year of release] VE Starburst. All rights reserved.\r
+ *\r
+ * NOTICE:All information contained herein is, and remains the property of VE\r
+ * Starburst. The intellectual and technical concepts contained herein are\r
+ * proprietary to VE Starburst. and may be covered by patents, patents in process,\r
+ * and are protected by trade secret or copyright law. Dissemination of this\r
+ * information or reproduction of this material is strictly forbidden unless prior\r
+ * written permission is obtained from VE Starburst.\r
+ */\r
+#ifndef _STB_APP_H_\r
+#define _STB_APP_H_\r
+#include <stdint.h>\r
+\r
+#if defined(__cplusplus)\r
+extern "C" {\r
+#endif\r
+\r
+#if (defined(WIN32) || defined(WIN64) || defined(_MSC_VER) || defined(_WIN32))\r
+#define DLL_EXPORTS __declspec(dllexport) \r
+#define STB_STDCALL __stdcall\r
+#else\r
+#define DLL_EXPORTS\r
+#define STB_STDCALL\r
+#endif\r
+\r
+//回调函数TYPE定义\r
+/* 激活相关TYPE*/\r
+#define STB_DYNREG_SUCCESS 0xFF000000\r
+#define STB_DYNREG_FAIL 0xFF000001\r
+/* MQTT连云相关TYPE*/\r
+#define STB_MQTT_CONNECT_SUCCESS 0xFF010000\r
+#define STB_MQTT_CONNECT_FAIL 0xFF010001\r
+#define STB_MQTT_CONNECT_TIMEOUT 0xFF010002\r
+#define STB_MQTT_CONNECT_OFFLINE 0xFF010003\r
+#define STB_MQTT_CONNECT_ONLINE 0xFF010004 \r
+#define STB_MQTT_CONNECT_STOP 0xFF010005 //认证退出,待设备重新连接后需要重新调用stb_app_start_identify\r
+\r
+/*业务数据*/\r
+#define STB_DM_DATA_ARRIVED_TOKEN 0xFF020000\r
+#define STB_DM_DATA_ARRIVED_TOKEN_TIMEOUT 0xFF020001\r
+#define STB_DM_DATA_ARRIVED_HOST 0xFF020002\r
+#define STB_DM_DATA_ARRIVED_PARAMS_SIGN 0xFF020003\r
+\r
+\r
+/* 事件回调函数类型定义 */\r
+typedef void (STB_STDCALL *stb_event_callback_func)(uint32_t type,uint8_t *data, uint32_t data_len);\r
+/* 日志打印函数类型定义 */\r
+typedef void (STB_STDCALL *stb_debug_func)(const char *format,...);\r
+/* 日志打印函数类型定义 */\r
+typedef void(STB_STDCALL *stb_debug_only_str_func)(char *str);\r
+/* 数据发送函数类型定义 */\r
+typedef int32_t (STB_STDCALL *stb_data_send_to_device)(uint8_t *data, uint32_t len);\r
+\r
+\r
+/*\r
+ * 函数名称: stb_app_init\r
+ * 参数:\r
+ * - appid: 应用ID,字符串类型\r
+ * 返回值:\r
+ * - 返回一个整数,表示初始化结果\r
+ * 函数说明:\r
+ * - 该函数用于初始化应用,传入应用ID进行初始化操作,appid由字节火山提供。\r
+ */\r
+DLL_EXPORTS int STB_STDCALL stb_app_init(char*appid);\r
+\r
+/*\r
+ * 函数名称: stb_app_deinit\r
+ * 参数:\r
+ * - 无\r
+ * 返回值:\r
+ * - 返回一个整数,表示反初始化结果\r
+ * 函数说明:\r
+ * - 该函数用于反初始化应用,释放资源并清理状态。\r
+ */\r
+DLL_EXPORTS int STB_STDCALL stb_app_deinit(void);\r
+\r
+/*\r
+ * 函数名称: stb_app_event_callback_register\r
+ * 参数:\r
+ * - callback: 事件回调函数指针\r
+ * 返回值:\r
+ * - 返回一个整数,表示注册结果\r
+ * 函数说明:\r
+ * - 该函数用于注册事件回调函数,当STB_XXX事件发生时,将调用该回调函数。\r
+ */\r
+\r
+DLL_EXPORTS int STB_STDCALL stb_app_event_callback_register(stb_event_callback_func callback);\r
+\r
+\r
+/*\r
+ * 函数名称: stb_app_printf_register\r
+ * 参数:\r
+ * - print_func: 自定义打印函数,stb_debug_func是带可变参数的\r
+ * 返回值:\r
+ * - 返回一个整数,表示注册结果\r
+ * 函数说明:\r
+ * - 指定日志输出注册函数\r
+ */\r
+\r
+DLL_EXPORTS int STB_STDCALL stb_app_printf_register(stb_debug_func print_func);\r
+/*\r
+ * 函数名称: stb_app_printf_str_register\r
+ * 参数:\r
+ * - print_func: 自定义打印函数,与stb_debug_func不同,stb_debug_only_str_func的参数只有char,无可变参数\r
+ * 返回值:\r
+ * - 返回一个整数,表示注册结果\r
+ * 函数说明:\r
+ * - 指定日志输出注册函数,与stb_app_printf_register类似,只需要实现一个函数即可\r
+ * - stb_debug_only_str_func 是解决某些平台或者语言可变参数兼容性问题\r
+ */\r
+\r
+DLL_EXPORTS int STB_STDCALL stb_app_printf_str_register(stb_debug_only_str_func print_str_func);\r
+\r
+/*\r
+ * 函数名称: stb_app_send_data_to_device_register\r
+ * 参数:\r
+ * - send_func: 自定义发送数据到蓝牙设备的函数\r
+\r
+ * 返回值:\r
+ * - 返回一个整数,表示注册结果\r
+ * 函数说明:\r
+ * - SDK需要发送给蓝牙设备的数据通过该API注册,SDK内部会调用该函数发送数据到设备端。\r
+ */\r
+DLL_EXPORTS int STB_STDCALL stb_app_send_data_to_device_register(stb_data_send_to_device send_func);\r
+\r
+/*\r
+* 函数名称: stb_app_recv_data_from_device\r
+* 参数:\r
+ * - data: 数据指针\r
+ * - len: 数据长度\r
+ * 返回值:\r
+ * - 返回0表示成功,返回-1表示失败\r
+ * 函数说明:\r
+ * - 该函数用于接收从蓝牙设备SDK发送过来的数据,由应用调用,前提是设备已经连上。\r
+\r
+*/\r
+DLL_EXPORTS int32_t STB_STDCALL stb_app_recv_data_from_device(uint8_t *data, uint32_t len);\r
+\r
+/*\r
+ * 函数名称: stb_app_start_identify\r
+ * 参数:\r
+ * - 无\r
+ * 返回值:\r
+ * - 返回一个整数,表示设备识别启动结果\r
+ * 函数说明:\r
+ * - 该函数用于启动设备鉴权过程,由应用调用,前提是设备已经连上边,并且HAL层的收发函数已经对接。\r
+ */\r
+DLL_EXPORTS int STB_STDCALL stb_app_start_identify(void);\r
+\r
+\r
+/*\r
+ * 函数名称: stb_app_stop_identify\r
+ * 参数:\r
+ * - 无\r
+ * 返回值:\r
+ * - 返回一个整数\r
+ * 函数说明:\r
+ * - 该函数用于停止已鉴权流程\r
+ */\r
+DLL_EXPORTS int STB_STDCALL stb_app_stop_identify(void);\r
+\r
+\r
+/*\r
+ * 函数名称: stb_app_set_device_connect_status\r
+ * 参数:\r
+ * - 设备连接状态,1表示已连接,0表示断开。\r
+ * 返回值:\r
+ * - 返回0表示成功,返回-1表示失败\r
+ * 函数说明:\r
+ * - 该函数用于设置设备连接状态,由应用调用,用来通知SDK设备连接状态。\r
+ */\r
+DLL_EXPORTS int STB_STDCALL stb_app_set_device_connect_status(uint8_t status);\r
+\r
+/*\r
+ * 函数名称: stb_app_get_token_async\r
+ * 参数:\r
+ * - 无\r
+ * 返回值:\r
+ * - 返回一个整数,表示异步获取令牌结果\r
+ * 函数说明:\r
+ * - 该函数用于异步获取令牌,用于访问AI应用使用。\r
+ */\r
+DLL_EXPORTS int STB_STDCALL stb_app_get_token_async();\r
+\r
+\r
+//测试函数,无需调用\r
+DLL_EXPORTS int STB_STDCALL stb_app_identify_test(uint8_t *pk, uint8_t *dn, uint8_t *ps);\r
+\r
+\r
+//如需使用产线激活,使用该接口\r
+DLL_EXPORTS char* STB_STDCALL device_register(char* product_key, char* device_name, char* product_secret);\r
+//如需使用产线激活,使用该接口\r
+DLL_EXPORTS int STB_STDCALL device_active(char*product_key, char* device_name, char*device_secret);\r
+\r
+#if defined(__cplusplus)\r
+}\r
+#endif\r
+\r
+#endif\r
+\r