2025-06-21 13:50:24 +08:00
|
|
|
|
/*******************************************************************************
|
|
|
|
|
* the includes
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
#include "ud_66.h"
|
2025-06-21 17:19:31 +08:00
|
|
|
|
#include "Uart2CanDiagApp.h"
|
2025-06-21 13:50:24 +08:00
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
|
* the defines
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
|
* the typedefs
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2025-06-21 17:19:31 +08:00
|
|
|
|
CMD66_CFG,//配置pid,fid,rid,stmin
|
|
|
|
|
CMD66_TTreq,//TT – Transparent Transmission透明传输
|
2025-06-21 13:50:24 +08:00
|
|
|
|
CMD66_NUM,
|
|
|
|
|
} CMD66_type;
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
|
* the globals
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
|
* the const
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*******************************************************************************
|
|
|
|
|
* the functions
|
|
|
|
|
******************************************************************************/
|
2025-06-21 17:19:31 +08:00
|
|
|
|
static void ud66_cfg(uint8_t* data, uint16_t len);
|
2025-06-21 13:50:24 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-06-21 17:19:31 +08:00
|
|
|
|
void uartapp_cmd66(uint8_t* data, uint16_t len)
|
|
|
|
|
{
|
|
|
|
|
if (len < 1)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
CMD66_type subid = data[0];
|
|
|
|
|
switch (subid)
|
|
|
|
|
{
|
|
|
|
|
case CMD66_CFG:
|
|
|
|
|
|
|
|
|
|
ud66_cfg(data+1,len-1);
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static void ud66_cfg(uint8_t* data, uint16_t len)
|
|
|
|
|
{
|
|
|
|
|
//pid,fid,rid,stmin,fill
|
|
|
|
|
//2+2+2+1+rev1
|
|
|
|
|
if (len == 8)
|
|
|
|
|
{
|
|
|
|
|
uint16_t pid = (data[0]<<8) + data[1];
|
|
|
|
|
uint16_t fid = (data[2]<<8) + data[3];
|
|
|
|
|
uint16_t rid = (data[4]<<8) + data[5];
|
|
|
|
|
uint8_t stmin = data[6];
|
|
|
|
|
uint8_t fill = data[7];
|
|
|
|
|
U2CD_cfg(pid,fid,rid,stmin,fill);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|