nico@207: \hypertarget{sdo_8h}{ nico@207: \section{/home/epimerde/documents/tc11/Can\-Festival-3/include/sdo.h File Reference} nico@207: \label{sdo_8h}\index{/home/epimerde/documents/tc11/CanFestival-3/include/sdo.h@{/home/epimerde/documents/tc11/CanFestival-3/include/sdo.h}} nico@207: } nico@207: {\tt \#include \char`\"{}timer.h\char`\"{}}\par nico@207: {\tt \#include \char`\"{}data.h\char`\"{}}\par nico@207: \subsection*{Data Structures} nico@207: \begin{CompactItemize} nico@207: \item nico@207: struct \hyperlink{structstruct__s__transfer}{struct\_\-s\_\-transfer} nico@207: \item nico@207: struct \hyperlink{structBODY}{BODY} nico@207: \item nico@207: struct \hyperlink{structstruct__s__SDO}{struct\_\-s\_\-SDO} nico@207: \end{CompactItemize} nico@207: \subsection*{Typedefs} nico@207: \begin{CompactItemize} nico@207: \item nico@207: typedef void($\ast$) \hyperlink{sdo_8h_606eccfef67e572723e1efba3f0d87ba}{SDOCallback\_\-t} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id) nico@207: \item nico@207: typedef \hyperlink{structstruct__s__transfer}{struct\_\-s\_\-transfer} \hyperlink{sdo_8h_0c41985ac8cf4546cbce64eb0f2ac897}{s\_\-transfer} nico@207: \item nico@207: typedef \hyperlink{structstruct__s__SDO}{struct\_\-s\_\-SDO} \hyperlink{sdo_8h_f9e5cbdc9fba242ca4060f6bffa6d7c8}{s\_\-SDO} nico@207: \end{CompactItemize} nico@207: \subsection*{Functions} nico@207: \begin{CompactItemize} nico@207: \item nico@207: void \hyperlink{sdo_8h_9309025e29b59e09026abcd3b45a5b61}{SDOTimeout\-Alarm} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS32 id) nico@207: \item nico@207: void \hyperlink{sdo_8h_1f4f07eccc4890a11ccf4f632da7740b}{reset\-SDO} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d) nico@207: \item nico@207: UNS32 \hyperlink{sdo_8h_2eb5309dca3a7363da5e5e7230b85d58}{SDOline\-To\-Objdict} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 line) nico@207: \item nico@207: UNS32 \hyperlink{sdo_8h_29427a80fd1aeabff30bf0602fbc220f}{objdict\-To\-SDOline} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 line) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_ad6eb8be03b832ebba4dfb87aaba4065}{line\-To\-SDO} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 line, UNS8 nb\-Bytes, UNS8 $\ast$data) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_18b6f7e9c9441640a88ffef1e8720694}{SDOto\-Line} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 line, UNS8 nb\-Bytes, UNS8 $\ast$data) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_2019db2a4d17e6d29c055cbae173e2b9}{failed\-SDO} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id, UNS8 whoami, UNS16 index, UNS8 sub\-Index, UNS32 abort\-Code) nico@207: \item nico@207: void \hyperlink{sdo_8h_42d33be015d4c4c83c73f1f0e588f481}{reset\-SDOline} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 line) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_b9c873a15f55b29112b5527a6cc6898d}{init\-SDOline} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 line, UNS8 node\-Id, UNS16 index, UNS8 sub\-Index, UNS8 state) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_58d1f9691977617601beb9e5b4123252}{get\-SDOfree\-Line} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 whoami, UNS8 $\ast$line) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_bb0c376b048ab2c6e0524b135b62376f}{get\-SDOline\-On\-Use} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id, UNS8 whoami, UNS8 $\ast$line) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_555a772d3a88a29c495f33513f8b2d58}{close\-SDOtransfer} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id, UNS8 whoami) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_acceb714c6e457e98deb9ba164ba2a2f}{get\-SDOline\-Rest\-Bytes} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 line, UNS8 $\ast$nb\-Bytes) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_601a837ecb5f21bf4c66b058c5ae7810}{set\-SDOline\-Rest\-Bytes} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 line, UNS8 nb\-Bytes) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_c6b5d7d1439d537da992a96644a1ca5d}{send\-SDO} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 whoami, \hyperlink{structstruct__s__SDO}{s\_\-SDO} sdo) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_b26c3f2fb63d81055809d6ccaa785b7c}{send\-SDOabort} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 whoami, UNS16 index, UNS8 sub\-Index, UNS32 abort\-Code) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_2a93a7c780472b1d8666d89aa270f661}{proceed\-SDO} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, \hyperlink{structMessage}{Message} $\ast$m) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_bc20ed246e00053dcf71faa8f45ee39c}{write\-Network\-Dict} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id, UNS16 index, UNS8 sub\-Index, UNS8 count, UNS8 data\-Type, void $\ast$data) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_f4ec05293fb8971a1b282994498ed4f5}{write\-Network\-Dict\-Call\-Back} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id, UNS16 index, UNS8 sub\-Index, UNS8 count, UNS8 data\-Type, void $\ast$data, \hyperlink{sdo_8h_606eccfef67e572723e1efba3f0d87ba}{SDOCallback\_\-t} Callback) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_0e102a0835e4115920cd406e80a8d135}{read\-Network\-Dict} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id, UNS16 index, UNS8 sub\-Index, UNS8 data\-Type) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_542a5cdd20c00aa130a39fe68295e769}{read\-Network\-Dict\-Callback} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id, UNS16 index, UNS8 sub\-Index, UNS8 data\-Type, \hyperlink{sdo_8h_606eccfef67e572723e1efba3f0d87ba}{SDOCallback\_\-t} Callback) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_05b0c8eee1faee3c7a2f6e2ba3a16533}{get\-Read\-Result\-Network\-Dict} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id, void $\ast$data, UNS8 $\ast$size, UNS32 $\ast$abort\-Code) nico@207: \item nico@207: UNS8 \hyperlink{sdo_8h_8671e306873f19362c60bb50ab930d1d}{get\-Write\-Result\-Network\-Dict} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id, UNS32 $\ast$abort\-Code) nico@207: \end{CompactItemize} nico@207: nico@207: nico@207: \subsection{Typedef Documentation} nico@207: \hypertarget{sdo_8h_f9e5cbdc9fba242ca4060f6bffa6d7c8}{ nico@207: \index{sdo.h@{sdo.h}!s_SDO@{s\_\-SDO}} nico@207: \index{s_SDO@{s\_\-SDO}!sdo.h@{sdo.h}} nico@207: \subsubsection[s\_\-SDO]{\setlength{\rightskip}{0pt plus 5cm}typedef struct \hyperlink{structstruct__s__SDO}{struct\_\-s\_\-SDO} \hyperlink{structstruct__s__SDO}{s\_\-SDO}}} nico@207: \label{sdo_8h_f9e5cbdc9fba242ca4060f6bffa6d7c8} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 86 of file sdo.h.\hypertarget{sdo_8h_0c41985ac8cf4546cbce64eb0f2ac897}{ nico@207: \index{sdo.h@{sdo.h}!s_transfer@{s\_\-transfer}} nico@207: \index{s_transfer@{s\_\-transfer}!sdo.h@{sdo.h}} nico@207: \subsubsection[s\_\-transfer]{\setlength{\rightskip}{0pt plus 5cm}typedef struct \hyperlink{structstruct__s__transfer}{struct\_\-s\_\-transfer} \hyperlink{structstruct__s__transfer}{s\_\-transfer}}} nico@207: \label{sdo_8h_0c41985ac8cf4546cbce64eb0f2ac897} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 69 of file sdo.h.\hypertarget{sdo_8h_606eccfef67e572723e1efba3f0d87ba}{ nico@207: \index{sdo.h@{sdo.h}!SDOCallback_t@{SDOCallback\_\-t}} nico@207: \index{SDOCallback_t@{SDOCallback\_\-t}!sdo.h@{sdo.h}} nico@207: \subsubsection[SDOCallback\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$) \hyperlink{sdo_8h_606eccfef67e572723e1efba3f0d87ba}{SDOCallback\_\-t}(\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id)}} nico@207: \label{sdo_8h_606eccfef67e572723e1efba3f0d87ba} nico@207: nico@207: nico@207: nico@207: nico@207: Definition at line 30 of file sdo.h. nico@207: nico@207: \subsection{Function Documentation} nico@207: \hypertarget{sdo_8h_555a772d3a88a29c495f33513f8b2d58}{ nico@207: \index{sdo.h@{sdo.h}!closeSDOtransfer@{closeSDOtransfer}} nico@207: \index{closeSDOtransfer@{closeSDOtransfer}!sdo.h@{sdo.h}} nico@207: \subsubsection[closeSDOtransfer]{\setlength{\rightskip}{0pt plus 5cm}UNS8 close\-SDOtransfer (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id}, UNS8 {\em whoami})}} nico@207: \label{sdo_8h_555a772d3a88a29c495f33513f8b2d58} nico@207: nico@207: nico@207: Close a transmission. node\-Id : Node id of the server if both server or client whoami : Line opened as SDO\_\-CLIENT or SDO\_\-SERVER nico@207: nico@207: Definition at line 318 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-timer\_\-entry::d, get\-SDOline\-On\-Use(), MSG\_\-WAR, reset\-SDOline(), and UNS8.\hypertarget{sdo_8h_2019db2a4d17e6d29c055cbae173e2b9}{ nico@207: \index{sdo.h@{sdo.h}!failedSDO@{failedSDO}} nico@207: \index{failedSDO@{failedSDO}!sdo.h@{sdo.h}} nico@207: \subsubsection[failedSDO]{\setlength{\rightskip}{0pt plus 5cm}UNS8 failed\-SDO (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id}, UNS8 {\em whoami}, UNS16 {\em index}, UNS8 {\em sub\-Index}, UNS32 {\em abort\-Code})}} nico@207: \label{sdo_8h_2019db2a4d17e6d29c055cbae173e2b9} nico@207: nico@207: nico@207: Called when an internal SDO abort occurs. Release the line $\ast$ Only if server $\ast$ If client, the line must be released manually in the core application. The reason of that is to permit the program to read the transfers\mbox{[}\mbox{]}\mbox{[}\mbox{]} structure before its reset, because many informations are stored on it : index, subindex, data received or trasmited, ... In all cases, sends a SDO abort. Returns 0 nico@207: nico@207: Definition at line 227 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-timer\_\-entry::d, get\-SDOline\-On\-Use(), MSG\_\-WAR, reset\-SDOline(), SDO\_\-ABORTED\_\-INTERNAL, SDO\_\-CLIENT, SDO\_\-SERVER, send\-SDOabort(), struct\_\-s\_\-transfer::state, Stop\-SDO\_\-TIMER, struct\_\-CO\_\-Data::transfers, and UNS8.\hypertarget{sdo_8h_05b0c8eee1faee3c7a2f6e2ba3a16533}{ nico@207: \index{sdo.h@{sdo.h}!getReadResultNetworkDict@{getReadResultNetworkDict}} nico@207: \index{getReadResultNetworkDict@{getReadResultNetworkDict}!sdo.h@{sdo.h}} nico@207: \subsubsection[getReadResultNetworkDict]{\setlength{\rightskip}{0pt plus 5cm}UNS8 get\-Read\-Result\-Network\-Dict (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id}, void $\ast$ {\em data}, UNS8 $\ast$ {\em size}, UNS32 $\ast$ {\em abort\-Code})}} nico@207: \label{sdo_8h_05b0c8eee1faee3c7a2f6e2ba3a16533} nico@207: nico@207: nico@207: Use this function after a read\-Network\-Dict to get the result. Returns : SDO\_\-FINISHED // data is available SDO\_\-ABORTED\_\-RCV // Transfert failed. (abort SDO received) SDO\_\-ABORTED\_\-INTERNAL // Transfert failed. Internal abort. SDO\_\-UPLOAD\_\-IN\_\-PROGRESS // Data not yet available SDO\_\-DOWNLOAD\_\-IN\_\-PROGRESS // Should not arrive ! nico@207: nico@207: data\-Type (defined in \hyperlink{objdictdef_8h}{objdictdef.h}) : type expected. put \char`\"{}visible\_\-string\char`\"{} for strings, 0 for integers or reals. abort\-Code : 0 = not available. Else : SDO abort code. (received if return SDO\_\-ABORTED\_\-RCV) example : UNS32 data; UNS8 size; read\-Network\-Dict(0, 0x05, 0x1016, 1, 0) // get the data index 1016 subindex 1 of node 5 while (get\-Read\-Result\-Network\-Dict (0, 0x05, \&data, \&size) != SDO\_\-UPLOAD\_\-IN\_\-PROGRESS); nico@207: nico@207: Definition at line 1295 of file sdo.c. nico@207: nico@207: References CANOPEN\_\-BIG\_\-ENDIAN, struct\_\-s\_\-transfer::count, struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::data, struct\_\-s\_\-transfer::data\-Type, get\-SDOline\-On\-Use(), MSG\_\-ERR, SDO\_\-ABORTED\_\-INTERNAL, SDO\_\-CLIENT, SDO\_\-FINISHED, struct\_\-s\_\-transfer::state, struct\_\-CO\_\-Data::transfers, UNS8, and visible\_\-string.\hypertarget{sdo_8h_58d1f9691977617601beb9e5b4123252}{ nico@207: \index{sdo.h@{sdo.h}!getSDOfreeLine@{getSDOfreeLine}} nico@207: \index{getSDOfreeLine@{getSDOfreeLine}!sdo.h@{sdo.h}} nico@207: \subsubsection[getSDOfreeLine]{\setlength{\rightskip}{0pt plus 5cm}UNS8 get\-SDOfree\-Line (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em whoami}, UNS8 $\ast$ {\em line})}} nico@207: \label{sdo_8h_58d1f9691977617601beb9e5b4123252} nico@207: nico@207: nico@207: Search for an unused line in the transfers array to store a new SDO. ie a line which value of the field \char`\"{}state\char`\"{} is \char`\"{}SDO\_\-RESET\char`\"{} An unused line have the field \char`\"{}state\char`\"{} at the value SDO\_\-RESET bus\_\-id is hardware dependant whoami : create the line for a SDO\_\-SERVER or SDO\_\-CLIENT. return 0x\-FF if all the lines are on use. Else, return 0 nico@207: nico@207: Definition at line 284 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-timer\_\-entry::d, SDO\_\-MAX\_\-SIMULTANEOUS\_\-TRANSFERTS, SDO\_\-RESET, struct\_\-s\_\-transfer::state, struct\_\-CO\_\-Data::transfers, UNS8, and struct\_\-s\_\-transfer::whoami.\hypertarget{sdo_8h_bb0c376b048ab2c6e0524b135b62376f}{ nico@207: \index{sdo.h@{sdo.h}!getSDOlineOnUse@{getSDOlineOnUse}} nico@207: \index{getSDOlineOnUse@{getSDOlineOnUse}!sdo.h@{sdo.h}} nico@207: \subsubsection[getSDOlineOnUse]{\setlength{\rightskip}{0pt plus 5cm}UNS8 get\-SDOline\-On\-Use (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id}, UNS8 {\em whoami}, UNS8 $\ast$ {\em line})}} nico@207: \label{sdo_8h_bb0c376b048ab2c6e0524b135b62376f} nico@207: nico@207: nico@207: Search for the line, in the transfers array, which contains the beginning of the reception of a fragmented SDO whoami takes 2 values : look for a line opened as SDO\_\-CLIENT or SDO\_\-SERVER bus\_\-id is hardware dependant node\-Id correspond to the message node-id return 0x\-FF if error. Else, return 0 nico@207: nico@207: Definition at line 301 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::node\-Id, SDO\_\-MAX\_\-SIMULTANEOUS\_\-TRANSFERTS, SDO\_\-RESET, struct\_\-s\_\-transfer::state, struct\_\-CO\_\-Data::transfers, UNS8, and struct\_\-s\_\-transfer::whoami.\hypertarget{sdo_8h_acceb714c6e457e98deb9ba164ba2a2f}{ nico@207: \index{sdo.h@{sdo.h}!getSDOlineRestBytes@{getSDOlineRestBytes}} nico@207: \index{getSDOlineRestBytes@{getSDOlineRestBytes}!sdo.h@{sdo.h}} nico@207: \subsubsection[getSDOlineRestBytes]{\setlength{\rightskip}{0pt plus 5cm}UNS8 get\-SDOline\-Rest\-Bytes (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em line}, UNS8 $\ast$ {\em nb\-Bytes})}} nico@207: \label{sdo_8h_acceb714c6e457e98deb9ba164ba2a2f} nico@207: nico@207: nico@207: Bytes in the line structure which must be transmited (or received) bus\_\-id is hardware dependant. return 0. nico@207: nico@207: Definition at line 332 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-transfer::count, struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::offset, struct\_\-CO\_\-Data::transfers, and UNS8.\hypertarget{sdo_8h_8671e306873f19362c60bb50ab930d1d}{ nico@207: \index{sdo.h@{sdo.h}!getWriteResultNetworkDict@{getWriteResultNetworkDict}} nico@207: \index{getWriteResultNetworkDict@{getWriteResultNetworkDict}!sdo.h@{sdo.h}} nico@207: \subsubsection[getWriteResultNetworkDict]{\setlength{\rightskip}{0pt plus 5cm}UNS8 get\-Write\-Result\-Network\-Dict (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id}, UNS32 $\ast$ {\em abort\-Code})}} nico@207: \label{sdo_8h_8671e306873f19362c60bb50ab930d1d} nico@207: nico@207: nico@207: Use this function after a write\-Network\-Dict to get the result of the write It is mandatory to call this function because it is releasing the line used for the transfer. Returns : SDO\_\-FINISHED // data is available SDO\_\-ABORTED\_\-RCV // Transfert failed. (abort SDO received) SDO\_\-ABORTED\_\-INTERNAL // Transfert failed. Internal abort. SDO\_\-DOWNLOAD\_\-IN\_\-PROGRESS // Data not yet available SDO\_\-UPLOAD\_\-IN\_\-PROGRESS // Should not arrive ! abort\-Code : 0 = not available. Else : SDO abort code. (received if return SDO\_\-ABORTED\_\-RCV) example : UNS32 data = 0x50; UNS8 size; UNS32 abort\-Code; write\-Network\-Dict(0, 0x05, 0x1016, 1, size, \&data) // write the data index 1016 subindex 1 of node 5 while ( get\-Write\-Result\-Network\-Dict (0, 0x05, \&abort\-Code) != SDO\_\-DOWNLOAD\_\-IN\_\-PROGRESS); nico@207: nico@207: Definition at line 1329 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-transfer::abort\-Code, struct\_\-s\_\-timer\_\-entry::d, get\-SDOline\-On\-Use(), MSG\_\-ERR, SDO\_\-ABORTED\_\-INTERNAL, SDO\_\-CLIENT, struct\_\-s\_\-transfer::state, struct\_\-CO\_\-Data::transfers, and UNS8.\hypertarget{sdo_8h_b9c873a15f55b29112b5527a6cc6898d}{ nico@207: \index{sdo.h@{sdo.h}!initSDOline@{initSDOline}} nico@207: \index{initSDOline@{initSDOline}!sdo.h@{sdo.h}} nico@207: \subsubsection[initSDOline]{\setlength{\rightskip}{0pt plus 5cm}UNS8 init\-SDOline (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em line}, UNS8 {\em node\-Id}, UNS16 {\em index}, UNS8 {\em sub\-Index}, UNS8 {\em state})}} nico@207: \label{sdo_8h_b9c873a15f55b29112b5527a6cc6898d} nico@207: nico@207: nico@207: Initialize some fields of the structure. Returns 0 nico@207: nico@207: Definition at line 263 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-transfer::Callback, struct\_\-s\_\-transfer::count, struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::data\-Type, struct\_\-s\_\-transfer::index, MSG\_\-WAR, struct\_\-s\_\-transfer::node\-Id, struct\_\-s\_\-transfer::offset, SDO\_\-DOWNLOAD\_\-IN\_\-PROGRESS, SDO\_\-UPLOAD\_\-IN\_\-PROGRESS, Start\-SDO\_\-TIMER, struct\_\-s\_\-transfer::state, Stop\-SDO\_\-TIMER, struct\_\-s\_\-transfer::sub\-Index, struct\_\-s\_\-transfer::toggle, and struct\_\-CO\_\-Data::transfers.\hypertarget{sdo_8h_ad6eb8be03b832ebba4dfb87aaba4065}{ nico@207: \index{sdo.h@{sdo.h}!lineToSDO@{lineToSDO}} nico@207: \index{lineToSDO@{lineToSDO}!sdo.h@{sdo.h}} nico@207: \subsubsection[lineToSDO]{\setlength{\rightskip}{0pt plus 5cm}UNS8 line\-To\-SDO (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em line}, UNS8 {\em nb\-Bytes}, UNS8 $\ast$ {\em data})}} nico@207: \label{sdo_8h_ad6eb8be03b832ebba4dfb87aaba4065} nico@207: nico@207: nico@207: copy data from an existant line in the argument \char`\"{}$\ast$ data\char`\"{} Returns 0x\-FF if error. Else, returns 0; nico@207: nico@207: Definition at line 189 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-transfer::count, struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::data, MSG\_\-ERR, struct\_\-s\_\-transfer::offset, SDO\_\-MAX\_\-LENGTH\_\-TRANSFERT, struct\_\-CO\_\-Data::transfers, and UNS8.\hypertarget{sdo_8h_29427a80fd1aeabff30bf0602fbc220f}{ nico@207: \index{sdo.h@{sdo.h}!objdictToSDOline@{objdictToSDOline}} nico@207: \index{objdictToSDOline@{objdictToSDOline}!sdo.h@{sdo.h}} nico@207: \subsubsection[objdictToSDOline]{\setlength{\rightskip}{0pt plus 5cm}UNS32 objdict\-To\-SDOline (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em line})}} nico@207: \label{sdo_8h_29427a80fd1aeabff30bf0602fbc220f} nico@207: nico@207: nico@207: Copy the data from the object dictionary to the SDO line for a network transfert. Returns SDO error code if error. Else, returns 0; nico@207: nico@207: Definition at line 157 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-transfer::count, struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::data, get\-ODentry(), struct\_\-s\_\-transfer::index, MSG\_\-WAR, OD\_\-SUCCESSFUL, struct\_\-s\_\-transfer::offset, struct\_\-s\_\-transfer::sub\-Index, struct\_\-CO\_\-Data::transfers, UNS32, and UNS8.\hypertarget{sdo_8h_2a93a7c780472b1d8666d89aa270f661}{ nico@207: \index{sdo.h@{sdo.h}!proceedSDO@{proceedSDO}} nico@207: \index{proceedSDO@{proceedSDO}!sdo.h@{sdo.h}} nico@207: \subsubsection[proceedSDO]{\setlength{\rightskip}{0pt plus 5cm}UNS8 proceed\-SDO (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, \hyperlink{structMessage}{Message} $\ast$ {\em m})}} nico@207: \label{sdo_8h_2a93a7c780472b1d8666d89aa270f661} nico@207: nico@207: nico@207: Treat a SDO frame reception bus\_\-id is hardware dependant call the function send\-SDO return 0x\-FF if error 0x80 if transfert aborted by the server 0x0 ok nico@207: nico@207: Definition at line 447 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-transfer::abort\-Code, struct\_\-CO\_\-Data::b\-Device\-Node\-Id, struct\_\-s\_\-SDO::body, td\_\-indextable::b\-Sub\-Count, struct\_\-s\_\-transfer::Callback, struct\_\-s\_\-transfer::count, struct\_\-s\_\-timer\_\-entry::d, BODY::data, Message::data, failed\-SDO(), struct\_\-CO\_\-Data::first\-Index, get\-SDOc, get\-SDOcs, get\-SDOe, get\-SDOfree\-Line(), get\-SDOindex, get\-SDOline\-On\-Use(), get\-SDOline\-Rest\-Bytes(), get\-SDOn2, get\-SDOn3, get\-SDOs, get\-SDOsub\-Index, get\-SDOt, struct\_\-s\_\-transfer::index, init\-SDOline(), struct\_\-CO\_\-Data::last\-Index, line\-To\-SDO(), MSG\_\-ERR, MSG\_\-WAR, struct\_\-s\_\-SDO::node\-Id, struct\_\-CO\_\-Data::objdict, objdict\-To\-SDOline(), td\_\-subindex::p\-Object, td\_\-indextable::p\-Subindex, reset\-SDOline(), Restart\-SDO\_\-TIMER, SDO\_\-ABORTED\_\-RCV, SDO\_\-CLIENT, s\_\-quick\_\-index::SDO\_\-CLT, SDO\_\-DOWNLOAD\_\-IN\_\-PROGRESS, SDO\_\-FINISHED, SDO\_\-SERVER, s\_\-quick\_\-index::SDO\_\-SVR, SDO\_\-UNKNOWN, SDO\_\-UPLOAD\_\-IN\_\-PROGRESS, SDOABT\_\-GENERAL\_\-ERROR, SDOABT\_\-LOCAL\_\-CTRL\_\-ERROR, SDOABT\_\-TOGGLE\_\-NOT\_\-ALTERNED, SDOline\-To\-Objdict(), SDOto\-Line(), send\-SDO(), set\-SDOline\-Rest\-Bytes(), struct\_\-s\_\-transfer::state, Stop\-SDO\_\-TIMER, struct\_\-s\_\-transfer::sub\-Index, struct\_\-s\_\-transfer::toggle, struct\_\-CO\_\-Data::transfers, UNS16, UNS32, and UNS8.\hypertarget{sdo_8h_0e102a0835e4115920cd406e80a8d135}{ nico@207: \index{sdo.h@{sdo.h}!readNetworkDict@{readNetworkDict}} nico@207: \index{readNetworkDict@{readNetworkDict}!sdo.h@{sdo.h}} nico@207: \subsubsection[readNetworkDict]{\setlength{\rightskip}{0pt plus 5cm}UNS8 read\-Network\-Dict (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id}, UNS16 {\em index}, UNS8 {\em sub\-Index}, UNS8 {\em data\-Type})}} nico@207: \label{sdo_8h_0e102a0835e4115920cd406e80a8d135} nico@207: nico@207: nico@207: Used by the application to send a SDO request frame to read in the dictionary of a server node whose node\_\-id is ID at the index and sub\-Index indicated bus\_\-id is hardware dependant datatype (defined in \hyperlink{objdictdef_8h}{objdictdef.h}) : put \char`\"{}visible\_\-string\char`\"{} for strings, 0 for integers or reals or other value. return 0x\-FF if error, else return 0 nico@207: nico@207: Definition at line 1282 of file sdo.c. nico@207: nico@207: References \_\-read\-Network\-Dict(), and struct\_\-s\_\-timer\_\-entry::d.\hypertarget{sdo_8h_542a5cdd20c00aa130a39fe68295e769}{ nico@207: \index{sdo.h@{sdo.h}!readNetworkDictCallback@{readNetworkDictCallback}} nico@207: \index{readNetworkDictCallback@{readNetworkDictCallback}!sdo.h@{sdo.h}} nico@207: \subsubsection[readNetworkDictCallback]{\setlength{\rightskip}{0pt plus 5cm}UNS8 read\-Network\-Dict\-Callback (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id}, UNS16 {\em index}, UNS8 {\em sub\-Index}, UNS8 {\em data\-Type}, \hyperlink{sdo_8h_606eccfef67e572723e1efba3f0d87ba}{SDOCallback\_\-t} {\em Callback})}} nico@207: \label{sdo_8h_542a5cdd20c00aa130a39fe68295e769} nico@207: nico@207: nico@207: Used to send a SDO request frame to read in a distant node dictionnary. The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort). nico@207: nico@207: Definition at line 1288 of file sdo.c. nico@207: nico@207: References \_\-read\-Network\-Dict(), and struct\_\-s\_\-timer\_\-entry::d.\hypertarget{sdo_8h_1f4f07eccc4890a11ccf4f632da7740b}{ nico@207: \index{sdo.h@{sdo.h}!resetSDO@{resetSDO}} nico@207: \index{resetSDO@{resetSDO}!sdo.h@{sdo.h}} nico@207: \subsubsection[resetSDO]{\setlength{\rightskip}{0pt plus 5cm}void reset\-SDO (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d})}} nico@207: \label{sdo_8h_1f4f07eccc4890a11ccf4f632da7740b} nico@207: nico@207: nico@207: Reset all sdo buffers nico@207: nico@207: Definition at line 131 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-timer\_\-entry::d, reset\-SDOline(), SDO\_\-MAX\_\-SIMULTANEOUS\_\-TRANSFERTS, and UNS8.\hypertarget{sdo_8h_42d33be015d4c4c83c73f1f0e588f481}{ nico@207: \index{sdo.h@{sdo.h}!resetSDOline@{resetSDOline}} nico@207: \index{resetSDOline@{resetSDOline}!sdo.h@{sdo.h}} nico@207: \subsubsection[resetSDOline]{\setlength{\rightskip}{0pt plus 5cm}void reset\-SDOline (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em line})}} nico@207: \label{sdo_8h_42d33be015d4c4c83c73f1f0e588f481} nico@207: nico@207: nico@207: Reset an unused line. nico@207: nico@207: Definition at line 253 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::data, init\-SDOline(), MSG\_\-WAR, SDO\_\-MAX\_\-LENGTH\_\-TRANSFERT, SDO\_\-RESET, struct\_\-CO\_\-Data::transfers, and UNS8.\hypertarget{sdo_8h_2eb5309dca3a7363da5e5e7230b85d58}{ nico@207: \index{sdo.h@{sdo.h}!SDOlineToObjdict@{SDOlineToObjdict}} nico@207: \index{SDOlineToObjdict@{SDOlineToObjdict}!sdo.h@{sdo.h}} nico@207: \subsubsection[SDOlineToObjdict]{\setlength{\rightskip}{0pt plus 5cm}UNS32 SDOline\-To\-Objdict (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em line})}} nico@207: \label{sdo_8h_2eb5309dca3a7363da5e5e7230b85d58} nico@207: nico@207: nico@207: Copy the data received from the SDO line transfert to the object dictionary Returns SDO error code if error. Else, returns 0; nico@207: nico@207: Definition at line 141 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-transfer::count, struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::data, struct\_\-s\_\-transfer::index, MSG\_\-WAR, OD\_\-SUCCESSFUL, set\-ODentry(), struct\_\-s\_\-transfer::sub\-Index, struct\_\-CO\_\-Data::transfers, UNS32, and UNS8.\hypertarget{sdo_8h_9309025e29b59e09026abcd3b45a5b61}{ nico@207: \index{sdo.h@{sdo.h}!SDOTimeoutAlarm@{SDOTimeoutAlarm}} nico@207: \index{SDOTimeoutAlarm@{SDOTimeoutAlarm}!sdo.h@{sdo.h}} nico@207: \subsubsection[SDOTimeoutAlarm]{\setlength{\rightskip}{0pt plus 5cm}void SDOTimeout\-Alarm (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS32 {\em id})}} nico@207: \label{sdo_8h_9309025e29b59e09026abcd3b45a5b61} nico@207: nico@207: nico@207: Reset of a SDO exchange on timeout. Send a SDO abort nico@207: nico@207: Definition at line 93 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-transfer::abort\-Code, struct\_\-s\_\-transfer::Callback, struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::index, MSG\_\-ERR, MSG\_\-WAR, struct\_\-s\_\-transfer::node\-Id, reset\-SDOline(), SDO\_\-ABORTED\_\-INTERNAL, SDO\_\-SERVER, SDOABT\_\-TIMED\_\-OUT, send\-SDOabort(), struct\_\-s\_\-transfer::state, struct\_\-s\_\-transfer::sub\-Index, struct\_\-s\_\-transfer::timer, struct\_\-CO\_\-Data::transfers, UNS8, and struct\_\-s\_\-transfer::whoami.\hypertarget{sdo_8h_18b6f7e9c9441640a88ffef1e8720694}{ nico@207: \index{sdo.h@{sdo.h}!SDOtoLine@{SDOtoLine}} nico@207: \index{SDOtoLine@{SDOtoLine}!sdo.h@{sdo.h}} nico@207: \subsubsection[SDOtoLine]{\setlength{\rightskip}{0pt plus 5cm}UNS8 SDOto\-Line (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em line}, UNS8 {\em nb\-Bytes}, UNS8 $\ast$ {\em data})}} nico@207: \label{sdo_8h_18b6f7e9c9441640a88ffef1e8720694} nico@207: nico@207: nico@207: Add data to an existant line Returns 0x\-FF if error. Else, returns 0; nico@207: nico@207: Definition at line 210 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-timer\_\-entry::d, struct\_\-s\_\-transfer::data, MSG\_\-ERR, struct\_\-s\_\-transfer::offset, SDO\_\-MAX\_\-LENGTH\_\-TRANSFERT, struct\_\-CO\_\-Data::transfers, and UNS8.\hypertarget{sdo_8h_c6b5d7d1439d537da992a96644a1ca5d}{ nico@207: \index{sdo.h@{sdo.h}!sendSDO@{sendSDO}} nico@207: \index{sendSDO@{sendSDO}!sdo.h@{sdo.h}} nico@207: \subsubsection[sendSDO]{\setlength{\rightskip}{0pt plus 5cm}UNS8 send\-SDO (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em whoami}, \hyperlink{structstruct__s__SDO}{s\_\-SDO} {\em sdo})}} nico@207: \label{sdo_8h_c6b5d7d1439d537da992a96644a1ca5d} nico@207: nico@207: nico@207: Transmit a SDO frame on the bus bus\_\-id sdo is a structure which contains the sdo to transmit bus\_\-id is hardware dependant whoami takes 2 values : SDO\_\-CLIENT or SDO\_\-SERVER return can\-Send(bus\_\-id,\&m) or 0x\-FF if error nico@207: nico@207: Definition at line 354 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-SDO::body, td\_\-indextable::b\-Sub\-Count, struct\_\-CO\_\-Data::can\-Handle, can\-Send(), Message::cob\_\-id, struct\_\-s\_\-timer\_\-entry::d, BODY::data, Message::data, struct\_\-CO\_\-Data::first\-Index, struct\_\-CO\_\-Data::last\-Index, Message::len, MSG\_\-ERR, MSG\_\-WAR, struct\_\-s\_\-SDO::node\-Id, struct\_\-CO\_\-Data::node\-State, NOT\_\-A\_\-REQUEST, struct\_\-CO\_\-Data::objdict, Operational, td\_\-subindex::p\-Object, Pre\_\-operational, td\_\-indextable::p\-Subindex, Message::rtr, s\_\-quick\_\-index::SDO\_\-CLT, SDO\_\-SERVER, s\_\-quick\_\-index::SDO\_\-SVR, UNS16, UNS32, UNS8, and SHORT\_\-CAN::w.\hypertarget{sdo_8h_b26c3f2fb63d81055809d6ccaa785b7c}{ nico@207: \index{sdo.h@{sdo.h}!sendSDOabort@{sendSDOabort}} nico@207: \index{sendSDOabort@{sendSDOabort}!sdo.h@{sdo.h}} nico@207: \subsubsection[sendSDOabort]{\setlength{\rightskip}{0pt plus 5cm}UNS8 send\-SDOabort (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em whoami}, UNS16 {\em index}, UNS8 {\em sub\-Index}, UNS32 {\em abort\-Code})}} nico@207: \label{sdo_8h_b26c3f2fb63d81055809d6ccaa785b7c} nico@207: nico@207: nico@207: Transmit a SDO error to the client. The reasons may be : Read/Write to a undefined object Read/Write to a undefined subindex Read/write a not valid length object Write a read only object whoami takes 2 values : SDO\_\-CLIENT or SDO\_\-SERVER nico@207: nico@207: Definition at line 424 of file sdo.c. nico@207: nico@207: References struct\_\-CO\_\-Data::b\-Device\-Node\-Id, struct\_\-s\_\-SDO::body, struct\_\-s\_\-timer\_\-entry::d, BODY::data, MSG\_\-WAR, struct\_\-s\_\-SDO::node\-Id, send\-SDO(), and UNS8.\hypertarget{sdo_8h_601a837ecb5f21bf4c66b058c5ae7810}{ nico@207: \index{sdo.h@{sdo.h}!setSDOlineRestBytes@{setSDOlineRestBytes}} nico@207: \index{setSDOlineRestBytes@{setSDOlineRestBytes}!sdo.h@{sdo.h}} nico@207: \subsubsection[setSDOlineRestBytes]{\setlength{\rightskip}{0pt plus 5cm}UNS8 set\-SDOline\-Rest\-Bytes (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em line}, UNS8 {\em nb\-Bytes})}} nico@207: \label{sdo_8h_601a837ecb5f21bf4c66b058c5ae7810} nico@207: nico@207: nico@207: Store in the line structure the nb of bytes which must be transmited (or received) bus\_\-id is hardware dependant. return 0 if success, 0x\-FF if error. nico@207: nico@207: Definition at line 342 of file sdo.c. nico@207: nico@207: References struct\_\-s\_\-transfer::count, struct\_\-s\_\-timer\_\-entry::d, MSG\_\-ERR, SDO\_\-MAX\_\-LENGTH\_\-TRANSFERT, and struct\_\-CO\_\-Data::transfers.\hypertarget{sdo_8h_bc20ed246e00053dcf71faa8f45ee39c}{ nico@207: \index{sdo.h@{sdo.h}!writeNetworkDict@{writeNetworkDict}} nico@207: \index{writeNetworkDict@{writeNetworkDict}!sdo.h@{sdo.h}} nico@207: \subsubsection[writeNetworkDict]{\setlength{\rightskip}{0pt plus 5cm}UNS8 write\-Network\-Dict (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id}, UNS16 {\em index}, UNS8 {\em sub\-Index}, UNS8 {\em count}, UNS8 {\em data\-Type}, void $\ast$ {\em data})}} nico@207: \label{sdo_8h_bc20ed246e00053dcf71faa8f45ee39c} nico@207: nico@207: nico@207: Used by the application to send a SDO request frame to write the data $\ast$data at the index and sub\-Index indicated in the dictionary of the slave whose node\_\-id is node\-Id Count : nb of bytes to write in the dictionnary. datatype (defined in \hyperlink{objdictdef_8h}{objdictdef.h}) : put \char`\"{}visible\_\-string\char`\"{} for strings, 0 for integers or reals or other value. bus\_\-id is hardware dependant return 0x\-FF if error, else return 0 nico@207: nico@207: Definition at line 1182 of file sdo.c. nico@207: nico@207: References \_\-write\-Network\-Dict(), and struct\_\-s\_\-timer\_\-entry::d.\hypertarget{sdo_8h_f4ec05293fb8971a1b282994498ed4f5}{ nico@207: \index{sdo.h@{sdo.h}!writeNetworkDictCallBack@{writeNetworkDictCallBack}} nico@207: \index{writeNetworkDictCallBack@{writeNetworkDictCallBack}!sdo.h@{sdo.h}} nico@207: \subsubsection[writeNetworkDictCallBack]{\setlength{\rightskip}{0pt plus 5cm}UNS8 write\-Network\-Dict\-Call\-Back (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id}, UNS16 {\em index}, UNS8 {\em sub\-Index}, UNS8 {\em count}, UNS8 {\em data\-Type}, void $\ast$ {\em data}, \hyperlink{sdo_8h_606eccfef67e572723e1efba3f0d87ba}{SDOCallback\_\-t} {\em Callback})}} nico@207: \label{sdo_8h_f4ec05293fb8971a1b282994498ed4f5} nico@207: nico@207: nico@207: Used to send a SDO request frame to write in a distant node dictionnary. The function Callback which must be defined in the user code is called at the end of the exchange. (on succes or abort). nico@207: nico@207: Definition at line 1190 of file sdo.c. nico@207: nico@207: References \_\-write\-Network\-Dict(), and struct\_\-s\_\-timer\_\-entry::d.