Files
luban-lite/packages/artinchip/uds/UDSLogic/SID34_RequestDownload.c

58 lines
1.9 KiB
C
Raw Normal View History

2025-07-22 11:15:46 +08:00
/*
*
* SPDX-License-Identifier: Apache-2.0
*
*/
#include "SID34_RequestDownload.h"
#include "service_cfg.h"
#include "uds_def.h"
// 36 服务数据传输报文总大小
2025-10-21 13:59:50 +08:00
#define TOTAL_LEN_36 (512 + 2)
2025-07-22 11:15:46 +08:00
/******************************************************************************
* : bool_t service_34_check_len(const uint8_t* msg_buf, uint16_t msg_dlc)
* : 34
* : uint16_t msg_dlc --
* :
* : TRUE: ; FALSE:
* :
******************************************************************************/
2025-10-21 13:59:50 +08:00
bool_t service_34_check_len(const uint8_t *msg_buf, uint16_t msg_dlc)
2025-07-22 11:15:46 +08:00
{
2025-10-21 13:59:50 +08:00
bool_t ret = FALSE;
2025-07-22 11:15:46 +08:00
2025-10-21 13:59:50 +08:00
ret = TRUE;
2025-07-22 11:15:46 +08:00
2025-10-21 13:59:50 +08:00
return ret;
}
2025-07-22 11:15:46 +08:00
/******************************************************************************
* : void service_34_RequestDownload(const uint8_t* msg_buf, uint16_t msg_dlc)
* : 34 -
* : uint8_t* msg_buf --
    uint8_t msg_dlc --
* :
* :
* :
******************************************************************************/
2025-10-21 13:59:50 +08:00
uint32_t req_total_len = 0;
void service_34_RequestDownload(const uint8_t *msg_buf, uint16_t msg_dlc)
2025-07-22 11:15:46 +08:00
{
2025-10-21 13:59:50 +08:00
uint8_t rsp_buf[8];
req_total_len = (uint32_t)msg_buf[6] << 24 // 长度第3字节高位
| (uint32_t)msg_buf[7] << 16 | (uint32_t)msg_buf[8] << 8 |
(uint32_t)msg_buf[9]; // 长度第0字节低位
// 这里需要解析 34 服务报文
rsp_buf[0] = USD_GET_POSITIVE_RSP(SID_34);
rsp_buf[1] = 0x20;
rsp_buf[2] = (uint8_t)(TOTAL_LEN_36 >> 8);
rsp_buf[3] = (uint8_t)(TOTAL_LEN_36 >> 0);
uds_positive_rsp(rsp_buf, 4);
2025-07-22 11:15:46 +08:00
}
/****************EOF****************/