... compiled!
This commit is contained in:
@@ -651,13 +651,13 @@ protected:
|
||||
}
|
||||
|
||||
|
||||
std::vector<char> handleClientCommand(std::string_view command)
|
||||
{
|
||||
std::vector<char> resp{MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR.begin(),
|
||||
MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR.end()};
|
||||
// std::vector<char> handleClientCommand(std::string_view command)
|
||||
// {
|
||||
// std::vector<char> resp{MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR.begin(),
|
||||
// MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR.end()};
|
||||
|
||||
return resp;
|
||||
}
|
||||
// return resp;
|
||||
// }
|
||||
|
||||
|
||||
template <mcc::traits::mcc_time_duration_c RCVT = decltype(DEFAULT_RCV_TIMEOUT),
|
||||
@@ -917,7 +917,7 @@ public:
|
||||
output_msg = handleMessage<output_msg_t>(input_msg, mount_ptr);
|
||||
}
|
||||
|
||||
return output_msg.byteRepr();
|
||||
return output_msg.template byteRepr<typename base_t::handle_message_func_result_t>();
|
||||
};
|
||||
}
|
||||
|
||||
@@ -951,9 +951,6 @@ protected:
|
||||
} else if (input_msg.withKey(MCC_COMMPROTO_KEYWORD_RESTART_SERVER_STR)) {
|
||||
this->restart();
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, input_msg.byteRepr());
|
||||
} else if (input_msg.withKey(MCC_COMMPROTO_KEYWORD_STATUS_STR)) {
|
||||
auto st = mount_ptr->status(); // according to mcc_generic_mount_c 'st' is formattable
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, MCC_COMMPROTO_KEYWORD_STATUS_STR, st);
|
||||
} else if (input_msg.withKey(MCC_COMMPROTO_KEYWORD_INIT_STR)) {
|
||||
m_err = mount_ptr->initMount();
|
||||
if (m_err) {
|
||||
@@ -1066,6 +1063,16 @@ protected:
|
||||
_coordFormat, _coordPrec, cp);
|
||||
}
|
||||
}
|
||||
} else if (input_msg.withKey(mcc::network::MCC_COMMPROTO_KEYWORD_STATUS_STR)) {
|
||||
auto st = mount_ptr->mountStatus(); // according to mcc_generic_mount_c 'st' is formattable
|
||||
using st_t = decltype(st);
|
||||
if constexpr (std::is_enum_v<st_t>) {
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, MCC_COMMPROTO_KEYWORD_STATUS_STR,
|
||||
std::to_underlying(st));
|
||||
} else {
|
||||
output_msg.construct(MCC_COMMPROTO_KEYWORD_SERVER_ACK_STR, MCC_COMMPROTO_KEYWORD_STATUS_STR,
|
||||
std::format(st));
|
||||
}
|
||||
} else {
|
||||
err = std::make_error_code(std::errc::invalid_argument);
|
||||
}
|
||||
@@ -1084,7 +1091,12 @@ protected:
|
||||
{
|
||||
auto ec = msg.fromCharRange(msg_bytes);
|
||||
|
||||
return ec;
|
||||
if (ec != MSG_T::ERROR_OK) {
|
||||
return std::make_error_code(std::errc::invalid_argument);
|
||||
}
|
||||
// return ec;
|
||||
|
||||
return {};
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user