3 * Copyright 2019 AT&T Intellectual Property
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
10 * http://www.apache.org/licenses/LICENSE-2.0
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.
20 #ifndef ADRUINO_SERIAL_H
21 #define ADRUINO_SERIAL_H
23 #include "arduino-serial-lib.h"
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
31 int start_serial_inferface(int baudrate, char *serial_port);
33 int serial_readline(int fd, char* buf, int buf_max);
35 int serial_writeline(int fd, char* buf);
38 void test_adruino_serial(void);