changeset 813:37b38b1a1136

fc-fsio write-bsim-config implemented
author Mychaela Falconia <falcon@freecalypso.org>
date Thu, 13 May 2021 05:11:36 +0000
parents d1fce6d9bfa4
children 214d4c1c7387
files rvinterf/etmsync/fscmdtab.c rvinterf/etmsync/fsnew.c
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rvinterf/etmsync/fscmdtab.c	Mon May 10 01:13:07 2021 +0000
+++ b/rvinterf/etmsync/fscmdtab.c	Thu May 13 05:11:36 2021 +0000
@@ -36,6 +36,7 @@
 extern int cmd_upload_subtree();
 extern int cmd_write_battery_table_v1();
 extern int cmd_write_battery_table_v2();
+extern int cmd_write_bsim_config();
 extern int cmd_write_charging_config();
 
 extern int create_std_dirs();
@@ -80,6 +81,7 @@
 	{"upload-subtree", 2, 2, cmd_upload_subtree},
 	{"write-battery-table-v1", 1, 1, cmd_write_battery_table_v1},
 	{"write-battery-table-v2", 1, 1, cmd_write_battery_table_v2},
+	{"write-bsim-config", 2, 2, cmd_write_bsim_config},
 	{"write-charging-config", 1, 1, cmd_write_charging_config},
 	{0, 0, 0, 0}
 };
--- a/rvinterf/etmsync/fsnew.c	Mon May 10 01:13:07 2021 +0000
+++ b/rvinterf/etmsync/fsnew.c	Thu May 13 05:11:36 2021 +0000
@@ -74,3 +74,16 @@
 	return upload_fc_table_from_ascii(argv[1], charging_compile_tool,
 					  "/etc/charging");
 }
+
+cmd_write_bsim_config(argc, argv)
+	char **argv;
+{
+	static char filename[] = "/etc/batterysim";
+	u_char bytes[4];
+
+	bytes[0] = strtoul(argv[1], 0, 0);
+	bytes[1] = strtoul(argv[2], 0, 0);
+	bytes[2] = 0;	/* RFU */
+	bytes[3] = 0;	/* RFU */
+	return do_short_fwrite(filename, bytes, 4);
+}