35 - a SDO received before writing in the dictionary |
35 - a SDO received before writing in the dictionary |
36 - the reading of the dictionary to put on a SDO to transmit |
36 - the reading of the dictionary to put on a SDO to transmit |
37 */ |
37 */ |
38 |
38 |
39 struct struct_s_transfer { |
39 struct struct_s_transfer { |
40 UNS8 nodeId; //own ID if server, or node ID of the server if client |
40 UNS8 nodeId; /*own ID if server, or node ID of the server if client */ |
41 |
41 |
42 UNS8 whoami; // Takes the values SDO_CLIENT or SDO_SERVER |
42 UNS8 whoami; /* Takes the values SDO_CLIENT or SDO_SERVER */ |
43 UNS8 state; // state of the transmission : Takes the values SDO_... |
43 UNS8 state; /* state of the transmission : Takes the values SDO_... */ |
44 UNS8 toggle; |
44 UNS8 toggle; |
45 UNS32 abortCode; // Sent or received |
45 UNS32 abortCode; /* Sent or received */ |
46 // index and subindex of the dictionary where to store |
46 /* index and subindex of the dictionary where to store */ |
47 // (for a received SDO) or to read (for a transmit SDO) |
47 /* (for a received SDO) or to read (for a transmit SDO) */ |
48 UNS16 index; |
48 UNS16 index; |
49 UNS8 subIndex; |
49 UNS8 subIndex; |
50 UNS32 count; // Number of data received or to be sent. |
50 UNS32 count; /* Number of data received or to be sent. */ |
51 UNS32 offset; // stack pointer of data[] |
51 UNS32 offset; /* stack pointer of data[] |
52 // Used only to tranfer part of a line to or from a SDO. |
52 * Used only to tranfer part of a line to or from a SDO. |
53 // offset is always pointing on the next free cell of data[]. |
53 * offset is always pointing on the next free cell of data[]. |
54 // WARNING s_transfer.data is subject to ENDIANISATION |
54 * WARNING s_transfer.data is subject to ENDIANISATION |
55 // (with respect to CANOPEN_BIG_ENDIAN) |
55 * (with respect to CANOPEN_BIG_ENDIAN) |
|
56 */ |
56 UNS8 data [SDO_MAX_LENGTH_TRANSFERT]; |
57 UNS8 data [SDO_MAX_LENGTH_TRANSFERT]; |
57 UNS8 dataType; // Defined in objdictdef.h Value is visible_string |
58 UNS8 dataType; /* Defined in objdictdef.h Value is visible_string |
58 // if it is a string, any other value if it is not a string, |
59 * if it is a string, any other value if it is not a string, |
59 // like 0. In fact, it is used only if client. |
60 * like 0. In fact, it is used only if client. |
60 TIMER_HANDLE timer; // Time counter to implement a timeout in milliseconds. |
61 */ |
61 // It is automatically incremented whenever |
62 TIMER_HANDLE timer; /* Time counter to implement a timeout in milliseconds. |
62 // the line state is in SDO_DOWNLOAD_IN_PROGRESS or |
63 /* It is automatically incremented whenever |
63 // SDO_UPLOAD_IN_PROGRESS, and reseted to 0 |
64 /* the line state is in SDO_DOWNLOAD_IN_PROGRESS or |
64 // when the response SDO have been received. |
65 /* SDO_UPLOAD_IN_PROGRESS, and reseted to 0 |
65 SDOCallback_t Callback; // The user callback func to be called at SDO transaction end |
66 /* when the response SDO have been received. |
|
67 */ |
|
68 SDOCallback_t Callback; /* The user callback func to be called at SDO transaction end */ |
66 }; |
69 }; |
67 typedef struct struct_s_transfer s_transfer; |
70 typedef struct struct_s_transfer s_transfer; |
68 |
71 |
69 |
72 |
70 #include "data.h" |
73 #include "data.h" |
71 |
74 |
72 /// The 8 bytes data of the SDO |
75 /* The 8 bytes data of the SDO */ |
73 struct BODY{ |
76 struct BODY{ |
74 UNS8 data[8]; |
77 UNS8 data[8]; |
75 }; |
78 }; |
76 |
79 |
77 /// The SDO structure ... |
80 /* The SDO structure ...*/ |
78 struct struct_s_SDO { |
81 struct struct_s_SDO { |
79 UNS8 nodeId; //in any case, Node ID of the server (case sender or receiver). |
82 UNS8 nodeId; /*in any case, Node ID of the server (case sender or receiver).*/ |
80 struct BODY body; |
83 struct BODY body; |
81 }; |
84 }; |
82 |
85 |
83 |
86 |
84 typedef struct struct_s_SDO s_SDO; |
87 typedef struct struct_s_SDO s_SDO; |