esc_mailbox.h 1.65 KB
Newer Older
Jeroen Vreeken's avatar
Jeroen Vreeken committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/*
	Copyright Jeroen Vreeken (pe1rxq@amsat.org), 2013
	Copyright Stichting C.A. Muller Radioastronomiestation, 2013

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.

 */

#ifndef _INCLUDE_EC_ESC_MAILBOX_H_
#define _INCLUDE_EC_ESC_MAILBOX_H_

Jeroen Vreeken's avatar
Jeroen Vreeken committed
23
#include <ec/esc_sm.h>
Jeroen Vreeken's avatar
Jeroen Vreeken committed
24
25
26
27
28
29
30
31
32
33
34
35
36
37

struct esc_mailbox *esc_mailbox_create(struct ec_dgram_addr *node,
    struct esc_syncmanager_info *rd, struct esc_syncmanager_info *wr);
void esc_mailbox_reinit(struct ec_dgram_addr *node,
    struct esc_syncmanager_info *rd, struct esc_syncmanager_info *wr);
ssize_t esc_mailbox_read(struct esc_mailbox *mailbox, int *type,
    void *data, size_t len, struct timespec *timeout);
ssize_t esc_mailbox_write(struct esc_mailbox *mailbox, int type,
    void *data, size_t len, struct timespec *timeout);
void esc_mailbox_destroy(struct esc_mailbox *mailbox);


int esc_syncmanager_claim(struct ec_dgram_addr *addr);

38
39
40
41
42
43
44
#define ESC_MAILBOX_TYPE_ADS	0x1
#define ESC_MAILBOX_TYPE_EOE	0x2
#define ESC_MAILBOX_TYPE_COE	0x3
#define ESC_MAILBOX_TYPE_FOE	0x4
#define ESC_MAILBOX_TYPE_SOE	0x5
#define ESC_MAILBOX_TYPE_VOE	0xf

Jeroen Vreeken's avatar
Jeroen Vreeken committed
45
46

#endif /* _INCLUDE_EC_ESC_MAILBOX_H_ */