-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #219 from arkedge/faeture/ccsds_settings
CCSDS data link layer における SCID をユーザー設定として切り出す
- Loading branch information
Showing
12 changed files
with
138 additions
and
39 deletions.
There are no files selected for viewing
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
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
19 changes: 19 additions & 0 deletions
19
examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.c
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,19 @@ | ||
#pragma section REPRO | ||
/** | ||
* @file | ||
* @brief AOS Transfer Frame のユーザー定義 | ||
*/ | ||
#include "aos_transfer_frame_define.h" | ||
|
||
AOSTF_SCID AOSTF_get_scid_from_uint8(uint8_t scid) | ||
{ | ||
switch ((AOSTF_SCID)scid) | ||
{ | ||
case AOSTF_SCID_SAMPLE_SATELLITE: | ||
return (AOSTF_SCID)scid; | ||
default: | ||
return AOSTF_SCID_UNKNOWN; | ||
} | ||
} | ||
|
||
#pragma section |
32 changes: 32 additions & 0 deletions
32
examples/mobc/src/src_user/settings/tlm_cmd/ccsds/aos_transfer_frame_define.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,32 @@ | ||
/** | ||
* @file | ||
* @brief AOS Transfer Frame のユーザー定義 | ||
* @note aos_transfer_frame.h などから include されることを前提 | ||
*/ | ||
#ifndef AOS_TRANSFER_FRAME_DEFINE_H_ | ||
#define AOS_TRANSFER_FRAME_DEFINE_H_ | ||
|
||
#include <stdint.h> | ||
|
||
/** | ||
* @enum AOSTF_SCID | ||
* @brief Spacecraft ID | ||
* @note 8 bit | ||
*/ | ||
typedef enum | ||
{ | ||
AOSTF_SCID_SAMPLE_SATELLITE = 0x00, | ||
AOSTF_SCID_UNKNOWN | ||
} AOSTF_SCID; | ||
|
||
#define AOSTF_SCID_MY_ID (AOSTF_SCID_SAMPLE_SATELLITE) //!< 自分の SCID | ||
|
||
/** | ||
* @brief バイト列から AOSTF_SCID を取得 | ||
* @param scid: AOSTF_SCID 候補の uint8_t | ||
* @note 不正な入力のときは AOSTF_SCID_UNKNOWN を返す | ||
* @return AOSTF_SCID | ||
*/ | ||
AOSTF_SCID AOSTF_get_scid_from_uint8(uint8_t scid); | ||
|
||
#endif |
19 changes: 19 additions & 0 deletions
19
examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.c
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,19 @@ | ||
#pragma section REPRO | ||
/** | ||
* @file | ||
* @brief TC Transfer Frame のユーザー定義 | ||
*/ | ||
#include "tc_transfer_frame_define.h" | ||
|
||
TCTF_SCID TCTF_get_scid_from_uint16(uint16_t scid) | ||
{ | ||
switch ((TCTF_SCID)scid) | ||
{ | ||
case TCTF_SCID_SAMPLE_SATELLITE: | ||
return (TCTF_SCID)scid; | ||
default: | ||
return TCTF_SCID_UNKNOWN; | ||
} | ||
} | ||
|
||
#pragma section |
32 changes: 32 additions & 0 deletions
32
examples/mobc/src/src_user/settings/tlm_cmd/ccsds/tc_transfer_frame_define.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,32 @@ | ||
/** | ||
* @file | ||
* @brief TC Transfer Frame のユーザー定義 | ||
* @note tc_transfer_frame.h などから include されることを前提 | ||
*/ | ||
#ifndef TC_TRANSFER_FRAME_DEFINE_H_ | ||
#define TC_TRANSFER_FRAME_DEFINE_H_ | ||
|
||
#include <stdint.h> | ||
|
||
/** | ||
* @enum TCTF_SCID | ||
* @brief Spacecraft ID | ||
* @note 10 bit | ||
*/ | ||
typedef enum | ||
{ | ||
TCTF_SCID_SAMPLE_SATELLITE = 0x157, // SCID for command of sample satellite | ||
TCTF_SCID_UNKNOWN | ||
} TCTF_SCID; | ||
|
||
#define TCTD_SCID_MY_ID (TCTF_SCID_SAMPLE_SATELLITE) //!< 自分の SCID | ||
|
||
/** | ||
* @brief バイト列から TCTF_SCID を取得 | ||
* @param scid: TCTF_SCID 候補の uint16_t | ||
* @note 不正な入力のときは TCTF_SCID_UNKNOWN を返す | ||
* @return TCTF_SCID | ||
*/ | ||
TCTF_SCID TCTF_get_scid_from_uint16(uint16_t scid); | ||
|
||
#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
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