# HG changeset patch # User etisserant # Date 1201080952 -3600 # Node ID 9b76e0881beb0fab3f4a7c12a356727a98e94c78 # Parent 17edd8a028fad29fcad8a7caa8682fa263210382 Changed cob_id from struct{UNS32} to UNS16 diff -r 17edd8a028fa -r 9b76e0881beb drivers/can_can4linux/can_can4linux.c --- a/drivers/can_can4linux/can_can4linux.c Tue Jan 22 10:27:13 2008 +0100 +++ b/drivers/can_can4linux/can_can4linux.c Wed Jan 23 10:35:52 2008 +0100 @@ -54,7 +54,7 @@ /* There is no mark for extended messages in CanFestival */; } - m->cob_id.w = canmsg.id; + m->cob_id = canmsg.id; m->len = canmsg.length; if(canmsg.flags&MSG_RTR){ m->rtr = 1; @@ -66,8 +66,8 @@ /*gettimeofday(¤t_time,NULL); time_period=(current_time.tv_sec - init_time.tv_sec)* 1000000 + current_time.tv_usec - init_time.tv_usec; - printf("%3ld.%3ld.%3ld - Receive ID: %lx ->",time_period/1000000,(time_period%1000000)/1000,time_period%1000,m->cob_id.w); - printf("Receive ID: %lx ->",m->cob_id.w); + printf("%3ld.%3ld.%3ld - Receive ID: %lx ->",time_period/1000000,(time_period%1000000)/1000,time_period%1000,m->cob_id); + printf("Receive ID: %lx ->",m->cob_id); for(i=0; idata[i]); printf("\n");*/ @@ -81,7 +81,7 @@ canmsg_t canmsg; canmsg.flags = 0; - canmsg.id = m->cob_id.w; + canmsg.id = m->cob_id; canmsg.length = m->len; if(m->rtr){ canmsg.flags |= MSG_RTR; diff -r 17edd8a028fa -r 9b76e0881beb drivers/can_ixxat_win32/ixxat.cpp --- a/drivers/can_ixxat_win32/ixxat.cpp Tue Jan 22 10:27:13 2008 +0100 +++ b/drivers/can_ixxat_win32/ixxat.cpp Wed Jan 23 10:35:52 2008 +0100 @@ -127,9 +127,9 @@ return true; // true -> NOT OK long res = VCI_ERR; if (m->rtr == NOT_A_REQUEST) - res = VCI_TransmitObj(m_BoardHdl, m_TxQueHdl, m->cob_id.w, m->len, const_cast(m->data)); + res = VCI_TransmitObj(m_BoardHdl, m_TxQueHdl, m->cob_id, m->len, const_cast(m->data)); else - res = VCI_RequestObj(m_BoardHdl, m_TxQueHdl, m->cob_id.w, m->len); + res = VCI_RequestObj(m_BoardHdl, m_TxQueHdl, m->cob_id, m->len); return (res == false); // false -> OK } @@ -141,7 +141,7 @@ VCI_CAN_OBJ obj; if (m_RX_Que.extract_top(obj)) { - m->cob_id.w = obj.id; + m->cob_id = obj.id; m->len = obj.len; m->rtr = (obj.rtr == VCI_RX_BUF) ? NOT_A_REQUEST : REQUEST; if (m->rtr == NOT_A_REQUEST) diff -r 17edd8a028fa -r 9b76e0881beb drivers/can_lincan/can_lincan.c --- a/drivers/can_lincan/can_lincan.c Tue Jan 22 10:27:13 2008 +0100 +++ b/drivers/can_lincan/can_lincan.c Wed Jan 23 10:35:52 2008 +0100 @@ -50,7 +50,7 @@ /* There is no mark for extended messages in CanFestival */; } - m->cob_id.w = canmsg.id; + m->cob_id = canmsg.id; m->len = canmsg.length; if(canmsg.flags&MSG_RTR){ m->rtr = 1; @@ -70,7 +70,7 @@ canmsg.flags = 0; - canmsg.id = m->cob_id.w; + canmsg.id = m->cob_id; canmsg.length = m->len; if(m->rtr){ canmsg.flags |= MSG_RTR; diff -r 17edd8a028fa -r 9b76e0881beb drivers/can_peak_linux/can_peak_linux.c --- a/drivers/can_peak_linux/can_peak_linux.c Tue Jan 22 10:27:13 2008 +0100 +++ b/drivers/can_peak_linux/can_peak_linux.c Wed Jan 23 10:35:52 2008 +0100 @@ -48,7 +48,7 @@ } return 1; } - m->cob_id.w = peakMsg.ID; + m->cob_id = peakMsg.ID; if (peakMsg.MSGTYPE == CAN_INIT_TYPE_ST) /* bits of MSGTYPE_*/ m->rtr = 0; else @@ -65,7 +65,7 @@ { UNS8 data; TPCANMsg peakMsg; - peakMsg.ID=m -> cob_id.w; /* 11/29 bit code */ + peakMsg.ID=m -> cob_id; /* 11/29 bit code */ if(m->rtr == 0) peakMsg.MSGTYPE = CAN_INIT_TYPE_ST; /* bits of MSGTYPE_*/ else { diff -r 17edd8a028fa -r 9b76e0881beb drivers/can_peak_win32/can_peak_win32.c --- a/drivers/can_peak_win32/can_peak_win32.c Tue Jan 22 10:27:13 2008 +0100 +++ b/drivers/can_peak_win32/can_peak_win32.c Wed Jan 23 10:35:52 2008 +0100 @@ -125,7 +125,7 @@ return peakMsg.MSGTYPE == MSGTYPE_STATUS ? peakMsg.DATA[2] : CAN_ERR_OVERRUN; } - m->cob_id.w = peakMsg.ID; + m->cob_id = peakMsg.ID; if (peakMsg.MSGTYPE == CAN_INIT_TYPE_ST) /* bits of MSGTYPE_ */ m->rtr = 0; @@ -161,7 +161,7 @@ { UNS8 data; TPCANMsg peakMsg; - peakMsg.ID = m->cob_id.w; /* 11/29 bit code */ + peakMsg.ID = m->cob_id; /* 11/29 bit code */ if (m->rtr == 0) peakMsg.MSGTYPE = CAN_INIT_TYPE_ST; /* bits of MSGTYPE_ */ else diff -r 17edd8a028fa -r 9b76e0881beb drivers/can_socket/can_socket.c --- a/drivers/can_socket/can_socket.c Tue Jan 22 10:27:13 2008 +0100 +++ b/drivers/can_socket/can_socket.c Wed Jan 23 10:35:52 2008 +0100 @@ -73,7 +73,7 @@ return 1; } - m->cob_id.w = frame.can_id & CAN_EFF_MASK; + m->cob_id = frame.can_id & CAN_EFF_MASK; m->len = frame.can_dlc; if (frame.can_id & CAN_RTR_FLAG) m->rtr = 1; @@ -96,7 +96,7 @@ int res; struct can_frame frame; - frame.can_id = m->cob_id.w; + frame.can_id = m->cob_id; if (frame.can_id >= 0x800) frame.can_id |= CAN_EFF_FLAG; frame.can_dlc = m->len; diff -r 17edd8a028fa -r 9b76e0881beb drivers/can_uvccm_win32/can_uvccm_win32.cpp --- a/drivers/can_uvccm_win32/can_uvccm_win32.cpp Tue Jan 22 10:27:13 2008 +0100 +++ b/drivers/can_uvccm_win32/can_uvccm_win32.cpp Wed Jan 23 10:35:52 2008 +0100 @@ -236,7 +236,7 @@ ::memset(&msg, 0 , sizeof (msg)); char colon = 0, type = 0, request = 0; std::istringstream buf(std::string(can_cmd_buf, bufsize)); - buf >> colon >> type >> std::hex >> msg.cob_id.w >> request; + buf >> colon >> type >> std::hex >> msg.cob_id >> request; if (colon != ':' || (type != 'S' && type != 'X')) { bufsize = 0; @@ -293,7 +293,7 @@ { // build can_uvccm_win32 command string std::ostringstream can_cmd_str; - can_cmd_str << ":S" << std::hex << m.cob_id.w; + can_cmd_str << ":S" << std::hex << m.cob_id; if (m.rtr == 1) { can_cmd_str << 'R' << (long)m.len; diff -r 17edd8a028fa -r 9b76e0881beb drivers/hcs12/canOpenDriver.c --- a/drivers/hcs12/canOpenDriver.c Tue Jan 22 10:27:13 2008 +0100 +++ b/drivers/hcs12/canOpenDriver.c Wed Jan 23 10:35:52 2008 +0100 @@ -422,8 +422,8 @@ /* Selecting a buffer */ IO_PORTS_8(adrCAN + CANTBSEL) = cantflg; /* We put ide = 0 because id is on 11 bits only */ - IO_PORTS_8(adrCAN + CANTRSID) = (UNS8)(msg.cob_id.w >> 3); - IO_PORTS_8(adrCAN + CANTRSID + 1) = (UNS8)((msg.cob_id.w << 5)| + IO_PORTS_8(adrCAN + CANTRSID) = (UNS8)(msg.cob_id >> 3); + IO_PORTS_8(adrCAN + CANTRSID + 1) = (UNS8)((msg.cob_id << 5)| (msg.rtr << 4)); IO_PORTS_8(adrCAN + CANTRSLEN) = msg.len & 0X0F; @@ -533,7 +533,7 @@ ptrMsgRcv[j].r ++; /* Store the message from the stack*/ - msgRcv->cob_id.w = stackMsgRcv[j][ptrMsgRcv[j].r].cob_id.w; + msgRcv->cob_id = stackMsgRcv[j][ptrMsgRcv[j].r].cob_id; msgRcv->len = stackMsgRcv[j][ptrMsgRcv[j].r].len; msgRcv->rtr = stackMsgRcv[j][ptrMsgRcv[j].r].rtr; for (i = 0 ; i < stackMsgRcv[j][ptrMsgRcv[j].r].len ; i++) @@ -572,7 +572,7 @@ ptrMsgRcv[0].w = NewPtrW; /* Store the message */ - stackMsgRcv[0][ptrMsgRcv[0].w].cob_id.w = IO_PORTS_16(CAN0 + CANRCVID) >> 5; + stackMsgRcv[0][ptrMsgRcv[0].w].cob_id = IO_PORTS_16(CAN0 + CANRCVID) >> 5; stackMsgRcv[0][ptrMsgRcv[0].w].len = IO_PORTS_8(CAN0 + CANRCVLEN) & 0x0F; stackMsgRcv[0][ptrMsgRcv[0].w].rtr = (IO_PORTS_8(CAN0 + CANRCVID + 1) >> 4) & 0x01; for (i = 0 ; i < stackMsgRcv[0][ptrMsgRcv[0].w].len ; i++) @@ -623,7 +623,7 @@ ptrMsgRcv[1].w = NewPtrW; /* Store the message */ - stackMsgRcv[1][ptrMsgRcv[1].w].cob_id.w = IO_PORTS_16(CAN1 + CANRCVID) >> 5; + stackMsgRcv[1][ptrMsgRcv[1].w].cob_id = IO_PORTS_16(CAN1 + CANRCVID) >> 5; stackMsgRcv[1][ptrMsgRcv[1].w].len = IO_PORTS_8(CAN1 + CANRCVLEN) & 0x0F; stackMsgRcv[0][ptrMsgRcv[0].w].rtr = (IO_PORTS_8(CAN1 + CANRCVID + 1) >> 4) & 0x01; for (i = 0 ; i < stackMsgRcv[1][ptrMsgRcv[1].w].len ; i++) diff -r 17edd8a028fa -r 9b76e0881beb examples/gene_SYNC_HCS12/appli.c --- a/examples/gene_SYNC_HCS12/appli.c Tue Jan 22 10:27:13 2008 +0100 +++ b/examples/gene_SYNC_HCS12/appli.c Wed Jan 23 10:35:52 2008 +0100 @@ -405,7 +405,7 @@ while (1) { Message m; if (f_can_receive(0, &m)) { - //MSG_WAR(0x3F36, "Msg received", m.cob_id.w); + //MSG_WAR(0x3F36, "Msg received", m.cob_id); lock(); // Not to have interruptions by timer, which can corrupt the data canDispatch(&gene_SYNC_Data, &m); unlock(); diff -r 17edd8a028fa -r 9b76e0881beb include/can.h --- a/include/can.h Tue Jan 22 10:27:13 2008 +0100 +++ b/include/can.h Wed Jan 23 10:35:52 2008 +0100 @@ -31,15 +31,15 @@ UNS32 w; }; */ - +/* typedef struct { - UNS32 w; /* 32 bits */ + UNS32 w; } SHORT_CAN; - +*/ /** Can message structure */ typedef struct { - SHORT_CAN cob_id; /* l'ID du mesg */ + UNS16 cob_id; /* l'ID du mesg */ UNS8 rtr; /* remote transmission request. 0 if not rtr, 1 for a rtr message */ UNS8 len; /* message length (0 to 8) */ diff -r 17edd8a028fa -r 9b76e0881beb include/can_driver.h --- a/include/can_driver.h Tue Jan 22 10:27:13 2008 +0100 +++ b/include/can_driver.h Wed Jan 23 10:35:52 2008 +0100 @@ -58,12 +58,12 @@ { int i; UNS8 fc; - printf("id:%02x ", m->cob_id.w & 0x7F); - fc = m->cob_id.w >> 7; + printf("id:%02x ", m->cob_id & 0x7F); + fc = m->cob_id >> 7; switch(fc) { case SYNC: - if(m->cob_id.w == 0x080) + if(m->cob_id == 0x080) printf("SYNC "); else printf("EMCY "); diff -r 17edd8a028fa -r 9b76e0881beb include/objdictdef.h --- a/include/objdictdef.h Tue Jan 22 10:27:13 2008 +0100 +++ b/include/objdictdef.h Wed Jan 23 10:35:52 2008 +0100 @@ -118,7 +118,7 @@ /************************** MACROS *********************************/ /* CANopen usefull helpers */ -#define GET_NODE_ID(m) (m.cob_id.w & 0x7f) -#define GET_FUNCTION_CODE(m) (m.cob_id.w >> 7) +#define GET_NODE_ID(m) (m.cob_id & 0x7f) +#define GET_FUNCTION_CODE(m) (m.cob_id >> 7) #endif /* __objdictdef_h__ */ diff -r 17edd8a028fa -r 9b76e0881beb src/emcy.c --- a/src/emcy.c Tue Jan 22 10:27:13 2008 +0100 +++ b/src/emcy.c Wed Jan 23 10:35:52 2008 +0100 @@ -100,7 +100,7 @@ MSG_WAR(0x3051, "sendEMCY", 0); - m.cob_id.w = *d->error_cobid; + m.cob_id = *d->error_cobid; m.rtr = NOT_A_REQUEST; m.len = 8; m.data[0] = errCode & 0xFF; /* LSB */ @@ -233,12 +233,12 @@ /* Test if the size of the EMCY is ok */ if ( m->len != 8) { - MSG_ERR(0x1056, "Error size EMCY. CobId : ", m->cob_id.w); + MSG_ERR(0x1056, "Error size EMCY. CobId : ", m->cob_id); return; } /* post the received EMCY */ - nodeID = m->cob_id.w & 0x7F; + nodeID = m->cob_id & 0x7F; errCode = m->data[0] | ((UNS16)m->data[1] << 8); errReg = m->data[2]; (*d->post_emcy)(nodeID, errCode, errReg); diff -r 17edd8a028fa -r 9b76e0881beb src/lifegrd.c --- a/src/lifegrd.c Tue Jan 22 10:27:13 2008 +0100 +++ b/src/lifegrd.c Wed Jan 23 10:35:52 2008 +0100 @@ -101,7 +101,7 @@ if (nodeId == *d->bDeviceNodeId ) { Message msg; - msg.cob_id.w = *d->bDeviceNodeId + 0x700; + msg.cob_id = *d->bDeviceNodeId + 0x700; msg.len = (UNS8)0x01; msg.rtr = 0; msg.data[0] = d->nodeState; @@ -178,7 +178,7 @@ ** the node-id of this device. */ - msg.cob_id.w = *d->bDeviceNodeId + 0x700; + msg.cob_id = *d->bDeviceNodeId + 0x700; msg.len = (UNS8)0x01; msg.rtr = 0; msg.data[0] = d->nodeState; /* No toggle for heartbeat !*/ diff -r 17edd8a028fa -r 9b76e0881beb src/lss.c --- a/src/lss.c Tue Jan 22 10:27:13 2008 +0100 +++ b/src/lss.c Wed Jan 23 10:35:52 2008 +0100 @@ -280,7 +280,7 @@ m.len = 8; m.rtr = NOT_A_REQUEST; m.data[0]=command; - m.cob_id.w=SLSS_ADRESS; + m.cob_id=SLSS_ADRESS; /* Tha data sent with the msg depends on the command */ switch(command){ @@ -331,7 +331,7 @@ m.len = 8; m.rtr = NOT_A_REQUEST; m.data[0]=command; - m.cob_id.w=MLSS_ADRESS; + m.cob_id=MLSS_ADRESS; /* Tha data sent with the msg depends on the command */ switch(command){ diff -r 17edd8a028fa -r 9b76e0881beb src/nmtMaster.c --- a/src/nmtMaster.c Tue Jan 22 10:27:13 2008 +0100 +++ b/src/nmtMaster.c Wed Jan 23 10:35:52 2008 +0100 @@ -49,7 +49,7 @@ MSG_WAR(0x3501, "Send_NMT cs : ", cs); MSG_WAR(0x3502, " to node : ", Node_ID); /* message configuration */ - m.cob_id.w = 0x0000; /*(NMT) << 7*/ + m.cob_id = 0x0000; /*(NMT) << 7*/ m.rtr = NOT_A_REQUEST; m.len = 2; m.data[0] = cs; @@ -74,7 +74,7 @@ MSG_WAR(0x3503, "Send_NODE_GUARD to node : ", nodeId); /* message configuration */ - m.cob_id.w = nodeId | (NODE_GUARD << 7); + m.cob_id = nodeId | (NODE_GUARD << 7); m.rtr = REQUEST; m.len = 1; diff -r 17edd8a028fa -r 9b76e0881beb src/nmtSlave.c --- a/src/nmtSlave.c Tue Jan 22 10:27:13 2008 +0100 +++ b/src/nmtSlave.c Wed Jan 23 10:35:52 2008 +0100 @@ -105,7 +105,7 @@ MSG_WAR(0x3407, "Send a Boot-Up msg ", 0); /* message configuration */ - m.cob_id.w = NODE_GUARD << 7 | *d->bDeviceNodeId; + m.cob_id = NODE_GUARD << 7 | *d->bDeviceNodeId; m.rtr = NOT_A_REQUEST; m.len = 1; m.data[0] = 0x00; diff -r 17edd8a028fa -r 9b76e0881beb src/pdo.c --- a/src/pdo.c Tue Jan 22 10:27:13 2008 +0100 +++ b/src/pdo.c Wed Jan 23 10:35:52 2008 +0100 @@ -54,7 +54,7 @@ UNS8 offset = 0x00; const UNS8* pMappingCount = (UNS8*) TPDO_map->pSubindex[0].pObject; - pdo->cob_id.w = *(UNS32*)TPDO_com->pSubindex[1].pObject & 0x7FF; + pdo->cob_id = *(UNS32*)TPDO_com->pSubindex[1].pObject & 0x7FF; pdo->rtr = NOT_A_REQUEST; MSG_WAR(0x3009, " PDO CobId is : ", *(UNS32*)TPDO_com->pSubindex[1].pObject); @@ -126,7 +126,7 @@ MSG_WAR(0x3930, "sendPDOrequest cobId is : ",*pwCobId); { Message pdo; - pdo.cob_id.w = *pwCobId; + pdo.cob_id = *pwCobId; pdo.rtr = REQUEST; pdo.len = 0; return canSend(d->canHandle,&pdo); @@ -168,7 +168,7 @@ status = state2; - MSG_WAR(0x3935, "proceedPDO, cobID : ", ((*m).cob_id.w & 0x7ff)); + MSG_WAR(0x3935, "proceedPDO, cobID : ", ((*m).cob_id & 0x7ff)); offset = 0x00; numPdo = 0; numMap = 0; @@ -191,7 +191,7 @@ /* check the CobId coherance */ /*pwCobId is the cobId read in the dictionary at the state 3 */ - if ( *pwCobId == (*m).cob_id.w ){ + if ( *pwCobId == (*m).cob_id ){ /* The cobId is recognized */ status = state4; MSG_WAR(0x3936, "cobId found at index ", 0x1400 + numPdo); @@ -249,7 +249,7 @@ return 0xFF; } - MSG_WAR(0x3942, "Variable updated with value received by PDO cobid : ", m->cob_id.w); + MSG_WAR(0x3942, "Variable updated with value received by PDO cobid : ", m->cob_id); MSG_WAR(0x3943, " Mapped at index : ", (*pMappingParameter) >> 16); MSG_WAR(0x3944, " subindex : ", ((*pMappingParameter) >> 8 ) & 0xFF); /* MSG_WAR(0x3945, " data : ",*((UNS32*)pMappedAppObject)); */ @@ -266,7 +266,7 @@ }/* end while*/ }/* end if Donnees */ else if ((*m).rtr == REQUEST ){ - MSG_WAR(0x3946, "Receive a PDO request cobId : ", m->cob_id.w); + MSG_WAR(0x3946, "Receive a PDO request cobId : ", m->cob_id); status = state1; offsetObjdict = d->firstIndex->PDO_TRS; lastIndex = d->lastIndex->PDO_TRS; @@ -279,7 +279,7 @@ /* get CobId of the dictionary which match to the received PDO */ pwCobId = (UNS32*) (d->objdict + offsetObjdict)->pSubindex[1].pObject; - if ( *pwCobId == (*m).cob_id.w ) { + if ( *pwCobId == (*m).cob_id ) { status = state4; break; } @@ -306,7 +306,7 @@ }else{ /* if SYNC did never occur, force emission with current data */ /* DS301 do not tell what to do in such a case...*/ - MSG_ERR(0x1947, "Not ready RTR_SYNC TPDO send current data : ", m->cob_id.w); + MSG_ERR(0x1947, "Not ready RTR_SYNC TPDO send current data : ", m->cob_id); status = state5; } break; @@ -323,7 +323,7 @@ }else { /* The requested PDO is not to send on request. So, does nothing. */ - MSG_WAR(0x2947, "PDO is not to send on request : ", m->cob_id.w); + MSG_WAR(0x2947, "PDO is not to send on request : ", m->cob_id); return 0xFF; } @@ -425,7 +425,7 @@ /* This is needed to avoid deletion of re-attribuated timer */ d->PDO_status[pdoNum].event_timer = TIMER_NONE; /* force emission of PDO by artificially changing last emitted*/ - d->PDO_status[pdoNum].last_message.cob_id.w = 0; + d->PDO_status[pdoNum].last_message.cob_id = 0; _sendPDOevent( d, 0 ); /* not a Sync Event*/ } @@ -523,7 +523,7 @@ } /*Compare new and old PDO*/ - if(d->PDO_status[pdoNum].last_message.cob_id.w == pdo.cob_id.w && + if(d->PDO_status[pdoNum].last_message.cob_id == pdo.cob_id && d->PDO_status[pdoNum].last_message.len == pdo.len && #ifdef UNS64 *(UNS64*)(&d->PDO_status[pdoNum].last_message.data[0]) == *(UNS64*)(&pdo.data[0])){ @@ -567,7 +567,7 @@ case state5: /*Send the pdo*/ /*store_as_last_message*/ d->PDO_status[pdoNum].last_message = pdo; - MSG_WAR(0x396D, "sendPDO cobId :", pdo.cob_id.w); + MSG_WAR(0x396D, "sendPDO cobId :", pdo.cob_id); MSG_WAR(0x396E, " Nb octets : ", pdo.len); canSend(d->canHandle,&pdo); @@ -670,7 +670,7 @@ d->PDO_status[pdoNum].inhibit_timer = DelAlarm(d->PDO_status[pdoNum].inhibit_timer); /* Reset transmit type parameter */ d->PDO_status[pdoNum].transmit_type_parameter = 0; - d->PDO_status[pdoNum].last_message.cob_id.w = 0; + d->PDO_status[pdoNum].last_message.cob_id = 0; pdoNum++; offsetObjdict++; } diff -r 17edd8a028fa -r 9b76e0881beb src/sdo.c --- a/src/sdo.c Tue Jan 22 10:27:13 2008 +0100 +++ b/src/sdo.c Wed Jan 23 10:35:52 2008 +0100 @@ -554,7 +554,7 @@ pwCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject; } /* message copy for sending */ - m.cob_id.w = *pwCobId; + m.cob_id = *pwCobId; m.rtr = NOT_A_REQUEST; /* the length of SDO must be 8 */ m.len = 8; @@ -636,7 +636,7 @@ return 0xFF; } pCobId = (UNS32*) d->objdict[offset].pSubindex[1].pObject; - if ( *pCobId == (*m).cob_id.w ) { + if ( *pCobId == (*m).cob_id ) { whoami = SDO_SERVER; MSG_WAR(0x3A62, "proceedSDO. I am server. index : ", 0x1200 + j); /* In case of server, the node id of the client may be unknown. So we put the index minus offset */ @@ -659,7 +659,7 @@ } /* a) Looking for the cobid received. */ pCobId = (UNS32*) d->objdict[offset].pSubindex[2].pObject; - if (*pCobId == (*m).cob_id.w ) { + if (*pCobId == (*m).cob_id ) { /* b) cobid found, so reading the node id of the server. */ pNodeId = (UNS8*) d->objdict[offset].pSubindex[3].pObject; whoami = SDO_CLIENT; @@ -678,7 +678,7 @@ /* Test if the size of the SDO is ok */ if ( (*m).len != 8) { - MSG_ERR(0x1A67, "Error size SDO. CobId : ", (*m).cob_id.w); + MSG_ERR(0x1A67, "Error size SDO. CobId : ", (*m).cob_id); failedSDO(d, nodeId, whoami, 0, 0, SDOABT_GENERAL_ERROR); return 0xFF; } @@ -687,7 +687,7 @@ MSG_WAR(0x3A68, "I am CLIENT. Received SDO from nodeId : ", nodeId); } else { - MSG_WAR(0x3A69, "I am SERVER. Received SDO cobId : ", (*m).cob_id.w); + MSG_WAR(0x3A69, "I am SERVER. Received SDO cobId : ", (*m).cob_id); } /* Testing the command specifier */ diff -r 17edd8a028fa -r 9b76e0881beb src/states.c --- a/src/states.c Tue Jan 22 10:27:13 2008 +0100 +++ b/src/states.c Wed Jan 23 10:35:52 2008 +0100 @@ -67,10 +67,10 @@ **/ void canDispatch(CO_Data* d, Message *m) { - switch(m->cob_id.w >> 7) + switch(m->cob_id >> 7) { case SYNC: /* can be a SYNC or a EMCY message */ - if(m->cob_id.w == 0x080) /* SYNC */ + if(m->cob_id == 0x080) /* SYNC */ { if(d->CurrentCommunicationState.csSYNC) proceedSYNC(d); @@ -107,11 +107,11 @@ #ifdef CO_ENABLE_LSS case LSS: if (!d->CurrentCommunicationState.csLSS)break; - if ((*(d->iam_a_slave)) && m->cob_id.w==MLSS_ADRESS) + if ((*(d->iam_a_slave)) && m->cob_id==MLSS_ADRESS) { proceedLSS_Slave(d,m); } - else if(!(*(d->iam_a_slave)) && m->cob_id.w==SLSS_ADRESS) + else if(!(*(d->iam_a_slave)) && m->cob_id==SLSS_ADRESS) { proceedLSS_Master(d,m); } diff -r 17edd8a028fa -r 9b76e0881beb src/sync.c --- a/src/sync.c Tue Jan 22 10:27:13 2008 +0100 +++ b/src/sync.c Wed Jan 23 10:35:52 2008 +0100 @@ -130,7 +130,7 @@ MSG_WAR(0x3001, "sendSYNC ", 0); - m.cob_id.w = *d->COB_ID_Sync & 0x1FFFFFFF; + m.cob_id = *d->COB_ID_Sync & 0x1FFFFFFF; m.rtr = NOT_A_REQUEST; m.len = 0;