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