Enhanced SIM for E2AP v1 for TS UC
[sim/e2-interface.git] / e2sim / e2apv1sim / test / Pendulum / Serial / adruino_serial.h
1 /*
2  *
3  * Copyright 2019 AT&T Intellectual Property
4  * Copyright 2019 Nokia
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  *      http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  *
18  */
19
20 #ifndef ADRUINO_SERIAL_H
21 #define ADRUINO_SERIAL_H
22
23 #include "arduino-serial-lib.h"
24
25 #define MAX_SERIAL_BUFFER       256
26 #define DEFAULT_SERIAL_PORT     "/dev/ttyACM0"
27 #define DEFAULT_BAUDRATE        115200
28 #define SERIAL_EOL_CHAR         '\n'
29 #define SERIAL_TIMEOUT          5000 //ms
30
31 int start_serial_inferface(int baudrate, char *serial_port);
32
33 int serial_readline(int fd, char* buf, int buf_max);
34
35 int serial_writeline(int fd, char* buf);
36
37 //For testing only
38 void test_adruino_serial(void);
39
40 #endif