既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上物联网嵌入式知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、电子书籍、讲解视频,并且后续会持续更新
CANoe的开发公司Vector 已经提供了DLL生成的工程模板,以Win7系统, CANoe 8.5为例,工程模板路径如下:
C:\Users\Public\Documents\Vector\CANoe\8.5\CANoe Sample Configurations\Programming\CAPLdll
1.2 接口函数
打开CAPLdll\Includes\cdll.h 180行
// New struct supporting up to 64 parameters
typedef struct CAPL_DLL_INFO4{
char cdlName[MAX_CDL_NAME2]; // name of the function
CAPL_FARCALL adr; // address of the function
const char\* categoryName; // name of function category
const char\* hintText; // hint text for function selection
char resultType; // type of func result
int parCount; // no. of parameters
char parTypes[MAXCAPLFUNCPARS_8_1]; // types of parameters
unsigned char array[MAXCAPLFUNCPARS_8_1]; // depth of array. Without: \0
const char\* parNames[MAXCAPLFUNCPARS_8_1]; // names of parameters
} CAPL_DLL_INFO4;
关于参数类型的定义如下:
1.3 添加 appSeedKeyCals
打开CAPLdll\Sources\capldll.cpp
a. Seed2Key 函数声明
// Seed2Key
unsigned long CAPLEXPORT far CAPLPASCAL appSeedKeyCals(unsigned long Seed,const unsigned long EncryptConstant)
{
unsigned long Key ;
Key=Seed+1; /\*Only for Demo\*/
return( Key );
}
b. Seed2Key 导出DLL
插入Seed2Key到接口函数table.
{"dllSeedKeyCals", (CAPL_FARCALL)appSeedKeyCals, "CAPL\_DLL","This function will calculation the key . The return value is the result",'D', 2, "DD", "", {"Seed","EncryptConstant"}},
更新后的table如下:
// ============================================================================
// CAPL\_DLL\_INFO\_LIST : list of exported functions
// The first field is predefined and mustn't be changed!
// The list has to end with a {0,0} entry!
// New struct supporting function names with up to 50 characters
// ============================================================================
CAPL_DLL_INFO4 table[] = {
{CDLL_VERSION_NAME, (CAPL_FARCALL)CDLL_VERSION, "", "", CAPL_DLL_CDECL, 0xabcd, CDLL_EXPORT },
{"dllInit", (CAPL_FARCALL)appInit, "CAPL\_DLL","This function will initialize all callback functions in the CAPLDLL",'V', 1, "D", "", {"handle"}},
{"dllEnd", (CAPL_FARCALL)appEnd, "CAPL\_DLL","This function will release the CAPL function handle in the CAPLDLL",'V', 1, "D", "", {"handle"}},
{"dllSetValue", (CAPL_FARCALL)appSetValue, "CAPL\_DLL","This function will call a callback functions",'L', 2, "DL", "", {"handle","x"}},
{"dllReadData", (CAPL_FARCALL)appReadData, "CAPL\_DLL","This function will call a callback functions",'L', 2, "DL", "", {"handle","x"}},
{"dllPut", (CAPL_FARCALL)appPut, "CAPL\_DLL","This function will save data from CAPL to DLL memory",'V', 1, "D", "", {"x"}},
{"dllGet", (CAPL_FARCALL)appGet, "CAPL\_DLL","This function will read data from DLL memory to CAPL",'D', 0, "", "", {""}},
{"dllVoid", (CAPL_FARCALL)voidFct, "CAPL\_DLL","This function will overwrite DLL memory from CAPL without parameter",'V', 0, "", "", {""}},
{"dllPutDataOnePar", (CAPL_FARCALL)appPutDataOnePar, "CAPL\_DLL","This function will put data from CAPL array to DLL",'V', 1, "B", "\001", {"datablock"}},
{"dllGetDataOnePar", (CAPL_FARCALL)appGetDataOnePar, "CAPL\_DLL","This function will get data from DLL into CAPL memory",'V', 1, "B", "\001", {"datablock"}},
{"dllPutDataTwoPars", (CAPL_FARCALL)appPutDataTwoPars,"CAPL\_DLL","This function will put two datas from CAPL array to DLL",'V', 2, "DB", "\000\001", {"noOfBytes","datablock"}},// number of pars in octal format
{"dllGetDataTwoPars", (CAPL_FARCALL)appGetDataTwoPars,"CAPL\_DLL","This function will get two datas from DLL into CAPL memory",'V', 2, "DB", "\000\001", {"noOfBytes","datablock"}},
{"dllAdd", (CAPL_FARCALL)appAdd, "CAPL\_DLL","This function will add two values. The return value is the result",'L', 2, "LL", "", {"x","y"}},
{"dllSubtract", (CAPL_FARCALL)appSubtract, "CAPL\_DLL","This function will substract two values. The return value is the result",'L', 2, "LL", "", {"x","y"}},
{"dllSeedKeyCals", (CAPL_FARCALL)appSeedKeyCals, "CAPL\_DLL","This function will calculation the key . The return value is the result",'D', 2, "DD", "", {"Seed","EncryptConstant"}},
{"dllSupportLongFunctionNamesWithUpTo50Characters", (CAPL_FARCALL)appLongFuncName, "CAPL\_DLL","This function shows the support of long function names",'D', 0, "", "", {""}},
{"dllAdd63Parameters", (CAPL_FARCALL)appAddValues63, "CAPL\_DLL", "This function will add 63 values. The return value is the result",'L', 63, "LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL", "", {"val01","val02","val03","val04","val05","val06","val07","val08","val09","val10","val11","val12","val13","val14","val15","val16","val17","val18","val19","val20","val21","val22","val23","val24","val25","val26","val27","val28","val29","val30","val31","val32","val33","val34","val35","val36","val37","val38","val39","val40","val41","val42","val43","val44","val45","val46","val47","val48","val49","val50","val51","val52","val53","val54","val55","val56","val57","val58","val59","val60","val61","val62","val63"}},
{"dllAdd64Parameters", (CAPL_FARCALL)appAddValues64, "CAPL\_DLL", "This function will add 64 values. The return value is the result",'L', 64, {SixtyFourLongPars}, "", {"val01","val02","val03","val04","val05","val06","val07","val08","val09","val10","val11","val12","val13","val14","val15","val16","val17","val18","val19","val20","val21","val22","val23","val24","val25","val26","val27","val28","val29","val30","val31","val32","val33","val34","val35","val36","val37","val38","val39","val40","val41","val42","val43","val44","val45","val46","val47","val48","val49","val50","val51","val52","val53","val54","val55","val56","val57","val58","val59","val60","val61","val62","val63","val64"}},
{0, 0}
};
1.4 编译生成DLL
2. Seed2Key DLL调用
2.1 Include DLL
既有适合小白学习的零基础资料,也有适合3年以上经验的小伙伴深入学习提升的进阶课程,涵盖了95%以上物联网嵌入式知识点,真正体系化!
由于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、电子书籍、讲解视频,并且后续会持续更新
于文件比较多,这里只是将部分目录截图出来,全套包含大厂面经、学习笔记、源码讲义、实战项目、大纲路线、电子书籍、讲解视频,并且后续会持续更新**