21#ifndef _OPENSAFETY_HEADER_
22#define _OPENSAFETY_HEADER_
31#ifndef OPENSAFETY_UDP_PORT
32#define OPENSAFETY_UDP_PORT 9877
36#ifndef OPENSAFETY_UDP_PORT_SIII
37#define OPENSAFETY_UDP_PORT_SIII 8755
40#define OPENSAFETY_DEFAULT_DOMAIN 0x1
43#define OPENSAFETY_CHECKSUM_CRC8 0x01
44#define OPENSAFETY_CHECKSUM_CRC16 0x02
45#define OPENSAFETY_CHECKSUM_CRC32 0x04
46#define OPENSAFETY_CHECKSUM_CRC16SLIM 0x08
47#define OPENSAFETY_CHECKSUM_INVALID 0xFF
50 { OPENSAFETY_CHECKSUM_CRC8,
"CRC8" },
51 { OPENSAFETY_CHECKSUM_CRC16,
"CRC16" },
52 { OPENSAFETY_CHECKSUM_CRC32,
"CRC32" },
53 { OPENSAFETY_CHECKSUM_CRC16SLIM,
"CRC16 Slim" },
58#define OPENSAFETY_SNMT_MESSAGE_TYPE 0xA0
59#define OPENSAFETY_SPDO_MESSAGE_TYPE 0xC0
60#define OPENSAFETY_SSDO_MESSAGE_TYPE 0xE0
61#define OPENSAFETY_SLIM_SSDO_MESSAGE_TYPE 0xE8
66 { OPENSAFETY_SNMT_MESSAGE_TYPE >> 5,
"openSAFETY SNMT" },
67 { OPENSAFETY_SPDO_MESSAGE_TYPE >> 5,
"openSAFETY SPDO" },
68 { OPENSAFETY_SSDO_MESSAGE_TYPE >> 5,
"openSAFETY SSDO" },
73#define OPENSAFETY_MSG_SPDO_DATA_ONLY 0xC0
74#define OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_REQUEST 0xC8
75#define OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_RESPONSE 0xD0
76#define OPENSAFETY_MSG_SPDO_RESERVED 0xD8
78#define OPENSAFETY_MSG_SSDO_SERVICE_REQUEST 0xE0
79#define OPENSAFETY_MSG_SSDO_SERVICE_RESPONSE 0xE4
80#define OPENSAFETY_MSG_SSDO_SLIM_SERVICE_REQUEST 0xE8
81#define OPENSAFETY_MSG_SSDO_SLIM_SERVICE_RESPONSE 0xEC
83#define OPENSAFETY_MSG_SNMT_REQUEST_UDID 0xA0
84#define OPENSAFETY_MSG_SNMT_RESPONSE_UDID 0xA4
85#define OPENSAFETY_MSG_SNMT_ASSIGN_SADR 0xA8
86#define OPENSAFETY_MSG_SNMT_SADR_ASSIGNED 0xAC
87#define OPENSAFETY_MSG_SNMT_SERVICE_REQUEST 0xB0
88#define OPENSAFETY_MSG_SNMT_SERVICE_RESPONSE 0xB4
89#define OPENSAFETY_MSG_SNMT_SN_RESET_GUARDING_SCM 0xBC
91static const value_string opensafety_message_type_values[] = {
92 { OPENSAFETY_MSG_SPDO_DATA_ONLY,
"SPDO Data only" },
93 { OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_REQUEST,
"SPDO Data with Time Request" },
94 { OPENSAFETY_MSG_SPDO_DATA_WITH_TIME_RESPONSE,
"SPDO Data with Time Response" },
95 { OPENSAFETY_MSG_SPDO_RESERVED,
"SPDO Reserved" },
97 { OPENSAFETY_MSG_SSDO_SERVICE_REQUEST,
"SSDO Service Request" },
98 { OPENSAFETY_MSG_SSDO_SERVICE_RESPONSE,
"SSDO Service Response" },
99 { OPENSAFETY_MSG_SSDO_SLIM_SERVICE_REQUEST,
"SSDO Slim Service Request" },
100 { OPENSAFETY_MSG_SSDO_SLIM_SERVICE_RESPONSE,
"SSDO Slim Service Response" },
102 { OPENSAFETY_MSG_SNMT_REQUEST_UDID,
"SNMT Request UDID" },
103 { OPENSAFETY_MSG_SNMT_RESPONSE_UDID,
"SNMT Response UDID" },
104 { OPENSAFETY_MSG_SNMT_ASSIGN_SADR,
"SNMT Assign SADR" },
105 { OPENSAFETY_MSG_SNMT_SADR_ASSIGNED,
"SNMT SADR Assigned" },
106 { OPENSAFETY_MSG_SNMT_SERVICE_REQUEST,
"SNMT Service Request" },
107 { OPENSAFETY_MSG_SNMT_SERVICE_RESPONSE,
"SNMT Service Response" },
108 { OPENSAFETY_MSG_SNMT_SN_RESET_GUARDING_SCM,
"SNMT SN reset guarding SCM" },
113#define OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_PRE_OP 0x00
114#define OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_OP 0x02
115#define OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_STOP 0x04
116#define OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_OP 0x06
117#define OPENSAFETY_MSG_SNMT_EXT_SCM_GUARD_SN 0x08
118#define OPENSAFETY_MSG_SNMT_EXT_ASSIGN_ADDITIONAL_SADR 0x0A
119#define OPENSAFETY_MSG_SNMT_EXT_SN_ACKNOWLEDGE 0x0C
120#define OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGN_UDID_SCM 0x0E
121#define OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_PRE_OP 0x01
122#define OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_OP 0x03
123#define OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_ADDITIONAL_SADR 0x05
124#define OPENSAFETY_MSG_SNMT_EXT_SN_FAIL 0x07
125#define OPENSAFETY_MSG_SNMT_EXT_SN_BUSY 0x09
126#define OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_UDID_SCM 0x0F
127#define OPENSAFETY_MSG_SNMT_EXT_ASSIGN_INIT_CT 0x10
128#define OPENSAFETY_MSG_SNMT_EXT_ASSIGNED_INIT_CT 0x11
130static const value_string opensafety_message_service_type[] = {
131 { OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_PRE_OP,
"SN set to pre Operational" },
132 { OPENSAFETY_MSG_SNMT_EXT_SN_SET_TO_OP,
"SN set to Operational" },
133 { OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_STOP,
"SCM set to Stop" },
134 { OPENSAFETY_MSG_SNMT_EXT_SCM_SET_TO_OP,
"SCM set to Operational" },
135 { OPENSAFETY_MSG_SNMT_EXT_SCM_GUARD_SN,
"SCM guard SN" },
136 { OPENSAFETY_MSG_SNMT_EXT_ASSIGN_ADDITIONAL_SADR,
"Assign additional SADR" },
137 { OPENSAFETY_MSG_SNMT_EXT_SN_ACKNOWLEDGE,
"SN Acknowledge" },
138 { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGN_UDID_SCM,
"SN assign UDID SCM" },
139 { OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_PRE_OP,
"SN status pre Operational" },
140 { OPENSAFETY_MSG_SNMT_EXT_SN_STATUS_OP,
"SN status Operational" },
141 { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_ADDITIONAL_SADR,
"Assigned additional SADR" },
142 { OPENSAFETY_MSG_SNMT_EXT_SN_FAIL,
"SN Fail" },
143 { OPENSAFETY_MSG_SNMT_EXT_SN_BUSY,
"SN Busy" },
144 { OPENSAFETY_MSG_SNMT_EXT_SN_ASSIGNED_UDID_SCM,
"SN assigned UDID SCM" },
145 { OPENSAFETY_MSG_SNMT_EXT_ASSIGN_INIT_CT,
"Assign initial CT for SN" },
146 { OPENSAFETY_MSG_SNMT_EXT_ASSIGNED_INIT_CT,
"Acknowledge initial CT for SN" },
153#define OPENSAFETY_ERROR_GROUP_APPLICATION 0x01
154#define OPENSAFETY_ERROR_GROUP_PARAMETER 0x02
155#define OPENSAFETY_ERROR_GROUP_VENDOR_SPECIFIC 0x03
156#define OPENSAFETY_ERROR_GROUP_OPENSAFETY_STACK 0x04
157#define OPENSAFETY_ERROR_GROUP_ADD_PARAMETER 0x05
159static const value_string opensafety_sn_fail_error_group[] = {
160 { OPENSAFETY_ERROR_GROUP_APPLICATION,
"Application" },
161 { OPENSAFETY_ERROR_GROUP_PARAMETER,
"Parameter" },
162 { OPENSAFETY_ERROR_GROUP_VENDOR_SPECIFIC,
"Vendor specific" },
163 { OPENSAFETY_ERROR_GROUP_OPENSAFETY_STACK,
"openSAFETY Stack" },
164 { OPENSAFETY_ERROR_GROUP_ADD_PARAMETER,
"Additional parameter needed" },
170#define OPENSAFETY_SSDO_SACMD_ACC 0x01
171#define OPENSAFETY_SSDO_SACMD_PRLD 0x02
172#define OPENSAFETY_SSDO_SACMD_ABRT 0x04
173#define OPENSAFETY_SSDO_SACMD_SEG 0x08
174#define OPENSAFETY_SSDO_SACMD_TGL 0x10
175#define OPENSAFETY_SSDO_SACMD_INI 0x20
176#define OPENSAFETY_SSDO_SACMD_ENSG 0x40
177#define OPENSAFETY_SSDO_SACMD_RES 0x80
179#define OPENSAFETY_SSDO_UPLOAD 0x00
180#define OPENSAFETY_SSDO_DOWNLOAD 0x01
182#define OPENSAFETY_MSG_SSDO_ABORT ( OPENSAFETY_SSDO_SACMD_ABRT )
183#define OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MIDDLE ( OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_UPLOAD )
184#define OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MIDDLE ( OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_DOWNLOAD )
185#define OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MID_PRELOAD ( OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MIDDLE | OPENSAFETY_SSDO_SACMD_PRLD )
186#define OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MID_PRELOAD ( OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MIDDLE | OPENSAFETY_SSDO_SACMD_PRLD )
187#define OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXPEDITED ( OPENSAFETY_SSDO_SACMD_INI | OPENSAFETY_SSDO_UPLOAD )
188#define OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXPEDITED ( OPENSAFETY_SSDO_SACMD_INI | OPENSAFETY_SSDO_DOWNLOAD )
189#define OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXP_PRELOAD ( OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXPEDITED | OPENSAFETY_SSDO_SACMD_PRLD )
190#define OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXP_PRELOAD ( OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXPEDITED | OPENSAFETY_SSDO_SACMD_PRLD )
191#define OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEGMENTED ( OPENSAFETY_SSDO_SACMD_INI | OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_UPLOAD )
192#define OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED ( OPENSAFETY_SSDO_SACMD_INI | OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_DOWNLOAD )
193#define OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEG_PRELOAD ( OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEGMENTED | OPENSAFETY_SSDO_SACMD_PRLD )
194#define OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEG_PRELOAD ( OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED | OPENSAFETY_SSDO_SACMD_PRLD )
195#define OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_END ( OPENSAFETY_SSDO_SACMD_ENSG | OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_UPLOAD )
196#define OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_END ( OPENSAFETY_SSDO_SACMD_ENSG | OPENSAFETY_SSDO_SACMD_SEG | OPENSAFETY_SSDO_DOWNLOAD )
198static const value_string opensafety_ssdo_sacmd_values[] = {
199 { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_END,
"Download End Segment" },
200 { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_END,
"Upload End Segment" },
201 { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXPEDITED,
"Download Expedited Initiate" },
202 { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEGMENTED,
"Upload Initiate Segmented" },
203 { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEGMENTED,
"Download Initiate Segmented" },
204 { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXPEDITED,
"Upload Expedited Initiate" },
205 { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_EXP_PRELOAD,
"Upload Expedited Initiate w.Preload" },
206 { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_EXP_PRELOAD,
"Download Initiate Segmented w.Preload" },
207 { OPENSAFETY_MSG_SSDO_UPLOAD_INITIATE_SEG_PRELOAD,
"Upload Initiate Segmented w. Preload" },
208 { OPENSAFETY_MSG_SSDO_DOWNLOAD_INITIATE_SEG_PRELOAD,
"Download Expedited Initiate w.Preload" },
209 { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MIDDLE,
"Download Middle Segment" },
210 { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MIDDLE,
"Upload Middle Segment" },
211 { OPENSAFETY_MSG_SSDO_DOWNLOAD_SEGMENT_MID_PRELOAD,
"Download Middle Segment w. Preload" },
212 { OPENSAFETY_MSG_SSDO_UPLOAD_SEGMENT_MID_PRELOAD,
"Upload Middle Segment w. Preload" },
213 { OPENSAFETY_MSG_SSDO_ABORT,
"Abort" },
218static const true_false_string opensafety_sacmd_abrt = {
"Abort Transfer",
"Successful Transfer" };
219static const true_false_string opensafety_sacmd_seg = {
"Segmented Access",
"Expedited Access" };
220static const true_false_string opensafety_sacmd_ini = {
"Initiate",
"No Initiate" };
221static const true_false_string opensafety_sacmd_ensg = {
"No more segments",
"More segments" };
225 { 0x100C0000,
"Life Guarding" },
226 { 0x100C0001,
"Guard Time" },
227 { 0x100C0002,
"LifeTimeFactor" },
229 { 0x100D0000,
"Number of Retries for Reset Guarding" },
231 { 0x10180000,
"Device Vendor Information" },
232 { 0x10180001,
"VendorID" },
233 { 0x10180002,
"ProductCode" },
234 { 0x10180003,
"RevisionNumber" },
235 { 0x10180004,
"SerialNumber" },
236 { 0x10180005,
"FirmWareChecksum" },
237 { 0x10180006,
"Parameter Checksum" },
238 { 0x10180007,
"Parameter Timestamp" },
240 { 0x10190000,
"Unique Device ID" },
241 { 0x101A0000,
"Parameter Download" },
242 { 0x101B0000,
"SCM Parameters" },
244 { 0x12000000,
"Common Communication Parameters" },
245 { 0x12000001,
"Safety Domain Number" },
246 { 0x12000002,
"SADR" },
247 { 0x12000003,
"Consecutive Timebase" },
248 { 0x12000004,
"UDID of SCM" },
250 { 0x14000000,
"RxSPDO Communication Parameters" },
251 { 0x14000001,
"SADR" },
252 { 0x14000002,
"SCT" },
253 { 0x14000003,
"Number of consecutive TReq" },
254 { 0x14000004,
"Time delay TReq" },
255 { 0x14000005,
"Time delay Sync" },
256 { 0x14000006,
"Min TSync Propagation Delay" },
257 { 0x14000007,
"Max TSync Propagation Delay" },
258 { 0x14000008,
"Min SPDO Propagation Delay" },
259 { 0x14000009,
"Max SPDO Propagation Delay" },
260 { 0x1400000A,
"Best case TRes Delay" },
261 { 0x1400000B,
"Time Request Cycle" },
262 { 0x1400000C,
"TxSPDO No" },
264 { 0x18000000,
"RxSPDO Mapping Parameters" },
266 { 0x1C000000,
"TxSPDO Communication Parameters" },
267 { 0x1C000001,
"SADR for broadcast" },
268 { 0x1C000002,
"Refresh Prescale" },
269 { 0x1C000003,
"Number of TRes" },
271 { 0x20000000,
"Manufacturer Parameters" },
272 { 0x20010000,
"Used Channels" },
274 { 0x21000000,
"Safe Machine Options" },
276 { 0x21010000,
"SDG CRC Configuration" },
277 { 0x21010001,
"SDG CRC #1" },
278 { 0x21010002,
"SDG CRC #2" },
279 { 0x21010003,
"SDG CRC #3" },
280 { 0x21010004,
"SDG CRC #4" },
281 { 0x21010005,
"SDG CRC #5" },
282 { 0x21010006,
"SDG CRC #6" },
283 { 0x21010007,
"SDG CRC #7" },
284 { 0x21010008,
"SDG CRC #8" },
285 { 0x21010009,
"SDG CRC #9" },
286 { 0x2101000A,
"SDG CRC #10" },
288 { 0x21120000,
"Manufacturer - Module specific" },
289 { 0x21120002,
"PDOmapRx" },
290 { 0x21120003,
"PDOmapTx" },
291 { 0x21120004,
"CycleTime min [us]" },
292 { 0x21120005,
"CycleTime max [us]" },
293 { 0x21120006,
"Used Channels (same as 0x2001)" },
294 { 0x21120007,
"External Machine Options" },
295 { 0x21120008,
"Parameter for SafeMC" },
297 { 0xC0000000,
"TxSPDO Mapping Parameters" },
299 { 0xD0000000,
"SCM Module Flags" },
300 { 0xD0000001,
"BCM" },
301 { 0xD0000002,
"Optional" },
302 { 0xD0000003,
"Startup" },
303 { 0xD0000004,
"EMOs" },
304 { 0xD0000005,
"ext. Startup-Flags allowed" },
305 { 0xD0000006,
"Remote-Ctrl allowed" },
306 { 0xD0000007,
"Scans at startup" },
307 { 0xD0000008,
"Not Present" },
308 { 0xD0000009,
"Use Remanent Data" },
309 { 0xD000000A,
"SCM-AR specific" },
311 { 0xD0100000,
"Remanent Data" },
312 { 0xD0100001,
"DINT" },
314 { 0xD0110000,
"Remanent Data" },
315 { 0xD0110001,
"DUINT" },
319static value_string_ext opensafety_sod_idx_names_ext = VALUE_STRING_EXT_INIT(opensafety_sod_idx_names);
324 { 0x05030000,
"Reserved" },
326 { 0x05040000,
"SSDO protocol timed out" },
327 { 0x05040001,
"Client/server Command ID not valid or unknown" },
328 { 0x05040002,
"Invalid block size" },
329 { 0x05040003,
"Invalid sequence number" },
330 { 0x05040004,
"Reserved" },
331 { 0x05040005,
"Out of memory" },
333 { 0x06010000,
"Unsupported access to an object" },
334 { 0x06010001,
"Attempt to read a write-only object" },
335 { 0x06010002,
"Attempt to write a read-only object" },
337 { 0x06020000,
"Object does not exist in the object dictionary" },
339 { 0x06040041,
"Object cannot be mapped to the SPDO" },
340 { 0x06040042,
"The number and length of the objects to be mapped would exceed SPDO length" },
341 { 0x06040043,
"General parameter incompatibility" },
342 { 0x06040047,
"General internal incompatibility in the device" },
344 { 0x06060000,
"Access failed due to a hardware error" },
346 { 0x06070010,
"Data type does not match, length of service parameter does not match" },
347 { 0x06070012,
"Data type does not match, length of service parameter too high" },
348 { 0x06070013,
"Data type does not match, length of service parameter too low" },
350 { 0x06090011,
"Sub-index does not exist" },
351 { 0x06090030,
"Value range o parameter exceeded (only for write access)" },
352 { 0x06090031,
"Value of parameter written too high" },
353 { 0x06090032,
"Value of parameter written too low" },
354 { 0x06090036,
"Maximum value is less than minimum value" },
356 { 0x08000000,
"General error" },
357 { 0x08000020,
"Data cannot be transferred or stored to the application" },
358 { 0x08000021,
"Data cannot be transferred or stored to the application because of local control" },
359 { 0x08000022,
"Data cannot be transferred or stored to the application because of the present device state" },
360 { 0x08000023,
"Data cannot be transferred or stored to the application because of the object data is not available now" },
364static value_string_ext opensafety_abort_codes_ext = VALUE_STRING_EXT_INIT(opensafety_abort_codes);
366static const true_false_string opensafety_message_direction = {
"Response",
"Request" };
367static const true_false_string opensafety_spdo_direction = {
"Producer",
"Consumer" };
368static const true_false_string opensafety_addparam_request = {
"Header only",
"Header & Data" };
372 uint16_t timerequest;
438 uint16_t byte_offset;
Definition packet-opensafety.h:445
Definition packet-opensafety.h:430
Definition packet-opensafety.h:456
uint8_t msg_type
Definition packet-opensafety.h:468
uint8_t msg_id
Definition packet-opensafety.h:467
Definition packet-opensafety.h:406
Definition packet-opensafety.h:371
Definition packet-opensafety.h:391
Definition value_string.h:169
Definition value_string.h:25
Definition tvbuff-int.h:35