copy TRDP_OP_TRAIN_DIR_STATUS_INFO_T completely when receiving a ComId 100 PD dataset.
Within implementation of tau_tti.c following memcpy is done:
memcpy(&appHandle->pTTDB->opTrnState, &pTelegram->state,
(sizeof(TRDP_OP_TRAIN_DIR_STATE_T) < dataSize) ? sizeof(TRDP_OP_TRAIN_DIR_STATE_T) : dataSize);
Cause TRDP_OP_TRAIN_DIR_STATE_T state; is in front of TRDP_OP_TRAIN_DIR_STATUS_INFO_T opTrnState; this will be copied correctly BUT everything else is left untouched/uncopied. Therefore for example the own consist numbers won't be copied and are therefore wrong in database.
Imho the correct call would be:
memcpy(&appHandle->pTTDB->opTrnState, pTelegram,
(sizeof(TRDP_OP_TRAIN_DIR_STATUS_INFO_T) < dataSize) ? sizeof(TRDP_OP_TRAIN_DIR_STATUS_INFO_T) : dataSize);
please see revision r1863 on branch trdp-mm-1.3.1.0 for a possible fix
Fixed, ownOpCstNo, ownTrnCstNo + safety trailer are now copied.
However, this rises an until now hidden problem: SDT must be able to validate these packets before using the values. This can only be done on the raw packets. -> For safety related communication, the tau_tti subsystem must not de-marshall SDTv2 protected data! see Ticket #258