blob: a814e21e34501b165d61e4803bedc28f01f386c9 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/**
* @author generated by eTrice
*
* Header File of ActorClass ATcpClient
*
*/
#ifndef _ROOM_BASIC_SERVICE_TCP_ATCPCLIENT_H_
#define _ROOM_BASIC_SERVICE_TCP_ATCPCLIENT_H_
#include "etDatatypes.h"
#include "messaging/etMessage.h"
/* include all referenced room classes */
#include "room/basic/service/tcp/DTcpPayload.h"
#include "room/basic/service/tcp/PTcpControl.h"
#include "room/basic/service/tcp/PTcpPayload.h"
/*--------------------- begin user code ---------------------*/
#include "osal/etTcpSockets.h"
/*--------------------- end user code ---------------------*/
typedef struct ATcpClient ATcpClient;
/* const part of ActorClass (ROM) */
typedef struct ATcpClient_const {
const char* instName;
/* simple ports */
const PTcpControlPort controlPort;
const PTcpPayloadPort payloadPort;
/* data receive ports */
/* saps */
/* replicated ports */
/* services */
} ATcpClient_const;
/* constant for state machine data */
#define ATCPCLIENT_HISTORY_SIZE 5
/* variable part of ActorClass (RAM) */
struct ATcpClient {
const ATcpClient_const* const constData;
/* data send ports */
/*--------------------- attributes ---------------------*/
int32 lastError;
DTcpPayload payloadRecvBuffer;
etSocketConnectionData* client;
/* state machine variables */
etInt16 state;
etInt16 history[ATCPCLIENT_HISTORY_SIZE];
};
void ATcpClient_init(ATcpClient* self);
void ATcpClient_receiveMessage(void* self, const void* ifitem, const etMessage* msg);
/*--------------------- user constructor/destructor ---------------------*/
void ATcpClient_ctor(ATcpClient* self);
void ATcpClient_dtor(ATcpClient* self);
/*--------------------- operations ---------------------*/
bool ATcpClient_hasError(ATcpClient* self);
void ATcpClient_setErrorCode(ATcpClient* self, int32 value);
#endif /* _ROOM_BASIC_SERVICE_TCP_ATCPCLIENT_H_ */
|