functions for the communication between SOLID slow control modules and Cprograms

Dependents:   sscm SPItest sscm

Revision:
7:6d3c421026df
Child:
12:cf007e9619e1
diff -r d9a96735d0fb -r 6d3c421026df getVersion.h
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/getVersion.h	Sun Oct 05 17:11:51 2014 +0000
@@ -0,0 +1,54 @@
+#ifndef GETVERSION_H
+#define GETVERSION_H
+
+/*  getVersion class
+ *  to get version number ( compile date etc)  of a module
+ *  to be used to verify module version used by a main program 
+ *  can be used as inheritance class
+ *  written for the SOLID SM1 control module firmware 
+ *
+ * author  Wim.Beaumont@Uantwerpen.be
+ * (C)  Universiteit Antwerpen  5 October 2014 
+ *
+ * version history 
+ * v 0.10  intial development vesion
+ *  
+ */
+
+#define GETVERSION_HDR_VER  "0.10"
+
+
+
+class getVersion {
+ 
+ const char* hver;
+ const char* sver;
+ const char* ctime;
+ const char* cdate;
+ 
+ 
+public:
+    getVersion(const char* ver_h,const char* ver_s=0, const char* time=0,const char* date=0) {
+        sver=ver_s; hver=ver_h; ctime=time;cdate=date;
+        } ;
+    getVersion(){sver=0; hver=0; ctime=0;cdate=0;};     
+    
+    // returns the version number of hdr of the  module in hex code     
+    unsigned short getHdrVersion(); 
+    // returns the version number of the  src of the  module  in hex code     
+    unsigned short getSrcVersion(); 
+    // returns the compile time  using __TIME__    in hex code 0xHHMM ver 0.1  returns always 0 
+    unsigned short getCompileTime();
+    // returns the compile date    using __DATE__     0xMMDD ver 0.1  returns always 0 
+    unsigned short getCompileDate();
+    // returns the compile year   using __DATE__  2014  0x140C ver 0.1  returns always 0 
+    unsigned short getCompileYear();
+    // takes a version nr of the type  "2.32"  and convert it to a hex nr   0x0220   ( 0x20== 33 dec) 
+    void get_dec_version( unsigned short  hexversion , unsigned char & version, unsigned char& subversion);
+    // translate  "2.32"  to 0x0222 
+    unsigned short  get_hex_version_nr(const char * vers);
+    
+};    
+
+
+#endif
\ No newline at end of file