增加了修改温度校准值的协议

This commit is contained in:
haped 2025-07-17 15:23:32 +08:00
parent 996d1ab3bb
commit 4833a132a0
11 changed files with 56606 additions and 51171 deletions

View File

@ -132,6 +132,20 @@ void ble_receive_callback(u8* data,u16 len){
} }
syscfg_write(ADJ_TEMP_CONFIG, &ADJ_temp,sizeof(ADJ_temp)); syscfg_write(ADJ_TEMP_CONFIG, &ADJ_temp,sizeof(ADJ_temp));
}
//温度偏差校准
else if(strstr(data,"AT+ADJOBJ=") != NULL){
u8 str_adj[64] = {0};
char *end;
long value = strtol(data + strlen("AT+ADJOBJ="), &end, 10);
ADJ_temp -= (int16_t)value;
memset(str_adj,0,sizeof(str_adj));
sprintf(str_adj,"AT+ADJOBJ=%d",-ADJ_temp);
ble_send_data(&str_adj,strlen(str_adj));
syscfg_write(ADJ_TEMP_CONFIG, &ADJ_temp,sizeof(ADJ_temp));
} }
else if(strstr(data,"AT+RESET=") != NULL){ else if(strstr(data,"AT+RESET=") != NULL){
u8 str_res[64] = {0}; u8 str_res[64] = {0};

View File

@ -2,21 +2,21 @@
<CodeBlocks_layout_file> <CodeBlocks_layout_file>
<FileVersion major="1" minor="0" /> <FileVersion major="1" minor="0" />
<ActiveTarget name="Release" /> <ActiveTarget name="Release" />
<File name="..\..\app_main.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3753" topLine="118" />
</Cursor>
</File>
<File name="..\..\app_temperature.c" open="1" top="1" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="25741" topLine="769" />
</Cursor>
</File>
<File name="..\..\examples\trans_data\ble_trans.c" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <File name="..\..\examples\trans_data\ble_trans.c" open="1" top="0" tabpos="7" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor> <Cursor>
<Cursor1 position="26810" topLine="719" /> <Cursor1 position="26810" topLine="719" />
</Cursor> </Cursor>
</File> </File>
<File name="..\..\..\..\cpu\bd19\charge.c" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="8796" topLine="308" />
</Cursor>
</File>
<File name="..\..\app_main.c" open="1" top="0" tabpos="2" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="3753" topLine="118" />
</Cursor>
</File>
<File name="..\..\include\app_config.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <File name="..\..\include\app_config.h" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor> <Cursor>
<Cursor1 position="10242" topLine="189" /> <Cursor1 position="10242" topLine="189" />
@ -27,24 +27,14 @@
<Cursor1 position="518" topLine="13" /> <Cursor1 position="518" topLine="13" />
</Cursor> </Cursor>
</File> </File>
<File name="..\..\..\common\third_party_profile\jieli\gatt_common\le_gatt_server.c" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <File name="..\..\..\common\device\usb\host\aoa.c" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor> <Cursor>
<Cursor1 position="27428" topLine="677" /> <Cursor1 position="593" topLine="9" />
</Cursor> </Cursor>
</File> </File>
<File name="..\..\..\..\cpu\bd19\charge.c" open="1" top="0" tabpos="9" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <File name="..\..\app_temperature.c" open="1" top="0" tabpos="1" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor> <Cursor>
<Cursor1 position="8796" topLine="308" /> <Cursor1 position="5781" topLine="128" />
</Cursor>
</File>
<File name="..\..\modules\power\app_charge.c" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1522" topLine="53" />
</Cursor>
</File>
<File name="..\..\..\common\device\usb\device\user_setup.c" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6496" topLine="231" />
</Cursor> </Cursor>
</File> </File>
<File name="..\..\..\..\include_lib\system\timer.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <File name="..\..\..\..\include_lib\system\timer.h" open="1" top="0" tabpos="10" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -52,19 +42,14 @@
<Cursor1 position="1916" topLine="61" /> <Cursor1 position="1916" topLine="61" />
</Cursor> </Cursor>
</File> </File>
<File name="..\..\..\common\device\usb\host\aoa.c" open="1" top="0" tabpos="12" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="593" topLine="9" />
</Cursor>
</File>
<File name="..\..\modules\bt\app_comm_edr.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <File name="..\..\modules\bt\app_comm_edr.c" open="0" top="0" tabpos="0" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor> <Cursor>
<Cursor1 position="1154" topLine="18" /> <Cursor1 position="1154" topLine="18" />
</Cursor> </Cursor>
</File> </File>
<File name="..\..\examples\trans_data\ble_trans.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <File name="..\..\..\common\third_party_profile\jieli\gatt_common\le_gatt_server.c" open="1" top="0" tabpos="8" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor> <Cursor>
<Cursor1 position="553" topLine="0" /> <Cursor1 position="27428" topLine="677" />
</Cursor> </Cursor>
</File> </File>
<File name="board_ac6323a_demo_cfg.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0"> <File name="board_ac6323a_demo_cfg.h" open="1" top="0" tabpos="3" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
@ -77,4 +62,19 @@
<Cursor1 position="11677" topLine="439" /> <Cursor1 position="11677" topLine="439" />
</Cursor> </Cursor>
</File> </File>
<File name="..\..\..\common\device\usb\device\user_setup.c" open="1" top="0" tabpos="11" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="6496" topLine="231" />
</Cursor>
</File>
<File name="..\..\examples\trans_data\ble_trans.h" open="1" top="0" tabpos="6" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="553" topLine="0" />
</Cursor>
</File>
<File name="..\..\modules\power\app_charge.c" open="1" top="0" tabpos="5" split="0" active="1" splitpos="0" zoom_1="0" zoom_2="0">
<Cursor>
<Cursor1 position="1522" topLine="53" />
</Cursor>
</File>
</CodeBlocks_layout_file> </CodeBlocks_layout_file>

View File

@ -7,7 +7,7 @@
/** /**
* 1.0.4 2025.07.03 * 1.0.4 2025.07.03
*/ */
#define BLE_TEMPERATURE_DEVICE_SOFT_VER "1.0.4" #define BLE_TEMPERATURE_DEVICE_SOFT_VER "1.0.6"
#define BLE_TEMPERATURE_DETECT_INTERVAL 250 #define BLE_TEMPERATURE_DETECT_INTERVAL 250
#define BLE_TEMPERATURE_WORK_TIMEOUT 10*1000 #define BLE_TEMPERATURE_WORK_TIMEOUT 10*1000

View File

@ -2327,6 +2327,7 @@ obj/Release/apps/spp_and_le/app_temperature.o
-r=obj/Release/apps/spp_and_le/app_temperature.o,sprintf,l -r=obj/Release/apps/spp_and_le/app_temperature.o,sprintf,l
-r=obj/Release/apps/spp_and_le/app_temperature.o,strlen,l -r=obj/Release/apps/spp_and_le/app_temperature.o,strlen,l
-r=obj/Release/apps/spp_and_le/app_temperature.o,syscfg_write,l -r=obj/Release/apps/spp_and_le/app_temperature.o,syscfg_write,l
-r=obj/Release/apps/spp_and_le/app_temperature.o,strtol,l
-r=obj/Release/apps/spp_and_le/app_temperature.o,temperature_poweron_led_timeout,pl -r=obj/Release/apps/spp_and_le/app_temperature.o,temperature_poweron_led_timeout,pl
-r=obj/Release/apps/spp_and_le/app_temperature.o,temperature_work_led,pl -r=obj/Release/apps/spp_and_le/app_temperature.o,temperature_work_led,pl
-r=obj/Release/apps/spp_and_le/app_temperature.o,ble_led_timeout,pl -r=obj/Release/apps/spp_and_le/app_temperature.o,ble_led_timeout,pl

File diff suppressed because it is too large Load Diff