Browse Source

Merge branch 'master' of http://10.16.0.29:3000/ADPilot/modularization

yuchuli 1 month ago
parent
commit
1781ebe3b1

+ 73 - 0
src/apollo/apollolib/adchassis/.gitignore

@@ -0,0 +1,73 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+

+ 127 - 0
src/apollo/apollolib/adchassis/adchassis.cpp

@@ -0,0 +1,127 @@
+#include "adchassis.h"
+#include "decodechassis.h"
+
+
+//void CallBack(iv::chassis * pchassis)
+//{
+//    iv::chassis xchassis;
+//    xchassis.CopyFrom(*pchassis);
+
+//}
+
+
+Adchassis::Adchassis(chassisfun * pchassiscall,std::string strvehicletype)
+{
+    mpchassiscall = pchassiscall;
+
+    if(strncmp(strvehicletype.data(),"GE3",255) == 0)
+    {
+        mVehicleType = iv::GE3;
+    }
+
+    if(strncmp(strvehicletype.data(),"VV7",255) == 0)
+    {
+        mVehicleType = iv::VV7;
+    }
+
+    if(strncmp(strvehicletype.data(),"PROBLUE",255) == 0)
+    {
+        mVehicleType = iv::PROBLUE;
+    }
+
+    if(strncmp(strvehicletype.data(),"MIDCAR",255) == 0)
+    {
+        mVehicleType = iv::MIDCAR;
+    }
+
+    if(strncmp(strvehicletype.data(),"MIDBUS",255) == 0)
+    {
+        mVehicleType = iv::MIDBUS;
+    }
+    if(strncmp(strvehicletype.data(),"HAPO",255) == 0)
+    {
+        mVehicleType = iv::HAPO;
+    }
+ if(strncmp(strvehicletype.data(),"YUHESEN",255) == 0)
+    {
+        mVehicleType = iv::YUHESEN;
+    }
+   if(strncmp(strvehicletype.data(),"SHENLAN",255) == 0)
+    {
+        mVehicleType = iv::SHENLAN;
+    }
+   if(strncmp(strvehicletype.data(),"SHENLAN_CANFD",255) == 0)
+    {
+        mVehicleType = iv::SHENLAN_CANFD;
+    }
+
+   if(strncmp(strvehicletype.data(),"HUNTER",255) == 0)
+    {
+        mVehicleType = iv::HUNTER;
+    }
+
+   if(strncmp(strvehicletype.data(),"SterraES",255) == 0)
+    {
+        mVehicleType = iv::STERRAES;
+    }
+   if(strncmp(strvehicletype.data(),"SHENLAN_S05",255) == 0)
+    {
+        mVehicleType = iv::SHENLAN_S05;
+    }
+   if(strncmp(strvehicletype.data(),"CAHNGAN_A07",255) == 0)
+    {
+        mVehicleType = iv::CHANGAN_A07;
+    }
+
+}
+
+void Adchassis::ProcCANMsg(iv::can::canmsg & xmsg)
+{
+    int nRtn = 0;
+    switch (mVehicleType) {
+    case iv::GE3:
+        nRtn = ProcGE3Chassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::VV7:
+        nRtn = ProcVV7Chassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::PROBLUE:
+        nRtn = ProcPROBLUEChassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::MIDCAR:
+        nRtn = ProcMIDCARChassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::MIDBUS:
+        nRtn = ProcMIDBUSChassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::HAPO:
+        nRtn = ProcHAPOChassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::YUHESEN:
+        nRtn = ProcYUHESENChassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::SHENLAN:
+        nRtn = ProcShenLanChassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::SHENLAN_CANFD:
+        nRtn = ProcShenLanCANFDChassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::HUNTER:
+        nRtn = ProcHunterChassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::STERRAES:
+        nRtn = ProcSterraesChassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::SHENLAN_S05:
+        nRtn = ProcShenLanS05Chassis((void *)mpchassiscall,&xmsg);
+        break;
+    case iv::CHANGAN_A07:
+        nRtn = ProcChangAnA07Chassis((void *)mpchassiscall,&xmsg);
+        break;
+    default:
+        nRtn = -100;
+        break;
+    }
+
+    if(nRtn == -100)std::cout<<" No This Vehicle Type. "<<std::endl;
+}

+ 33 - 0
src/apollo/apollolib/adchassis/adchassis.h

@@ -0,0 +1,33 @@
+#ifndef ADCHASSIS_H
+#define ADCHASSIS_H
+#include <functional>
+
+#include "chassis.pb.h"
+#include "canmsg.pb.h"
+
+#ifndef ADCHASSISFUN
+#define ADCHASSISFUN
+typedef std::function<void(iv::chassis *pchassis)> chassisfun;
+#endif
+
+namespace  iv {
+
+enum VehicleTypeDef {GE3,VV7,MIDCAR,PROBLUE,MIDBUS,HAPO,UNKNOWN, YUHESEN,SHENLAN,SHENLAN_CANFD,HUNTER,STERRAES,SHENLAN_S05,CHANGAN_A07};  //车辆类型
+
+
+}
+
+class  Adchassis
+{
+public:
+    Adchassis(chassisfun * pchassiscall,std::string strvehicletype);
+
+    void ProcCANMsg(iv::can::canmsg &xmsg);
+
+private:
+    chassisfun *mpchassiscall;
+
+    iv::VehicleTypeDef mVehicleType = iv::UNKNOWN;
+};
+
+#endif // ADCHASSIS_H

+ 41 - 0
src/apollo/apollolib/adchassis/adchassis.pro

@@ -0,0 +1,41 @@
+CONFIG -= qt
+
+TEMPLATE = lib
+DEFINES += ADCHASSIS_LIBRARY
+
+CONFIG += c++11
+
+CONFIG += plugin
+
+# The following define makes your compiler emit warnings if you use
+# any Qt feature that has been marked deprecated (the exact warnings
+# depend on your compiler). Please consult the documentation of the
+# deprecated API in order to know how to port your code away from it.
+DEFINES += QT_DEPRECATED_WARNINGS
+
+# You can also make your code fail to compile if it uses deprecated APIs.
+# In order to do so, uncomment the following line.
+# You can also select to disable deprecated APIs only up to a certain version of Qt.
+#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
+
+SOURCES += \
+    adchassis.cpp \
+    canmsg.pb.cc \
+    canraw.pb.cc \
+    chassis.pb.cc \
+    decodechassis.cpp \
+    shenlan.c
+
+HEADERS += \
+    adchassis.h \
+    canmsg.pb.h \
+    canraw.pb.h \
+    chassis.pb.h \
+    decodechassis.h \
+    shenlan.h
+
+# Default rules for deployment.
+unix {
+    target.path = /usr/lib
+}
+!isEmpty(target.path): INSTALLS += target

+ 14 - 0
src/apollo/apollolib/adchassis/canmsg.proto

@@ -0,0 +1,14 @@
+
+syntax = "proto2";
+
+package iv.can;
+
+import "canraw.proto";
+
+message canmsg
+{
+ required uint32 index = 1;
+ required uint32 channel = 2;
+ repeated canraw rawmsg = 3;
+ optional int64 mstime = 4;
+};

+ 13 - 0
src/apollo/apollolib/adchassis/canraw.proto

@@ -0,0 +1,13 @@
+syntax = "proto2";
+
+package iv.can;
+
+message canraw
+{
+ required uint32 id = 1;
+ required bool bExt = 2;
+ required bool bRemote = 3;
+ required uint32 len = 4;
+ required bytes data = 5;
+ optional int64 rectime = 6;  //unit s 20251028
+};

+ 33 - 0
src/apollo/apollolib/adchassis/chassis.proto

@@ -0,0 +1,33 @@
+syntax = "proto2";
+
+package iv;
+
+message chassis
+{
+  optional int64 time = 1; //ns
+  optional int32 EPSMode = 2  [default = 0]; //0 idle 1 Manual 2 Auto
+  optional int32 EPBFault = 3 [default = 0];  //0 No 1 Have Fault
+  optional int32 DriveMode = 4;      //0 Manual 1 Auto
+  optional int32 Shift = 5;  //0 N  1 D   2 R  3 P  hapo:1p2r3n4d   cheerysterraes 1 P 2 r 3 N 4 D
+  optional int32 AEBAvailable = 6;
+  optional int32 CDDAvailable = 7;
+  optional int32 angle_feedback = 8;
+  optional float torque = 9;
+  optional float vel = 10;   //km/h
+  optional float accstep = 11;
+  optional float soc = 12;
+  optional float brake_feedback = 13;
+  optional int32 EPB_feedback = 14;
+  optional int32 EmergencyStop_feedback = 15;
+  optional int32 brakelight_feedback = 16;
+  optional float range_feedback = 17;
+  optional int32 drivectrltype_feedback = 18;
+  optional int32 brakectrltype_feedback = 19;
+  optional int32 epsctrltype_feedback = 20;
+  optional float frontleftwheel_feedback = 21;
+  optional float frontrightwheel_feedback = 22;
+  optional float rearleftwheel_feedback = 23;
+  optional float rearrightwheel_feedback = 24;
+  optional float engine_speed = 25;
+  
+};

+ 951 - 0
src/apollo/apollolib/adchassis/decodechassis.cpp

