po_hi_protocols.h 1.77 KB
Newer Older
1
2
3
4
5
6
7
/*
 * This is a part of PolyORB-HI-C distribution, a minimal
 * middleware written for generated code from AADL models.
 * You should use it with the Ocarina toolsuite.
 *
 * For more informations, please visit http://ocarina.enst.fr
 *
8
 * Copyright (C) 2010, European Space Agency
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * Copyright (C) 2007-2009, GET-Telecom Paris.
 */

#ifndef __PO_HI_PROTOCOLS__
#define __PO_HI_PROTOCOLS__

#include <po_hi_messages.h>
#include <po_hi_types.h>

#include <deployment.h>
#include <request.h>

typedef __po_hi_uint16_t __po_hi_inetport_t;
typedef char*            __po_hi_inetaddr_t;

24
25
26
#define __PO_HI_NOPORT 1
#define __PO_HI_NOADDR ""

27
28
29
int __po_hi_protocols_send_default (__po_hi_task_id id,
                                    __po_hi_port_t port);

30
int __po_hi_protocols_send (__po_hi_entity_t from,
31
32
                            __po_hi_entity_t to,
                            __po_hi_msg_t* msg);
33
34
35
36
37
38
39
40
/*
 * Send a message to a specified entity.  The "from" argument is the
 * node which send the message. The argument "to" is used to designate
 * the entity which receive the message. Finally, the last argument
 * (msg) is the message
 */

int __po_hi_protocols_receive (__po_hi_entity_t from,
41
                               __po_hi_msg_t* msg);
42
43
44
45
46
47
48
/*
 * Receive a message from a specified entity The entity which sent the
 * message is specified by the first argument.  The second argument
 * will contains the received message.
 */

int __po_hi_protocols_nonblocking_receive (__po_hi_entity_t from,
49
                                           __po_hi_msg_t* msg);
50
51
52
53
54
55
56
/*
 * Receive a message from a specified entity The entity which sent the
 * message is specified by the first argument.  The second argument
 * will contains the received message.  Receive 1 if data was received
 */

#endif /* __PO_HI_PROTOCOLS__ */