nico@207: nico@207: nico@207: CanFestival: /home/epimerde/documents/tc11/CanFestival-3/src/pdo.c File Reference nico@207: nico@207: nico@207: nico@207: nico@207:
nico@207:
nico@207:
nico@207:
nico@207:

/home/epimerde/documents/tc11/CanFestival-3/src/pdo.c File Reference

#include "pdo.h"
nico@207: #include "objacces.h"
nico@207: #include "canfestival.h"
nico@207: nico@207:

nico@210: Include dependency graph for pdo.c:

nico@210: nico@210:

nico@207: Go to the source code of this file. nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:

Functions

UNS8 sendPDO (CO_Data *d, s_PDO pdo, UNS8 req)
UNS8 PDOmGR (CO_Data *d, UNS32 cobId)
UNS8 sendPDOrequest (CO_Data *d, UNS32 cobId)
UNS8 proceedPDO (CO_Data *d, Message *m)
void CopyBits (UNS8 NbBits, UNS8 *SrcByteIndex, UNS8 SrcBitIndex, UNS8 SrcBigEndian, UNS8 *DestByteIndex, UNS8 DestBitIndex, UNS8 DestBigEndian)
nico@210:


Detailed Description

nico@210:
Author:
Edouard TISSERANT and Francis DUPIN
nico@210:
Date:
Tue Jun 5 09:32:32 2007
nico@210: nico@210:

nico@210: Definition in file pdo.c.


Function Documentation

nico@207: nico@207:
nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
void CopyBits (UNS8  NbBits,
UNS8 *  SrcByteIndex,
UNS8  SrcBitIndex,
UNS8  SrcBigEndian,
UNS8 *  DestByteIndex,
UNS8  DestBitIndex,
UNS8  DestBigEndian 
)
nico@207:
nico@207:
nico@207: nico@207:

nico@210:

Parameters:
nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210:
NbBits 
SrcByteIndex 
SrcBitIndex 
SrcBigEndian 
DestByteIndex 
DestBitIndex 
DestBigEndian 
nico@210:
nico@210: nico@210:

nico@210: This loop copy as many bits that it can each time, crossing

nico@210: successively bytes

nico@210: Bit missalignement between src and dest

nico@210: We can now get src and align it to dest

nico@210: Compute the nb of bit we will be able to copy

nico@210: Create a mask that will serve in:

nico@210:

nico@210:

nico@210:

nico@210:

nico@210: Then write.

nico@210: Compute next time cursors for src

nico@210: cross boundary ?

nico@210: First bit

nico@210: Next byte

nico@210: Compute next time cursors for dest

nico@210: First bit

nico@210: Next byte

nico@210: And decrement counter. nico@210:

nico@210: Definition at line 430 of file pdo.c. nico@210:

nico@210: Referenced by proceedPDO(), and proceedSYNC(). nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
UNS8 PDOmGR (CO_Data *  d,
UNS32  cobId 
)
nico@207:
nico@207:
nico@207: nico@207:

nico@210: PDO Manager

nico@210:

Parameters:
nico@210: nico@210: nico@210: nico@210:
d 
cobId 
nico@210:
nico@210:
Returns:
nico@210: nico@210:

nico@210: if PDO is waiting for transmission, preparation of the message to send

nico@210: memcpy(&(pdo.data), &(process_var.data), pdo.len); nico@210:

nico@210: Definition at line 79 of file pdo.c. nico@210:

nico@210: References sendPDO(). nico@210:

nico@210: Referenced by proceedPDO(), and proceedSYNC(). nico@210:

nico@210: Here is the call graph for this function:

nico@210: nico@210: nico@210: nico@210: nico@207:
nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
UNS8 proceedPDO (CO_Data *  d,
Message *  m 
)
nico@207:
nico@207:
nico@207: nico@207:

nico@210:

Parameters:
nico@210: nico@210: nico@210: nico@210:
d 
m 
nico@210:
nico@210:
Returns:
nico@210: nico@210:

nico@210: Number of the mapped varable

nico@210: count of mapped objects...

nico@210: pointer to the var which is mapped to a pdo...

nico@210: void * pMappedAppObject = NULL;

nico@210: pointer fo the var which holds the mapping parameter of an mapping entry

nico@210: pointer to the transmission type

nico@210: The PDO received is not a request.

nico@210: study of all the PDO stored in the dictionary

nico@210: data are stored in process_var array

nico@210: memcpy(&(process_var.data), &m->data, (*m).len);

nico@210: Ce memcpy devrait etre portable

nico@210: get CobId of the dictionary correspondant to the received PDO

nico@210: check the CobId coherance

nico@210: pwCobId is the cobId read in the dictionary at the state 3

nico@210: The cobId is recognized

nico@210: cobId received does not match with those write in the dictionnary

nico@210: Get Mapped Objects Number

nico@210: The cobId of the message received has been found in the dictionnary.

nico@210: Get the addresse of the mapped variable.

nico@210: detail of *pMappingParameter :

nico@210: The 16 hight bits contains the index, the medium 8 bits contains the subindex,

nico@210: and the lower 8 bits contains the size of the mapped variable.

nico@210: copy bit per bit in little endian

nico@210: MSG_WAR(0x3945, " data : ",*((UNS32*)pMappedAppObject));

nico@210: end loop while on mapped variables

nico@210: end switch status

nico@210: end while

nico@210: end if Donnees

nico@210: study of all PDO stored in the objects dictionary

nico@210: check the CobId

nico@210: get CobId of the dictionary which match to the received PDO

nico@210: check transmission type (after request?)

nico@210: The requested PDO is not to send on request. So, does nothing.

nico@210: get mapped objects number

nico@210: Get the mapped variable

nico@210: end while

nico@210: Transmit the PDO

nico@210: end switch status

nico@210: end while

nico@210: end if Requete nico@210:

nico@210: Definition at line 221 of file pdo.c. nico@210:

nico@210: References CopyBits(), getODentry(), PDOmGR(), and setODentry(). nico@210:

nico@210: Referenced by canDispatch(). nico@210:

nico@210: Here is the call graph for this function:

nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@210: nico@207:
nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
UNS8 sendPDO (CO_Data *  d,
s_PDO  pdo,
UNS8  req 
)
nico@207:
nico@207:
nico@207: nico@207:

nico@207: nico@207:

nico@210: Definition at line 37 of file pdo.c. nico@210:

nico@210: Referenced by PDOmGR(), and sendPDOrequest(). nico@207:

nico@207:

nico@207: nico@207:

nico@207:
nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207: nico@207:
UNS8 sendPDOrequest (CO_Data *  d,
UNS32  cobId 
)
nico@207:
nico@207:
nico@207: nico@207:

nico@210:

Parameters:
nico@210: nico@210: nico@210: nico@210:
d 
cobId 
nico@210:
nico@210:
Returns:
nico@210: nico@210:

nico@210: Sending the request only if the cobid have been found on the PDO receive

nico@210: part dictionary

nico@210: get the CobId nico@210:

nico@210: Definition at line 181 of file pdo.c. nico@210:

nico@210: References sendPDO(). nico@210:

nico@210: Here is the call graph for this function:

nico@210: nico@210: nico@210: nico@210: nico@210:
nico@210:

nico@210:


Generated on Tue Jun 5 18:32:07 2007 for CanFestival by  nico@207: nico@207: doxygen 1.5.1
nico@207: nico@207: