OpENer - Open Source EtherNet/IP(TM) I/O Target Stack  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
endianconv.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (c) 2009, Rockwell Automation, Inc.
3  * All rights reserved.
4  *
5  ******************************************************************************/
6 #ifndef OPENER_ENDIANCONV_H_
7 #define OPENER_ENDIANCONV_H_
8 
9 #include "typedefs.h"
10 
15 typedef enum {
20 
26 EipUint8 GetSintFromMessage(const EipUint8 **const buffer);
27 
28 CipByte GetByteFromMessage(const CipOctet **const buffer_address);
29 
30 CipUsint GetUsintFromMessage(const CipOctet **const buffer_address);
31 
38 EipUint16 GetIntFromMessage(const EipUint8 **const buffer);
39 
40 CipUint GetUintFromMessage(const CipOctet **const buffer_address);
41 
42 CipWord GetWordFromMessage(const CipOctet **const buffer_address);
43 
50 EipUint32 GetDintFromMessage(const EipUint8 **const buffer);
51 
52 CipUdint GetUdintFromMessage(const CipOctet **const buffer_address);
53 
60 int AddSintToMessage(const EipUint8 data,
61  EipUint8 **const buffer);
62 
71 int AddIntToMessage(const EipUint16 data,
72  EipUint8 **const buffer);
73 
82 int AddDintToMessage(const EipUint32 data,
83  EipUint8 **const buffer);
84 
85 #ifdef OPENER_SUPPORT_64BIT_DATATYPES
86 
87 EipUint64 GetLintFromMessage(const EipUint8 **const buffer);
88 
97 int AddLintToMessage(const EipUint64 pa_unData,
98  EipUint8 **const buffer);
99 
100 #endif
101 
111  EipUint32 address,
112  EipByte **communication_buffer);
113 
117 void DetermineEndianess(void);
118 
125 int GetEndianess(void);
126 
127 int MoveMessageNOctets(const int n,
128  const CipOctet **message_runner);
129 
131  unsigned int n,
132  CipOctet **message);
133 
135  unsigned int n,
136  CipOctet **message);
137 #endif /* OPENER_ENDIANCONV_H_ */
void DetermineEndianess(void)
Detects Endianess of the platform and sets global g_nOpENerPlatformEndianess variable accordingly...
Definition: endianconv.c:239
CipUdint GetUdintFromMessage(const CipOctet **const buffer_address)
Definition: endianconv.c:90
int FillNextNMessageOctetsWithValueAndMoveToNextPosition(CipOctet value, unsigned int n, CipOctet **message)
Definition: endianconv.c:271
int MoveMessageNOctets(const int n, const CipOctet **message_runner)
Definition: endianconv.c:258
EipUint32 GetDintFromMessage(const EipUint8 **const buffer)
Get an 32Bit integer from the network buffer.
Definition: endianconv.c:83
EipUint8 GetSintFromMessage(const EipUint8 **const buffer)
Reads EIP_UINT8 from *buffer and converts little endian to host.
Definition: endianconv.c:29
int EncapsulateIpAddress(EipUint16 port, EipUint32 address, EipByte **communication_buffer)
Encapsulate the sockaddr information as necessary for the Common Packet Format data items...
Definition: endianconv.c:197
CipByte GetByteFromMessage(const CipOctet **const buffer_address)
Definition: endianconv.c:36
uint8_t CipOctet
Data types as defined in the CIP Specification Vol 1 Appendix C.
Definition: typedefs.h:41
int AddIntToMessage(const EipUint16 data, EipUint8 **const buffer)
Write an 16Bit integer to the network buffer.
Definition: endianconv.c:117
uint8_t EipUint8
Definition: typedefs.h:32
uint32_t EipUint32
Definition: typedefs.h:34
int AddDintToMessage(const EipUint32 data, EipUint8 **const buffer)
Write an 32Bit integer to the network buffer.
Definition: endianconv.c:132
OpenerEndianess
Definition: endianconv.h:15
uint8_t CipByte
Definition: typedefs.h:43
CipWord GetWordFromMessage(const CipOctet **const buffer_address)
Definition: endianconv.c:71
int AddSintToMessage(const EipUint8 data, EipUint8 **const buffer)
converts UINT8 data from host to little endian an writes it to buffer.
Definition: endianconv.c:103
uint8_t CipUsint
Definition: typedefs.h:46
CipUint GetUintFromMessage(const CipOctet **const buffer_address)
Definition: endianconv.c:64
uint8_t EipByte
EIP Data type definitions.
Definition: typedefs.h:28
CipUsint GetUsintFromMessage(const CipOctet **const buffer_address)
Definition: endianconv.c:43
uint32_t CipUdint
Definition: typedefs.h:48
uint16_t CipUint
Definition: typedefs.h:47
EipUint16 GetIntFromMessage(const EipUint8 **const buffer)
Get an 16Bit integer from the network buffer, and moves pointer beyond the 16 bit value...
Definition: endianconv.c:57
int GetEndianess(void)
Return the endianess identified on system startup.
Definition: endianconv.c:254
uint16_t CipWord
Definition: typedefs.h:44
uint16_t EipUint16
Definition: typedefs.h:33
int FillNextNMessageOctetsWith(CipOctet value, unsigned int n, CipOctet **message)
Definition: endianconv.c:264