Creates DAC interface
Fork of DevInterfaces by
getVersion.h@2:58f1d5a3f850, 2016-01-13 (annotated)
- Committer:
- wbeaumont
- Date:
- Wed Jan 13 14:14:39 2016 +0000
- Revision:
- 2:58f1d5a3f850
- Parent:
- 0:da1fb7dd363f
for getVersion added infostr and moved constructor implementation to src file
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wbeaumont | 0:da1fb7dd363f | 1 | #ifndef GETVERSION_H |
wbeaumont | 0:da1fb7dd363f | 2 | #define GETVERSION_H |
wbeaumont | 0:da1fb7dd363f | 3 | |
wbeaumont | 0:da1fb7dd363f | 4 | /* getVersion class |
wbeaumont | 0:da1fb7dd363f | 5 | * to get version number ( compile date etc) of a module |
wbeaumont | 0:da1fb7dd363f | 6 | * to be used to verify module version used by a main program |
wbeaumont | 0:da1fb7dd363f | 7 | * can be used as inheritance class |
wbeaumont | 0:da1fb7dd363f | 8 | * written for the SOLID SM1 control module firmware |
wbeaumont | 0:da1fb7dd363f | 9 | * |
wbeaumont | 0:da1fb7dd363f | 10 | * author Wim.Beaumont@Uantwerpen.be |
wbeaumont | 0:da1fb7dd363f | 11 | * (C) Universiteit Antwerpen 5 October 2014 |
wbeaumont | 0:da1fb7dd363f | 12 | * |
wbeaumont | 0:da1fb7dd363f | 13 | * version history |
wbeaumont | 0:da1fb7dd363f | 14 | * v 0.10 intial development vesion |
wbeaumont | 0:da1fb7dd363f | 15 | * |
wbeaumont | 0:da1fb7dd363f | 16 | */ |
wbeaumont | 0:da1fb7dd363f | 17 | |
wbeaumont | 2:58f1d5a3f850 | 18 | #define GETVERSION_HDR_VER "0.20" |
wbeaumont | 0:da1fb7dd363f | 19 | |
wbeaumont | 0:da1fb7dd363f | 20 | |
wbeaumont | 0:da1fb7dd363f | 21 | |
wbeaumont | 0:da1fb7dd363f | 22 | class getVersion { |
wbeaumont | 0:da1fb7dd363f | 23 | |
wbeaumont | 0:da1fb7dd363f | 24 | const char* hver; |
wbeaumont | 0:da1fb7dd363f | 25 | const char* sver; |
wbeaumont | 0:da1fb7dd363f | 26 | const char* ctime; |
wbeaumont | 0:da1fb7dd363f | 27 | const char* cdate; |
wbeaumont | 2:58f1d5a3f850 | 28 | char infostr[100]; // 100 is not precise nr. |
wbeaumont | 0:da1fb7dd363f | 29 | |
wbeaumont | 0:da1fb7dd363f | 30 | public: |
wbeaumont | 2:58f1d5a3f850 | 31 | getVersion(const char* ver_h,const char* ver_s=0, const char* time=0,const char* date=0) ; |
wbeaumont | 2:58f1d5a3f850 | 32 | getVersion(); |
wbeaumont | 0:da1fb7dd363f | 33 | |
wbeaumont | 0:da1fb7dd363f | 34 | // returns the version number of hdr of the module in hex code |
wbeaumont | 0:da1fb7dd363f | 35 | unsigned short getHdrVersion(); |
wbeaumont | 0:da1fb7dd363f | 36 | // returns the version number of the src of the module in hex code |
wbeaumont | 0:da1fb7dd363f | 37 | unsigned short getSrcVersion(); |
wbeaumont | 0:da1fb7dd363f | 38 | // returns the compile time using __TIME__ in hex code 0xHHMM ver 0.1 returns always 0 |
wbeaumont | 0:da1fb7dd363f | 39 | unsigned short getCompileTime(); |
wbeaumont | 0:da1fb7dd363f | 40 | // returns the compile date using __DATE__ 0xMMDD ver 0.1 returns always 0 |
wbeaumont | 0:da1fb7dd363f | 41 | unsigned short getCompileDate(); |
wbeaumont | 0:da1fb7dd363f | 42 | // returns the compile year using __DATE__ 2014 0x140C ver 0.1 returns always 0 |
wbeaumont | 0:da1fb7dd363f | 43 | unsigned short getCompileYear(); |
wbeaumont | 0:da1fb7dd363f | 44 | // takes a version nr of the type "2.32" and convert it to a hex nr 0x0220 ( 0x20== 33 dec) |
wbeaumont | 0:da1fb7dd363f | 45 | void get_dec_version( unsigned short hexversion , unsigned char & version, unsigned char& subversion); |
wbeaumont | 0:da1fb7dd363f | 46 | // translate "2.32" to 0x0222 |
wbeaumont | 0:da1fb7dd363f | 47 | unsigned short get_hex_version_nr(const char * vers); |
wbeaumont | 2:58f1d5a3f850 | 48 | // give a string with the HDR and SRC version |
wbeaumont | 2:58f1d5a3f850 | 49 | char* getversioninfo(); |
wbeaumont | 0:da1fb7dd363f | 50 | |
wbeaumont | 0:da1fb7dd363f | 51 | }; |
wbeaumont | 0:da1fb7dd363f | 52 | |
wbeaumont | 0:da1fb7dd363f | 53 | |
wbeaumont | 0:da1fb7dd363f | 54 | #endif |