generated from ut-issl/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d965f25
commit 198b7bd
Showing
9 changed files
with
321 additions
and
59 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
Examples/minimum_user_for_s2e/src/src_user/Settings/TlmCmd/Ccsds/space_packet_params.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/** | ||
* @file | ||
* @brief SpacePacket のユーザー設定 | ||
*/ | ||
#ifndef SPACE_PACKET_PARAMS_H_ | ||
#define SPACE_PACKET_PARAMS_H_ | ||
|
||
#undef SP_TLM_MAX_LEN | ||
#undef SP_CMD_MAX_LEN | ||
|
||
#define SP_TLM_MAX_LEN (432) | ||
#define SP_CMD_MAX_LEN (128) | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma section REPRO | ||
/** | ||
* @file | ||
* @brief CCSDS で規定される Space Packet の コマンド版の実装 | ||
* @brief C ではテンプレートが使えないため,別で定義する | ||
* @note 詳細は space_packet.h を参照 | ||
*/ | ||
|
||
#include "cmd_space_packet.h" | ||
#include "space_packet.h" | ||
|
||
|
||
#pragma section |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/** | ||
* @file | ||
* @brief CCSDS で規定される Space Packet の コマンド版の実装 | ||
* @brief C ではテンプレートが使えないため,別で定義する | ||
* @note 詳細は space_packet.h を参照 | ||
* @note packet 構造 | ||
* |---------+-------+-------+------------------| | ||
* | Pos | Pos | size | name | | ||
* | [octet] | [bit] | [bit] | | | ||
* |---------+-------+-------+------------------| | ||
* | === Primary Header ======================= | | ||
* |---------+-------+-------+------------------| | ||
* | 0 | 0 | 3 | Version No | | ||
* | 0 | 3 | 1 | Packet Type | | ||
* | 0 | 4 | 1 | Sec. HDR Flag | | ||
* | 0 | 5 | 11 | APID | | ||
* | 2 | 0 | 2 | Sequence Flags | | ||
* | 2 | 2 | 14 | Sequence Count | | ||
* | 4 | 0 | 16 | Packet Data Len | | ||
* |---------+-------+-------+------------------| | ||
* | === Secondary Header ===================== | | ||
* |---------+-------+-------+------------------| | ||
* | 6 | 0 | 8 | Format ID | // TODO: これ,必要? 今後, Tlm と同様に, Version No にしたい? | ||
* | 7 | 0 | 8 | Cmd Type | | ||
* | 8 | 0 | 16 | Cmd ID | | ||
* | 10 | 0 | 8 | Execution Type | | ||
* | 11 | 0 | 32 | Time Indicator | | ||
* |---------+-------+-------+------------------| | ||
* | === User Data Field ====================== | | ||
* |---------+-------+-------+------------------| | ||
* | 15 | 0 | * | Cmd Param #0 | | ||
* | * | 0 | * | Cmd Param #1 | | ||
* | * | 0 | * | Cmd Param #2 | | ||
* | * | 0 | * | ... | | ||
* |---------+-------+-------+------------------| | ||
*/ | ||
#ifndef CMD_SPACE_PACKET_H_ | ||
#define CMD_SPACE_PACKET_H_ | ||
|
||
// FIXME: 拡張性の高いように, Secondary Heaer の定義などを直していく | ||
// https://github.com/ut-issl/c2a-core/issues/155 | ||
|
||
#include <src_user/Library/stdint.h> | ||
|
||
#define SP_CMD_MAX_LEN (128) //!< CmdSpacePacket の最大パケット長.値は適当においている | ||
|
||
// SP_CMD_MAX_LEN を再定義 | ||
#include <src_user/Settings/TlmCmd/Ccsds/space_packet_params.h> | ||
// ここで APID を定義する | ||
// 詳細は common_tlm_cmd_packet.h を参照 | ||
#include <src_user/Settings/TlmCmd/Ccsds/apid_define.h> | ||
|
||
// TODO: 上に持ってきて,コンパイルが通らないことを確認する!!!!!!!!!!!!!!!!!! | ||
// space_packet.h と相互 include になってしまっているので,最後のここで include する | ||
#include "space_packet.h" | ||
|
||
#if SP_CMD_MAX_LEN <= SP_PRM_HDR_LEN | ||
#error SP_CMD_MAX_LEN is too small | ||
#endif | ||
|
||
|
||
/** | ||
* @struct CmdSpacePacket | ||
* @brief Space Packet (コマンド用) | ||
* @note C ではテンプレートが使えないため,別で定義する | ||
* https://github.com/ut-issl/c2a-core/issues/204 | ||
*/ | ||
typedef struct | ||
{ | ||
uint8_t packet[SP_CMD_MAX_LEN]; | ||
} CmdSpacePacket; | ||
|
||
|
||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#pragma section REPRO | ||
/** | ||
* @file | ||
* @brief CCSDS で規定される Space Packet の テレメ版の実装 | ||
* @brief C ではテンプレートが使えないため,別で定義する | ||
* @note 詳細は space_packet.h を参照 | ||
*/ | ||
|
||
#include "tlm_space_packet.h" | ||
#include "space_packet.h" | ||
|
||
|
||
#pragma section |
Oops, something went wrong.