@@ -0,0 +1,951 @@
+
+#include "decodechassis.h"
+#include <iostream>
+#include <chrono>
+
+extern "C"
+{
+    #include "shenlan.h"
+}
+
+
+
+void PrintCANRaw(const iv::can::canraw * praw )
+{
+    char strout[512];
+    int ndatalen = praw->len();
+    int i;
+    snprintf(strout,512,"%ld id: %02X data: ",std::chrono::system_clock::now().time_since_epoch().count()/1000000, praw->id());
+    char * pdata = new char[8];
+    if(ndatalen>0)pdata = new char[ndatalen];
+    memcpy(pdata,praw->data().data(),ndatalen);
+    for(i=0;i<ndatalen;i++)
+    {
+        char strtem[10];
+        snprintf(strtem,10,"%02X ",pdata[i]);
+        strncat(strout,strtem,512);
+    }
+    std::cout<<strout<<std::endl;
+    delete  pdata;
+
+}
+
+/**
+  * @brief ShareChassis
+  * Share Chassis State
+  * @param pa                pointer to module communication handle
+  * @param pchassis          pointer to chassis state
+**/
+static void ShareChassis(void * pa,iv::chassis  * pchassis)
+{
+    char * str;
+    int ndatasize = pchassis->ByteSize();
+    str = new char[ndatasize];
+    std::shared_ptr<char> pstr;
+    pstr.reset(str);
+    if(!pchassis->SerializeToArray(str,ndatasize))
+    {
+        std::cout<<"ShareChassis Error."<<std::endl;
+        return;
+    }
+
+    chassisfun * p = (chassisfun *) pa;
+    (*p)(pchassis);
+
+}
+
+/**
+  * @brief ProcGE3Chassis
+  * Process GE3 Chassis State
+  * @param pa                pointer to module communication handle
+  * @param pmsg              pointer to CAN Message
+  * @retval                  0 No Chassis Message   1 Have Chassis Message And Update
+**/
+int ProcGE3Chassis(void * pa, iv::can::canmsg * pmsg)
+{
+    int i;
+    int nRtn = 0;
+
+//    mygivlog = new iv::Ivlog("chassis");
+ //   mygivfault = new iv::Ivfault("chassis");
+
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+        const iv::can::canraw * praw = &(pmsg->rawmsg(i));
+        unsigned char data[8];
+        if(praw->id() == 0x13)
+        {
+            std::cout<<"receive chassis."<<std::endl;
+            memcpy(data,praw->data().data(),8);
+            unsigned char EPSMode,EPBFault,DriveMode,Shift,AEBAvailable,CDDAvailable;
+            unsigned short angle_feedback;
+
+            EPSMode = (data[1] & 0x60)>>5;     //EPS_mode,00:失效;01:人工;10自动
+            EPBFault = (data[1] & 0x10)>>4;    //EPB故障状态,0:无故障  1:故障
+            DriveMode = (data[1] & 0x0C)>>2;   //驾驶模式,1:Manual  3:Auto
+            Shift = data[1] & 0x03;   //Gear,00N,01D,10R,11p
+
+            angle_feedback = data[2] * 256 + data[3];
+            angle_feedback = angle_feedback * 0.1 - 780;
+
+
+            //制动的两个状态为反馈,AEBAvailable 和CDDAvailable,这两个都为1的时候制动有效,有一个为0,制动失效
+            AEBAvailable = data[4] & 0x01; //0=Not available,1=Available
+            CDDAvailable = (data[4] & 0x02) >> 1;  //0=Not available,1=Available
+
+            iv::chassis xchassis;
+
+            //xchassis.set_epsmode(EPSMode);
+            if(EPSMode == 0)
+            {
+                std::cout<<"eps mode"<<std::endl;
+ //               mygivlog->warn("chassis"," Warning!!  NOW GE3 chassis triggers a epsmode!!");
+            }
+            if(EPSMode == 1)
+            {
+//                mygivlog->info("chassis","OK!!  NOW GE3 chassis epsmode is Manual!");
+            }
+            if(EPSMode == 2)
+            {
+  //              mygivlog->info("chassis","OK!! NOW GE3 chassis epsmode is Auto!");
+            }
+
+//            xchassis.set_epsmode(2);//为了不退出自动驾驶,经讨论,在这个地方写定值。
+
+            xchassis.set_epsmode(EPSMode);
+            xchassis.set_epbfault(EPBFault);
+            xchassis.set_drivemode(DriveMode);
+            xchassis.set_shift(Shift);
+
+            xchassis.set_aebavailable(AEBAvailable);
+            xchassis.set_cddavailable(CDDAvailable);
+            xchassis.set_angle_feedback(angle_feedback);
+
+            ShareChassis(pa,&xchassis);
+            nRtn = 1;
+        }
+    }
+
+    return nRtn;
+
+
+}
+
+
+//struct Command_Response_Bit_0x14
+//{
+//    unsigned char feedback_angle_H;
+//    unsigned char feedback_angle_L;
+//    unsigned char feedback_angle_speed;
+//    unsigned char feedback_torque;
+//    unsigned char feedback_speed_H;
+//    unsigned char feedback_speed_L;
+//    unsigned char feedback_battery_power;
+//    unsigned char feedback_door_state:2;
+//    unsigned char feedback_EPB_state:1;
+//    unsigned char feedback_reserved:3;
+//    unsigned char feedback_dangwei:2;
+//};
+
+
+//ServiceCarStatus.torque_st = ServiceControlStatus.command_reponse_0x14.bit.feedback_torque;
+//ServiceCarStatus.dangwei_st = ServiceControlStatus.command_reponse_0x14.bit.feedback_dangwei;
+//ServiceCarStatus.battery_st = ServiceControlStatus.command_reponse_0x14.bit.feedback_battery_power*0.4;
+
+//ServiceCarStatus.vehSpeed_st= (ServiceControlStatus.command_reponse_0x14.bit.feedback_speed_H*256+
+//                              ServiceControlStatus.command_reponse_0x14.bit.feedback_speed_L)*0.05625;
+
+int ProcPROBLUEChassis(void * pa, iv::can::canmsg * pmsg)
+{
+    int i;
+    int nRtn = 0;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        const iv::can::canraw * praw = &(pmsg->rawmsg(i));
+        unsigned char data[8];
+        if(praw->id() == 0x14)
+        {
+            memcpy(data,praw->data().data(),8);
+            double torque,dangwei,soc,vehspeed;
+            torque = data[3];
+            dangwei = data[7]>>6;
+            soc = data[6]; soc = soc *0.4;
+            vehspeed = (data[4]*256.0 + data[5])*0.05625;
+
+            iv::chassis xchassis;
+            xchassis.set_torque(torque);
+            xchassis.set_shift(dangwei);
+            xchassis.set_soc(soc);
+            xchassis.set_vel(vehspeed);
+
+            ShareChassis(pa,&xchassis);
+            nRtn = 1;
+        }
+    }
+
+    return nRtn;
+}
+
+int ProcMIDCARChassis(void * pa, iv::can::canmsg * pmsg)
+{
+    int i;
+    int nRtn = 0;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        const iv::can::canraw * praw = &(pmsg->rawmsg(i));
+        unsigned char data[8];
+        if(praw->id() == 0x14)
+        {
+            memcpy(data,praw->data().data(),8);
+            double torque,dangwei,soc,vehspeed;
+            torque = data[3];
+            dangwei = data[7]>>6;
+            soc = data[6]; soc = soc *0.4;
+            vehspeed = (data[4]*256.0 + data[5])*0.05625;
+
+            iv::chassis xchassis;
+            xchassis.set_torque(torque);
+            xchassis.set_shift(dangwei);
+            xchassis.set_soc(soc);
+            xchassis.set_vel(vehspeed);
+
+            ShareChassis(pa,&xchassis);
+            nRtn = 1;
+        }
+        else if(praw->id() == 0xC2)
+        {
+            memcpy(data,praw->data().data(),8);
+            float soc;
+            soc = data[0];
+
+            iv::chassis xchassis;
+            xchassis.set_soc(soc);
+
+            ShareChassis(pa,&xchassis);
+            nRtn = 1;
+        }
+    }
+
+    return nRtn;
+
+}
+
+int ProcVV7Chassis(void * pa, iv::can::canmsg * pmsg)
+{
+    int i;
+    int nRtn = 0;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        const iv::can::canraw * praw = &(pmsg->rawmsg(i));
+        unsigned char data[8];
+        if(praw->id() == 0x13)
+        {
+            memcpy(data,praw->data().data(),8);
+            double engine_speed;
+
+            engine_speed = (data[5]*256.0 + data[6])*0.125;
+
+            iv::chassis xchassis;
+            xchassis.set_engine_speed(engine_speed);
+
+
+            ShareChassis(pa,&xchassis);
+            nRtn = 1;
+        }
+    }
+
+    return nRtn;
+
+}
+
+
+inline float gettwomotovalue(unsigned char * strdata,float fratio,float foff)
+{
+    int a,b;
+    a = strdata[0];
+    b = strdata[1];
+    float fvalue = a*256+ b;
+    fvalue = fvalue * fratio + foff;
+    return fvalue;
+}
+
+inline float getonevalue(unsigned char * strdata,float fratio,float foff)
+{
+    int a;
+    a = strdata[0];
+    float fvalue = a;
+    fvalue = fvalue * fratio + foff;
+ //   std::cout<<"hapo torque: "<<fvalue<<std::endl;
+    return fvalue;
+}
+
+
+static bool  ghave0x13= false;
+static bool  ghave0x14= false;
+static bool  ghave0x15= false;
+int ProcMIDBUSChassis(void * pa, iv::can::canmsg * pmsg)
+{
+    int i;
+    int nRtn = 0;
+    static iv::chassis xchassis;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        const iv::can::canraw * praw = &(pmsg->rawmsg(i));
+        unsigned char data[8];
+        memcpy(data,praw->data().data(),8);
+        if(praw->id() == 0x13)
+        {           
+            xchassis.set_angle_feedback(gettwomotovalue(data+0,0.1,-870));
+            xchassis.set_torque(getonevalue(data+2,1.0,0));
+            xchassis.set_brake_feedback(getonevalue(data+3,0.4,0));
+            xchassis.set_vel(gettwomotovalue(data+4,0.05625,0));
+            xchassis.set_epb_feedback(data[6]&0x03);
+            xchassis.set_shift((data[6]&0xf0)>>4);
+            xchassis.set_drivemode(data[7]&0x01);
+            xchassis.set_emergencystop_feedback((data[7]&06)>>1);
+            xchassis.set_brakelight_feedback((data[7]&0x08)>>3);
+
+
+
+            ghave0x13 = true;
+
+        }
+        if(praw->id() == 0x14)
+        {
+            xchassis.set_range_feedback(data[0]);
+            xchassis.set_soc(getonevalue(data+1,0.4,0));
+            xchassis.set_drivectrltype_feedback(data[5]&0x0f);
+            xchassis.set_brakectrltype_feedback((data[5]&0xf0)>>4);
+            xchassis.set_epsctrltype_feedback(data[6]&0x0f);
+            ghave0x14 = true;
+        }
+        if(praw->id() == 0x15)
+        {
+
+            xchassis.set_frontleftwheel_feedback(gettwomotovalue(data,0.05625,0));
+            xchassis.set_frontrightwheel_feedback(gettwomotovalue(data+2,0.05625,0));
+            xchassis.set_rearleftwheel_feedback(gettwomotovalue(data+4,0.05625,0));
+            xchassis.set_rearrightwheel_feedback(gettwomotovalue(data+6,0.05625,0));
+            ghave0x15 = true;
+        }
+
+        if(ghave0x13&&ghave0x14&&ghave0x15)
+        {
+            ghave0x13 = false;
+            ghave0x14 = false;
+            ghave0x15 = false;
+            ShareChassis(pa,&xchassis);
+            nRtn = 1;
+        }
+    }
+
+    return nRtn;
+
+}
+
+int ProcHAPOChassis(void * pa, iv::can::canmsg * pmsg)
+{
+    int i;
+    int nRtn = 0;
+    static iv::chassis xchassis;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        const iv::can::canraw * praw = &(pmsg->rawmsg(i));
+        unsigned char data[8];
+        memcpy(data,praw->data().data(),8);
+        if(praw->id() == 0x13)
+        {
+            xchassis.set_angle_feedback(gettwomotovalue(data+0,0.1,-870));
+            xchassis.set_torque(getonevalue(data+2,0.4,0));
+            xchassis.set_brake_feedback(getonevalue(data+3,0.4,0));
+            xchassis.set_vel(gettwomotovalue(data+4,0.05625,0));
+            xchassis.set_epb_feedback(data[6]&0x03);
+            xchassis.set_shift((data[6]&0xf0)>>4);
+            xchassis.set_drivemode(data[7]&0x01);
+            xchassis.set_emergencystop_feedback((data[7]&06)>>1);
+            xchassis.set_brakelight_feedback((data[7]&0x08)>>3);
+
+            std::cout<<"torque is "<<xchassis.torque()<<std::endl;
+            ghave0x13 = true;
+
+        }
+        if(praw->id() == 0x14)
+        {
+            xchassis.set_range_feedback(data[0]);
+            xchassis.set_soc(getonevalue(data+1,0.4,0));
+            xchassis.set_drivectrltype_feedback(data[5]&0x0f);
+            xchassis.set_brakectrltype_feedback((data[5]&0xf0)>>4);
+            xchassis.set_epsctrltype_feedback(data[6]&0x0f);
+            ghave0x14 = true;
+        }
+        if(praw->id() == 0x15)
+        {
+
+            xchassis.set_frontleftwheel_feedback(gettwomotovalue(data,0.05625,0));
+            xchassis.set_frontrightwheel_feedback(gettwomotovalue(data+2,0.05625,0));
+            xchassis.set_rearleftwheel_feedback(gettwomotovalue(data+4,0.05625,0));
+            xchassis.set_rearrightwheel_feedback(gettwomotovalue(data+6,0.05625,0));
+            ghave0x15 = true;
+        }
+
+        if(ghave0x13&&ghave0x14&&ghave0x15)
+        {
+            ghave0x13 = false;
+            ghave0x14 = false;
+            ghave0x15 = false;
+            ShareChassis(pa,&xchassis);
+            nRtn = 1;
+        }
+    }
+
+    return nRtn;
+
+}
+
+
+int ProcYUHESENChassis(void * pa, iv::can::canmsg * pmsg)
+{
+    (void)pa;
+    (void)pmsg;
+//    int i;
+    int nRtn = 0;
+
+
+    return nRtn;
+
+}
+
+int ProcShenLanChassis(void *pa, iv::can::canmsg *pmsg)
+{
+    int i;
+    static iv::chassis xchassis;
+    static bool bHave0x147 = false;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        const iv::can::canraw * praw = &(pmsg->rawmsg(i));
+//        unsigned char data[8];
+//        memcpy(data,praw->data().data(),8);
+        uint64_t rawdata;
+        memcpy(&rawdata,praw->data().data(),8);
+        can_obj_shenlan_h_t canobj;
+        unpack_message(&canobj, praw->id(),rawdata,8,0);
+        if(praw->id() == 0x147)
+        {
+            double vehspeed,wheelangle;
+            decode_can_0x147_EspVehSpd(&canobj,&vehspeed);
+            decode_can_0x147_EpsSasSteerAg(&canobj,&wheelangle);
+            xchassis.set_vel(static_cast<float>(vehspeed));
+            bHave0x147 = true;
+        }
+        if(praw->id() == 0x14A)
+        {
+
+        }
+        if(praw->id() == 0x250)
+        {
+
+
+        }
+        if(praw->id() == 0x358)
+        {
+
+
+        }
+        if(praw->id() == 0x3AA)
+        {
+
+
+        }
+
+        if(bHave0x147)
+        {
+            bHave0x147 = false;
+            ShareChassis(pa,&xchassis);
+            std::cout<<"veh: "<<xchassis.vel()<<std::endl;
+        }
+
+//        if(ghave0x13&&ghave0x14&&ghave0x15)
+//        {
+//            ghave0x13 = false;
+//            ghave0x14 = false;
+//            ghave0x15 = false;
+//            ShareChassis(pa,&xchassis);
+//            nRtn = 1;
+//        }
+    }
+
+
+    return 0;
+}
+
+int ProcShenLanCANFDChassis(void *pa, iv::can::canmsg *pmsg)
+{
+    int i;
+    static iv::chassis xchassis;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        iv::can::canraw * praw =  pmsg->mutable_rawmsg(i);//&(pmsg->rawmsg(i));
+ //       qDebug("id: % 0x2x",praw->id());
+//        unsigned char data[8];
+//        memcpy(data,praw->data().data(),8);
+        if(praw->id() == 0x1CC)
+        {
+            unsigned char byte[64];
+            double vehspeed;
+            if(praw->len() == 64)
+            {
+                memcpy(byte,praw->data().data(),64);
+                unsigned int value;
+                value = byte[12]&0x1F;
+                value = (value<<8) +  static_cast<unsigned int >( byte[13]);
+                vehspeed = static_cast<double>(value) * 0.05625;
+
+                value = byte[2]&0x1F;
+                value = (value<<8) +  static_cast<unsigned int >( byte[3]);
+                double frlvehspeed = static_cast<double>(value) * 0.05625;
+
+                value = byte[0]&0x1F;
+                value = (value<<8) +  static_cast<unsigned int >( byte[1]);
+                double frrvehspeed = static_cast<double>(value) * 0.05625;
+
+                vehspeed = (frlvehspeed + frrvehspeed)/2.0;
+
+                xchassis.set_vel(static_cast<float>(vehspeed));
+                xchassis.set_time(std::chrono::system_clock::now().time_since_epoch().count());
+
+                ShareChassis(pa,&xchassis);
+  //              xchassis.clear_angle_feedback();
+  //              std::cout<<"veh: "<<xchassis.vel()<<std::endl;
+            }
+            else
+            {
+                std::cout<<" 1CC not 64 bytes. 1CC bytes: "<<praw->len()<<std::endl;
+            }
+        }
+        if(praw->id() == 0x18a)
+        {
+            unsigned char byte[64];
+            double ang;
+            if(praw->len() == 64)
+            {
+                memcpy(byte,praw->data().data(),64);
+                unsigned int value;
+                value = byte[0]&0xFF;
+                value = (value<<8) +  static_cast<unsigned int >( byte[1]);
+                if(value<32767)
+                    ang = static_cast<double>(value) * 0.1;
+                else
+                    ang=static_cast<double>(value) * 0.1-65536*0.1;
+
+                xchassis.set_angle_feedback(static_cast<float>(ang));
+     //           ShareChassis(pa,&xchassis);
+                if(ang<30)std::cout<<"ang: "<<xchassis.angle_feedback()<<std::endl;
+            }
+            else
+            {
+                std::cout<<" 1CC not 64 bytes. 1CC bytes: "<<praw->len()<<std::endl;
+            }
+        }
+
+    }
+
+
+    return 0;
+}
+
+int ProcSterraesChassis(void *pa, iv::can::canmsg *pmsg){
+    int i;
+    static iv::chassis xchassis;
+    static int nprint = 0;
+    static double facc;
+    static std::vector<double> xvectortime;
+    static std::vector<double> xvectorvel;
+    const double fmaxtimediff = 45;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        iv::can::canraw * praw =  pmsg->mutable_rawmsg(i);//&(pmsg->rawmsg(i));
+
+        if(praw->id() == 0x98)
+        {
+            unsigned char byte[24];
+            double vehspeed;
+            if(praw->len() == 24)
+            {
+                memcpy(byte,praw->data().data(),24);
+                unsigned int value;
+                value = byte[2]&0xFF;
+                value = (value<<8) +  static_cast<unsigned int >( byte[3]);
+                value = value>>3;
+                vehspeed = static_cast<double>(value) * 0.0625;
+
+                xchassis.set_vel(static_cast<float>(vehspeed));  //km/s
+                xvectortime.push_back(praw->rectime());
+                xvectorvel.push_back(vehspeed/3.6);
+                if(xvectortime.size()>1)
+                {
+                    double timediff = xvectortime[xvectortime.size() -1] - xvectortime[0];
+                    if(timediff<=0)
+                    {
+                        std::cout<<" system time change. so clear vector."<<std::endl;
+                        xvectortime.clear();
+                        xvectorvel.clear();
+                    }
+                    else
+                    {
+                        if(timediff> fmaxtimediff)
+                        {
+                            facc = (xvectorvel[xvectorvel.size() -1] - xvectorvel[0])/timediff;
+                            while(xvectortime.size()>2)
+                            {
+                                double fdiff = xvectortime[xvectortime.size() -1] - xvectortime[0];
+                                if(fdiff> fmaxtimediff)
+                                {
+                                    xvectortime.erase(xvectortime.begin());
+                                    xvectorvel.erase(xvectorvel.begin());
+                                }
+                                else
+                                {
+                                    break;
+                                }
+                            }
+                        }
+                    }
+                }
+                xchassis.set_accstep(facc);
+                xchassis.set_time(std::chrono::system_clock::now().time_since_epoch().count());
+
+                ShareChassis(pa,&xchassis);
+                //              xchassis.clear_angle_feedback();
+                //              std::cout<<"veh: "<<xchassis.vel()<<std::endl;
+            }
+            else
+            {
+                std::cout<<" 0x98 not 64 bytes. 0x98 bytes: "<<praw->len()<<std::endl;
+            }
+        }
+        if(praw->id() == 0x132)
+        {
+            unsigned char byte[8];
+            double ang;
+            if(praw->len() == 8)
+            {
+                memcpy(byte,praw->data().data(),8);
+                unsigned int value;
+                value = byte[2]&0xFF;
+                value = (value<<8) +  static_cast<unsigned int >( byte[3]);
+                ang = static_cast<double>(value) * 0.0625 - 2048.0;
+
+                xchassis.set_angle_feedback(static_cast<float>(ang));
+
+                //           ShareChassis(pa,&xchassis);
+  //              if(ang<30)std::cout<<"ang: "<<xchassis.angle_feedback()<<std::endl;
+            }
+            else
+            {
+                std::cout<<" 0x132 not 64 bytes. 0x132 bytes: "<<praw->len()<<std::endl;
+            }
+        }
+
+        if(praw->id() == 0x38)
+        {
+            unsigned char byte[8];
+            int ngear;
+            if(praw->len() == 16)
+            {
+                memcpy(byte,praw->data().data(),8);
+                unsigned int value;
+                value = byte[2]&0xFF;
+                value = value>>5;
+                ngear = value;
+                xchassis.set_shift(ngear);
+                if(nprint>=100){
+                    std::cout<<std::chrono::system_clock::now().time_since_epoch().count()<< " gear: "<<xchassis.shift()<< " vel: "<<xchassis.vel()<<" angle: "<<xchassis.angle_feedback()<< std::endl;
+                    nprint = 0;
+                }
+
+            }
+        }
+
+    }
+
+    nprint++;
+    return 0;
+}
+
+int ProcHunterChassis(void *pa, iv::can::canmsg *pmsg)
+{
+    int i;
+    static iv::chassis xchassis;
+    static bool bHave0x221 = false;
+    static bool bHave0x361 = false;
+    float fsoc = 0.0;
+    float fsoh = 0.0;
+    float fbatv = 0.0;
+    float fbati = 0.0;
+    float fbatt = 0.0;
+    float fmileage_left = 0.0;
+    float fmileage_right = 0.0;
+    double fwheelangle_feedback = 0.0;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        const iv::can::canraw * praw = &(pmsg->rawmsg(i));
+//        unsigned char data[8];
+//        memcpy(data,praw->data().data(),8);
+        if(praw->id() == 0x221)
+        {
+            unsigned char vdata[2];
+            memcpy(&vdata,praw->data().data(),2);
+            unsigned char vswap[2];
+            vswap[0] = vdata[1];
+            vswap[1] = vdata[0];
+            short svalue;
+            memcpy(&svalue,vswap,2);
+            double vehspeed =  svalue;
+            vehspeed = vehspeed * 0.001 *3.6;
+
+            memcpy(&vdata,praw->data().data() + 6,2);
+            vswap[0] = vdata[1];
+            vswap[1] = vdata[0];
+            memcpy(&svalue,vswap,2);
+            fwheelangle_feedback =  svalue;
+            fwheelangle_feedback = fwheelangle_feedback * 0.001;
+
+
+            xchassis.set_vel(static_cast<float>(vehspeed));
+            xchassis.set_angle_feedback(fwheelangle_feedback);
+            bHave0x221 = true;
+        }
+        if(praw->id() == 0x361)
+        {
+            unsigned char vdata[8];
+            memcpy(&vdata,praw->data().data(),8);
+ //           std::cout<<" vdata "<<(int)vdata[0]<<" "<<(int)vdata[1]<<" "<<(int)vdata[2]<<" "<<(int)vdata[3]<<" "<<std::endl;
+            fsoc = vdata[0];
+            memcpy(&vdata,praw->data().data() + 1,1);
+            fsoh = vdata[0];
+            memcpy(&vdata,praw->data().data()+2,2);
+            double fvh = vdata[0];
+            double fvl = vdata[1];
+            fbatv = (fvh * 256 + fvl) * 0.01f;
+
+            memcpy(&vdata,praw->data().data()+4,2);
+            unsigned char vswap[2];
+            vswap[0] = vdata[1];
+            vswap[1] = vdata[0];
+            unsigned short svalue;
+            memcpy(&svalue,vswap,2);
+            fbati = svalue;
+            fbati = fbati * 0.1f;
+
+            memcpy(&vdata,praw->data().data()+6,2);
+            vswap[0] = vdata[1];
+            vswap[1] = vdata[0];
+            memcpy(&svalue,vswap,2);
+            fbatt = svalue;
+            fbatt = fbatt * 0.1f;
+
+            bHave0x361 = true;
+        }
+        if(praw->id() == 0x311)
+        {
+            unsigned char vdata[4];
+            memcpy(&vdata,praw->data().data(),4);
+            unsigned char vswap[4];
+            vswap[0] = vdata[3];
+            vswap[1] = vdata[2];
+            vswap[2] = vdata[1];
+            vswap[3] = vdata[0];
+            int mil_left;
+            memcpy(&mil_left,vswap,4);
+            fmileage_left = mil_left;
+            fmileage_left = fmileage_left * 0.001f;
+
+            memcpy(&vdata,praw->data().data(),4);
+            vswap[0] = vdata[3];
+            vswap[1] = vdata[2];
+            vswap[2] = vdata[1];
+            vswap[3] = vdata[0];
+            int mil_right;
+            memcpy(&mil_right,vswap,4);
+            fmileage_right = mil_right;
+            fmileage_right = fmileage_right * 0.001f;
+        }
+        if(praw->id() == 0x358)
+        {
+
+
+        }
+        if(praw->id() == 0x3AA)
+        {
+
+
+        }
+
+        if(bHave0x221 && bHave0x361)
+        {
+            bHave0x221 = false;
+            bHave0x361 = false;
+            ShareChassis(pa,&xchassis);
+
+            std::cout<<"veh: "<<xchassis.vel()<<" wheel: "<<fwheelangle_feedback<<" soc: "<<fsoc<<" soh:"<<fsoh<< std::endl;
+            std::cout<<"bat v:"<<fbatv<<" i: "<<fbati<<" Temp:"<<fbatt<<" mil left:"<<fmileage_left<<" right: "<<fmileage_right<<std::endl;
+        }
+
+//        if(ghave0x13&&ghave0x14&&ghave0x15)
+//        {
+//            ghave0x13 = false;
+//            ghave0x14 = false;
+//            ghave0x15 = false;
+//            ShareChassis(pa,&xchassis);
+//            nRtn = 1;
+//        }
+    }
+
+
+    return 0;
+}
+
+int ProcShenLanS05Chassis(void * pa,iv::can::canmsg * pmsg)
+{
+    int i;
+    static iv::chassis xchassis;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        iv::can::canraw * praw =  pmsg->mutable_rawmsg(i);//&(pmsg->rawmsg(i));
+        //       qDebug("id: % 0x2x",praw->id());
+        //        unsigned char data[8];
+        //        memcpy(data,praw->data().data(),8);
+        if(praw->id() == 0x217)
+        {
+            unsigned char byte[64];
+            double vehspeed;
+            if(praw->len() == 64)
+            {
+                memcpy(byte,praw->data().data(),64);
+                unsigned int value;
+                value = byte[12]&0x1F;
+                value = (value<<8) +  static_cast<unsigned int >( byte[13]);
+                vehspeed = static_cast<double>(value) * 0.05625;
+
+
+                xchassis.set_vel(static_cast<float>(vehspeed));
+                xchassis.set_time(std::chrono::system_clock::now().time_since_epoch().count());
+
+                ShareChassis(pa,&xchassis);
+                //              xchassis.clear_angle_feedback();
+                //              std::cout<<"veh: "<<xchassis.vel()<<std::endl;
+            }
+            else
+            {
+                std::cout<<" 217 not 64 bytes. 217 bytes: "<<praw->len()<<std::endl;
+            }
+        }
+        if(praw->id() == 0x204)
+        {
+            unsigned char byte[64];
+            double ang;
+            if(praw->len() == 64)
+            {
+                memcpy(byte,praw->data().data(),64);
+                unsigned int value;
+                value = byte[8]&0xFF;
+                value = (value<<8) +  static_cast<unsigned int >( byte[9]);
+                if(value<32767)
+                    ang = static_cast<double>(value) * 0.1;
+                else
+                    ang=static_cast<double>(value) * 0.1-65536*0.1;
+
+                xchassis.set_angle_feedback(static_cast<float>(ang));
+                //           ShareChassis(pa,&xchassis);
+  //              if(ang<30)std::cout<<"ang: "<<xchassis.angle_feedback()<<std::endl;
+            }
+            else
+            {
+                std::cout<<" 204 not 64 bytes. 204 bytes: "<<praw->len()<<std::endl;
+            }
+        }
+
+    }
+
+
+    return 0;
+}
+
+int ProcChangAnA07Chassis(void * pa,iv::can::canmsg * pmsg)
+{
+    int i;
+    static iv::chassis xchassis;
+    for(i=0;i<pmsg->rawmsg_size();i++)
+    {
+
+        iv::can::canraw * praw =  pmsg->mutable_rawmsg(i);//&(pmsg->rawmsg(i));
+        //       qDebug("id: % 0x2x",praw->id());
+        //        unsigned char data[8];
+        //        memcpy(data,praw->data().data(),8);
+        if(praw->id() == 0x1CA)
+        {
+            unsigned char byte[64];
+            double vehspeed;
+            if(praw->len() == 64)
+            {
+                memcpy(byte,praw->data().data(),64);
+                unsigned int value;
+                value = byte[12]&0x1F;
+                value = (value<<8) +  static_cast<unsigned int >( byte[13]);
+                vehspeed = static_cast<double>(value) * 0.05625;
+
+
+                xchassis.set_vel(static_cast<float>(vehspeed));
+                xchassis.set_time(std::chrono::system_clock::now().time_since_epoch().count());
+
+                ShareChassis(pa,&xchassis);
+                //              xchassis.clear_angle_feedback();
+                //              std::cout<<"veh: "<<xchassis.vel()<<std::endl;
+            }
+            else
+            {
+                std::cout<<" 1CA not 64 bytes. 1CA bytes: "<<praw->len()<<std::endl;
+            }
+        }
+        if(praw->id() == 0x188)
+        {
+            unsigned char byte[64];
+            double ang;
+            if(praw->len() == 64)
+            {
+                memcpy(byte,praw->data().data(),64);
+                unsigned int value;
+                value = byte[8]&0xFF;
+                value = (value<<8) +  static_cast<unsigned int >( byte[9]);
+                if(value<32767)
+                    ang = static_cast<double>(value) * 0.1;
+                else
+                    ang=static_cast<double>(value) * 0.1-65536*0.1;
+
+                xchassis.set_angle_feedback(static_cast<float>(ang));
+                //           ShareChassis(pa,&xchassis);
+                //              if(ang<30)std::cout<<"ang: "<<xchassis.angle_feedback()<<std::endl;
+            }
+            else
+            {
+                std::cout<<" 188 not 64 bytes. 188 bytes: "<<praw->len()<<std::endl;
+            }
+        }
+
+    }
+
+
+    return 0;
+}
+
+

