KM3NeT CLB  2.0
KM3NeT CLB v2 Embedded Software
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
contun.h
Go to the documentation of this file.
1 /*
2  * KM3NeT CLB v2 Firmware
3  * ----------------------
4  *
5  * Copyright 2012-2015 KM3NeT Collaboration
6  *
7  * All Rights Reserved.
8  *
9  *
10  * File : contun.h
11  * Created : 6 okt. 2015
12  * Author : Vincent van Beveren
13  */
14 #ifndef KERNEL_CONTUN_H_
15 #define KERNEL_CONTUN_H_
16 
17 /**
18  * @file
19  *
20  * @ingroup kernel
21  *
22  * This modules provides console tunneling, for both PTP core and 2nd LM32.
23  */
24 
25 #include "net/msg.h"
26 
27 /**
28  * Initializes the console tunnel.
29  *
30  * @param addr The socket address to forward the console data to.
31  *
32  * @note Provide NULL to conTunInit to deinitialize,or call conTunDeinit.
33  */
34 bool conTunInit(SockAddr * addr);
35 
36 /**
37  * Deinitializes the console tunnel.
38  */
39 static inline void conTunDeinit()
40 {
41  conTunInit(NULL);
42 }
43 
44 /**
45  * Send characters to PTP core and second LM32.
46  *
47  * @param ptp String for the PTP core
48  * @param lm32 String for the second LM32.
49  *
50  * @note Both string may be empty to send nothing.
51  */
52 void conTunSend(char * ptp, char * secLm32);
53 
54 
55 /**
56  * Receive characters from PTP core and second LM32.
57  *
58  * @param ptp String for receiving PTP core console data in
59  * @param lm32 String for receiving 2ndLM32 console date in
60  * @param max Maximum length for each string
61  *
62  * @note Both string may be empty to send nothing.
63  */
64 void conTunRecv(char * ptp, char * secLm32, int max);
65 
66 #endif /* KERNEL_CONTUN_H_ */
void conTunRecv(char *ptp, char *secLm32, int max)
Receive characters from PTP core and second LM32.
Handles MCF packed messages from the higher protocol layer.
void conTunSend(char *ptp, char *secLm32)
Send characters to PTP core and second LM32.
Definition: contun.c:109
Combination of IP address and port.
Definition: net.h:31
bool conTunInit(SockAddr *addr)
Initializes the console tunnel.
Definition: contun.c:81
static void conTunDeinit()
Deinitializes the console tunnel.
Definition: contun.h:39