diff --git a/app/include/cmd.h b/app/include/cmd.h index b30b69e..6673673 100755 --- a/app/include/cmd.h +++ b/app/include/cmd.h @@ -248,6 +248,8 @@ typedef struct int lines; /* System wide terminal lines. */ char *version; /* 版本号. */ char *compile; /* 编译时间. */ + char *hardversion; /* 硬件版本号. */ + char *FPGAversion; /* PFGA版本号. */ char configfile[FILE_NAME_LEN]; /* config file name of this host */ char bannerfile[FILE_NAME_LEN]; /* Banner configuration file name. */ } host_t; diff --git a/app/include/common.h b/app/include/common.h index 1b60d4f..6440212 100755 --- a/app/include/common.h +++ b/app/include/common.h @@ -146,6 +146,8 @@ extern int printh(const char *format, ...); extern char* version_get(); extern char* version_date_get(); extern uint16_t sofrware_version_get(void); +extern char* hardware_version_get(); +extern char* fpga_version_date_get(); extern int32_t str_to_mac(char *mac_str, OUT uint8_t *mac); extern int32_t str_to_id(char *id_str, OUT uint32_t *id); extern int32_t bitmap_set(uint8_t *buf, int32_t nbit, int32_t buf_len); diff --git a/app/lib/m_management/cmd.c b/app/lib/m_management/cmd.c index 303e769..1da95bd 100755 --- a/app/lib/m_management/cmd.c +++ b/app/lib/m_management/cmd.c @@ -2398,6 +2398,8 @@ void cmd_init(void) strncpy(host.configfile, "startup-config", FILE_NAME_LEN); host.version = version_get(); host.compile = version_date_get(); + host.hardversion = hardware_version_get(); + host.FPGAversion = fpga_version_date_get(); host.lines = -1; /* 安装命令行模式节点. */ diff --git a/build/Makefile b/build/Makefile index dd71671..bf3e822 100755 --- a/build/Makefile +++ b/build/Makefile @@ -31,6 +31,8 @@ VERSION_FILE := $(SOURCE_DIR)/include/version.h VERSION_LIB := version.a DATE_STRING := `date "+%Y.%m.%d %k:%M:%S"` VERSION_STRING := "10.0.1.0" +HARDWARE_VERSION := "A.1" +FPGA_VERSION := "1.0" MV := mv -f RM := rm -rf @@ -98,10 +100,14 @@ $(VERSION_LIB): $(CONFIG_FILE) $(libraries) version.c @echo "#define VERSION \"$(VERSION_STRING)\"" >> $(VERSION_FILE) @echo "#define DATE \"$(DATE_STRING)\"" >> $(VERSION_FILE) + @echo "#define HARDV_ERSION \"$(HARDWARE_VERSION)\"" >> $(VERSION_FILE) + @echo "#define FPGA_VERSION \"$(FPGA_VERSION)\"" >> $(VERSION_FILE) @echo "" >> $(VERSION_FILE) @echo "char* version_get();" >> $(VERSION_FILE) @echo "char* version_date_get();" >> $(VERSION_FILE) + @echo "char* hardware_version_get();" >> $(VERSION_FILE) + @echo "char* fpga_version_date_get();" >> $(VERSION_FILE) @echo "" >> $(VERSION_FILE) @echo "#endif" >> $(VERSION_FILE)