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

SDO and NMT simulation #64

Open
Chernobrovka opened this issue Apr 22, 2024 · 0 comments
Open

SDO and NMT simulation #64

Chernobrovka opened this issue Apr 22, 2024 · 0 comments

Comments

@Chernobrovka
Copy link

Is it possible to simulate the reception of nmt and sdo messages in CO Node using the functions:
static void CO_NMT_receive(void *object, void *msg);
static void CO_SDO_receive(void object, void msg);
I'm trying to do it like this:
if (tx_hdr.StdId == 0 && buffer->data[1] == CO_NODE_ID && buffer->DLC == 2){
CO_CANrxMsg_t rcvMsg;
CO_CANrx_t
nmt_command = CANModule_local->rxArray;
memcpy(rcvMsg.data, buffer->data, NMT_LEN);
rcvMsg.ident = 0;
rcvMsg.dlc = NMT_LEN;
nmtReceiveInterface(&nmt_command, &rcvMsg);
}
else if (tx_hdr.StdId == SDO_START_ADRESS + CO_NODE_ID){
CO_CANrxMsg_t rcvMsg;
CO_CANrx_t
sdo_command = CANModule_local->rxArray;
memcpy(rcvMsg.data, buffer->data, SDO_LEN);
rcvMsg.ident = tx_hdr.StdId;
rcvMsg.dlc = SDO_LEN;
sdoReceiveInterface(&sdo_command, &rcvMsg);
}
Will I be able to do this?

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