Code to process UI input messages and verify them with checksum.
Embed:
(wiki syntax)
Show/hide line numbers
UserInterface.h
00001 #ifndef USERINTERFACE_H 00002 #define USERINTERFACE_H 00003 00004 /** 00005 * Copyright (c) 2014 00006 * All rights reserved. 00007 * 00008 * This header file contains functions for reading received signals and checking that they are properly formed. 00009 * @author Bradley Perry 00010 * @date 00011 */ 00012 00013 #include "mbed.h" 00014 #include "MODSERIAL.h" 00015 #include "initDatabed.h" 00016 extern int UI; 00017 class UserInterface 00018 { 00019 public: 00020 UserInterface(void); 00021 void find_length(char *idx, int *count); 00022 bool checksum_check(char * idx, int length); 00023 void checkUI_XBee(); 00024 void readBuffer(); 00025 void initializeUI(); 00026 00027 private: 00028 int _buttonA; 00029 int _buttonA_prev; 00030 float _tHold; 00031 float _tIdle; 00032 int _SSconfirm; 00033 float _tRelease; 00034 Timer _time_StateChange; 00035 Timer _time_pressA; 00036 Timer _time_pressB; 00037 int _buttonB; 00038 int _buttonB_prev; 00039 char _xbeeBuffer[250]; 00040 int _dataCnt; 00041 float _time_sinceA; 00042 float _time_sinceB; 00043 }; 00044 #endif
Generated on Thu Jul 14 2022 01:55:52 by
1.7.2