Menu

#365 All FctInfo are stored at index 0

2.1.0.0
closed
2237 (1)
2021-08-11
2021-04-13
No

In the function ttiCreateCstInfoEntry all fctInfo enteris are copied to index 0. The idx counter are not used.

Old sources:
for (idx = 0u; idx < pDest->fctCnt; idx++)
{
memcpy(pDest->pFctInfoList->fctName, pData, sizeof(TRDP_NET_LABEL_T));
pData += sizeof(TRDP_NET_LABEL_T);
pDest->pFctInfoList->fctId = vos_ntohs((UINT16 )pData);
pData += sizeof(UINT16);
pDest->pFctInfoList->grp = pData++;
pDest->pFctInfoList->reserved01 =
pData++;
pDest->pFctInfoList->cstVehNo = pData++;
pDest->pFctInfoList->etbId =
pData++;
pDest->pFctInfoList->cnId = pData++;
pDest->pFctInfoList->reserved02 =
pData++;
}

 Suggested change:
     for (idx = 0u; idx < pDest->fctCnt; idx++)
{
    memcpy(pDest->pFctInfoList[idx].fctName, pData, sizeof(TRDP_NET_LABEL_T));
    pData += sizeof(TRDP_NET_LABEL_T);
    pDest->pFctInfoList[idx].fctId = vos_ntohs(*(UINT16 *)pData);
    pData += sizeof(UINT16);
    pDest->pFctInfoList[idx].grp        = *pData++;
    pDest->pFctInfoList[idx].reserved01 = *pData++;
    pDest->pFctInfoList[idx].cstVehNo   = *pData++;
    pDest->pFctInfoList[idx].etbId      = *pData++;
    pDest->pFctInfoList[idx].cnId       = *pData++;
    pDest->pFctInfoList[idx].reserved02 = *pData++;
}

Related

Tickets: #402

Discussion

  • Armin-Hagen Weiss

    • labels: --> 2237
    • status: open --> pending
    • assigned_to: Iris Bosse
     
  • Armin-Hagen Weiss

    Changed accordingly. To be tested.

     
  • Stefan Bender

    Stefan Bender - 2021-08-02

    In the function tau_getCstInfo() in tau_tti.c etbCnt, vehCnt and fctCnt in appHandle.pTTDB->cstInfo are already in Host endianess. Rotating them again leads to false values:

            *pCstInfo           = *appHandle->pTTDB->cstInfo[l_index];
            pCstInfo->etbCnt    = vos_ntohs(pCstInfo->etbCnt);
            pCstInfo->vehCnt    = vos_ntohs(pCstInfo->vehCnt);
            pCstInfo->fctCnt    = vos_ntohs(pCstInfo->fctCnt);
    
     
  • Stefan Bender

    Stefan Bender - 2021-08-11
     
  • Stefan Bender

    Stefan Bender - 2021-08-11

    Tested in api_test_4.c test3

     

    Last edit: Stefan Bender 2021-08-11
  • Stefan Bender

    Stefan Bender - 2021-08-11
    • status: pending --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB