C2A_Core
command_analyze.h
[詳解]
1 
5 #ifndef COMMAND_ANALYZE_H_
6 #define COMMAND_ANALYZE_H_
7 
8 #include "common_cmd_packet.h"
11 
12 #define CA_TLM_PAGE_SIZE (32)
13 #define CA_TLM_PAGE_MAX (48)
14 #define CA_MAX_CMDS (CA_TLM_PAGE_SIZE * CA_TLM_PAGE_MAX)
15 #define CA_MAX_CMD_PARAM_NUM (6)
16 
18 
19 
25 typedef enum
26 {
27  CA_ACK_OK = 0,
28  CA_ACK_ERR
30 
37 typedef struct
38 {
39  union
40  {
41  uint8_t byte;
42  struct
43  {
44  unsigned first: 4;
45  unsigned second: 4;
46  } bit;
47  } packed_info;
49 
55 typedef enum
56 {
64 
69 typedef struct
70 {
71  CCP_CmdRet (*cmd_func)(const CommonCmdPacket*);
72  CA_PackedParamSizeInfo param_size_infos[(CA_MAX_CMD_PARAM_NUM + 1) / 2];
73 } CA_CmdInfo;
74 
79 typedef struct
80 {
81  CA_CmdInfo cmd_table[CA_MAX_CMDS];
82  uint8_t tlm_page_no;
84 
85 extern const CommandAnalyze* const command_analyze;
86 
87 
93 void CA_initialize(void);
94 
101 
108 uint8_t CA_get_cmd_param_num(CMD_CODE cmd_code);
109 
117 uint8_t CA_get_cmd_param_size(CMD_CODE cmd_code, uint8_t n);
118 
126 uint16_t CA_get_cmd_param_min_len(CMD_CODE cmd_code);
127 
135 CA_ACK CA_ckeck_cmd_param_len(CMD_CODE cmd_code, uint16_t param_len);
136 
143 int CA_has_raw_param(CMD_CODE cmd_code);
144 
151 void CA_load_cmd_table(CA_CmdInfo cmd_table[CA_MAX_CMDS]);
152 
153 CCP_CmdRet Cmd_CA_INIT(const CommonCmdPacket* packet);
154 
156 
158 
159 #endif
uint8_t CA_get_cmd_param_num(CMD_CODE cmd_code)
コマンドパラメタ数を取得する
CCP_CmdRet Cmd_CA_SET_PAGE_FOR_TLM(const CommonCmdPacket *packet)
uint8_t CA_get_cmd_param_size(CMD_CODE cmd_code, uint8_t n)
コマンドパラメタサイズを取得する
#define CA_MAX_CMD_PARAM_NUM
コマンドパラメタ(引数)の最大数.現時点ではユーザー側で可変にすることを想定してはない
CA_PARAM_SIZE_TYPE
コマンドパラメタサイズ
@ CA_PARAM_SIZE_TYPE_8BYTE
8 byte
@ CA_PARAM_SIZE_TYPE_RAW
RAW パラメタ
@ CA_PARAM_SIZE_TYPE_2BYTE
2 byte
@ CA_PARAM_SIZE_TYPE_NONE
パラメタなし
@ CA_PARAM_SIZE_TYPE_1BYTE
1 byte
@ CA_PARAM_SIZE_TYPE_4BYTE
4 byte
CCP_CmdRet Cmd_CA_INIT(const CommonCmdPacket *packet)
int CA_has_raw_param(CMD_CODE cmd_code)
RAW パラメタを持っているか?
const CommandAnalyze *const command_analyze
#define CA_MAX_CMDS
コマンドテーブルサイズ.すなわち登録できる最大コマンド数
void CA_load_cmd_table(CA_CmdInfo cmd_table[CA_MAX_CMDS])
Cmd Tableのロード
CCP_CmdRet Cmd_CA_REGISTER_CMD(const CommonCmdPacket *packet)
uint16_t CA_get_cmd_param_min_len(CMD_CODE cmd_code)
最小コマンドパラメタ長を取得する
CA_ACK
@ CA_ACK_ERR
エラー
@ CA_ACK_OK
正常終了
CCP_CmdRet CA_execute_cmd(const CommonCmdPacket *packet)
コマンド実行の本体
void CA_initialize(void)
CA の初期化
CA_ACK CA_ckeck_cmd_param_len(CMD_CODE cmd_code, uint16_t param_len)
コマンドパラメタ長をチェックする
CAのCoreTlmパラメタのオーバーライド用ヘッダー
コマンド定義
CCP 関連基本関数の宣言
CCP の汎用 Utility
コマンドテーブルの要素となる構造体
パラメタのサイズ情報を圧縮した構造体
コマンド返り値
Space Packet (コマンド用)
CommandAnalyze の Info 構造体
uint8_t tlm_page_no
テレメで使うページ数