Skip to content

Commit ac60378

Browse files
committed
Fixed minor bugs
-- Fixed type_id code accessor for Module class returning uint8, instead of uint16 -- Removed unnecessary Kernel error codes (and revised status code numbers)
1 parent 4c6ac0d commit ac60378

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

src/kernel.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,17 @@ class Kernel
7777
*/
7878
enum class kKernelStatusCodes : uint8_t
7979
{
80-
kStandBy = 0, ///< Currently not used. Statically reserves 0 to NOT be a valid code.
81-
kSetupComplete = 1, ///< Setup() method runtime succeeded.
82-
kModuleSetupError = 2, ///< Setup() method runtime failed due to a module setup error.
83-
kReceptionError = 3, ///< Encountered a communication error when receiving the data from PC.
84-
kTransmissionError = 4, ///< Encountered a communication error when sending the data to PC.
85-
kServiceSendingError = 5, ///< Error sending a service message to the connected system.
86-
kInvalidMessageProtocol = 6, ///< Received message uses an unsupported (unknown) protocol.
87-
kKernelParametersSet = 7, ///< Received and applied the parameters addressed to the Kernel class.
88-
kModuleParametersSet = 8, ///< Received and applied the parameters addressed to a managed Module class.
89-
kModuleParametersError = 9, ///< Unable to apply the received Module parameters.
90-
kCommandNotRecognized = 10, ///< The Kernel has received an unknown command.
91-
kTargetModuleNotFound = 11 ///< No module with the requested type and id combination is found.
80+
kStandBy = 0, ///< Currently not used. Statically reserves 0 to NOT be a valid code.
81+
kSetupComplete = 1, ///< Setup() method runtime succeeded.
82+
kModuleSetupError = 2, ///< Setup() method runtime failed due to a module setup error.
83+
kReceptionError = 3, ///< Encountered a communication error when receiving the data from PC.
84+
kTransmissionError = 4, ///< Encountered a communication error when sending the data to PC.
85+
kInvalidMessageProtocol = 5, ///< Received message uses an unsupported (unknown) protocol.
86+
kKernelParametersSet = 6, ///< Received and applied the parameters addressed to the Kernel class.
87+
kModuleParametersSet = 7, ///< Received and applied the parameters addressed to a managed Module class.
88+
kModuleParametersError = 8, ///< Unable to apply the received Module parameters.
89+
kCommandNotRecognized = 9, ///< The Kernel has received an unknown command.
90+
kTargetModuleNotFound = 10 ///< No module with the requested type and id combination is found.
9291
};
9392

9493
/**
@@ -551,7 +550,7 @@ class Kernel
551550
// Otherwise, attempts sending a communication error to the PC and activates the LED indicator.
552551
_communication.SendCommunicationErrorMessage(
553552
kernel_command,
554-
static_cast<uint8_t>(kKernelStatusCodes::kServiceSendingError)
553+
static_cast<uint8_t>(kKernelStatusCodes::kTransmissionError)
555554
);
556555
}
557556

@@ -572,7 +571,7 @@ class Kernel
572571
// ending the runtime.
573572
_communication.SendCommunicationErrorMessage(
574573
kernel_command,
575-
static_cast<uint8_t>(kKernelStatusCodes::kServiceSendingError)
574+
static_cast<uint8_t>(kKernelStatusCodes::kTransmissionError)
576575
);
577576
}
578577
}
@@ -591,7 +590,7 @@ class Kernel
591590
// Otherwise, attempts sending a communication error to the PC and activates the LED indicator.
592591
_communication.SendCommunicationErrorMessage(
593592
kernel_command,
594-
static_cast<uint8_t>(kKernelStatusCodes::kServiceSendingError)
593+
static_cast<uint8_t>(kKernelStatusCodes::kTransmissionError)
595594
);
596595
}
597596

src/module.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class Module
305305
* @brief Returns the combined type and id value of the Module instance.
306306
*/
307307
[[nodiscard]]
308-
uint8_t GetModuleTypeID() const
308+
uint16_t GetModuleTypeID() const
309309
{
310310
return _module_type_id;
311311
}
@@ -855,7 +855,7 @@ class Module
855855
template <typename ObjectType>
856856
bool ExtractParameters(ObjectType& storage_object)
857857
{
858-
return _communication.ExtractModuleParameters(storage_object);
858+
return _communication.ExtractModuleParameters(storage_object);
859859
}
860860
};
861861

0 commit comments

Comments
 (0)