Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename & refactor: IF list -> DS handler registry #22

Closed
Tracked by #8 ...
sksat opened this issue Jul 21, 2023 · 16 comments · Fixed by #165 or #166
Closed
Tracked by #8 ...

rename & refactor: IF list -> DS handler registry #22

sksat opened this issue Jul 21, 2023 · 16 comments · Fixed by #165 or #166
Assignees
Labels
enhancement New feature or request invalid This doesn't seem right priority::high priorityg high tools
Milestone

Comments

@sksat
Copy link
Member

sksat commented Jul 21, 2023

#21 の rename によって src_user/IfWrapper/if_list.c の歪さが表出する.そもそもこの存在をどうにかしたいというのはありつつ,実態に即した場所と名前は src_user/Settings/DriverSuper/handler_registry.h などなので,これも変更する必要がある.

@sksat sksat self-assigned this Jul 21, 2023
@sksat sksat added enhancement New feature or request invalid This doesn't seem right priority::high priorityg high tools labels Jul 21, 2023
@sksat sksat mentioned this issue Oct 12, 2023
22 tasks
@sksat
Copy link
Member Author

sksat commented Oct 24, 2023

各ハンドラは HAL_init(), HAL_rx(), HAL_tx(), HAL_reopen() とかかなあ.場所は一旦 src/src_user/settings/component_driver_super/hal_handler.h かな

@sksat
Copy link
Member Author

sksat commented Oct 24, 2023

IF_init とかは実際は関数ポインタの array なので,名前で明示したい(そもそも関数ポインタを集約する構造体を作ってそれの array にすべきではある)

@meltingrabbit
Copy link
Member

handlerだと,EHとかぶるので
hal_handler_registry.h
かなぁ?

@meltingrabbit
Copy link
Member

HAL_init_list
HAL_rx_list

..

でよさそう

@meltingrabbit
Copy link
Member

meltingrabbit commented Oct 24, 2023

extern  int     (*IF_TX[]    )(void* my_if, void* data_v, int data_size);

extern  int     (*HAL_tx_list[]    )(void* config, void* data, int data_size);

rx は data→buffer

@meltingrabbit
Copy link
Member

typedef enum
{
  CCSDS,
  UART,
  IF_LIST_MAX
} IF_LIST_ENUM;

typedef enum
{
  HAL_HANDLER_LIST_CCSDS,
  HAL_HANDLER_LIST_UART,
  HAL_HANDLER_LIST_MAX
} HAL_HANDLER_LIST;

@meltingrabbit
Copy link
Member

typedef enum
{
  IF_REOPEN_TLM_DISRUPTION = 100
} IF_REOPEN_REASON;

typedef enum
{
  HAL_HANDLER_REOPEN_REASON_TLM_DISRUPTION = 100
} HAL_HANDLER_REOPEN_REASON;

@sksat sksat added this to the v4.0.0 milestone Oct 24, 2023
@sksat
Copy link
Member Author

sksat commented Oct 24, 2023

CDS_IF_RX_BUFFER_SIZECDS_HAL_RX_HANDLER_BUFFER_SIZE かな

@meltingrabbit
Copy link
Member

あ~,そこまで手を出すと rx_buffer_size_in_if_rx_ なども変わるので,issueきって後回し,はいかがだろうか?(だいぶ大変になっちゃう)

@meltingrabbit
Copy link
Member

CDS_IF_RX_BUFFER_SIZE , rx_buffer_size_in_if_rx_ だけだからやっちゃうか

@sksat
Copy link
Member Author

sksat commented Oct 24, 2023

そう.これだけだし CDS_IF_RX_BUFFER_SIZE は core でデフォルト設定提供して(例によって undef して)user 側で定義することもあるやつですよね(つまり core -> user のインターフェースですよね).なのでこのタイミングで変えたい.

@meltingrabbit
Copy link
Member

OK

@meltingrabbit
Copy link
Member

meltingrabbit commented Oct 25, 2023

ret_from_if_rx
ret_from_if_tx

if_config → hal_config
CDS_if_rx_buffer_

@meltingrabbit
Copy link
Member

meltingrabbit commented Oct 25, 2023

大文字 IF で grep すると結構出てくるね.コメントが

@meltingrabbit
Copy link
Member

meltingrabbit commented Oct 25, 2023

p_super->interfacep_super->hal_handler とかにします?

struct ComponentDriverSuper
{
  // 【継承先まで公開】
  HAL_HANDLER_LIST hal_handler_id;                             //!< 継承先の機器の使用 IF
  void*            hal_config;                                 //!< IF 設定

@sksat
Copy link
Member Author

sksat commented Oct 25, 2023

if_list に意識が引っ張られてたけど,hal_handlers だな

@github-project-automation github-project-automation bot moved this from In Progress to Done in C2A public Oct 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request invalid This doesn't seem right priority::high priorityg high tools
Projects
Status: Done
2 participants