PsiSwarm Library  0.8
serial.h
1 /* University of York Robotics Laboratory PsiSwarm Library: Serial Control Header File
2  *
3  * Copyright 2016 University of York
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
7  * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS
8  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
9  * See the License for the specific language governing permissions and limitations under the License.
10  *
11  * File: serial.h
12  *
13  * (C) Dept. Electronics & Computer Science, University of York
14  * James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
15  *
16  * PsiSwarm Library Version: 0.8
17  *
18  * October 2016
19  *
20  *
21  */
22 
23 
24 #ifndef SERIAL_H
25 #define SERIAL_H
26 
39 {
40 public:
41 //void handle_user_serial_message(char * message, char length, char interface);
42 
47 void setup_serial_interfaces(void);
48 
49 private:
50 void IF_start_file_transfer_mode(void);
51 void IF_end_file_transfer_mode(void);
52 void IF_file_transfer_timeout(void);
53 void IF_handle_file_transfer_serial_message(char * message, char length, char interface);
54 void IF_handle_user_serial_message(char * message, char length, char interface);
55 void IF_handle_command_serial_message(char message [3], char interface);
56 void IF_invalid_transfer(void);
57 void IF_pc_rx_callback(void);
58 void IF_bt_rx_callback(void);
59 void IF_pc_rx_command_timeout(void);
60 void IF_bt_rx_command_timeout(void);
61 void IF_bt_message_timeout(void);
62 char * IF_nibble_to_binary_char(char in);
63 char * IF_char_to_binary_char(char in);
64 float IF_decode_unsigned_float(char byte0, char byte1);
65 float IF_decode_float(char byte0, char byte1);
66 float IF_decode_float(char byte0);
67 float IF_decode_unsigned_float(char byte0);
68 void IF_set_filename(char * filename_in);
69 unsigned short IF_calculateCRC16(int file_length);
70 };
71 
72 #endif
void setup_serial_interfaces(void)
Definition: serial.cpp:54