include/objacces.h
changeset 588 ee181b4f177b
parent 561 f9be4262c68d
child 594 17a171fe7c56
--- a/include/objacces.h	Wed Sep 16 15:15:28 2009 +0200
+++ b/include/objacces.h	Wed Sep 16 15:16:19 2009 +0200
@@ -41,6 +41,12 @@
 
 #include <applicfg.h>
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 typedef UNS32 (*valueRangeTest_t)(UNS8 typeValue, void *Value);
 typedef void (* storeODSubIndex_t)(CO_Data* d, UNS16 wIndex, UNS8 bSubindex);
 void _storeODSubIndex (CO_Data* d, UNS16 wIndex, UNS8 bSubindex);
@@ -105,14 +111,15 @@
  * - OD_SUCCESSFUL is returned upon success. 
  * - SDO abort code is returned if error occurs . (See file def.h)
  */
-UNS32 _getODentry( CO_Data* d, 
-		  UNS16 wIndex,
-		  UNS8 bSubindex,
-		  void * pDestData,
-		  UNS32 * pExpectedSize,
-		  UNS8 * pDataType,
-		  UNS8 checkAccess,
-		  UNS8 endianize);
+UNS32 _getODentry( CO_Data* d,
+                   UNS16 wIndex,
+                   UNS8 bSubindex,
+                   void * pDestData,
+                   UNS32 * pExpectedSize,
+                   UNS8 * pDataType,
+                   UNS8 checkAccess,
+                   UNS8 endianize);
+
 
 /** 
  * @ingroup od
@@ -135,10 +142,13 @@
  * - OD_SUCCESSFUL is returned upon success. 
  * - SDO abort code is returned if error occurs . (See file def.h)
  */
-#define getODentry( OD, wIndex, bSubindex, pDestData, pExpectedSize, \
-		          pDataType,  checkAccess)                         \
-       _getODentry( OD, wIndex, bSubindex, pDestData, pExpectedSize, \
-		          pDataType,  checkAccess, 1)            
+UNS32 getODentry( CO_Data* d,
+                  UNS16 wIndex,
+                  UNS8 bSubindex,
+                  void * pDestData,
+                  UNS32 * pExpectedSize,
+                  UNS8 * pDataType,
+                  UNS8 checkAccess);
 
 /** 
  * @ingroup od
@@ -165,10 +175,13 @@
  * - OD_SUCCESSFUL is returned upon success. 
  * - SDO abort code is returned if error occurs . (See file def.h)
  */
-#define readLocalDict( OD, wIndex, bSubindex, pDestData, pExpectedSize, \
-		          pDataType,  checkAccess)                         \
-       _getODentry( OD, wIndex, bSubindex, pDestData, pExpectedSize, \
-		          pDataType,  checkAccess, 0)
+UNS32 readLocalDict( CO_Data* d,
+                     UNS16 wIndex,
+                     UNS8 bSubindex,
+                     void * pDestData,
+                     UNS32 * pExpectedSize,
+                     UNS8 * pDataType,
+                     UNS8 checkAccess);
 
 /* By this function you can write an entry into the object dictionary
  * @param *d Pointer to a CAN object data structure
@@ -224,10 +237,12 @@
  * - OD_SUCCESSFUL is returned upon success. 
  * - SDO abort code is returned if error occurs . (See file def.h)
  */
-#define setODentry( d, wIndex, bSubindex, pSourceData, pExpectedSize, \
-                  checkAccess) \
-       _setODentry( d, wIndex, bSubindex, pSourceData, pExpectedSize, \
-                  checkAccess, 1)
+UNS32 setODentry( CO_Data* d,
+                   UNS16 wIndex,
+                   UNS8 bSubindex,
+                   void * pSourceData,
+                   UNS32 * pExpectedSize,
+                   UNS8 checkAccess);
 
 /** @fn UNS32 writeLocalDict(d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess)
  * @ingroup od
@@ -257,11 +272,12 @@
  * retcode = writeLocalDict( (UNS16)0x1800, (UNS8)2, &B, sizeof(UNS8), 1 );
  * @endcode
  */
-#define writeLocalDict( d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess) \
-       _setODentry( d, wIndex, bSubindex, pSourceData, pExpectedSize, checkAccess, 0)
-
-
-
+UNS32 writeLocalDict( CO_Data* d,
+                      UNS16 wIndex,
+                      UNS8 bSubindex,
+                      void * pSourceData,
+                      UNS32 * pExpectedSize,
+                      UNS8 checkAccess);
 /**
  * @brief Scan the index of object dictionary. Used only by setODentry and getODentry.
  * @param *d Pointer to a CAN object data structure
@@ -274,4 +290,8 @@
 
 UNS32 RegisterSetODentryCallBack(CO_Data* d, UNS16 wIndex, UNS8 bSubindex, ODCallback_t Callback);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* __objacces_h__ */