短信 356/1 356/head 357/target/1
authorhcj <1224667075@qq.com>
Sat, 22 Jun 2024 07:01:02 +0000 (15:01 +0800)
committerhcj <1224667075@qq.com>
Sat, 22 Jun 2024 07:01:02 +0000 (15:01 +0800)
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.c
code/sdk/application/wearable/service/ble_service/bleservice/bleEvent.h
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.cpp
code/sdk/drivers/peripheral/slip/cat1Service/cat1_server.h
code/sdk/drivers/peripheral/utils/pdu.c

index 394ef20..ae3665f 100644 (file)
@@ -5139,6 +5139,12 @@ void ancsDataShowCmd(uint16_t cmd,uint8_t *data,uint16_t len,uint8_t *totalData,
         sendBleData(value,19);\r
     }\r
 }\r
+\r
+void CustomEventPublish_TOPIC_EVENT_MESSAGENOTE(void)\r
+{\r
+     CustomEventPublish(TOPIC_EVENT_MESSAGENOTE,NULL,0);\r
+}\r
+\r
 void type2AE1Data(uint8_t *buf_cmd,uint8_t *data,uint16_t datalen,uint8_t *totalData,uint8_t crcvalue)\r
 {\r
     uint16_t typeID = buf_cmd[1]*256+buf_cmd[2];\r
index 04fc992..280ac82 100644 (file)
@@ -765,6 +765,11 @@ bool Read_tar_file_buf_send_Data(uint16_t pack_size,uint8_t id);
 uint8_t get_crc_from_lrc(uint8_t lrcValue);
 
 uint8_t  calculate_lrc_file(char *file_path);
+
+void message_data(int uid,int appid,char  *title,char  *msg,int hasCode);
+
+void CustomEventPublish_TOPIC_EVENT_MESSAGENOTE(void);
+
 #ifdef __cplusplus
 }
 #endif
index 07d1660..f15e418 100644 (file)
@@ -92,6 +92,13 @@ enum UDP_COMMAND_HEAD {
 };
 static uint8_t g_msg_format_type = 0;// 0: old format , 1: new format
 
+static char ble_buffer[20] = {0};
+
+void ble_get_cat1_at_msg(char *buffer,uint8_t len)
+{
+    memcpy_s(buffer,len,ble_buffer,strlen(ble_buffer));
+}
+
 static uint8_t get_int8_from_ascii_char( uint8_t ascii)
 {
 
@@ -1232,6 +1239,8 @@ static int udp_packet_parse(char *rx_buffer, int len)
             index = cat1_handle_version_msg(msg_buffer);
             break;
         case UDP_CMD_MSG_ATCMD:
+            memset_s(ble_buffer,20,0,20);
+            memcpy_s(ble_buffer,20,msg_buffer,strlen(msg_buffer));
             if (strlen(msg_buffer) == 0)
             {
                 PRINT("ATCMD reply len(0): OK\n");
index 0ac8edd..128cc9b 100644 (file)
@@ -36,6 +36,8 @@ void set_telecom_dmp_switch_to_cat1(uint8_t on);//设置电信入库功能开关
 void save_regist_time_to_ble(char *msg);//保存注册的时间戳
 void get_regist_time_toCat1(void);
 
+void ble_get_cat1_at_msg(char *buffer,uint8_t len);
+
 #ifdef __cplusplus
 #if __cplusplus
 }
index 81df84a..21f2616 100644 (file)
@@ -10,6 +10,7 @@
 #include <string.h>
 #include <time.h>
 #include <stdint.h>
+#include <bleEvent.h>
 
 enum {
        BITMASK_7BITS = 0x7F,
@@ -320,6 +321,10 @@ int pdu_decode_example(const char *inpdustr )
                        timenow->tm_hour,
                        timenow->tm_min,
                        timenow->tm_sec);
+
+               message_data(0,0,phone_number,text,0);
+               CustomEventPublish_TOPIC_EVENT_MESSAGENOTE();
+               
        }
        return ret;
 }