a lot of bugfixes
This commit is contained in:
@ -2,6 +2,7 @@ use lazy_static::lazy_static;
|
||||
use num_enum::{IntoPrimitive, TryFromPrimitive};
|
||||
use once_cell::sync::OnceCell;
|
||||
use satrs::events::{EventU32TypedSev, SeverityInfo};
|
||||
use satrs::res_code::ResultU16;
|
||||
use satrs::spacepackets::PacketId;
|
||||
use satrs_mib::res_code::ResultU16Info;
|
||||
use satrs_mib::resultcode;
|
||||
@ -40,11 +41,13 @@ pub enum CustomPusServiceId {
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum GroupId {
|
||||
Tmtc = 0,
|
||||
Hk = 1,
|
||||
Mode = 2,
|
||||
Action = 3,
|
||||
Controller = 4,
|
||||
Generic = 0,
|
||||
Tmtc = 1,
|
||||
Hk = 2,
|
||||
Mode = 3,
|
||||
Action = 4,
|
||||
Controller = 5,
|
||||
Camera = 6,
|
||||
}
|
||||
|
||||
pub const TEST_EVENT: EventU32TypedSev<SeverityInfo> =
|
||||
@ -187,9 +190,11 @@ pub mod cfg_file {
|
||||
}
|
||||
}
|
||||
|
||||
#[resultcode]
|
||||
pub const GENERIC_FAILED: ResultU16 = ResultU16::new(GroupId::Generic as u8, 1);
|
||||
|
||||
pub mod tmtc_err {
|
||||
use super::*;
|
||||
use satrs::res_code::ResultU16;
|
||||
|
||||
#[resultcode]
|
||||
pub const INVALID_PUS_SERVICE: ResultU16 = ResultU16::new(GroupId::Tmtc as u8, 0);
|
||||
@ -225,7 +230,6 @@ pub mod tmtc_err {
|
||||
|
||||
pub mod action_err {
|
||||
use super::*;
|
||||
use satrs::res_code::ResultU16;
|
||||
|
||||
#[resultcode]
|
||||
pub const INVALID_ACTION_ID: ResultU16 = ResultU16::new(GroupId::Action as u8, 0);
|
||||
@ -235,7 +239,6 @@ pub mod action_err {
|
||||
|
||||
pub mod hk_err {
|
||||
use super::*;
|
||||
use satrs::res_code::ResultU16;
|
||||
|
||||
#[resultcode]
|
||||
pub const TARGET_ID_MISSING: ResultU16 = ResultU16::new(GroupId::Hk as u8, 0);
|
||||
@ -256,7 +259,6 @@ pub mod hk_err {
|
||||
|
||||
pub mod mode_err {
|
||||
use super::*;
|
||||
use satrs::res_code::ResultU16;
|
||||
|
||||
#[resultcode]
|
||||
pub const WRONG_MODE: ResultU16 = ResultU16::new(GroupId::Mode as u8, 0);
|
||||
@ -264,7 +266,6 @@ pub mod mode_err {
|
||||
|
||||
pub mod ctrl_err {
|
||||
use super::*;
|
||||
use satrs::res_code::ResultU16;
|
||||
|
||||
#[resultcode]
|
||||
pub const INVALID_CMD_FORMAT: ResultU16 = ResultU16::new(GroupId::Controller as u8, 0);
|
||||
@ -290,6 +291,35 @@ pub mod ctrl_err {
|
||||
];
|
||||
}
|
||||
|
||||
pub mod cam_error {
|
||||
use super::*;
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Debug, Error)]
|
||||
pub enum CameraError {
|
||||
#[error("Error taking image: {0}")]
|
||||
TakeImageError(String),
|
||||
#[error("error listing image files: {0}")]
|
||||
ListFileError(String),
|
||||
#[error("IO error: {0}")]
|
||||
IoError(#[from] std::io::Error),
|
||||
}
|
||||
|
||||
#[resultcode]
|
||||
pub const TAKE_IMAGE_ERROR: ResultU16 = ResultU16::new(GroupId::Camera as u8, 0);
|
||||
#[resultcode]
|
||||
pub const NO_DATA: ResultU16 = ResultU16::new(GroupId::Camera as u8, 1);
|
||||
#[resultcode]
|
||||
pub const ACTION_REQ_VARIANT_NOT_IMPL: ResultU16 = ResultU16::new(GroupId::Camera as u8, 2);
|
||||
#[resultcode]
|
||||
pub const DESERIALIZE_ERROR: ResultU16 = ResultU16::new(GroupId::Camera as u8, 3);
|
||||
// TODO: Probably could be in a dedicated modules for these returnvalues.
|
||||
#[resultcode]
|
||||
pub const LIST_FILE_ERROR: ResultU16 = ResultU16::new(GroupId::Camera as u8, 4);
|
||||
#[resultcode]
|
||||
pub const IO_ERROR: ResultU16 = ResultU16::new(GroupId::Camera as u8, 5);
|
||||
}
|
||||
|
||||
pub mod pool {
|
||||
use satrs::pool::{StaticMemoryPool, StaticPoolConfig};
|
||||
|
||||
|
Reference in New Issue
Block a user