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

#include "pdo.h"
#include "objacces.h"
#include "canfestival.h"

Include dependency graph for pdo.c:

Go to the source code of this file.

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)


Detailed Description

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

Definition in file pdo.c.


Function Documentation

void CopyBits ( UNS8  NbBits,
UNS8 *  SrcByteIndex,
UNS8  SrcBitIndex,
UNS8  SrcBigEndian,
UNS8 *  DestByteIndex,
UNS8  DestBitIndex,
UNS8  DestBigEndian 
)

Parameters:
NbBits 
SrcByteIndex 
SrcBitIndex 
SrcBigEndian 
DestByteIndex 
DestBitIndex 
DestBigEndian 

This loop copy as many bits that it can each time, crossing

successively bytes

Bit missalignement between src and dest

We can now get src and align it to dest

Compute the nb of bit we will be able to copy

Create a mask that will serve in:

Then write.

Compute next time cursors for src

cross boundary ?

First bit

Next byte

Compute next time cursors for dest

First bit

Next byte

And decrement counter.

Definition at line 430 of file pdo.c.

Referenced by proceedPDO(), and proceedSYNC().

UNS8 PDOmGR ( CO_Data *  d,
UNS32  cobId 
)

PDO Manager

Parameters:
d 
cobId 
Returns:

if PDO is waiting for transmission, preparation of the message to send

memcpy(&(pdo.data), &(process_var.data), pdo.len);

Definition at line 79 of file pdo.c.

References sendPDO().

Referenced by proceedPDO(), and proceedSYNC().

Here is the call graph for this function:

UNS8 proceedPDO ( CO_Data *  d,
Message *  m 
)

Parameters:
d 
m 
Returns:

Number of the mapped varable

count of mapped objects...

pointer to the var which is mapped to a pdo...

void * pMappedAppObject = NULL;

pointer fo the var which holds the mapping parameter of an mapping entry

pointer to the transmission type

The PDO received is not a request.

study of all the PDO stored in the dictionary

data are stored in process_var array

memcpy(&(process_var.data), &m->data, (*m).len);

Ce memcpy devrait etre portable

get CobId of the dictionary correspondant to the received PDO

check the CobId coherance

pwCobId is the cobId read in the dictionary at the state 3

The cobId is recognized

cobId received does not match with those write in the dictionnary

Get Mapped Objects Number

The cobId of the message received has been found in the dictionnary.

Get the addresse of the mapped variable.

detail of *pMappingParameter :

The 16 hight bits contains the index, the medium 8 bits contains the subindex,

and the lower 8 bits contains the size of the mapped variable.

copy bit per bit in little endian

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

end loop while on mapped variables

end switch status

end while

end if Donnees

study of all PDO stored in the objects dictionary

check the CobId

get CobId of the dictionary which match to the received PDO

check transmission type (after request?)

The requested PDO is not to send on request. So, does nothing.

get mapped objects number

Get the mapped variable

end while

Transmit the PDO

end switch status

end while

end if Requete

Definition at line 221 of file pdo.c.

References CopyBits(), getODentry(), PDOmGR(), and setODentry().

Referenced by canDispatch().

Here is the call graph for this function:

UNS8 sendPDO ( CO_Data *  d,
s_PDO  pdo,
UNS8  req 
)

Definition at line 37 of file pdo.c.

Referenced by PDOmGR(), and sendPDOrequest().

UNS8 sendPDOrequest ( CO_Data *  d,
UNS32  cobId 
)

Parameters:
d 
cobId 
Returns:

Sending the request only if the cobid have been found on the PDO receive

part dictionary

get the CobId

Definition at line 181 of file pdo.c.

References sendPDO().

Here is the call graph for this function:


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