解决fd230 的650乘车码不能获取问题 2185/1
authorluozheng <1732036298@qq.com>
Sat, 30 Aug 2025 03:42:43 +0000 (11:42 +0800)
committerluozheng <1732036298@qq.com>
Sat, 30 Aug 2025 03:42:43 +0000 (11:42 +0800)
code/sdk/build/config/target_config/brandy/config.py
code/sdk/zhihui/services/ble_service/transspecard/transspecard.c
code/sdk/zhihui/services/factorytest_service/factorytest_protocol.c

index 6a084ed..366c61c 100644 (file)
@@ -409,7 +409,7 @@ target = {
             'NANDFLASH_DS35X',
             'BLE_INSTRUCT',
             # 'AILPAY_SUPPORT',
-            # 'SUPPORT_FACTORY_SERVICE',
+            'SUPPORT_FACTORY_SERVICE',
             # 'MEMORY_CORRUPTION',
             
         ],
@@ -421,7 +421,6 @@ target = {
                            "ppg_sensor_hx3695",
                         #   "ppgBleService",
                            "mag_sensor_mmc5603",
-                           "thunderbird_toys",#雷鸟
                           "vibrator",
                           "vibrator_service",
                         #   "-:lwip",
@@ -1140,6 +1139,7 @@ target = {
                           "vibrator",
                           "vibrator_service",
                         #   "-:lwip",
+                          "thunderbird_toys",#雷鸟
                           "cat1Service",
                           "cat1Test",
                           "audio_manager",
index 4b8d7dc..b8dda87 100644 (file)
@@ -9,8 +9,6 @@
 #endif
 #include <time.h>
 #include <cmsis_os2.h>
-#include <stdint.h>
-#include <stdlib.h>
 
 #define alipay_transspecard_log 0 // 用于日志打印
 #define ALIPAY_TRANSSPECARD_ERRCODE_SUCC 0
@@ -242,7 +240,7 @@ uint8_t send_transspecard_data(uint8_t type_id, void *data, uint16_t datalen)
     {
         send_packet_total++;
     }
-
+    printf("get_alipay_ble_nus_max_data_len: %u\r\n",get_alipay_ble_nus_max_data_len());
     printf("总数据长度: %u 字节, 预计分包数量: %u 个\n", datalen, send_packet_total);
 
     // 单包传输逻辑
@@ -271,10 +269,14 @@ uint8_t send_transspecard_data(uint8_t type_id, void *data, uint16_t datalen)
     // 多包传输逻辑
     uint8_t current_packet = 1;
     int all_packets_sent = 0;
-    // 初始化信号量
+    if(g_transspecard_ack_sem != NULL)
+    {
+        osSemaphoreDelete(g_transspecard_ack_sem);
+        g_transspecard_ack_sem = NULL;
+    }
     if (g_transspecard_ack_sem == NULL)
     {
-        g_transspecard_ack_sem = osSemaphoreNew(1, 0, NULL);
+        g_transspecard_ack_sem = osSemaphoreNew(1, 0, NULL);// 初始化信号量
     }
 
     // 先顺序发送所有数据包
@@ -470,7 +472,7 @@ uint8_t send_transspecard_data(uint8_t type_id, void *data, uint16_t datalen)
 #endif
 
 // 接收缓冲区最大长度
-#define MAX_RECEIVE_BUFFER_SIZE (1024 * 4) //
+#define MAX_RECEIVE_BUFFER_SIZE (1024 * 5) //
 #define RECEIVE_PACKET_FIRST 0x01          // 第一个包
 #define RECEVIE_PACKET_COMPLETED_ACK 0x00  // 最后一个包接收完成ACK
 #define RECEIVE_PACKET_HEADER 0x73         // 消息头
@@ -634,14 +636,16 @@ uint8_t parse_transspecard_data(void *buf, uint16_t event_size)
         receive_packet_total = current_packet_total;
         receive_total_datalen = current_total_datalen;
 
+        #if 0 
         if (receive_total_datalen > MAX_RECEIVE_BUFFER_SIZE)
         {
-            printf("Received data length exceeds buffer size!\r\n");
+            printf("Received data length exceeds buffer size,receive_total_datalen:%u!\r\n",receive_total_datalen);
             isProcessingData = 0;
             ble_transspecard_receive_cleanup_resources();
             notify_resend(RECEIVE_PACKET_FIRST);
             return ALIPAY_TRANSSPECARD_ERRCODE_FAIL;
         }
+        #endif
 
         packet_received_flags = (uint8_t *)malloc(receive_packet_total);
         if (packet_received_flags == NULL)
index a2d6c95..951565b 100644 (file)
@@ -1364,7 +1364,7 @@ void factorytest_protocol_soft_test_decode(uint8_t submode,uint8_t testitem,uint
                 //获取原始数据\r
                 int16_t x,y;\r
 #ifdef TPTYPE_FT6X46\r
-                get_tp_info(&x,&y);\r
+                // get_tp_info(&x,&y);\r
 #endif\r
                 uint8_t databuf[5] = {0};\r
 \r