-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ptt/init reporting #434
Ptt/init reporting #434
Changes from 5 commits
9c5fc99
030c3b8
7686749
7cc03a5
ee78729
c3025cf
16a41c8
b7e4ee6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -129,7 +129,10 @@ void CommManager::param_request_list_callback(uint8_t target_system) | |
if (target_system == sysid_) { send_params_index_ = 0; } | ||
} | ||
|
||
void CommManager::send_parameter_list() { send_params_index_ = 0; } | ||
//void CommManager::send_parameter_list() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as above There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
//{ | ||
// send_params_index_ = 0; | ||
//} | ||
|
||
void CommManager::param_request_read_callback(uint8_t target_system, const char * const param_name, | ||
int16_t param_index) | ||
|
@@ -329,10 +332,15 @@ void CommManager::log(CommLinkInterface::LogSeverity severity, const char * fmt, | |
// Convert the format string to a raw char array | ||
va_list args; | ||
va_start(args, fmt); | ||
char text[LOG_MSG_SIZE]; | ||
vsnprintf(text, LOG_MSG_SIZE, fmt, args); | ||
char message[LOG_MSG_SIZE]; | ||
vsnprintf(message, LOG_MSG_SIZE, fmt, args); | ||
va_end(args); | ||
|
||
log_message(severity, message); | ||
} | ||
|
||
void CommManager::log_message(CommLinkInterface::LogSeverity severity, char * text) | ||
{ | ||
if (initialized_ && connected_) { | ||
comm_link_.send_log_message(sysid_, severity, text); | ||
} else { | ||
|
@@ -361,7 +369,7 @@ void CommManager::send_status(void) | |
comm_link_.send_status( | ||
sysid_, RF_.state_manager_.state().armed, RF_.state_manager_.state().failsafe, | ||
RF_.command_manager_.rc_override_active(), RF_.command_manager_.offboard_control_active(), | ||
RF_.state_manager_.state().error_codes, control_mode, RF_.board_.num_sensor_errors(), | ||
RF_.state_manager_.state().error_codes, control_mode, RF_.board_.sensors_errors_count(), | ||
RF_.get_loop_time_us()); | ||
} | ||
|
||
|
@@ -526,6 +534,23 @@ void CommManager::send_named_value_float(const char * const name, float value) | |
|
||
void CommManager::send_next_param(void) | ||
{ | ||
//PTT Hack | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we figure out a more permanent solution for this before merging these changes into main? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed hack, note initialization status will not be reported, that will require more code and maybe a request from rosflight io There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes we should think of a more permanent solution |
||
//TODO figure out a better place to do this | ||
if (send_params_index_==0) | ||
{ | ||
|
||
// Board initialization status | ||
for(uint16_t i=0; i<RF_.board_.sensors_init_message_count(); i++) | ||
{ | ||
char message[LOG_MSG_SIZE]; // No point in makeing a message larger than this. | ||
if(RF_.board_.sensors_init_message(message,LOG_MSG_SIZE,i) !=0) | ||
{ | ||
CommLinkInterface::LogSeverity severity = CommLinkInterface::LogSeverity::LOG_INFO; | ||
if(!RF_.board_.sensors_init_message_good(i)) { severity = CommLinkInterface::LogSeverity::LOG_ERROR; } | ||
log_message(severity, message); | ||
} | ||
} | ||
} | ||
if (send_params_index_ < PARAMS_COUNT) { | ||
send_param_value(static_cast<uint16_t>(send_params_index_)); | ||
send_params_index_++; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to remove old code than comment it out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done