移植到stm32f1,实现手动线赋码控制器功能
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user