Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: model.h
- Revision:
- 9:97b26dcd1035
- Parent:
- 8:96c852630824
- Child:
- 11:95e4e04a7dd2
--- a/model.h Sun Dec 11 16:28:43 2016 +0000
+++ b/model.h Mon Dec 12 22:25:35 2016 +0000
@@ -5,43 +5,53 @@
#include <iostream>
#include "structures.h"
#include "Serial.h"
+
typedef map<string,pair<bool , int > > mMap;
class Model
{
public:
- Model(Serial *pci,Timer _tm) ;
- char startByteIn;
- char targetAdd;
- char sourceAdd;
- char DataLength;
- char DataIn[6];
- char CrcIn;
+ Model(Serial *pci) ;
void sendPacket(char startByte,char target,char source,char *data,int DataSize);
void doSomething(char data);
Serial * getSerial(void);
- Serial *pc;
- map<string, bool> mapPoschodie;
+ char getSourceAdd(){
+ return sourceAdd ;};
+
private:
- void setDataForResend(char targetAdd,char sourceAdd,int dataLength,char *data );
+
char crcCalc(char targetAddr, char senderAddr, char *data,int DataSize);
- static unsigned char crcArray[] ;
- Commands *cmd;
+ void setDoorStatus(bool mValue);
+ void downMotor();
+ void upMotor();
+ void stopMotor();
+
+ bool p4,p3,p2,p1,p0;
+ void SerialCallBack();
+ void TickerCallBack();
+ void TimeOutCallBack();
+ void DoorUnlock();
+ /*Variable*/
char rTarget;
char rSource;
int rLength;
char *rData;
-
- void setDoorStatus(bool mValue);
- void downMotor();
- void upMotor();
- void stopMotor();
+ bool dataSent;
+ char startByteIn;
+ char targetAdd;
+ char sourceAdd;
+ char DataLength;
+ char *DataIn;
+ char CrcIn;
+ char watchDog[1];
+ static unsigned char crcArray[] ;
+ Commands *cmd;
+ map<string, bool> mapPoschodie;
int direction;
int poschodie;
- bool p4,p3,p2,p1,p0;
-
-
-
-
+ Serial *pc;
+ Ticker tc;
+ Timeout tmOut;
+ Timeout tmOut2;
};
#endif
\ No newline at end of file