Skip to content

Commit

Permalink
fix LinSTP SN not correct bug
Browse files Browse the repository at this point in the history
  • Loading branch information
parai committed Feb 28, 2021
1 parent 6b21004 commit 7c5a33d
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions com/as.infrastructure/communication/Lin/LinSTp.c
Original file line number Diff line number Diff line change
@@ -194,10 +194,12 @@ Std_ReturnType LinSTp_Transmit(PduIdType Instance, const PduInfoType *PduInfo)
context->PduInfo.SduLength = PduInfo->SduLength;
context->PduInfo.SduDataPtr = PduInfo2->SduDataPtr;
context->index = 0;
context->SN = 1;
context->state = LINSTP_TX_BUSY;
context->timer =config->timeout;
} else {
ASLOG(LINSTPE, ("[%d] provide TX buffer failed\n",Instance));
ercd = E_NOT_OK;
}
}
} else {
4 changes: 2 additions & 2 deletions com/as.tool/as.one.py/pyas/cantp.py
Original file line number Diff line number Diff line change
@@ -406,8 +406,8 @@ def __waitCF__(self,response):
SN = data[0]&0x0F
if (SN == self.SN):
l_size = t_size - sz # left size
if (l_size > (self.ll_dl-1)):
l_size = self.ll_dl-1
if (l_size > (len(data)-1)):
l_size = len(data)-1
for i in range(l_size):
response.append(data[i+1])

0 comments on commit 7c5a33d

Please sign in to comment.