include/sdo.h
changeset 539 187058b4a4b8
parent 529 c171e11707c5
child 561 f9be4262c68d
equal deleted inserted replaced
538:49f6d796b692 539:187058b4a4b8
   133  * @param line SDO line
   133  * @param line SDO line
   134  * @param nbBytes
   134  * @param nbBytes
   135  * @param *data Pointer on the data
   135  * @param *data Pointer on the data
   136  * @return 0xFF if error. Else, returns 0.
   136  * @return 0xFF if error. Else, returns 0.
   137  */
   137  */
   138 UNS8 lineToSDO (CO_Data* d, UNS8 line, UNS8 nbBytes, UNS8 * data);
   138 UNS8 lineToSDO (CO_Data* d, UNS8 line, UNS32 nbBytes, UNS8 * data);
   139 
   139 
   140 /** 
   140 /** 
   141  * @brief Add data to an existant line
   141  * @brief Add data to an existant line
   142  * @param d Pointer on a CAN object data structure
   142  * @param d Pointer on a CAN object data structure
   143  * @param line SDO line
   143  * @param line SDO line
   144  * @param nbBytes
   144  * @param nbBytes
   145  * @param *data Pointer on the data
   145  * @param *data Pointer on the data
   146  * @return 0xFF if error. Else, returns 0.
   146  * @return 0xFF if error. Else, returns 0.
   147  */
   147  */
   148 UNS8 SDOtoLine (CO_Data* d, UNS8 line, UNS8 nbBytes, UNS8 * data);
   148 UNS8 SDOtoLine (CO_Data* d, UNS8 line, UNS32 nbBytes, UNS8 * data);
   149 
   149 
   150 /** 
   150 /** 
   151  * @brief Called when an internal SDO abort occurs.
   151  * @brief Called when an internal SDO abort occurs.
   152  * Release the line * Only if server *
   152  * Release the line * Only if server *
   153  * If client, the line must be released manually in the core application.
   153  * If client, the line must be released manually in the core application.
   222  * @param *d Pointer on a CAN object data structure
   222  * @param *d Pointer on a CAN object data structure
   223  * @param line SDO line 
   223  * @param line SDO line 
   224  * @param *nbBytes Pointer on nbBytes
   224  * @param *nbBytes Pointer on nbBytes
   225  * @return 0.
   225  * @return 0.
   226  */
   226  */
   227 UNS8 getSDOlineRestBytes (CO_Data* d, UNS8 line, UNS8 * nbBytes);
   227 UNS8 getSDOlineRestBytes (CO_Data* d, UNS8 line, UNS32 * nbBytes);
   228 
   228 
   229 /** 
   229 /** 
   230  * @brief Store in the line structure the nb of bytes which must be transmited (or received)
   230  * @brief Store in the line structure the nb of bytes which must be transmited (or received)
   231  * bus_id is hardware dependant.
   231  * bus_id is hardware dependant.
   232  * @param *d Pointer on a CAN object data structure
   232  * @param *d Pointer on a CAN object data structure
   233  * @param line SDO line 
   233  * @param line SDO line 
   234  * @param nbBytes
   234  * @param nbBytes
   235  * @return 0 if success, 0xFF if error.
   235  * @return 0 if success, 0xFF if error.
   236  */
   236  */
   237 UNS8 setSDOlineRestBytes (CO_Data* d, UNS8 line, UNS8 nbBytes);
   237 UNS8 setSDOlineRestBytes (CO_Data* d, UNS8 line, UNS32 nbBytes);
   238 
   238 
   239 /**
   239 /**
   240  * @brief Transmit a SDO frame on the bus bus_id
   240  * @brief Transmit a SDO frame on the bus bus_id
   241  * bus_id is hardware dependant
   241  * bus_id is hardware dependant
   242  * @param *d Pointer on a CAN object data structure
   242  * @param *d Pointer on a CAN object data structure
   288  * @param dataType (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value.
   288  * @param dataType (defined in objdictdef.h) : put "visible_string" for strings, 0 for integers or reals or other value.
   289  * @param *data Pointer on data
   289  * @param *data Pointer on data
   290  * @return 0xFF if error, else return 0
   290  * @return 0xFF if error, else return 0
   291  */
   291  */
   292 UNS8 writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index,
   292 UNS8 writeNetworkDict (CO_Data* d, UNS8 nodeId, UNS16 index,
   293 		       UNS8 subIndex, UNS8 count, UNS8 dataType, void *data);
   293 		       UNS8 subIndex, UNS32 count, UNS8 dataType, void *data);
   294 
   294 
   295 /** 
   295 /** 
   296  * @ingroup sdo
   296  * @ingroup sdo
   297  * @brief Used to send a SDO request frame to write in a distant node dictionnary.
   297  * @brief Used to send a SDO request frame to write in a distant node dictionnary.
   298  * The function Callback which must be defined in the user code is called at the
   298  * The function Callback which must be defined in the user code is called at the
   306  * @param *data Pointer on data
   306  * @param *data Pointer on data
   307  * @param Callback Callback function
   307  * @param Callback Callback function
   308  * @return 0xFF if error, else return 0
   308  * @return 0xFF if error, else return 0
   309  */
   309  */
   310 UNS8 writeNetworkDictCallBack (CO_Data* d, UNS8 nodeId, UNS16 index,
   310 UNS8 writeNetworkDictCallBack (CO_Data* d, UNS8 nodeId, UNS16 index,
   311 		       UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback);
   311 		       UNS8 subIndex, UNS32 count, UNS8 dataType, void *data, SDOCallback_t Callback);
   312 
   312 
   313 /**
   313 /**
   314  * @ingroup sdo 
   314  * @ingroup sdo 
   315  * @brief Used to send a SDO request frame to write in a distant node dictionnary.
   315  * @brief Used to send a SDO request frame to write in a distant node dictionnary.
   316  * The function Callback	which must be defined in the user code is called at the
   316  * The function Callback	which must be defined in the user code is called at the
   328  *                  when 0, data is not endianized and copied in machine native
   328  *                  when 0, data is not endianized and copied in machine native
   329  *                  endianness
   329  *                  endianness
   330  * @return 0xFF if error, else return 0
   330  * @return 0xFF if error, else return 0
   331  */
   331  */
   332 UNS8 writeNetworkDictCallBackAI (CO_Data* d, UNS8 nodeId, UNS16 index,
   332 UNS8 writeNetworkDictCallBackAI (CO_Data* d, UNS8 nodeId, UNS16 index,
   333 		       UNS8 subIndex, UNS8 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize);
   333 		       UNS8 subIndex, UNS32 count, UNS8 dataType, void *data, SDOCallback_t Callback, UNS8 endianize);
   334 
   334 
   335 /**
   335 /**
   336  * @ingroup sdo 
   336  * @ingroup sdo 
   337  * @brief Used by the application to send a SDO request frame to read
   337  * @brief Used by the application to send a SDO request frame to read
   338  * @param *d Pointer on a CAN object data structure
   338  * @param *d Pointer on a CAN object data structure
   397  * UNS8 size;
   397  * UNS8 size;
   398  * readNetworkDict(0, 0x05, 0x1016, 1, 0) // get the data index 1016 subindex 1 of node 5
   398  * readNetworkDict(0, 0x05, 0x1016, 1, 0) // get the data index 1016 subindex 1 of node 5
   399  * while (getReadResultNetworkDict (0, 0x05, &data, &size) != SDO_UPLOAD_IN_PROGRESS);
   399  * while (getReadResultNetworkDict (0, 0x05, &data, &size) != SDO_UPLOAD_IN_PROGRESS);
   400  * @endcode
   400  * @endcode
   401 */
   401 */
   402 UNS8 getReadResultNetworkDict (CO_Data* d, UNS8 nodeId, void* data, UNS8 *size, UNS32 * abortCode);
   402 UNS8 getReadResultNetworkDict (CO_Data* d, UNS8 nodeId, void* data, UNS32 *size, UNS32 * abortCode);
   403 
   403 
   404 /**
   404 /**
   405  * @brief Use this function after a writeNetworkDict to get the result of the write
   405  * @brief Use this function after a writeNetworkDict to get the result of the write
   406  * It is mandatory to call this function because it is releasing the line used for the transfer.
   406  * It is mandatory to call this function because it is releasing the line used for the transfer.
   407  * @param *d Pointer on a CAN object data structure
   407  * @param *d Pointer on a CAN object data structure