Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Something confused about byte_stuffing_cnt #117

Open
Bozenton opened this issue Dec 9, 2022 · 0 comments
Open

Something confused about byte_stuffing_cnt #117

Bozenton opened this issue Dec 9, 2022 · 0 comments

Comments

@Bozenton
Copy link

Bozenton commented Dec 9, 2022

Hi there,

Thanks for your code. When I was reading your code, I noticed that you declared byte_stuffing_cnt as a private variable of the function:

static DXLLibErrorCode_t parse_dxl2_0_packet(InfoToParseDXLPacket_t* p_parse_packet, uint8_t recv_data)
{
DXLLibErrorCode_t ret = DXL_LIB_PROCEEDING;
uint16_t byte_stuffing_cnt = 0;

as far as I know from your repo, this function parse_dxl2_0_packet is called when a byte is received. So each time it is called, the variable byte_stuffing_cnt would reset to 0, which, I think, may cause bad influence on this line if there are many 'byte stuffing' in the packet:

if(p_parse_packet->recv_param_len+byte_stuffing_cnt+3 == p_parse_packet->packet_len){ // 3 = Instruction(1)+CRC(2)

Is it a bug or is there something wrong with my understanding? Hope for your reply sincerely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant