00001 #ifndef __DECODE_HK_H
00002 #define __DECODE_HK_H
00003 #include "load_hk_config_files.h"
00004 #include "packets.h"
00005 #include "printk.h"
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #define KEYWORD_NAME_SIZE 10
00018 #define KEYWORD_TYPE_SIZE 10
00019 #define TELEMETRY_MNEMONIC_SIZE 50
00020 #define HK_DECODER_SUCCESSFUL SUCCESS
00021 #define HK_DECODER_ERROR_UNKNOWN_APID ERROR_HK_UNKNOWN_APID
00022 #define HK_DECODER_ERROR_NO_CONFIG_DATA ERROR_HK_UNKNOWN_APID
00023 #define HK_DECODER_ERROR_CANNOT_FIND_VER_NUM ERROR_HK_CANNOT_FIND_VER_NUM
00024 #define HK_DECODER_ERROR_CANNOT_LOAD_HK_VALUES ERROR_HK_CANNOT_LOAD_HK_VALUES
00025 #define HK_DECODER_ERROR_CANNOT_LOAD_ENGR_VALUES ERROR_HK_CANNOT_LOAD_ENGR_VALUES
00026 #define HK_DECODER_ERROR_UNKNOWN_ENV_VARIABLE ERROR_HK_CANNOT_LOAD_ENGR_VALUES
00027 #define HK_LEV0_START_MERGED_PVNW (1)
00028 #define HK_LEV0_START_MERGED_PVND (194)
00029
00030
00031
00032 typedef struct Pointers_HK_Keywords_Format_struct
00033 {
00034 int apid;
00035 char version_number[10];
00036 int fsn;
00037 int fid;
00038 int number_bytes_in_packet;
00039 struct HK_Keywords_Format_struct *ptr_hk_kw;
00040 struct Pointers_HK_Keywords_Format_struct *next;
00041 } Pointers_HK_Keywords_Format;
00042
00043 typedef struct HK_Keywords_Format_struct
00044 {
00045 char keyword_name[KEYWORD_NAME_SIZE];
00046
00047
00048 int64_t keyword_value;
00049
00050
00051 char type[KEYWORD_TYPE_SIZE] ;
00052
00053
00054
00055 char telemetry_mnemonic_name[TELEMETRY_MNEMONIC_SIZE];
00056 int start_byte ;
00057
00058
00059
00060
00061 int start_bit;
00062 int bit_length;
00063 char conv_type;
00064 struct ALG_Conversion_struct *alg;
00065 struct DSC_Conversion_struct *dsc;
00066 struct HK_Keywords_Format_struct *next;
00067
00068
00069 } HK_Keywords_Format;
00070
00071 int decode_hk_keywords(unsigned short *ptr, int apid, HK_Keyword_t **kw_head);
00072 void deallocate_hk_keyword(HK_Keyword_t *head);
00073 HK_Keyword_t *copy_hk_keywords(HK_Keyword_t *head);
00074
00075
00076 #endif