\r
printf("发送AI准备就绪\r\n");\r
send_big_data(0, (char *)&type, 1, 1, 1, 1, 0x05, 5);\r
-\r
+}\r
+//查询AI 模型是否可用,结果通过2AE4返回\r
+/*使用模型:\r
+0:文心一言\r
+1:ChatGPT\r
+2:KIMI\r
+3:豆包*/\r
+void inquire_AI_is_ready(uint8_t type)\r
+{\r
+ \r
+ printf("查询AI模型,是否准备就绪\r\n");\r
+ send_big_data(0, (char *)&type, 1, 1, 1, 1, 0x06, 5);\r
}\r
\r
+\r
+\r
//发送ble数据\r
uint8_t phone_mac[6];//手机下发的mac地址 第一次连接为空 \r
uint8_t parie_mac[6];//配对完成之后的的mac地址\r
} \r
}\r
\r
+void APP_reply_AI_is_ready(uint8_t *data,uint16_t len)\r
+{\r
+ if(data[0])\r
+ {\r
+ if(len>1)\r
+ {\r
+ //更新chatgptKEY\r
+ FILE *fp= fopen("/user/userdata/chatGPTkey.bin","wb+");\r
+ if(fp)\r
+ {\r
+ fwrite(data+1,1,len-1,fp);\r
+ fclose(fp);\r
+ }\r
+ }\r
+ }\r
+ ble_app_reply(data[0]);\r
+}\r
void SaveChatGPTCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,uint8_t crcvalue)\r
{\r
uint32_t tmp = 1;\r
memcpy(sendBuf+11,&tmp,4);\r
memcpy(sendBuf+15,&tmp_data,2);\r
// printf("GetWeatherCmd:len:%d data:%s\r\n",len,data);\r
+ //"sk-proj-04ogvrZQqyaiv1OWw8OZT3BlbkFJG9Gyr8oFvRdmr3oXQNbX"\r
if(Check_CRC(data,len,crcvalue))\r
{\r
\r
{\r
sendBuf[17] = 2;\r
}\r
- \r
sendBuf[18] = Calculate_CRC(sendBuf,18);\r
sendBleData(sendBuf,19);\r
}\r
GetGPSCmd(typeID,data,datalen,totalData,crcvalue);\r
break;\r
case APP_SEND_CHATGPT_KEY_CMD:\r
-\r
+ SaveChatGPTCmd(typeID,data,datalen,totalData,crcvalue);\r
+ break;\r
+ case APP_SEND_AI_KEY_IS_AVAILABLE_CMD:\r
+ APP_reply_AI_is_ready(data,datalen);\r
break;\r
\r
default:\r
memcpy(value+15,&tmp_data,2);\r
\r
//0空闲状态 9 usb状态 10 运动训练状态\r
- uint8_t watchStatus = 0;\r
+ uint8_t watchStatus = 0;\r
+ if(uapi_dev_runtime_get_train_status())\r
+ watchStatus=10;\r
+ \r
value[17] = 0;\r
value[18] = Calculate_CRC(value,18);\r
sendBleData(value,19);\r
#define SYN_BASIC_REAL_HEATR_CMD 0x024B //同步基础训练试试心率记录
#define APP_SEND_CHATGPT_KEY_CMD 0x0223 //APP发送chatGPT key
#define SYN_TODAY_BASIC_TRAIN_TXT_CMD 0x024D //同步当天任意时间之后的基础训练记录
+#define APP_SEND_AI_KEY_IS_AVAILABLE_CMD 0x0601 //查询AI是否可用,APP 回复
#define SYN_APP_GET_GPS_DATA_CMD 0x024F //同步gps信息
void send_AI_is_ready(uint8_t type);
+void inquire_AI_is_ready(uint8_t type);
+
void GetCurDataCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totaldata,uint8_t crcvalue);
bool get_ctkd_flag(void);