
nico@207: \hypertarget{states_8h}{
nico@207: \section{/home/epimerde/documents/tc11/Can\-Festival-3/include/states.h File Reference}
nico@207: \label{states_8h}\index{/home/epimerde/documents/tc11/CanFestival-3/include/states.h@{/home/epimerde/documents/tc11/CanFestival-3/include/states.h}}
nico@207: }
nico@207: {\tt \#include $<$applicfg.h$>$}\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{structs__state__communication}{s\_\-state\_\-communication}
nico@207: \end{CompactItemize}
nico@207: \subsection*{Typedefs}
nico@207: \begin{CompactItemize}
nico@207: \item 
nico@207: typedef enum \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec68646}{enum\_\-node\-State} \hyperlink{states_8h_5891f63a4c9243179838389a93d084e2}{e\_\-node\-State}
nico@207: \item 
nico@207: typedef void($\ast$) \hyperlink{states_8h_d0cd6d1eb89085da7cb9f32ce386e8bc}{initialisation\_\-t} (void)
nico@207: \item 
nico@207: typedef void($\ast$) \hyperlink{states_8h_f4a6da4fe018afbe20eaf716c248e02a}{pre\-Operational\_\-t} (void)
nico@207: \item 
nico@207: typedef void($\ast$) \hyperlink{states_8h_8aed99e590473f26db47a9c2dc5b73fc}{operational\_\-t} (void)
nico@207: \item 
nico@207: typedef void($\ast$) \hyperlink{states_8h_c99397ce6341b6b5128104aee4c27ec5}{stopped\_\-t} (void)
nico@207: \end{CompactItemize}
nico@207: \subsection*{Enumerations}
nico@207: \begin{CompactItemize}
nico@207: \item 
nico@207: enum \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec68646}{enum\_\-node\-State} \{ \par
nico@207: \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec68646eb3ae26d7a1629aa0fc6c83f46306cf5}{Initialisation} =  0x00, 
nico@207: \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec6864684ab0fbbb76a8c897feb1cd806d56443}{Disconnected} =  0x01, 
nico@207: \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec686466ea90df6fe966852496b4846da497fb0}{Connecting} =  0x02, 
nico@207: \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec6864695fc3c631fbad8ca3dc8d5b69a3e0d5b}{Preparing} =  0x02, 
nico@207: \par
nico@207: \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec686464d049c6d45e08a294523df186ad77a75}{Stopped} =  0x04, 
nico@207: \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec68646a80594b1522cb686b981f56bbec45124}{Operational} =  0x05, 
nico@207: \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec68646c747c16a9c4d7dec65cdab6e38df99b7}{Pre\_\-operational} =  0x7F, 
nico@207: \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec68646cb4b5cb64be091d76f846380eb0afe59}{Unknown\_\-state} =  0x0F
nico@207:  \}
nico@207: \end{CompactItemize}
nico@207: \subsection*{Functions}
nico@207: \begin{CompactItemize}
nico@207: \item 
nico@207: void \hyperlink{states_8h_67ca1ac7ff49e88cf7847e408b258cae}{\_\-initialisation} (void)
nico@207: \item 
nico@207: void \hyperlink{states_8h_f4e52eb187303eca1962bb6f74cb8169}{\_\-pre\-Operational} (void)
nico@207: \item 
nico@207: void \hyperlink{states_8h_b31a0526e24de79a09ccc512db420d91}{\_\-operational} (void)
nico@207: \item 
nico@207: void \hyperlink{states_8h_9117ccff20aaed468dd715517e77dbc3}{\_\-stopped} (void)
nico@207: \item 
nico@207: void \hyperlink{states_8h_3f8975650604cc23582f19a43fd4e518}{can\-Dispatch} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, \hyperlink{structMessage}{Message} $\ast$m)
nico@207: \item 
nico@207: \hyperlink{states_8h_5891f63a4c9243179838389a93d084e2}{e\_\-node\-State} \hyperlink{states_8h_95d835785ba564bf6d92e3224c5e3848}{get\-State} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d)
nico@207: \item 
nico@207: UNS8 \hyperlink{states_8h_0a5004efd1dedbee82a4f21ec5c44fb5}{set\-State} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, \hyperlink{states_8h_5891f63a4c9243179838389a93d084e2}{e\_\-node\-State} new\-State)
nico@207: \item 
nico@207: UNS8 \hyperlink{states_8h_3020f2e5762f6e389a21382ec827b6a6}{get\-Node\-Id} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d)
nico@207: \item 
nico@207: void \hyperlink{states_8h_d47a53979b9311a374d029f7923abbe1}{set\-Node\-Id} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d, UNS8 node\-Id)
nico@207: \item 
nico@207: void \hyperlink{states_8h_3e57769f3a958c103825263b7abdd92b}{init\-Pre\-Operational\-Mode} (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$d)
nico@207: \end{CompactItemize}
nico@207: 
nico@207: 
nico@207: \subsection{Typedef Documentation}
nico@207: \hypertarget{states_8h_5891f63a4c9243179838389a93d084e2}{
nico@207: \index{states.h@{states.h}!e_nodeState@{e\_\-nodeState}}
nico@207: \index{e_nodeState@{e\_\-nodeState}!states.h@{states.h}}
nico@207: \subsubsection[e\_\-nodeState]{\setlength{\rightskip}{0pt plus 5cm}typedef enum \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec68646}{enum\_\-node\-State} \hyperlink{states_8h_5891f63a4c9243179838389a93d084e2}{e\_\-node\-State}}}
nico@207: \label{states_8h_5891f63a4c9243179838389a93d084e2}
nico@207: 
nico@207: 
nico@207: 
nico@207: 
nico@207: Definition at line 46 of file states.h.\hypertarget{states_8h_d0cd6d1eb89085da7cb9f32ce386e8bc}{
nico@207: \index{states.h@{states.h}!initialisation_t@{initialisation\_\-t}}
nico@207: \index{initialisation_t@{initialisation\_\-t}!states.h@{states.h}}
nico@207: \subsubsection[initialisation\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$) \hyperlink{states_8h_d0cd6d1eb89085da7cb9f32ce386e8bc}{initialisation\_\-t}(void)}}
nico@207: \label{states_8h_d0cd6d1eb89085da7cb9f32ce386e8bc}
nico@207: 
nico@207: 
nico@207: Function that user app can overload 
nico@207: 
nico@207: Definition at line 61 of file states.h.\hypertarget{states_8h_8aed99e590473f26db47a9c2dc5b73fc}{
nico@207: \index{states.h@{states.h}!operational_t@{operational\_\-t}}
nico@207: \index{operational_t@{operational\_\-t}!states.h@{states.h}}
nico@207: \subsubsection[operational\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$) \hyperlink{states_8h_8aed99e590473f26db47a9c2dc5b73fc}{operational\_\-t}(void)}}
nico@207: \label{states_8h_8aed99e590473f26db47a9c2dc5b73fc}
nico@207: 
nico@207: 
nico@207: 
nico@207: 
nico@207: Definition at line 63 of file states.h.\hypertarget{states_8h_f4a6da4fe018afbe20eaf716c248e02a}{
nico@207: \index{states.h@{states.h}!preOperational_t@{preOperational\_\-t}}
nico@207: \index{preOperational_t@{preOperational\_\-t}!states.h@{states.h}}
nico@207: \subsubsection[preOperational\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$) \hyperlink{states_8h_f4a6da4fe018afbe20eaf716c248e02a}{pre\-Operational\_\-t}(void)}}
nico@207: \label{states_8h_f4a6da4fe018afbe20eaf716c248e02a}
nico@207: 
nico@207: 
nico@207: 
nico@207: 
nico@207: Definition at line 62 of file states.h.\hypertarget{states_8h_c99397ce6341b6b5128104aee4c27ec5}{
nico@207: \index{states.h@{states.h}!stopped_t@{stopped\_\-t}}
nico@207: \index{stopped_t@{stopped\_\-t}!states.h@{states.h}}
nico@207: \subsubsection[stopped\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$) \hyperlink{states_8h_c99397ce6341b6b5128104aee4c27ec5}{stopped\_\-t}(void)}}
nico@207: \label{states_8h_c99397ce6341b6b5128104aee4c27ec5}
nico@207: 
nico@207: 
nico@207: 
nico@207: 
nico@207: Definition at line 64 of file states.h.
nico@207: 
nico@207: \subsection{Enumeration Type Documentation}
nico@207: \hypertarget{states_8h_3136d2815abe9d284f985e0a7ec68646}{
nico@207: \index{states.h@{states.h}!enum_nodeState@{enum\_\-nodeState}}
nico@207: \index{enum_nodeState@{enum\_\-nodeState}!states.h@{states.h}}
nico@207: \subsubsection[enum\_\-nodeState]{\setlength{\rightskip}{0pt plus 5cm}enum \hyperlink{states_8h_3136d2815abe9d284f985e0a7ec68646}{enum\_\-node\-State}}}
nico@207: \label{states_8h_3136d2815abe9d284f985e0a7ec68646}
nico@207: 
nico@207: 
nico@207: \begin{Desc}
nico@207: \item[Enumerator: ]\par
nico@207: \begin{description}
nico@207: \index{Initialisation@{Initialisation}!states.h@{states.h}}\index{states.h@{states.h}!Initialisation@{Initialisation}}\item[{\em 
nico@207: \hypertarget{states_8h_3136d2815abe9d284f985e0a7ec68646eb3ae26d7a1629aa0fc6c83f46306cf5}{
nico@207: Initialisation}
nico@207: \label{states_8h_3136d2815abe9d284f985e0a7ec68646eb3ae26d7a1629aa0fc6c83f46306cf5}
nico@207: }]\index{Disconnected@{Disconnected}!states.h@{states.h}}\index{states.h@{states.h}!Disconnected@{Disconnected}}\item[{\em 
nico@207: \hypertarget{states_8h_3136d2815abe9d284f985e0a7ec6864684ab0fbbb76a8c897feb1cd806d56443}{
nico@207: Disconnected}
nico@207: \label{states_8h_3136d2815abe9d284f985e0a7ec6864684ab0fbbb76a8c897feb1cd806d56443}
nico@207: }]\index{Connecting@{Connecting}!states.h@{states.h}}\index{states.h@{states.h}!Connecting@{Connecting}}\item[{\em 
nico@207: \hypertarget{states_8h_3136d2815abe9d284f985e0a7ec686466ea90df6fe966852496b4846da497fb0}{
nico@207: Connecting}
nico@207: \label{states_8h_3136d2815abe9d284f985e0a7ec686466ea90df6fe966852496b4846da497fb0}
nico@207: }]\index{Preparing@{Preparing}!states.h@{states.h}}\index{states.h@{states.h}!Preparing@{Preparing}}\item[{\em 
nico@207: \hypertarget{states_8h_3136d2815abe9d284f985e0a7ec6864695fc3c631fbad8ca3dc8d5b69a3e0d5b}{
nico@207: Preparing}
nico@207: \label{states_8h_3136d2815abe9d284f985e0a7ec6864695fc3c631fbad8ca3dc8d5b69a3e0d5b}
nico@207: }]\index{Stopped@{Stopped}!states.h@{states.h}}\index{states.h@{states.h}!Stopped@{Stopped}}\item[{\em 
nico@207: \hypertarget{states_8h_3136d2815abe9d284f985e0a7ec686464d049c6d45e08a294523df186ad77a75}{
nico@207: Stopped}
nico@207: \label{states_8h_3136d2815abe9d284f985e0a7ec686464d049c6d45e08a294523df186ad77a75}
nico@207: }]\index{Operational@{Operational}!states.h@{states.h}}\index{states.h@{states.h}!Operational@{Operational}}\item[{\em 
nico@207: \hypertarget{states_8h_3136d2815abe9d284f985e0a7ec68646a80594b1522cb686b981f56bbec45124}{
nico@207: Operational}
nico@207: \label{states_8h_3136d2815abe9d284f985e0a7ec68646a80594b1522cb686b981f56bbec45124}
nico@207: }]\index{Pre_operational@{Pre\_\-operational}!states.h@{states.h}}\index{states.h@{states.h}!Pre_operational@{Pre\_\-operational}}\item[{\em 
nico@207: \hypertarget{states_8h_3136d2815abe9d284f985e0a7ec68646c747c16a9c4d7dec65cdab6e38df99b7}{
nico@207: Pre\_\-operational}
nico@207: \label{states_8h_3136d2815abe9d284f985e0a7ec68646c747c16a9c4d7dec65cdab6e38df99b7}
nico@207: }]\index{Unknown_state@{Unknown\_\-state}!states.h@{states.h}}\index{states.h@{states.h}!Unknown_state@{Unknown\_\-state}}\item[{\em 
nico@207: \hypertarget{states_8h_3136d2815abe9d284f985e0a7ec68646cb4b5cb64be091d76f846380eb0afe59}{
nico@207: Unknown\_\-state}
nico@207: \label{states_8h_3136d2815abe9d284f985e0a7ec68646cb4b5cb64be091d76f846380eb0afe59}
nico@207: }]\end{description}
nico@207: \end{Desc}
nico@207: 
nico@207: 
nico@207: 
nico@207: Definition at line 35 of file states.h.
nico@207: 
nico@207: \subsection{Function Documentation}
nico@207: \hypertarget{states_8h_67ca1ac7ff49e88cf7847e408b258cae}{
nico@207: \index{states.h@{states.h}!_initialisation@{\_\-initialisation}}
nico@207: \index{_initialisation@{\_\-initialisation}!states.h@{states.h}}
nico@207: \subsubsection[\_\-initialisation]{\setlength{\rightskip}{0pt plus 5cm}void \_\-initialisation (void)}}
nico@207: \label{states_8h_67ca1ac7ff49e88cf7847e408b258cae}
nico@207: 
nico@207: 
nico@207: 
nico@207: 
nico@207: Definition at line 234 of file states.c.\hypertarget{states_8h_b31a0526e24de79a09ccc512db420d91}{
nico@207: \index{states.h@{states.h}!_operational@{\_\-operational}}
nico@207: \index{_operational@{\_\-operational}!states.h@{states.h}}
nico@207: \subsubsection[\_\-operational]{\setlength{\rightskip}{0pt plus 5cm}void \_\-operational (void)}}
nico@207: \label{states_8h_b31a0526e24de79a09ccc512db420d91}
nico@207: 
nico@207: 
nico@207: 
nico@207: 
nico@207: Definition at line 236 of file states.c.\hypertarget{states_8h_f4e52eb187303eca1962bb6f74cb8169}{
nico@207: \index{states.h@{states.h}!_preOperational@{\_\-preOperational}}
nico@207: \index{_preOperational@{\_\-preOperational}!states.h@{states.h}}
nico@207: \subsubsection[\_\-preOperational]{\setlength{\rightskip}{0pt plus 5cm}void \_\-pre\-Operational (void)}}
nico@207: \label{states_8h_f4e52eb187303eca1962bb6f74cb8169}
nico@207: 
nico@207: 
nico@207: 
nico@207: 
nico@207: Definition at line 235 of file states.c.\hypertarget{states_8h_9117ccff20aaed468dd715517e77dbc3}{
nico@207: \index{states.h@{states.h}!_stopped@{\_\-stopped}}
nico@207: \index{_stopped@{\_\-stopped}!states.h@{states.h}}
nico@207: \subsubsection[\_\-stopped]{\setlength{\rightskip}{0pt plus 5cm}void \_\-stopped (void)}}
nico@207: \label{states_8h_9117ccff20aaed468dd715517e77dbc3}
nico@207: 
nico@207: 
nico@207: 
nico@207: 
nico@207: Definition at line 237 of file states.c.\hypertarget{states_8h_3f8975650604cc23582f19a43fd4e518}{
nico@207: \index{states.h@{states.h}!canDispatch@{canDispatch}}
nico@207: \index{canDispatch@{canDispatch}!states.h@{states.h}}
nico@207: \subsubsection[canDispatch]{\setlength{\rightskip}{0pt plus 5cm}void can\-Dispatch (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, \hyperlink{structMessage}{Message} $\ast$ {\em m})}}
nico@207: \label{states_8h_3f8975650604cc23582f19a43fd4e518}
nico@207: 
nico@207: 
nico@207: Called by driver/app when receiving messages 
nico@207: 
nico@207: Definition at line 39 of file states.c.
nico@207: 
nico@207: References Message::cob\_\-id, s\_\-state\_\-communication::cs\-Heartbeat, s\_\-state\_\-communication::cs\-PDO, s\_\-state\_\-communication::cs\-SDO, s\_\-state\_\-communication::cs\-SYNC, struct\_\-CO\_\-Data::Current\-Communication\-State, struct\_\-s\_\-timer\_\-entry::d, struct\_\-CO\_\-Data::iam\_\-a\_\-slave, NMT, NODE\_\-GUARD, PDO1rx, PDO1tx, PDO2rx, PDO2tx, PDO3rx, PDO3tx, PDO4rx, PDO4tx, proceed\-NMTstate\-Change(), proceed\-NODE\_\-GUARD(), proceed\-PDO(), proceed\-SDO(), proceed\-SYNC(), SDOrx, SDOtx, SYNC, and SHORT\_\-CAN::w.\hypertarget{states_8h_3020f2e5762f6e389a21382ec827b6a6}{
nico@207: \index{states.h@{states.h}!getNodeId@{getNodeId}}
nico@207: \index{getNodeId@{getNodeId}!states.h@{states.h}}
nico@207: \subsubsection[getNodeId]{\setlength{\rightskip}{0pt plus 5cm}UNS8 get\-Node\-Id (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d})}}
nico@207: \label{states_8h_3020f2e5762f6e389a21382ec827b6a6}
nico@207: 
nico@207: 
nico@207: Returns the nod\-Id 
nico@207: 
nico@207: Definition at line 180 of file states.c.
nico@207: 
nico@207: References struct\_\-CO\_\-Data::b\-Device\-Node\-Id, and struct\_\-s\_\-timer\_\-entry::d.\hypertarget{states_8h_95d835785ba564bf6d92e3224c5e3848}{
nico@207: \index{states.h@{states.h}!getState@{getState}}
nico@207: \index{getState@{getState}!states.h@{states.h}}
nico@207: \subsubsection[getState]{\setlength{\rightskip}{0pt plus 5cm}\hyperlink{states_8h_5891f63a4c9243179838389a93d084e2}{e\_\-node\-State} get\-State (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d})}}
nico@207: \label{states_8h_95d835785ba564bf6d92e3224c5e3848}
nico@207: 
nico@207: 
nico@207: Returns the state of the node 
nico@207: 
nico@207: Definition at line 33 of file states.c.
nico@207: 
nico@207: References struct\_\-s\_\-timer\_\-entry::d, and struct\_\-CO\_\-Data::node\-State.\hypertarget{states_8h_3e57769f3a958c103825263b7abdd92b}{
nico@207: \index{states.h@{states.h}!initPreOperationalMode@{initPreOperationalMode}}
nico@207: \index{initPreOperationalMode@{initPreOperationalMode}!states.h@{states.h}}
nico@207: \subsubsection[initPreOperationalMode]{\setlength{\rightskip}{0pt plus 5cm}void init\-Pre\-Operational\-Mode (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d})}}
nico@207: \label{states_8h_3e57769f3a958c103825263b7abdd92b}
nico@207: 
nico@207: 
nico@207: Some stuff to do when the node enter in pre-operational mode \hypertarget{states_8h_d47a53979b9311a374d029f7923abbe1}{
nico@207: \index{states.h@{states.h}!setNodeId@{setNodeId}}
nico@207: \index{setNodeId@{setNodeId}!states.h@{states.h}}
nico@207: \subsubsection[setNodeId]{\setlength{\rightskip}{0pt plus 5cm}void set\-Node\-Id (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, UNS8 {\em node\-Id})}}
nico@207: \label{states_8h_d47a53979b9311a374d029f7923abbe1}
nico@207: 
nico@207: 
nico@207: Define the node ID. Initialize the object dictionary 
nico@207: 
nico@207: Definition at line 186 of file states.c.
nico@207: 
nico@207: References struct\_\-CO\_\-Data::b\-Device\-Node\-Id, struct\_\-s\_\-timer\_\-entry::d, struct\_\-CO\_\-Data::first\-Index, struct\_\-CO\_\-Data::last\-Index, struct\_\-CO\_\-Data::objdict, s\_\-quick\_\-index::PDO\_\-RCV, s\_\-quick\_\-index::PDO\_\-TRS, td\_\-subindex::p\-Object, td\_\-indextable::p\-Subindex, s\_\-quick\_\-index::SDO\_\-SVR, UNS16, UNS32, and UNS8.\hypertarget{states_8h_0a5004efd1dedbee82a4f21ec5c44fb5}{
nico@207: \index{states.h@{states.h}!setState@{setState}}
nico@207: \index{setState@{setState}!states.h@{states.h}}
nico@207: \subsubsection[setState]{\setlength{\rightskip}{0pt plus 5cm}UNS8 set\-State (\hyperlink{structstruct__CO__Data}{CO\_\-Data} $\ast$ {\em d}, \hyperlink{states_8h_5891f63a4c9243179838389a93d084e2}{e\_\-node\-State} {\em new\-State})}}
nico@207: \label{states_8h_0a5004efd1dedbee82a4f21ec5c44fb5}
nico@207: 
nico@207: 
nico@207: Change the state of the node 
nico@207: 
nico@207: Definition at line 100 of file states.c.
nico@207: 
nico@207: References struct\_\-s\_\-timer\_\-entry::d, decompo\_\-dcf(), struct\_\-CO\_\-Data::iam\_\-a\_\-slave, struct\_\-CO\_\-Data::initialisation, Initialisation, struct\_\-CO\_\-Data::node\-State, OD\_\-SUCCESSFUL, struct\_\-CO\_\-Data::operational, Operational, Pre\_\-operational, struct\_\-CO\_\-Data::pre\-Operational, ptr\-Table, struct\_\-CO\_\-Data::scan\-Index\-OD, struct\_\-CO\_\-Data::stopped, Stopped, switch\-Communication\-State(), UNS16, and UNS32.



