21#ifndef PROTOCORE_PROFINET_H
22#define PROTOCORE_PROFINET_H
26#if PROTOCORE_ENABLE_PROFINET
34#define PN_FRAMEID_DCP_HELLO 0xFEFC
35#define PN_FRAMEID_DCP_GETSET 0xFEFD
36#define PN_FRAMEID_DCP_IDENT_REQ 0xFEFE
37#define PN_FRAMEID_DCP_IDENT_RES 0xFEFF
38#define PN_DCP_SERVICE_GET 0x03
39#define PN_DCP_SERVICE_SET 0x04
40#define PN_DCP_SERVICE_IDENTIFY 0x05
41#define PN_DCP_TYPE_REQUEST 0x00
42#define PN_DCP_TYPE_RESPONSE_SUCCESS 0x01
43#define PN_DCP_OPT_IP 0x01
44#define PN_DCP_SUB_IP_PARAM 0x02
45#define PN_DCP_OPT_DEVICE 0x02
46#define PN_DCP_SUB_DEV_NAME_OF_STATION 0x02
47#define PN_DCP_SUB_DEV_ID 0x03
48#define PN_DCP_OPT_ALL 0xFF
49#define PN_DCP_SUB_ALL 0xFF
50#define PN_DCP_HDR_LEN 12
59 uint16_t response_delay;
64typedef void (*protocore_pn_dcp_block_cb)(uint8_t option, uint8_t suboption,
const uint8_t *value,
size_t value_len,
74 uint16_t response_delay;
79} ProfinetDcpHeaderArgs;
90} ProfinetDcpBlockArgs;
98} ProfinetDcpParseHeaderArgs;
103 const uint8_t *blocks;
105 protocore_pn_dcp_block_cb cb;
107} ProfinetDcpWalkArgs;
143 ProfinetDcpHeaderArgs dcp_header_args;
144 ProfinetDcpBlockArgs dcp_block_args;
145 ProfinetDcpParseHeaderArgs dcp_parse_header_args;
146 ProfinetDcpWalkArgs dcp_walk_args;
152extern ProfinetVars ProfinetV;
157 void (*
const dcp_header)(uint8_t *work);
158 void (*
const dcp_block)(uint8_t *work);
159 void (*
const dcp_parse_header)(uint8_t *work);
160 void (*
const dcp_walk)(uint8_t *work);
165void protocore_profinet_dcp_header(uint8_t *work);
166void protocore_profinet_dcp_block(uint8_t *work);
167void protocore_profinet_dcp_parse_header(uint8_t *work);
168void protocore_profinet_dcp_walk(uint8_t *work);
174static const ProfinetNs Profinet __attribute__((unused)) = {
175 .dcp_header = protocore_profinet_dcp_header,
176 .dcp_block = protocore_profinet_dcp_block,
177 .dcp_parse_header = protocore_profinet_dcp_parse_header,
178 .dcp_walk = protocore_profinet_dcp_walk,
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS