Major update of ThingSet Data Object structure for v0.5

The structure has been changed to match the new ThingSet v0.5 spec which
is more suitable to be used in mobile phone apps because the data is
structured based on logical subsystems (Battery, Load) and not on data type
(conf, input, etc.) anymore.

This required some updates in the ThingSet library aswell. Especially the
update mechanism for configuration data had to be changed.

The data_objects_parser script is now able to extract the units itself,
reducing the commenting effort.

All IDs have been kept the same, so previously stored settings in charge
controllers NVM should be compatible.
This commit is contained in:
Martin Jäger
2022-02-10 17:40:29 +01:00
parent 0087114020
commit 0d07bcf055
8 changed files with 802 additions and 869 deletions
+6 -1
View File
@@ -39,7 +39,7 @@ static struct k_sem rx_buf_mutex; // binary semaphore used as mutex in ISR conte
extern ThingSet ts;
const char serial_subset_path[] = "serial";
const char serial_subset_path[] = "mSerial";
static ThingSetDataObject *serial_subset;
void serial_pub_msg()
@@ -65,6 +65,11 @@ void serial_process_command()
uart_poll_out(uart_dev, tx_buf[i]);
}
uart_poll_out(uart_dev, '\n');
if (ts.check_updated(SUBSET_NVM, true)) {
// ToDo: This could take a few milliseconds, better offload from ISR context
data_objects_update_conf();
}
}
// release buffer and start waiting for new commands