移植到stm32f1,实现手动线赋码控制器功能

This commit is contained in:
ranchuan
2023-09-09 17:27:06 +08:00
parent 8d779a68f3
commit 7baa63de05
382 changed files with 36618 additions and 148064 deletions

View File

@@ -111,6 +111,27 @@ int coder_shell_to_uid(const char *year,const char *shell_code,char *uid_code)
// JQ管壳码转uid码
int coder_shell_to_uid_jq(const char *year,const char *shell_code,char *uid_code)
{
int ret=0;
memset(uid_code,0,16);
// 添加雷管厂代号(2byte)
memcpy(&uid_code[0],&shell_code[0],2);
// 添加年份(2y=byte)
ret=coder_calc_year(year,shell_code[2],&uid_code[2]);
// 添加0(1byte)
memcpy(&uid_code[4],"0",1);
// 添加月日特征码流水号
memcpy(&uid_code[5], &shell_code[3],10);
return ret;
}
// 转换hex字符串为一个byte
static int coder_strhex_to_byte(const char *str_hex)
{
@@ -212,3 +233,5 @@ int coder_uid_to_shell(const char *uid_code,char *shell_code)