|
NNP STM Generic Remote Module git-main
|
#include "data.h"Go to the source code of this file.
Macros | |
| #define | accessDictionaryError(index, subIndex, sizeDataDict, sizeDataGiven, code) |
| Print MSG_WAR (s) if error to the access to the object dictionary occurs. | |
Functions | |
| UNS32 | _getODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pDestData, UNS32 *pExpectedSize, UNS8 *pDataType, UNS8 checkAccess, UNS8 endianize) |
| _getODentry() Reads an entry from the object dictionary. | |
| UNS32 | _setODentry (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, void *pSourceData, UNS32 *pExpectedSize, UNS8 checkAccess, UNS8 endianize) |
| By this function you can write an entry into the object dictionary. | |
| const indextable * | scanIndexOD (CO_Data *d, UNS16 wIndex, UNS32 *errorCode, ODCallback_t **Callback) |
| Scan the index of object dictionary. Used only by setODentry and getODentry. | |
| UNS32 | RegisterSetODentryCallBack (CO_Data *d, UNS16 wIndex, UNS8 bSubindex, ODCallback_t Callback) |
| <BRIEF> | |
| void | _storeODSubIndex (CO_Data *d, UNS16 wIndex, UNS8 bSubindex) |
| <BRIEF> | |
Definition in file objacces.c.
| #define accessDictionaryError | ( | index, | |
| subIndex, | |||
| sizeDataDict, | |||
| sizeDataGiven, | |||
| code ) |
Print MSG_WAR (s) if error to the access to the object dictionary occurs.
You must uncomment the lines in the file objaccess.c :
//#define DEBUG_CAN
//#define DEBUG_WAR_CONSOLE_ON
//#define DEBUG_ERR_CONSOLE_ON
Beware that sometimes, we force the sizeDataDict or sizeDataGiven to 0, when we wants to use this function but we do not have the access to the right value. One example is getSDOerror(). So do not take attention to these variables if they are null.
| index | |
| subIndex | |
| sizeDataDict | Size of the data defined in the dictionary |
| sizeDataGiven | Size data given by the user. |
| code | error code to print. (SDO abort code. See file def.h) |
Definition at line 68 of file objacces.c.
Referenced by _getODentry(), and _setODentry().
| UNS32 _getODentry | ( | CO_Data * | d, |
| UNS16 | wIndex, | ||
| UNS8 | bSubindex, | ||
| void * | pDestData, | ||
| UNS32 * | pExpectedSize, | ||
| UNS8 * | pDataType, | ||
| UNS8 | checkAccess, | ||
| UNS8 | endianize ) |
_getODentry() Reads an entry from the object dictionary.
use getODentry() macro to read from object and endianize use readLocalDict() macro to read from object and not endianize
| *d | Pointer to a CAN object data structure |
| wIndex | The index in the object dictionary where you want to read an entry |
| bSubindex | The subindex of the Index. e.g. mostly subindex 0 is used to tell you how many valid entries you can find in this index. Look at the canopen standard for further information |
| *pDestData | Pointer to the pointer which points to the variable where the value of this object dictionary entry should be copied |
| *pExpectedSize | This function writes the size of the copied value (in Byte) into this variable. |
| *pDataType | Pointer to the type of the data. See objdictdef.h |
| CheckAccess | if other than 0, do not read if the data is Write Only [Not used today. Put always 0]. |
| Endianize | When not 0, data is endianized into network byte order when 0, data is not endianized and copied in machine native endianness |
Definition at line 111 of file objacces.c.
| UNS32 _setODentry | ( | CO_Data * | d, |
| UNS16 | wIndex, | ||
| UNS8 | bSubindex, | ||
| void * | pSourceData, | ||
| UNS32 * | pExpectedSize, | ||
| UNS8 | checkAccess, | ||
| UNS8 | endianize ) |
By this function you can write an entry into the object dictionary.
| *d | Pointer to a CAN object data structure |
| wIndex | The index in the object dictionary where you want to write an entry |
| bSubindex | The subindex of the Index. e.g. mostly subindex 0 is used to tell you how many valid entries you can find in this index. Look at the canopen standard for further information |
| *pSourceData | Pointer to the variable that holds the value that should be copied into the object dictionary |
| *pExpectedSize | The size of the value (in Byte). |
| checkAccess | Flag that indicate if a check rights must be perfomed (0 : no , other than 0 : yes) |
| endianize | When not 0, data is endianized into network byte order when 0, data is not endianized and copied in machine native endianness |
Definition at line 235 of file objacces.c.
| const indextable * scanIndexOD | ( | CO_Data * | d, |
| UNS16 | wIndex, | ||
| UNS32 * | errorCode, | ||
| ODCallback_t ** | Callback ) |
Scan the index of object dictionary. Used only by setODentry and getODentry.
| *d | Pointer to a CAN object data structure |
| wIndex | |
| *errorCode | : OD_SUCCESSFUL if index foundor SDO abort code. (See file def.h) |
| **Callback |
Definition at line 343 of file objacces.c.
Referenced by PDOInit(), and RegisterSetODentryCallBack().
