OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
cipelectronickey.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2016, Rockwell Automation, Inc.
3  * All rights reserved.
4  *
5  ******************************************************************************/
6 
7 #ifndef SRC_CIP_CIPELECTRONICKEY_H_
8 #define SRC_CIP_CIPELECTRONICKEY_H_
9 
10 #include <stdbool.h>
11 
12 #include "typedefs.h"
13 
17 typedef struct {
20  void *key_data;
23 
24 void ElectronicKeySetSegmentType(CipElectronicKey *const electronic_key,
25  const CipUsint segment_type);
26 
28  const CipElectronicKey *const electronic_key);
29 
30 void ElectronicKeySetKeyFormat(CipElectronicKey *const electronic_key,
31  const CipUsint key_format);
32 
33 CipUint ElectronicKeyGetKeyFormat(const CipElectronicKey *const electronic_key);
34 
35 void ElectronicKeySetKeyData(CipElectronicKey *const electronic_key,
36  void *key_data);
37 
38 void *ElectronicKeyGetKeyData(const CipElectronicKey *const electronic_key);
39 
44 
45 extern const size_t kElectronicKeyFormat4Size;
46 
52  );
53 
60 
65 void ElectronicKeyFormat4SetVendorId(ElectronicKeyFormat4 *const electronic_key,
66  const CipUint vendor_id);
67 
74  const ElectronicKeyFormat4 *const electronic_key);
75 
82  ElectronicKeyFormat4 *const electronic_key,
83  const CipUint device_type);
84 
91  const ElectronicKeyFormat4 *const electronic_key);
92 
99  ElectronicKeyFormat4 *const electronic_key,
100  const CipUint product_code);
101 
108  const ElectronicKeyFormat4 *const electronic_key);
109 
116  ElectronicKeyFormat4 *const electronic_key,
118 
125  const ElectronicKeyFormat4 *const electronic_key);
126 
133  const ElectronicKeyFormat4 *const electronic_key);
134 
141  ElectronicKeyFormat4 *const electronic_key,
142  const CipUsint minor_revision);
143 
150  const ElectronicKeyFormat4 *const electronic_key);
151 
152 #endif /* SRC_CIP_CIPELECTRONICKEY_H_ */
void ElectronicKeyFormat4SetMajorRevisionCompatibility(ElectronicKeyFormat4 *const electronic_key, const CipByte major_revision_compatibility)
Sets the major revision byte including the compatibility flag.
CipUsint ElectronicKeyFormat4GetMinorRevision(const ElectronicKeyFormat4 *const electronic_key)
Gets the minor revision from an format 4 electronic key.
CipUint ElectronicKeyFormat4GetDeviceType(const ElectronicKeyFormat4 *const electronic_key)
Gets the device type from a format 4 electronic key.
const size_t kElectronicKeyFormat4Size
CipUint ElectronicKeyFormat4GetVendorId(const ElectronicKeyFormat4 *const electronic_key)
Gets the vendor ID form the electronic key.
void ElectronicKeyFormat4SetMinorRevision(ElectronicKeyFormat4 *const electronic_key, const CipUsint minor_revision)
Sets the devices minor revision in an format 4 electronic key.
void ElectronicKeyFormat4SetDeviceType(ElectronicKeyFormat4 *const electronic_key, const CipUint device_type)
Sets the device type in the electronic key.
uint8_t CipByte
Definition: typedefs.h:43
CIP Electronic Key Segment struct.
CipByte ElectronicKeyFormat4GetMajorRevision(const ElectronicKeyFormat4 *const electronic_key)
Gets the major revision from an format 4 electronic key.
CipUsint ElectronicKeyGetSegmentType(const CipElectronicKey *const electronic_key)
uint8_t CipUsint
Definition: typedefs.h:46
void ElectronicKeyFormat4SetProductCode(ElectronicKeyFormat4 *const electronic_key, const CipUint product_code)
Set product code in the electronic key.
void ElectronicKeySetSegmentType(CipElectronicKey *const electronic_key, const CipUsint segment_type)
bool ElectronicKeyFormat4GetMajorRevisionCompatibility(const ElectronicKeyFormat4 *const electronic_key)
Gets the Compatibility flag from the format 4 electronic key.
CipUint ElectronicKeyGetKeyFormat(const CipElectronicKey *const electronic_key)
void ElectronicKeyFormat4SetVendorId(ElectronicKeyFormat4 *const electronic_key, const CipUint vendor_id)
Sets vendor ID in the electronic key.
void ElectronicKeyFormat4Delete(ElectronicKeyFormat4 **electronic_key)
Destructor for the electroic key format 4 class.
ElectronicKeyFormat4 * ElectronicKeyFormat4New()
Constructor for the electroic key format 4 class.
uint16_t CipUint
Definition: typedefs.h:47
CipUint ElectronicKeyFormat4GetProductCode(const ElectronicKeyFormat4 *const electronic_key)
Gets the product code from an format 4 electronic key.
segment_type
Segment type Enum.
Definition: cipepath.h:59
void ElectronicKeySetKeyFormat(CipElectronicKey *const electronic_key, const CipUsint key_format)
void ElectronicKeySetKeyData(CipElectronicKey *const electronic_key, void *key_data)
void * ElectronicKeyGetKeyData(const CipElectronicKey *const electronic_key)