+ 46 - 0
src/apollo/apollolib/adchassis/decodechassis.h

@@ -0,0 +1,46 @@
+#ifndef DECODECHASSIS_H
+#define DECODECHASSIS_H
+
+#include <memory>
+#include <functional>
+
+#include "canmsg.pb.h"
+#include "canraw.pb.h"
+#include "chassis.pb.h"
+
+#ifndef ADCHASSISFUN
+#define ADCHASSISFUN
+typedef std::function<void(iv::chassis *pchassis)> chassisfun;
+#endif
+
+int ProcGE3Chassis(void * pa, iv::can::canmsg * pmsg);
+
+int ProcPROBLUEChassis(void * pa, iv::can::canmsg * pmsg);
+
+int ProcMIDCARChassis(void * pa, iv::can::canmsg * pmsg);
+
+int ProcVV7Chassis(void * pa, iv::can::canmsg * pmsg);
+
+int ProcMIDBUSChassis(void * pa, iv::can::canmsg * pmsg);
+
+int ProcHAPOChassis(void * pa, iv::can::canmsg * pmsg);
+
+int ProcYUHESENChassis(void * pa, iv::can::canmsg * pmsg);
+
+int ProcShenLanChassis(void * pa, iv::can::canmsg * pmsg);
+
+int ProcShenLanCANFDChassis(void *pa, iv::can::canmsg *pmsg);
+
+int ProcHunterChassis(void *pa, iv::can::canmsg *pmsg);
+
+int ProcSterraesChassis(void *pa, iv::can::canmsg *pmsg);
+
+int ProcShenLanS05Chassis(void * pa,iv::can::canmsg * pmsg);
+
+int ProcChangAnA07Chassis(void * pa,iv::can::canmsg * pmsg);
+
+void PrintCANRaw(const iv::can::canraw * praw );
+
+
+
+#endif // DECODECHASSIS_H

+ 1496 - 0
src/apollo/apollolib/adchassis/shenlan.c

@@ -0,0 +1,1496 @@
+/* Generated by DBCC, see <https://github.com/howerj/dbcc> */
+#include "shenlan.h"
+#include <inttypes.h>
+#include <assert.h>
+
+#define UNUSED(X) ((void)(X))
+
+static inline uint64_t reverse_byte_order(uint64_t x) {
+	x = (x & 0x00000000FFFFFFFF) << 32 | (x & 0xFFFFFFFF00000000) >> 32;
+	x = (x & 0x0000FFFF0000FFFF) << 16 | (x & 0xFFFF0000FFFF0000) >> 16;
+	x = (x & 0x00FF00FF00FF00FF) << 8  | (x & 0xFF00FF00FF00FF00) >> 8;
+	return x;
+}
+
+static inline int print_helper(int r, int print_return_value) {
+	return ((r >= 0) && (print_return_value >= 0)) ? r + print_return_value : -1;
+}
+
+static int pack_can_0x144_ECU_144(can_obj_shenlan_h_t *o, uint64_t *data) {
+	assert(o);
+	assert(data);
+	register uint64_t x;
+	register uint64_t m = 0;
+	/* ACC_LatAngReq: start-bit 4, length 14, endianess motorola, scaling 0.1, offset -720 */
+	x = ((uint16_t)(o->can_0x144_ECU_144.ACC_LatAngReq)) & 0x3fff;
+	x <<= 47; 
+	m |= x;
+	/* ACC_MotorTorqueMaxLimitRequest: start-bit 21, length 11, endianess motorola, scaling 0.02, offset -20.48 */
+	x = ((uint16_t)(o->can_0x144_ECU_144.ACC_MotorTorqueMaxLimitRequest)) & 0x7ff;
+	x <<= 35; 
+	m |= x;
+	/* ACC_MotorTorqueMinLimitRequest: start-bit 26, length 11, endianess motorola, scaling 0.02, offset -20.48 */
+	x = ((uint16_t)(o->can_0x144_ECU_144.ACC_MotorTorqueMinLimitRequest)) & 0x7ff;
+	x <<= 24; 
+	m |= x;
+	/* ADS_Reqmode: start-bit 7, length 3, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x144_ECU_144.ADS_Reqmode)) & 0x7;
+	x <<= 61; 
+	m |= x;
+	/* ACC_ADCReqType: start-bit 47, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x144_ECU_144.ACC_ADCReqType)) & 0x3;
+	x <<= 22; 
+	m |= x;
+	/* ACC_LatAngReqActive: start-bit 22, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x144_ECU_144.ACC_LatAngReqActive)) & 0x1;
+	x <<= 46; 
+	m |= x;
+	*data = reverse_byte_order(m);
+	o->can_0x144_ECU_144_tx = 1;
+	return 0;
+}
+
+static int unpack_can_0x144_ECU_144(can_obj_shenlan_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) {
+	assert(o);
+	assert(dlc <= 8);
+	register uint64_t x;
+	register uint64_t m = reverse_byte_order(data);
+	if (dlc < 8)
+		return -1;
+	/* ACC_LatAngReq: start-bit 4, length 14, endianess motorola, scaling 0.1, offset -720 */
+	x = (m >> 47) & 0x3fff;
+	o->can_0x144_ECU_144.ACC_LatAngReq = x;
+	/* ACC_MotorTorqueMaxLimitRequest: start-bit 21, length 11, endianess motorola, scaling 0.02, offset -20.48 */
+	x = (m >> 35) & 0x7ff;
+	o->can_0x144_ECU_144.ACC_MotorTorqueMaxLimitRequest = x;
+	/* ACC_MotorTorqueMinLimitRequest: start-bit 26, length 11, endianess motorola, scaling 0.02, offset -20.48 */
+	x = (m >> 24) & 0x7ff;
+	o->can_0x144_ECU_144.ACC_MotorTorqueMinLimitRequest = x;
+	/* ADS_Reqmode: start-bit 7, length 3, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 61) & 0x7;
+	o->can_0x144_ECU_144.ADS_Reqmode = x;
+	/* ACC_ADCReqType: start-bit 47, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 22) & 0x3;
+	o->can_0x144_ECU_144.ACC_ADCReqType = x;
+	/* ACC_LatAngReqActive: start-bit 22, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 46) & 0x1;
+	o->can_0x144_ECU_144.ACC_LatAngReqActive = x;
+	o->can_0x144_ECU_144_rx = 1;
+	o->can_0x144_ECU_144_time_stamp_rx = time_stamp;
+	return 0;
+}
+
+int decode_can_0x144_ACC_LatAngReq(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x144_ECU_144.ACC_LatAngReq);
+	rval *= 0.1;
+	rval += -720;
+	if (rval <= 720) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x144_ACC_LatAngReq(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x144_ECU_144.ACC_LatAngReq = 0;
+	if (in > 720)
+		return -1;
+	in += 720;
+	in *= 10;
+	o->can_0x144_ECU_144.ACC_LatAngReq = in;
+	return 0;
+}
+
+int decode_can_0x144_ACC_MotorTorqueMaxLimitRequest(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x144_ECU_144.ACC_MotorTorqueMaxLimitRequest);
+	rval *= 0.02;
+	rval += -20.48;
+	if (rval <= 20.44) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x144_ACC_MotorTorqueMaxLimitRequest(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x144_ECU_144.ACC_MotorTorqueMaxLimitRequest = 0;
+	if (in > 20.44)
+		return -1;
+	in += 20.48;
+	in *= 50;
+	o->can_0x144_ECU_144.ACC_MotorTorqueMaxLimitRequest = in;
+	return 0;
+}
+
+int decode_can_0x144_ACC_MotorTorqueMinLimitRequest(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x144_ECU_144.ACC_MotorTorqueMinLimitRequest);
+	rval *= 0.02;
+	rval += -20.48;
+	if (rval <= 20.44) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x144_ACC_MotorTorqueMinLimitRequest(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x144_ECU_144.ACC_MotorTorqueMinLimitRequest = 0;
+	if (in > 20.44)
+		return -1;
+	in += 20.48;
+	in *= 50;
+	o->can_0x144_ECU_144.ACC_MotorTorqueMinLimitRequest = in;
+	return 0;
+}
+
+int decode_can_0x144_ADS_Reqmode(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x144_ECU_144.ADS_Reqmode);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x144_ADS_Reqmode(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x144_ECU_144.ADS_Reqmode = in;
+	return 0;
+}
+
+int decode_can_0x144_ACC_ADCReqType(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x144_ECU_144.ACC_ADCReqType);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x144_ACC_ADCReqType(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x144_ECU_144.ACC_ADCReqType = in;
+	return 0;
+}
+
+int decode_can_0x144_ACC_LatAngReqActive(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x144_ECU_144.ACC_LatAngReqActive);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x144_ACC_LatAngReqActive(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x144_ECU_144.ACC_LatAngReqActive = in;
+	return 0;
+}
+
+int print_can_0x144_ECU_144(const can_obj_shenlan_h_t *o) {
+	assert(o);
+
+	int r = 0;
+	double ACC_LatAngReq = 0.0;
+	decode_can_0x144_ACC_LatAngReq(o,&ACC_LatAngReq);
+	printf("\tACC_LatAngReq = %f\r\n", ACC_LatAngReq);
+	double ACC_MotorTorqueMaxLimitRequest = 0.0;
+	decode_can_0x144_ACC_MotorTorqueMaxLimitRequest(o,&ACC_MotorTorqueMaxLimitRequest);
+	printf("\tACC_MotorTorqueMaxLimitRequest = %f\r\n", ACC_MotorTorqueMaxLimitRequest);
+	double ACC_MotorTorqueMinLimitRequest = 0.0;
+	decode_can_0x144_ACC_MotorTorqueMinLimitRequest(o,&ACC_MotorTorqueMinLimitRequest);
+	printf("\tACC_MotorTorqueMinLimitRequest = %f\r\n", ACC_MotorTorqueMinLimitRequest);
+	printf("\tADS_Reqmode = %d\r\n", (o->can_0x144_ECU_144.ADS_Reqmode));
+	printf("\tACC_ADCReqType = %d\r\n", (o->can_0x144_ECU_144.ACC_ADCReqType));
+	printf("\tACC_LatAngReqActive = %d\r\n", (o->can_0x144_ECU_144.ACC_LatAngReqActive));
+	return r;
+}
+
+static int pack_can_0x147_ADC_147(can_obj_shenlan_h_t *o, uint64_t *data) {
+	assert(o);
+	assert(data);
+	register uint64_t x;
+	register uint64_t m = 0;
+	/* EpsSasSteerAg: start-bit 9, length 16, endianess motorola, scaling 0.1, offset 0 */
+	x = ((uint16_t)(o->can_0x147_ADC_147.EpsSasSteerAg)) & 0xffff;
+	x <<= 34; 
+	m |= x;
+	/* EPS_Pinionang: start-bit 7, length 14, endianess motorola, scaling 0.1, offset -720 */
+	x = ((uint16_t)(o->can_0x147_ADC_147.EPS_Pinionang)) & 0x3fff;
+	x <<= 50; 
+	m |= x;
+	/* EspVehSpd: start-bit 41, length 13, endianess motorola, scaling 0.05625, offset 0 */
+	x = ((uint16_t)(o->can_0x147_ADC_147.EspVehSpd)) & 0x1fff;
+	x <<= 5; 
+	m |= x;
+	/* EpsSteerAgRate: start-bit 24, length 8, endianess motorola, scaling 4, offset 0 */
+	x = ((uint8_t)(o->can_0x147_ADC_147.EpsSteerAgRate)) & 0xff;
+	x <<= 25; 
+	m |= x;
+	/* EPS_ADS_Abortfeedback: start-bit 45, length 4, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x147_ADC_147.EPS_ADS_Abortfeedback)) & 0xf;
+	x <<= 18; 
+	m |= x;
+	/* EPS_LatCtrlAvailabilityStatus: start-bit 47, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x147_ADC_147.EPS_LatCtrlAvailabilityStatus)) & 0x3;
+	x <<= 22; 
+	m |= x;
+	/* EpsSasSteerAgVld: start-bit 25, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x147_ADC_147.EpsSasSteerAgVld)) & 0x1;
+	x <<= 33; 
+	m |= x;
+	/* EPS_LatCtrlActive: start-bit 32, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x147_ADC_147.EPS_LatCtrlActive)) & 0x1;
+	x <<= 24; 
+	m |= x;
+	/* EspVehSpdVld: start-bit 60, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x147_ADC_147.EspVehSpdVld)) & 0x1;
+	x <<= 4; 
+	m |= x;
+	*data = reverse_byte_order(m);
+	o->can_0x147_ADC_147_tx = 1;
+	return 0;
+}
+
+static int unpack_can_0x147_ADC_147(can_obj_shenlan_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) {
+	assert(o);
+	assert(dlc <= 8);
+	register uint64_t x;
+	register uint64_t m = reverse_byte_order(data);
+	if (dlc < 8)
+		return -1;
+	/* EpsSasSteerAg: start-bit 9, length 16, endianess motorola, scaling 0.1, offset 0 */
+	x = (m >> 34) & 0xffff;
+	o->can_0x147_ADC_147.EpsSasSteerAg = x;
+	/* EPS_Pinionang: start-bit 7, length 14, endianess motorola, scaling 0.1, offset -720 */
+	x = (m >> 50) & 0x3fff;
+	o->can_0x147_ADC_147.EPS_Pinionang = x;
+	/* EspVehSpd: start-bit 41, length 13, endianess motorola, scaling 0.05625, offset 0 */
+	x = (m >> 5) & 0x1fff;
+	o->can_0x147_ADC_147.EspVehSpd = x;
+	/* EpsSteerAgRate: start-bit 24, length 8, endianess motorola, scaling 4, offset 0 */
+	x = (m >> 25) & 0xff;
+	o->can_0x147_ADC_147.EpsSteerAgRate = x;
+	/* EPS_ADS_Abortfeedback: start-bit 45, length 4, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 18) & 0xf;
+	o->can_0x147_ADC_147.EPS_ADS_Abortfeedback = x;
+	/* EPS_LatCtrlAvailabilityStatus: start-bit 47, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 22) & 0x3;
+	o->can_0x147_ADC_147.EPS_LatCtrlAvailabilityStatus = x;
+	/* EpsSasSteerAgVld: start-bit 25, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 33) & 0x1;
+	o->can_0x147_ADC_147.EpsSasSteerAgVld = x;
+	/* EPS_LatCtrlActive: start-bit 32, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 24) & 0x1;
+	o->can_0x147_ADC_147.EPS_LatCtrlActive = x;
+	/* EspVehSpdVld: start-bit 60, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 4) & 0x1;
+	o->can_0x147_ADC_147.EspVehSpdVld = x;
+	o->can_0x147_ADC_147_rx = 1;
+	o->can_0x147_ADC_147_time_stamp_rx = time_stamp;
+	return 0;
+}
+
+int decode_can_0x147_EpsSasSteerAg(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x147_ADC_147.EpsSasSteerAg);
+	rval *= 0.1;
+	if ((rval >= -780) && (rval <= 780)) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x147_EpsSasSteerAg(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x147_ADC_147.EpsSasSteerAg = 0;
+	if (in < -780)
+		return -1;
+	if (in > 780)
+		return -1;
+	in *= 10;
+	o->can_0x147_ADC_147.EpsSasSteerAg = in;
+	return 0;
+}
+
+int decode_can_0x147_EPS_Pinionang(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x147_ADC_147.EPS_Pinionang);
+	rval *= 0.1;
+	rval += -720;
+	if (rval <= 720) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x147_EPS_Pinionang(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x147_ADC_147.EPS_Pinionang = 0;
+	if (in > 720)
+		return -1;
+	in += 720;
+	in *= 10;
+	o->can_0x147_ADC_147.EPS_Pinionang = in;
+	return 0;
+}
+
+int decode_can_0x147_EspVehSpd(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x147_ADC_147.EspVehSpd);
+	rval *= 0.05625;
+	if (rval <= 460.744) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x147_EspVehSpd(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x147_ADC_147.EspVehSpd = 0;
+	if (in > 460.744)
+		return -1;
+	in *= 17.7778;
+	o->can_0x147_ADC_147.EspVehSpd = in;
+	return 0;
+}
+
+int decode_can_0x147_EpsSteerAgRate(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x147_ADC_147.EpsSteerAgRate);
+	rval *= 4;
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x147_EpsSteerAgRate(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	in *= 0.25;
+	o->can_0x147_ADC_147.EpsSteerAgRate = in;
+	return 0;
+}
+
+int decode_can_0x147_EPS_ADS_Abortfeedback(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x147_ADC_147.EPS_ADS_Abortfeedback);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x147_EPS_ADS_Abortfeedback(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x147_ADC_147.EPS_ADS_Abortfeedback = in;
+	return 0;
+}
+
+int decode_can_0x147_EPS_LatCtrlAvailabilityStatus(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x147_ADC_147.EPS_LatCtrlAvailabilityStatus);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x147_EPS_LatCtrlAvailabilityStatus(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x147_ADC_147.EPS_LatCtrlAvailabilityStatus = in;
+	return 0;
+}
+
+int decode_can_0x147_EpsSasSteerAgVld(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x147_ADC_147.EpsSasSteerAgVld);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x147_EpsSasSteerAgVld(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x147_ADC_147.EpsSasSteerAgVld = in;
+	return 0;
+}
+
+int decode_can_0x147_EPS_LatCtrlActive(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x147_ADC_147.EPS_LatCtrlActive);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x147_EPS_LatCtrlActive(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x147_ADC_147.EPS_LatCtrlActive = in;
+	return 0;
+}
+
+int decode_can_0x147_EspVehSpdVld(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x147_ADC_147.EspVehSpdVld);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x147_EspVehSpdVld(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x147_ADC_147.EspVehSpdVld = in;
+	return 0;
+}
+
+int print_can_0x147_ADC_147(const can_obj_shenlan_h_t *o) {
+	assert(o);
+
+	int r = 0;
+	double EpsSasSteerAg = 0.0;
+	decode_can_0x147_EpsSasSteerAg(o,&EpsSasSteerAg);
+	printf("\tEpsSasSteerAg = %f\r\n", EpsSasSteerAg);
+	double EPS_Pinionang = 0.0;
+	decode_can_0x147_EPS_Pinionang(o,&EPS_Pinionang);
+	printf("\tEPS_Pinionang = %f\r\n", EPS_Pinionang);
+	double EspVehSpd = 0.0;
+	decode_can_0x147_EspVehSpd(o,&EspVehSpd);
+	printf("\tEspVehSpd = %f\r\n", EspVehSpd);
+	double EpsSteerAgRate = 0.0;
+	decode_can_0x147_EpsSteerAgRate(o,&EpsSteerAgRate);
+	printf("\tEpsSteerAgRate = %f\r\n", EpsSteerAgRate);
+	printf("\tEPS_ADS_Abortfeedback = %d\r\n", (o->can_0x147_ADC_147.EPS_ADS_Abortfeedback));
+	printf("\tEPS_LatCtrlAvailabilityStatus = %d\r\n", (o->can_0x147_ADC_147.EPS_LatCtrlAvailabilityStatus));
+	printf("\tEpsSasSteerAgVld = %d\r\n", (o->can_0x147_ADC_147.EpsSasSteerAgVld));
+	printf("\tEPS_LatCtrlActive = %d\r\n", (o->can_0x147_ADC_147.EPS_LatCtrlActive));
+	printf("\tEspVehSpdVld = %d\r\n", (o->can_0x147_ADC_147.EspVehSpdVld));
+	return r;
+}
+
+static int pack_can_0x14a_ADC_14A(can_obj_shenlan_h_t *o, uint64_t *data) {
+	assert(o);
+	assert(data);
+	register uint64_t x;
+	register uint64_t m = 0;
+	/* VcuPtTqLimMax: start-bit 7, length 16, endianess motorola, scaling 1, offset -32768 */
+	x = ((uint16_t)(o->can_0x14a_ADC_14A.VcuPtTqLimMax)) & 0xffff;
+	x <<= 48; 
+	m |= x;
+	/* VcuPtTqLimMin: start-bit 23, length 16, endianess motorola, scaling 1, offset -32768 */
+	x = ((uint16_t)(o->can_0x14a_ADC_14A.VcuPtTqLimMin)) & 0xffff;
+	x <<= 32; 
+	m |= x;
+	/* VcuPtTqReal: start-bit 39, length 16, endianess motorola, scaling 1, offset -32768 */
+	x = ((uint16_t)(o->can_0x14a_ADC_14A.VcuPtTqReal)) & 0xffff;
+	x <<= 16; 
+	m |= x;
+	/* VcuShiftLvlPosn: start-bit 50, length 4, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x14a_ADC_14A.VcuShiftLvlPosn)) & 0xf;
+	x <<= 7; 
+	m |= x;
+	/* IBCU_ReduceFuncAvail: start-bit 52, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x14a_ADC_14A.IBCU_ReduceFuncAvail)) & 0x3;
+	x <<= 11; 
+	m |= x;
+	/* IBCU_FullFuncAvail: start-bit 54, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x14a_ADC_14A.IBCU_FullFuncAvail)) & 0x3;
+	x <<= 13; 
+	m |= x;
+	/* ESP_BrakeForce: start-bit 55, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x14a_ADC_14A.ESP_BrakeForce)) & 0x1;
+	x <<= 15; 
+	m |= x;
+	*data = reverse_byte_order(m);
+	o->can_0x14a_ADC_14A_tx = 1;
+	return 0;
+}
+
+static int unpack_can_0x14a_ADC_14A(can_obj_shenlan_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) {
+	assert(o);
+	assert(dlc <= 8);
+	register uint64_t x;
+	register uint64_t m = reverse_byte_order(data);
+	if (dlc < 8)
+		return -1;
+	/* VcuPtTqLimMax: start-bit 7, length 16, endianess motorola, scaling 1, offset -32768 */
+	x = (m >> 48) & 0xffff;
+	o->can_0x14a_ADC_14A.VcuPtTqLimMax = x;
+	/* VcuPtTqLimMin: start-bit 23, length 16, endianess motorola, scaling 1, offset -32768 */
+	x = (m >> 32) & 0xffff;
+	o->can_0x14a_ADC_14A.VcuPtTqLimMin = x;
+	/* VcuPtTqReal: start-bit 39, length 16, endianess motorola, scaling 1, offset -32768 */
+	x = (m >> 16) & 0xffff;
+	o->can_0x14a_ADC_14A.VcuPtTqReal = x;
+	/* VcuShiftLvlPosn: start-bit 50, length 4, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 7) & 0xf;
+	o->can_0x14a_ADC_14A.VcuShiftLvlPosn = x;
+	/* IBCU_ReduceFuncAvail: start-bit 52, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 11) & 0x3;
+	o->can_0x14a_ADC_14A.IBCU_ReduceFuncAvail = x;
+	/* IBCU_FullFuncAvail: start-bit 54, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 13) & 0x3;
+	o->can_0x14a_ADC_14A.IBCU_FullFuncAvail = x;
+	/* ESP_BrakeForce: start-bit 55, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 15) & 0x1;
+	o->can_0x14a_ADC_14A.ESP_BrakeForce = x;
+	o->can_0x14a_ADC_14A_rx = 1;
+	o->can_0x14a_ADC_14A_time_stamp_rx = time_stamp;
+	return 0;
+}
+
+int decode_can_0x14a_VcuPtTqLimMax(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x14a_ADC_14A.VcuPtTqLimMax);
+	rval += -32768;
+	if (rval <= 32767) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x14a_VcuPtTqLimMax(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x14a_ADC_14A.VcuPtTqLimMax = 0;
+	if (in > 32767)
+		return -1;
+	in += 32768;
+	o->can_0x14a_ADC_14A.VcuPtTqLimMax = in;
+	return 0;
+}
+
+int decode_can_0x14a_VcuPtTqLimMin(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x14a_ADC_14A.VcuPtTqLimMin);
+	rval += -32768;
+	if (rval <= 32767) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x14a_VcuPtTqLimMin(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x14a_ADC_14A.VcuPtTqLimMin = 0;
+	if (in > 32767)
+		return -1;
+	in += 32768;
+	o->can_0x14a_ADC_14A.VcuPtTqLimMin = in;
+	return 0;
+}
+
+int decode_can_0x14a_VcuPtTqReal(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x14a_ADC_14A.VcuPtTqReal);
+	rval += -32768;
+	if (rval <= 32767) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x14a_VcuPtTqReal(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x14a_ADC_14A.VcuPtTqReal = 0;
+	if (in > 32767)
+		return -1;
+	in += 32768;
+	o->can_0x14a_ADC_14A.VcuPtTqReal = in;
+	return 0;
+}
+
+int decode_can_0x14a_VcuShiftLvlPosn(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x14a_ADC_14A.VcuShiftLvlPosn);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x14a_VcuShiftLvlPosn(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x14a_ADC_14A.VcuShiftLvlPosn = in;
+	return 0;
+}
+
+int decode_can_0x14a_IBCU_ReduceFuncAvail(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x14a_ADC_14A.IBCU_ReduceFuncAvail);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x14a_IBCU_ReduceFuncAvail(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x14a_ADC_14A.IBCU_ReduceFuncAvail = in;
+	return 0;
+}
+
+int decode_can_0x14a_IBCU_FullFuncAvail(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x14a_ADC_14A.IBCU_FullFuncAvail);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x14a_IBCU_FullFuncAvail(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x14a_ADC_14A.IBCU_FullFuncAvail = in;
+	return 0;
+}
+
+int decode_can_0x14a_ESP_BrakeForce(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x14a_ADC_14A.ESP_BrakeForce);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x14a_ESP_BrakeForce(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x14a_ADC_14A.ESP_BrakeForce = in;
+	return 0;
+}
+
+int print_can_0x14a_ADC_14A(const can_obj_shenlan_h_t *o) {
+	assert(o);
+
+	int r = 0;
+	double VcuPtTqLimMax = 0.0;
+	decode_can_0x14a_VcuPtTqLimMax(o,&VcuPtTqLimMax);
+	printf("\tVcuPtTqLimMax = %f\r\n", VcuPtTqLimMax);
+	double VcuPtTqLimMin = 0.0;
+	decode_can_0x14a_VcuPtTqLimMin(o,&VcuPtTqLimMin);
+	printf("\tVcuPtTqLimMin = %f\r\n", VcuPtTqLimMin);
+	double VcuPtTqReal = 0.0;
+	decode_can_0x14a_VcuPtTqReal(o,&VcuPtTqReal);
+	printf("\tVcuPtTqReal = %f\r\n", VcuPtTqReal);
+	printf("\tVcuShiftLvlPosn = %d\r\n", (o->can_0x14a_ADC_14A.VcuShiftLvlPosn));
+	printf("\tIBCU_ReduceFuncAvail = %d\r\n", (o->can_0x14a_ADC_14A.IBCU_ReduceFuncAvail));
+	printf("\tIBCU_FullFuncAvail = %d\r\n", (o->can_0x14a_ADC_14A.IBCU_FullFuncAvail));
+	printf("\tESP_BrakeForce = %d\r\n", (o->can_0x14a_ADC_14A.ESP_BrakeForce));
+	return r;
+}
+
+static int pack_can_0x24b_ECU_24B(can_obj_shenlan_h_t *o, uint64_t *data) {
+	assert(o);
+	assert(data);
+	register uint64_t x;
+	register uint64_t m = 0;
+	/* ACC_AEBTargetDeceleration: start-bit 24, length 16, endianess motorola, scaling 0.0005, offset -16 */
+	x = ((uint16_t)(o->can_0x24b_ECU_24B.ACC_AEBTargetDeceleration)) & 0xffff;
+	x <<= 17; 
+	m |= x;
+	/* ACC_AccTrqReq: start-bit 7, length 15, endianess motorola, scaling 1, offset -16384 */
+	x = ((uint16_t)(o->can_0x24b_ECU_24B.ACC_AccTrqReq)) & 0x7fff;
+	x <<= 49; 
+	m |= x;
+	/* ACC_ACCTargetAcceleration: start-bit 20, length 8, endianess motorola, scaling 0.05, offset -10 */
+	x = ((uint8_t)(o->can_0x24b_ECU_24B.ACC_ACCTargetAcceleration)) & 0xff;
+	x <<= 37; 
+	m |= x;
+	/* ACC_ACCMode: start-bit 58, length 3, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x24b_ECU_24B.ACC_ACCMode)) & 0x7;
+	m |= x;
+	/* ADCReqMode: start-bit 50, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x24b_ECU_24B.ADCReqMode)) & 0x3;
+	x <<= 9; 
+	m |= x;
+	/* ACC_AccTrqReqActive: start-bit 8, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x24b_ECU_24B.ACC_AccTrqReqActive)) & 0x1;
+	x <<= 48; 
+	m |= x;
+	/* ACC_AEBVehilceHoldReq: start-bit 40, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x24b_ECU_24B.ACC_AEBVehilceHoldReq)) & 0x1;
+	x <<= 16; 
+	m |= x;
+	/* ACC_AEBActive: start-bit 51, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x24b_ECU_24B.ACC_AEBActive)) & 0x1;
+	x <<= 11; 
+	m |= x;
+	/* ACC_Driveoff_Request: start-bit 53, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x24b_ECU_24B.ACC_Driveoff_Request)) & 0x1;
+	x <<= 13; 
+	m |= x;
+	/* ACC_DecToStop: start-bit 54, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x24b_ECU_24B.ACC_DecToStop)) & 0x1;
+	x <<= 14; 
+	m |= x;
+	/* ACC_CDDActive: start-bit 55, length 1, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x24b_ECU_24B.ACC_CDDActive)) & 0x1;
+	x <<= 15; 
+	m |= x;
+	*data = reverse_byte_order(m);
+	o->can_0x24b_ECU_24B_tx = 1;
+	return 0;
+}
+
+static int unpack_can_0x24b_ECU_24B(can_obj_shenlan_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) {
+	assert(o);
+	assert(dlc <= 8);
+	register uint64_t x;
+	register uint64_t m = reverse_byte_order(data);
+	if (dlc < 8)
+		return -1;
+	/* ACC_AEBTargetDeceleration: start-bit 24, length 16, endianess motorola, scaling 0.0005, offset -16 */
+	x = (m >> 17) & 0xffff;
+	o->can_0x24b_ECU_24B.ACC_AEBTargetDeceleration = x;
+	/* ACC_AccTrqReq: start-bit 7, length 15, endianess motorola, scaling 1, offset -16384 */
+	x = (m >> 49) & 0x7fff;
+	o->can_0x24b_ECU_24B.ACC_AccTrqReq = x;
+	/* ACC_ACCTargetAcceleration: start-bit 20, length 8, endianess motorola, scaling 0.05, offset -10 */
+	x = (m >> 37) & 0xff;
+	o->can_0x24b_ECU_24B.ACC_ACCTargetAcceleration = x;
+	/* ACC_ACCMode: start-bit 58, length 3, endianess motorola, scaling 1, offset 0 */
+	x = m & 0x7;
+	o->can_0x24b_ECU_24B.ACC_ACCMode = x;
+	/* ADCReqMode: start-bit 50, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 9) & 0x3;
+	o->can_0x24b_ECU_24B.ADCReqMode = x;
+	/* ACC_AccTrqReqActive: start-bit 8, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 48) & 0x1;
+	o->can_0x24b_ECU_24B.ACC_AccTrqReqActive = x;
+	/* ACC_AEBVehilceHoldReq: start-bit 40, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 16) & 0x1;
+	o->can_0x24b_ECU_24B.ACC_AEBVehilceHoldReq = x;
+	/* ACC_AEBActive: start-bit 51, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 11) & 0x1;
+	o->can_0x24b_ECU_24B.ACC_AEBActive = x;
+	/* ACC_Driveoff_Request: start-bit 53, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 13) & 0x1;
+	o->can_0x24b_ECU_24B.ACC_Driveoff_Request = x;
+	/* ACC_DecToStop: start-bit 54, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 14) & 0x1;
+	o->can_0x24b_ECU_24B.ACC_DecToStop = x;
+	/* ACC_CDDActive: start-bit 55, length 1, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 15) & 0x1;
+	o->can_0x24b_ECU_24B.ACC_CDDActive = x;
+	o->can_0x24b_ECU_24B_rx = 1;
+	o->can_0x24b_ECU_24B_time_stamp_rx = time_stamp;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_AEBTargetDeceleration(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x24b_ECU_24B.ACC_AEBTargetDeceleration);
+	rval *= 0.0005;
+	rval += -16;
+	if (rval <= 16) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x24b_ACC_AEBTargetDeceleration(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_AEBTargetDeceleration = 0;
+	if (in > 16)
+		return -1;
+	in += 16;
+	in *= 2000;
+	o->can_0x24b_ECU_24B.ACC_AEBTargetDeceleration = in;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_AccTrqReq(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x24b_ECU_24B.ACC_AccTrqReq);
+	rval += -16384;
+	if (rval <= 16383) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x24b_ACC_AccTrqReq(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_AccTrqReq = 0;
+	if (in > 16383)
+		return -1;
+	in += 16384;
+	o->can_0x24b_ECU_24B.ACC_AccTrqReq = in;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_ACCTargetAcceleration(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x24b_ECU_24B.ACC_ACCTargetAcceleration);
+	rval *= 0.05;
+	rval += -10;
+	if (rval <= 2.75) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x24b_ACC_ACCTargetAcceleration(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_ACCTargetAcceleration = 0;
+	if (in > 2.75)
+		return -1;
+	in += 10;
+	in *= 20;
+	o->can_0x24b_ECU_24B.ACC_ACCTargetAcceleration = in;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_ACCMode(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x24b_ECU_24B.ACC_ACCMode);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x24b_ACC_ACCMode(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_ACCMode = in;
+	return 0;
+}
+
+int decode_can_0x24b_ADCReqMode(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x24b_ECU_24B.ADCReqMode);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x24b_ADCReqMode(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ADCReqMode = in;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_AccTrqReqActive(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x24b_ECU_24B.ACC_AccTrqReqActive);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x24b_ACC_AccTrqReqActive(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_AccTrqReqActive = in;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_AEBVehilceHoldReq(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x24b_ECU_24B.ACC_AEBVehilceHoldReq);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x24b_ACC_AEBVehilceHoldReq(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_AEBVehilceHoldReq = in;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_AEBActive(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x24b_ECU_24B.ACC_AEBActive);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x24b_ACC_AEBActive(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_AEBActive = in;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_Driveoff_Request(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x24b_ECU_24B.ACC_Driveoff_Request);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x24b_ACC_Driveoff_Request(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_Driveoff_Request = in;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_DecToStop(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x24b_ECU_24B.ACC_DecToStop);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x24b_ACC_DecToStop(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_DecToStop = in;
+	return 0;
+}
+
+int decode_can_0x24b_ACC_CDDActive(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x24b_ECU_24B.ACC_CDDActive);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x24b_ACC_CDDActive(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x24b_ECU_24B.ACC_CDDActive = in;
+	return 0;
+}
+
+int print_can_0x24b_ECU_24B(const can_obj_shenlan_h_t *o) {
+	assert(o);
+
+	int r = 0;
+	double ACC_AEBTargetDeceleration = 0.0;
+	decode_can_0x24b_ACC_AEBTargetDeceleration(o,&ACC_AEBTargetDeceleration);
+	printf("\tACC_AEBTargetDeceleration = %f\r\n", ACC_AEBTargetDeceleration);
+	double ACC_AccTrqReq = 0.0;
+	decode_can_0x24b_ACC_AccTrqReq(o,&ACC_AccTrqReq);
+	printf("\tACC_AccTrqReq = %f\r\n", ACC_AccTrqReq);
+	double ACC_ACCTargetAcceleration = 0.0;
+	decode_can_0x24b_ACC_ACCTargetAcceleration(o,&ACC_ACCTargetAcceleration);
+	printf("\tACC_ACCTargetAcceleration = %f\r\n", ACC_ACCTargetAcceleration);
+	printf("\tACC_ACCMode = %d\r\n", (o->can_0x24b_ECU_24B.ACC_ACCMode));
+	printf("\tADCReqMode = %d\r\n", (o->can_0x24b_ECU_24B.ADCReqMode));
+	printf("\tACC_AccTrqReqActive = %d\r\n", (o->can_0x24b_ECU_24B.ACC_AccTrqReqActive));
+	printf("\tACC_AEBVehilceHoldReq = %d\r\n", (o->can_0x24b_ECU_24B.ACC_AEBVehilceHoldReq));
+	printf("\tACC_AEBActive = %d\r\n", (o->can_0x24b_ECU_24B.ACC_AEBActive));
+	printf("\tACC_Driveoff_Request = %d\r\n", (o->can_0x24b_ECU_24B.ACC_Driveoff_Request));
+	printf("\tACC_DecToStop = %d\r\n", (o->can_0x24b_ECU_24B.ACC_DecToStop));
+	printf("\tACC_CDDActive = %d\r\n", (o->can_0x24b_ECU_24B.ACC_CDDActive));
+	return r;
+}
+
+static int pack_can_0x250_ADC_250(can_obj_shenlan_h_t *o, uint64_t *data) {
+	assert(o);
+	assert(data);
+	register uint64_t x;
+	register uint64_t m = 0;
+	/* ESP_YawRate: start-bit 2, length 14, endianess motorola, scaling 0.01, offset -81.91 */
+	x = ((uint16_t)(o->can_0x250_ADC_250.ESP_YawRate)) & 0x3fff;
+	x <<= 45; 
+	m |= x;
+	/* ESP_LongAccel: start-bit 20, length 10, endianess motorola, scaling 0.03125, offset -16 */
+	x = ((uint16_t)(o->can_0x250_ADC_250.ESP_LongAccel)) & 0x3ff;
+	x <<= 35; 
+	m |= x;
+	/* ESP_LatAccel: start-bit 24, length 8, endianess motorola, scaling 0.1, offset -12.7 */
+	x = ((uint8_t)(o->can_0x250_ADC_250.ESP_LatAccel)) & 0xff;
+	x <<= 25; 
+	m |= x;
+	/* EPS_ADS_ControlFeedback: start-bit 7, length 3, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x250_ADC_250.EPS_ADS_ControlFeedback)) & 0x7;
+	x <<= 61; 
+	m |= x;
+	/* ESP_YawRateValid: start-bit 4, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x250_ADC_250.ESP_YawRateValid)) & 0x3;
+	x <<= 59; 
+	m |= x;
+	/* ESP_LongAccelValid: start-bit 26, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x250_ADC_250.ESP_LongAccelValid)) & 0x3;
+	x <<= 33; 
+	m |= x;
+	/* ESP_LatAccelValid: start-bit 32, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x250_ADC_250.ESP_LatAccelValid)) & 0x3;
+	x <<= 23; 
+	m |= x;
+	*data = reverse_byte_order(m);
+	o->can_0x250_ADC_250_tx = 1;
+	return 0;
+}
+
+static int unpack_can_0x250_ADC_250(can_obj_shenlan_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) {
+	assert(o);
+	assert(dlc <= 8);
+	register uint64_t x;
+	register uint64_t m = reverse_byte_order(data);
+	if (dlc < 8)
+		return -1;
+	/* ESP_YawRate: start-bit 2, length 14, endianess motorola, scaling 0.01, offset -81.91 */
+	x = (m >> 45) & 0x3fff;
+	o->can_0x250_ADC_250.ESP_YawRate = x;
+	/* ESP_LongAccel: start-bit 20, length 10, endianess motorola, scaling 0.03125, offset -16 */
+	x = (m >> 35) & 0x3ff;
+	o->can_0x250_ADC_250.ESP_LongAccel = x;
+	/* ESP_LatAccel: start-bit 24, length 8, endianess motorola, scaling 0.1, offset -12.7 */
+	x = (m >> 25) & 0xff;
+	o->can_0x250_ADC_250.ESP_LatAccel = x;
+	/* EPS_ADS_ControlFeedback: start-bit 7, length 3, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 61) & 0x7;
+	o->can_0x250_ADC_250.EPS_ADS_ControlFeedback = x;
+	/* ESP_YawRateValid: start-bit 4, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 59) & 0x3;
+	o->can_0x250_ADC_250.ESP_YawRateValid = x;
+	/* ESP_LongAccelValid: start-bit 26, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 33) & 0x3;
+	o->can_0x250_ADC_250.ESP_LongAccelValid = x;
+	/* ESP_LatAccelValid: start-bit 32, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 23) & 0x3;
+	o->can_0x250_ADC_250.ESP_LatAccelValid = x;
+	o->can_0x250_ADC_250_rx = 1;
+	o->can_0x250_ADC_250_time_stamp_rx = time_stamp;
+	return 0;
+}
+
+int decode_can_0x250_ESP_YawRate(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x250_ADC_250.ESP_YawRate);
+	rval *= 0.01;
+	rval += -81.91;
+	if (rval <= 81.92) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x250_ESP_YawRate(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x250_ADC_250.ESP_YawRate = 0;
+	if (in > 81.92)
+		return -1;
+	in += 81.91;
+	in *= 100;
+	o->can_0x250_ADC_250.ESP_YawRate = in;
+	return 0;
+}
+
+int decode_can_0x250_ESP_LongAccel(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x250_ADC_250.ESP_LongAccel);
+	rval *= 0.03125;
+	rval += -16;
+	if (rval <= 15.9062) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x250_ESP_LongAccel(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x250_ADC_250.ESP_LongAccel = 0;
+	if (in > 15.9062)
+		return -1;
+	in += 16;
+	in *= 32;
+	o->can_0x250_ADC_250.ESP_LongAccel = in;
+	return 0;
+}
+
+int decode_can_0x250_ESP_LatAccel(const can_obj_shenlan_h_t *o, double *out) {
+	assert(o);
+	assert(out);
+	double rval = (double)(o->can_0x250_ADC_250.ESP_LatAccel);
+	rval *= 0.1;
+	rval += -12.7;
+	if (rval <= 12.7) {
+		*out = rval;
+		return 0;
+	} else {
+		*out = (double)0;
+		return -1;
+	}
+}
+
+int encode_can_0x250_ESP_LatAccel(can_obj_shenlan_h_t *o, double in) {
+	assert(o);
+	o->can_0x250_ADC_250.ESP_LatAccel = 0;
+	if (in > 12.7)
+		return -1;
+	in += 12.7;
+	in *= 10;
+	o->can_0x250_ADC_250.ESP_LatAccel = in;
+	return 0;
+}
+
+int decode_can_0x250_EPS_ADS_ControlFeedback(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x250_ADC_250.EPS_ADS_ControlFeedback);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x250_EPS_ADS_ControlFeedback(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x250_ADC_250.EPS_ADS_ControlFeedback = in;
+	return 0;
+}
+
+int decode_can_0x250_ESP_YawRateValid(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x250_ADC_250.ESP_YawRateValid);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x250_ESP_YawRateValid(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x250_ADC_250.ESP_YawRateValid = in;
+	return 0;
+}
+
+int decode_can_0x250_ESP_LongAccelValid(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x250_ADC_250.ESP_LongAccelValid);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x250_ESP_LongAccelValid(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x250_ADC_250.ESP_LongAccelValid = in;
+	return 0;
+}
+
+int decode_can_0x250_ESP_LatAccelValid(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x250_ADC_250.ESP_LatAccelValid);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x250_ESP_LatAccelValid(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x250_ADC_250.ESP_LatAccelValid = in;
+	return 0;
+}
+
+int print_can_0x250_ADC_250(const can_obj_shenlan_h_t *o) {
+	assert(o);
+
+	int r = 0;
+	double ESP_YawRate = 0.0;
+	decode_can_0x250_ESP_YawRate(o,&ESP_YawRate);
+	printf("\tESP_YawRate = %f\r\n", ESP_YawRate);
+	double ESP_LongAccel = 0.0;
+	decode_can_0x250_ESP_LongAccel(o,&ESP_LongAccel);
+	printf("\tESP_LongAccel = %f\r\n", ESP_LongAccel);
+	double ESP_LatAccel = 0.0;
+	decode_can_0x250_ESP_LatAccel(o,&ESP_LatAccel);
+	printf("\tESP_LatAccel = %f\r\n", ESP_LatAccel);
+	printf("\tEPS_ADS_ControlFeedback = %d\r\n", (o->can_0x250_ADC_250.EPS_ADS_ControlFeedback));
+	printf("\tESP_YawRateValid = %d\r\n", (o->can_0x250_ADC_250.ESP_YawRateValid));
+	printf("\tESP_LongAccelValid = %d\r\n", (o->can_0x250_ADC_250.ESP_LongAccelValid));
+	printf("\tESP_LatAccelValid = %d\r\n", (o->can_0x250_ADC_250.ESP_LatAccelValid));
+	return r;
+}
+
+static int pack_can_0x358_ADC_358(can_obj_shenlan_h_t *o, uint64_t *data) {
+	assert(o);
+	assert(data);
+	register uint64_t x;
+	register uint64_t m = 0;
+	/* ADS_UDLCTurnLightReq: start-bit 26, length 3, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x358_ADC_358.ADS_UDLCTurnLightReq)) & 0x7;
+	x <<= 32; 
+	m |= x;
+	*data = reverse_byte_order(m);
+	o->can_0x358_ADC_358_tx = 1;
+	return 0;
+}
+
+static int unpack_can_0x358_ADC_358(can_obj_shenlan_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) {
+	assert(o);
+	assert(dlc <= 8);
+	register uint64_t x;
+	register uint64_t m = reverse_byte_order(data);
+	if (dlc < 8)
+		return -1;
+	/* ADS_UDLCTurnLightReq: start-bit 26, length 3, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 32) & 0x7;
+	o->can_0x358_ADC_358.ADS_UDLCTurnLightReq = x;
+	o->can_0x358_ADC_358_rx = 1;
+	o->can_0x358_ADC_358_time_stamp_rx = time_stamp;
+	return 0;
+}
+
+int decode_can_0x358_ADS_UDLCTurnLightReq(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x358_ADC_358.ADS_UDLCTurnLightReq);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x358_ADS_UDLCTurnLightReq(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x358_ADC_358.ADS_UDLCTurnLightReq = in;
+	return 0;
+}
+
+int print_can_0x358_ADC_358(const can_obj_shenlan_h_t *o) {
+	assert(o);
+
+	int r = 0;
+	printf("\tADS_UDLCTurnLightReq = %d\r\n", (o->can_0x358_ADC_358.ADS_UDLCTurnLightReq));
+	return r;
+}
+
+static int pack_can_0x36e_ECU_36E(can_obj_shenlan_h_t *o, uint64_t *data) {
+	assert(o);
+	assert(data);
+	register uint64_t x;
+	register uint64_t m = 0;
+	/* ADS_UDLCTurnLightReq: start-bit 7, length 3, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x36e_ECU_36E.ADS_UDLCTurnLightReq)) & 0x7;
+	x <<= 61; 
+	m |= x;
+	*data = reverse_byte_order(m);
+	o->can_0x36e_ECU_36E_tx = 1;
+	return 0;
+}
+
+static int unpack_can_0x36e_ECU_36E(can_obj_shenlan_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) {
+	assert(o);
+	assert(dlc <= 8);
+	register uint64_t x;
+	register uint64_t m = reverse_byte_order(data);
+	if (dlc < 8)
+		return -1;
+	/* ADS_UDLCTurnLightReq: start-bit 7, length 3, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 61) & 0x7;
+	o->can_0x36e_ECU_36E.ADS_UDLCTurnLightReq = x;
+	o->can_0x36e_ECU_36E_rx = 1;
+	o->can_0x36e_ECU_36E_time_stamp_rx = time_stamp;
+	return 0;
+}
+
+int decode_can_0x36e_ADS_UDLCTurnLightReq(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x36e_ECU_36E.ADS_UDLCTurnLightReq);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x36e_ADS_UDLCTurnLightReq(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x36e_ECU_36E.ADS_UDLCTurnLightReq = in;
+	return 0;
+}
+
+int print_can_0x36e_ECU_36E(const can_obj_shenlan_h_t *o) {
+	assert(o);
+
+	int r = 0;
+	printf("\tADS_UDLCTurnLightReq = %d\r\n", (o->can_0x36e_ECU_36E.ADS_UDLCTurnLightReq));
+	return r;
+}
+
+static int pack_can_0x3aa_ADC_3AA(can_obj_shenlan_h_t *o, uint64_t *data) {
+	assert(o);
+	assert(data);
+	register uint64_t x;
+	register uint64_t m = 0;
+	/* VcuCrsSetSwtSts: start-bit 3, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x3aa_ADC_3AA.VcuCrsSetSwtSts)) & 0x3;
+	x <<= 58; 
+	m |= x;
+	/* VcuCrsResuSwtSts: start-bit 5, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x3aa_ADC_3AA.VcuCrsResuSwtSts)) & 0x3;
+	x <<= 60; 
+	m |= x;
+	/* VcuCrsDstSwtPlusSts: start-bit 7, length 2, endianess motorola, scaling 1, offset 0 */
+	x = ((uint8_t)(o->can_0x3aa_ADC_3AA.VcuCrsDstSwtPlusSts)) & 0x3;
+	x <<= 62; 
+	m |= x;
+	*data = reverse_byte_order(m);
+	o->can_0x3aa_ADC_3AA_tx = 1;
+	return 0;
+}
+
+static int unpack_can_0x3aa_ADC_3AA(can_obj_shenlan_h_t *o, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) {
+	assert(o);
+	assert(dlc <= 8);
+	register uint64_t x;
+	register uint64_t m = reverse_byte_order(data);
+	if (dlc < 8)
+		return -1;
+	/* VcuCrsSetSwtSts: start-bit 3, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 58) & 0x3;
+	o->can_0x3aa_ADC_3AA.VcuCrsSetSwtSts = x;
+	/* VcuCrsResuSwtSts: start-bit 5, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 60) & 0x3;
+	o->can_0x3aa_ADC_3AA.VcuCrsResuSwtSts = x;
+	/* VcuCrsDstSwtPlusSts: start-bit 7, length 2, endianess motorola, scaling 1, offset 0 */
+	x = (m >> 62) & 0x3;
+	o->can_0x3aa_ADC_3AA.VcuCrsDstSwtPlusSts = x;
+	o->can_0x3aa_ADC_3AA_rx = 1;
+	o->can_0x3aa_ADC_3AA_time_stamp_rx = time_stamp;
+	return 0;
+}
+
+int decode_can_0x3aa_VcuCrsSetSwtSts(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x3aa_ADC_3AA.VcuCrsSetSwtSts);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x3aa_VcuCrsSetSwtSts(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x3aa_ADC_3AA.VcuCrsSetSwtSts = in;
+	return 0;
+}
+
+int decode_can_0x3aa_VcuCrsResuSwtSts(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x3aa_ADC_3AA.VcuCrsResuSwtSts);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x3aa_VcuCrsResuSwtSts(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x3aa_ADC_3AA.VcuCrsResuSwtSts = in;
+	return 0;
+}
+
+int decode_can_0x3aa_VcuCrsDstSwtPlusSts(const can_obj_shenlan_h_t *o, uint8_t *out) {
+	assert(o);
+	assert(out);
+	uint8_t rval = (uint8_t)(o->can_0x3aa_ADC_3AA.VcuCrsDstSwtPlusSts);
+	*out = rval;
+	return 0;
+}
+
+int encode_can_0x3aa_VcuCrsDstSwtPlusSts(can_obj_shenlan_h_t *o, uint8_t in) {
+	assert(o);
+	o->can_0x3aa_ADC_3AA.VcuCrsDstSwtPlusSts = in;
+	return 0;
+}
+
+int print_can_0x3aa_ADC_3AA(const can_obj_shenlan_h_t *o) {
+	assert(o);
+
+	int r = 0;
+	printf("\tVcuCrsSetSwtSts = %d\r\n", (o->can_0x3aa_ADC_3AA.VcuCrsSetSwtSts));
+	printf("\tVcuCrsResuSwtSts = %d\r\n", (o->can_0x3aa_ADC_3AA.VcuCrsResuSwtSts));
+	printf("\tVcuCrsDstSwtPlusSts = %d\r\n", (o->can_0x3aa_ADC_3AA.VcuCrsDstSwtPlusSts));
+	return r;
+}
+
+int unpack_message(can_obj_shenlan_h_t *o, const unsigned long id, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp) {
+	assert(o);
+	assert(id < (1ul << 29)); /* 29-bit CAN ID is largest possible */
+	assert(dlc <= 8);         /* Maximum of 8 bytes in a CAN packet */
+	switch (id) {
+	case 0x144: return unpack_can_0x144_ECU_144(o, data, dlc, time_stamp);
+	case 0x147: return unpack_can_0x147_ADC_147(o, data, dlc, time_stamp);
+	case 0x14a: return unpack_can_0x14a_ADC_14A(o, data, dlc, time_stamp);
+	case 0x24b: return unpack_can_0x24b_ECU_24B(o, data, dlc, time_stamp);
+	case 0x250: return unpack_can_0x250_ADC_250(o, data, dlc, time_stamp);
+	case 0x358: return unpack_can_0x358_ADC_358(o, data, dlc, time_stamp);
+	case 0x36e: return unpack_can_0x36e_ECU_36E(o, data, dlc, time_stamp);
+	case 0x3aa: return unpack_can_0x3aa_ADC_3AA(o, data, dlc, time_stamp);
+	default: break; 
+	}
+	return -1; 
+}
+
+int pack_message(can_obj_shenlan_h_t *o, const unsigned long id, uint64_t *data) {
+	assert(o);
+	assert(id < (1ul << 29)); /* 29-bit CAN ID is largest possible */
+	switch (id) {
+	case 0x144: return pack_can_0x144_ECU_144(o, data);
+	case 0x147: return pack_can_0x147_ADC_147(o, data);
+	case 0x14a: return pack_can_0x14a_ADC_14A(o, data);
+	case 0x24b: return pack_can_0x24b_ECU_24B(o, data);
+	case 0x250: return pack_can_0x250_ADC_250(o, data);
+	case 0x358: return pack_can_0x358_ADC_358(o, data);
+	case 0x36e: return pack_can_0x36e_ECU_36E(o, data);
+	case 0x3aa: return pack_can_0x3aa_ADC_3AA(o, data);
+	default: break; 
+	}
+	return -1; 
+}
+
+int print_message(const can_obj_shenlan_h_t *o, const unsigned long id) {
+	assert(o);
+	assert(id < (1ul << 29)); /* 29-bit CAN ID is largest possible */
+
+	switch (id) {
+	case 0x144: return print_can_0x144_ECU_144(o);
+	case 0x147: return print_can_0x147_ADC_147(o);
+	case 0x14a: return print_can_0x14a_ADC_14A(o);
+	case 0x24b: return print_can_0x24b_ECU_24B(o);
+	case 0x250: return print_can_0x250_ADC_250(o);
+	case 0x358: return print_can_0x358_ADC_358(o);
+	case 0x36e: return print_can_0x36e_ECU_36E(o);
+	case 0x3aa: return print_can_0x3aa_ADC_3AA(o);
+	default: break; 
+	}
+	return -1; 
+}
+

+ 261 - 0
src/apollo/apollolib/adchassis/shenlan.h

@@ -0,0 +1,261 @@
+/** CAN message encoder/decoder: automatically generated - do not edit
+  * Generated by dbcc: See https://github.com/howerj/dbcc */
+#ifndef SHENLAN_H
+#define SHENLAN_H
+
+#include <stdint.h>
+
+
+#ifdef __cplusplus
+extern "C" { 
+#endif
+
+#ifndef PREPACK
+#define PREPACK
+#endif
+
+#ifndef POSTPACK
+#define POSTPACK
+#endif
+
+#ifndef DBCC_TIME_STAMP
+#define DBCC_TIME_STAMP
+typedef uint32_t dbcc_time_stamp_t; /* Time stamp for message; you decide on units */
+#endif
+
+#ifndef DBCC_STATUS_ENUM
+#define DBCC_STATUS_ENUM
+typedef enum {
+	DBCC_SIG_STAT_UNINITIALIZED_E = 0, /* Message never sent/received */
+	DBCC_SIG_STAT_OK_E            = 1, /* Message ok */
+	DBCC_SIG_STAT_ERROR_E         = 2, /* Encode/Decode/Timestamp/Any error */
+} dbcc_signal_status_e;
+#endif
+
+typedef PREPACK struct {
+	uint16_t ACC_LatAngReq; /* scaling 0.1, offset -720.0, units degree  */
+	uint16_t ACC_MotorTorqueMaxLimitRequest; /* scaling 0.0, offset -20.5, units Nm  */
+	uint16_t ACC_MotorTorqueMinLimitRequest; /* scaling 0.0, offset -20.5, units Nm  */
+	uint8_t ADS_Reqmode; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ACC_ADCReqType; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ACC_LatAngReqActive; /* scaling 1.0, offset 0.0, units none  */
+} POSTPACK can_0x144_ECU_144_t;
+
+typedef PREPACK struct {
+	int16_t EpsSasSteerAg; /* scaling 0.1, offset 0.0, units degree  */
+	uint16_t EPS_Pinionang; /* scaling 0.1, offset -720.0, units degree  */
+	uint16_t EspVehSpd; /* scaling 0.1, offset 0.0, units km/h  */
+	uint8_t EpsSteerAgRate; /* scaling 4.0, offset 0.0, units deg/s  */
+	uint8_t EPS_ADS_Abortfeedback; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t EPS_LatCtrlAvailabilityStatus; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t EpsSasSteerAgVld; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t EPS_LatCtrlActive; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t EspVehSpdVld; /* scaling 1.0, offset 0.0, units none  */
+} POSTPACK can_0x147_ADC_147_t;
+
+typedef PREPACK struct {
+	uint16_t VcuPtTqLimMax; /* scaling 1.0, offset -32768.0, units Nm  */
+	uint16_t VcuPtTqLimMin; /* scaling 1.0, offset -32768.0, units Nm  */
+	uint16_t VcuPtTqReal; /* scaling 1.0, offset -32768.0, units Nm  */
+	uint8_t VcuShiftLvlPosn; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t IBCU_ReduceFuncAvail; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t IBCU_FullFuncAvail; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ESP_BrakeForce; /* scaling 1.0, offset 0.0, units none  */
+} POSTPACK can_0x14a_ADC_14A_t;
+
+typedef PREPACK struct {
+	uint16_t ACC_AEBTargetDeceleration; /* scaling 0.0, offset -16.0, units m/s2  */
+	uint16_t ACC_AccTrqReq; /* scaling 1.0, offset -16384.0, units Nm  */
+	uint8_t ACC_ACCTargetAcceleration; /* scaling 0.1, offset -10.0, units m/s2  */
+	uint8_t ACC_ACCMode; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ADCReqMode; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ACC_AccTrqReqActive; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ACC_AEBVehilceHoldReq; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ACC_AEBActive; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ACC_Driveoff_Request; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ACC_DecToStop; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ACC_CDDActive; /* scaling 1.0, offset 0.0, units none  */
+} POSTPACK can_0x24b_ECU_24B_t;
+
+typedef PREPACK struct {
+	uint16_t ESP_YawRate; /* scaling 0.0, offset -81.9, units degree/s  */
+	uint16_t ESP_LongAccel; /* scaling 0.0, offset -16.0, units m/s2  */
+	uint8_t ESP_LatAccel; /* scaling 0.1, offset -12.7, units m/s2  */
+	uint8_t EPS_ADS_ControlFeedback; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ESP_YawRateValid; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ESP_LongAccelValid; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t ESP_LatAccelValid; /* scaling 1.0, offset 0.0, units none  */
+} POSTPACK can_0x250_ADC_250_t;
+
+typedef PREPACK struct {
+	uint8_t ADS_UDLCTurnLightReq; /* scaling 1.0, offset 0.0, units none  */
+} POSTPACK can_0x358_ADC_358_t;
+
+typedef PREPACK struct {
+	uint8_t ADS_UDLCTurnLightReq; /* scaling 1.0, offset 0.0, units none  */
+} POSTPACK can_0x36e_ECU_36E_t;
+
+typedef PREPACK struct {
+	uint8_t VcuCrsSetSwtSts; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t VcuCrsResuSwtSts; /* scaling 1.0, offset 0.0, units none  */
+	uint8_t VcuCrsDstSwtPlusSts; /* scaling 1.0, offset 0.0, units none  */
+} POSTPACK can_0x3aa_ADC_3AA_t;
+
+typedef PREPACK struct {
+	dbcc_time_stamp_t can_0x144_ECU_144_time_stamp_rx;
+	dbcc_time_stamp_t can_0x147_ADC_147_time_stamp_rx;
+	dbcc_time_stamp_t can_0x14a_ADC_14A_time_stamp_rx;
+	dbcc_time_stamp_t can_0x24b_ECU_24B_time_stamp_rx;
+	dbcc_time_stamp_t can_0x250_ADC_250_time_stamp_rx;
+	dbcc_time_stamp_t can_0x358_ADC_358_time_stamp_rx;
+	dbcc_time_stamp_t can_0x36e_ECU_36E_time_stamp_rx;
+	dbcc_time_stamp_t can_0x3aa_ADC_3AA_time_stamp_rx;
+	unsigned can_0x144_ECU_144_status : 2;
+	unsigned can_0x144_ECU_144_tx : 1;
+	unsigned can_0x144_ECU_144_rx : 1;
+	unsigned can_0x147_ADC_147_status : 2;
+	unsigned can_0x147_ADC_147_tx : 1;
+	unsigned can_0x147_ADC_147_rx : 1;
+	unsigned can_0x14a_ADC_14A_status : 2;
+	unsigned can_0x14a_ADC_14A_tx : 1;
+	unsigned can_0x14a_ADC_14A_rx : 1;
+	unsigned can_0x24b_ECU_24B_status : 2;
+	unsigned can_0x24b_ECU_24B_tx : 1;
+	unsigned can_0x24b_ECU_24B_rx : 1;
+	unsigned can_0x250_ADC_250_status : 2;
+	unsigned can_0x250_ADC_250_tx : 1;
+	unsigned can_0x250_ADC_250_rx : 1;
+	unsigned can_0x358_ADC_358_status : 2;
+	unsigned can_0x358_ADC_358_tx : 1;
+	unsigned can_0x358_ADC_358_rx : 1;
+	unsigned can_0x36e_ECU_36E_status : 2;
+	unsigned can_0x36e_ECU_36E_tx : 1;
+	unsigned can_0x36e_ECU_36E_rx : 1;
+	unsigned can_0x3aa_ADC_3AA_status : 2;
+	unsigned can_0x3aa_ADC_3AA_tx : 1;
+	unsigned can_0x3aa_ADC_3AA_rx : 1;
+	can_0x144_ECU_144_t can_0x144_ECU_144;
+	can_0x147_ADC_147_t can_0x147_ADC_147;
+	can_0x14a_ADC_14A_t can_0x14a_ADC_14A;
+	can_0x24b_ECU_24B_t can_0x24b_ECU_24B;
+	can_0x250_ADC_250_t can_0x250_ADC_250;
+	can_0x358_ADC_358_t can_0x358_ADC_358;
+	can_0x36e_ECU_36E_t can_0x36e_ECU_36E;
+	can_0x3aa_ADC_3AA_t can_0x3aa_ADC_3AA;
+} POSTPACK can_obj_shenlan_h_t;
+
+int unpack_message(can_obj_shenlan_h_t *o, const unsigned long id, uint64_t data, uint8_t dlc, dbcc_time_stamp_t time_stamp);
+int pack_message(can_obj_shenlan_h_t *o, const unsigned long id, uint64_t *data);
+int print_message(const can_obj_shenlan_h_t *o, const unsigned long id);
+
+int decode_can_0x144_ACC_LatAngReq(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x144_ACC_LatAngReq(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x144_ACC_MotorTorqueMaxLimitRequest(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x144_ACC_MotorTorqueMaxLimitRequest(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x144_ACC_MotorTorqueMinLimitRequest(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x144_ACC_MotorTorqueMinLimitRequest(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x144_ADS_Reqmode(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x144_ADS_Reqmode(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x144_ACC_ADCReqType(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x144_ACC_ADCReqType(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x144_ACC_LatAngReqActive(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x144_ACC_LatAngReqActive(can_obj_shenlan_h_t *o, uint8_t in);
+
+
+int decode_can_0x147_EpsSasSteerAg(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x147_EpsSasSteerAg(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x147_EPS_Pinionang(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x147_EPS_Pinionang(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x147_EspVehSpd(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x147_EspVehSpd(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x147_EpsSteerAgRate(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x147_EpsSteerAgRate(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x147_EPS_ADS_Abortfeedback(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x147_EPS_ADS_Abortfeedback(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x147_EPS_LatCtrlAvailabilityStatus(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x147_EPS_LatCtrlAvailabilityStatus(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x147_EpsSasSteerAgVld(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x147_EpsSasSteerAgVld(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x147_EPS_LatCtrlActive(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x147_EPS_LatCtrlActive(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x147_EspVehSpdVld(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x147_EspVehSpdVld(can_obj_shenlan_h_t *o, uint8_t in);
+
+
+int decode_can_0x14a_VcuPtTqLimMax(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x14a_VcuPtTqLimMax(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x14a_VcuPtTqLimMin(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x14a_VcuPtTqLimMin(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x14a_VcuPtTqReal(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x14a_VcuPtTqReal(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x14a_VcuShiftLvlPosn(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x14a_VcuShiftLvlPosn(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x14a_IBCU_ReduceFuncAvail(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x14a_IBCU_ReduceFuncAvail(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x14a_IBCU_FullFuncAvail(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x14a_IBCU_FullFuncAvail(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x14a_ESP_BrakeForce(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x14a_ESP_BrakeForce(can_obj_shenlan_h_t *o, uint8_t in);
+
+
+int decode_can_0x24b_ACC_AEBTargetDeceleration(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x24b_ACC_AEBTargetDeceleration(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x24b_ACC_AccTrqReq(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x24b_ACC_AccTrqReq(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x24b_ACC_ACCTargetAcceleration(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x24b_ACC_ACCTargetAcceleration(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x24b_ACC_ACCMode(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x24b_ACC_ACCMode(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x24b_ADCReqMode(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x24b_ADCReqMode(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x24b_ACC_AccTrqReqActive(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x24b_ACC_AccTrqReqActive(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x24b_ACC_AEBVehilceHoldReq(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x24b_ACC_AEBVehilceHoldReq(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x24b_ACC_AEBActive(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x24b_ACC_AEBActive(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x24b_ACC_Driveoff_Request(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x24b_ACC_Driveoff_Request(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x24b_ACC_DecToStop(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x24b_ACC_DecToStop(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x24b_ACC_CDDActive(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x24b_ACC_CDDActive(can_obj_shenlan_h_t *o, uint8_t in);
+
+
+int decode_can_0x250_ESP_YawRate(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x250_ESP_YawRate(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x250_ESP_LongAccel(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x250_ESP_LongAccel(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x250_ESP_LatAccel(const can_obj_shenlan_h_t *o, double *out);
+int encode_can_0x250_ESP_LatAccel(can_obj_shenlan_h_t *o, double in);
+int decode_can_0x250_EPS_ADS_ControlFeedback(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x250_EPS_ADS_ControlFeedback(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x250_ESP_YawRateValid(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x250_ESP_YawRateValid(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x250_ESP_LongAccelValid(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x250_ESP_LongAccelValid(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x250_ESP_LatAccelValid(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x250_ESP_LatAccelValid(can_obj_shenlan_h_t *o, uint8_t in);
+
+
+int decode_can_0x358_ADS_UDLCTurnLightReq(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x358_ADS_UDLCTurnLightReq(can_obj_shenlan_h_t *o, uint8_t in);
+
+
+int decode_can_0x36e_ADS_UDLCTurnLightReq(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x36e_ADS_UDLCTurnLightReq(can_obj_shenlan_h_t *o, uint8_t in);
+
+
+int decode_can_0x3aa_VcuCrsSetSwtSts(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x3aa_VcuCrsSetSwtSts(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x3aa_VcuCrsResuSwtSts(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x3aa_VcuCrsResuSwtSts(can_obj_shenlan_h_t *o, uint8_t in);
+int decode_can_0x3aa_VcuCrsDstSwtPlusSts(const can_obj_shenlan_h_t *o, uint8_t *out);
+int encode_can_0x3aa_VcuCrsDstSwtPlusSts(can_obj_shenlan_h_t *o, uint8_t in);
+
+
+#ifdef __cplusplus
+} 
+#endif
+
+#endif

+ 20 - 3
src/apollo/apollolib/shenlanfd/shenlanfd.cpp

@@ -1,6 +1,8 @@
 #include "shenlanfd.h"
 
 
+#include <memory.h>
+
 // signal: @ACC_LatAngReq    //更改CANid
 #define ECU_1C4_ACC_LatAngReq_CovFactor (0.1)
 // conversion value to CAN signal
@@ -66,9 +68,9 @@ typedef struct
     uint8_t ADS_UDLCTurnLightReq;
 } ECU_25E_t;  //zhuanxiangdeng IDgenghuan
 
-unsigned char byte_1C4[64];//byte_144[8];
-unsigned char byte_24E[64];
-unsigned char byte_25E[32];
+static unsigned char byte_1C4[64];//byte_144[8];
+static unsigned char byte_24E[64];
+static unsigned char byte_25E[32];
 
 ECU_1C4_t _m1C4 = {0,0,0,0};
 ECU_24E_t _m24E = {0,0,0,0,0,0,0,0,0,0,0};
@@ -267,3 +269,18 @@ void Shenlanfd::SetDecision(iv::dcs & xdcs)
     mnLastUpdate = std::chrono::system_clock::now().time_since_epoch().count();
     mmutexdcs.unlock();
 }
+
+void Shenlanfd::Get1C4(unsigned char * p1C4)
+{
+    memcpy(p1C4,byte_1C4,64);
+}
+
+void Shenlanfd::Get24E(unsigned char * p24E)
+{
+    memcpy(p24E,byte_24E,64);
+}
+
+void Shenlanfd::Get25E(unsigned char * p25E)
+{
+    memcpy(p25E,byte_25E,32);
+}

+ 4 - 0
src/apollo/apollolib/shenlanfd/shenlanfd.h

@@ -27,6 +27,10 @@ public:
     void SetSpeed(double fSpeed);
     void SetDecision(iv::dcs &xdcs);
 
+    void Get1C4(unsigned char * p1C4);
+    void Get24E(unsigned char * p24E);
+    void Get25E(unsigned char * p25E);
+
 private:
     void threadsend();
 

+ 1 - 0
src/detection/detection_chassis/main.cpp

@@ -98,6 +98,7 @@ void Listencan0(const char * strdata,const unsigned int nSize,const unsigned int
         break;
     case iv::SHENLAN:
         nRtn = ProcShenLanChassis(gpa,&xmsg);
+        break;
     case iv::SHENLAN_CANFD:
         nRtn = ProcShenLanCANFDChassis(gpa,&xmsg);
         break;