summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Gevaerts <frank@gevaerts.be>2008-09-22 19:59:00 +0000
committerFrank Gevaerts <frank@gevaerts.be>2008-09-22 19:59:00 +0000
commit0a1d3653bdd016493189e6cc4e318d2a5cdd77a8 (patch)
treebafd159cf178f7754d6c4d65b212ef8ff5cfabb9
parent726a63f309b553fec16de4e856ea71575498e3f4 (diff)
downloadrockbox-0a1d3653bdd016493189e6cc4e318d2a5cdd77a8.tar.gz
rockbox-0a1d3653bdd016493189e6cc4e318d2a5cdd77a8.zip
Add player name and rockbox version to the battery_bench output
This need appsversion in plugin_api git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18569 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/plugin.c2
-rw-r--r--apps/plugin.h1
-rw-r--r--apps/plugins/battery_bench.c13
3 files changed, 14 insertions, 2 deletions
diff --git a/apps/plugin.c b/apps/plugin.c
index aa24b327ca..6ef8623eea 100644
--- a/apps/plugin.c
+++ b/apps/plugin.c
@@ -37,6 +37,7 @@
37#include "logf.h" 37#include "logf.h"
38#include "option_select.h" 38#include "option_select.h"
39#include "talk.h" 39#include "talk.h"
40#include "version.h"
40 41
41#if CONFIG_CHARGING 42#if CONFIG_CHARGING
42#include "power.h" 43#include "power.h"
@@ -616,6 +617,7 @@ static const struct plugin_api rockbox_api = {
616 event_wait, 617 event_wait,
617 event_set_state, 618 event_set_state,
618#endif 619#endif
620 appsversion,
619 /* new stuff at the end, sort into place next time 621 /* new stuff at the end, sort into place next time
620 the API gets incompatible */ 622 the API gets incompatible */
621 623
diff --git a/apps/plugin.h b/apps/plugin.h
index c6d258377f..409108d2d9 100644
--- a/apps/plugin.h
+++ b/apps/plugin.h
@@ -774,6 +774,7 @@ struct plugin_api {
774 void (*event_set_state)(struct event *e, unsigned int state); 774 void (*event_set_state)(struct event *e, unsigned int state);
775#endif 775#endif
776 776
777 const char *appsversion;
777 /* new stuff at the end, sort into place next time 778 /* new stuff at the end, sort into place next time
778 the API gets incompatible */ 779 the API gets incompatible */
779 780
diff --git a/apps/plugins/battery_bench.c b/apps/plugins/battery_bench.c
index 44e7ad7bec..abcd962356 100644
--- a/apps/plugins/battery_bench.c
+++ b/apps/plugins/battery_bench.c
@@ -21,6 +21,7 @@
21 ****************************************************************************/ 21 ****************************************************************************/
22#ifndef SIMULATOR /* not for the simulator */ 22#ifndef SIMULATOR /* not for the simulator */
23 23
24#include "version.h"
24#include "plugin.h" 25#include "plugin.h"
25PLUGIN_HEADER 26PLUGIN_HEADER
26 27
@@ -483,7 +484,12 @@ int main(void)
483 "logging activity will end.\n\n" 484 "logging activity will end.\n\n"
484 "P.S: You can decide how you will make your tests.\n" 485 "P.S: You can decide how you will make your tests.\n"
485 "Just don't open another plugin to be sure that your log " 486 "Just don't open another plugin to be sure that your log "
486 "will continue.\n\n" 487 "will continue.\n\n",BATTERY_LOG);
488 rb->fdprintf(fd,
489 "Battery bench run for %s version %s\n\n"
490 ,MODEL_NAME,rb->appsversion);
491
492 rb->fdprintf(fd,
487 "Battery type: %d mAh Buffer Entries: %d\n" 493 "Battery type: %d mAh Buffer Entries: %d\n"
488 " Time:, Seconds:, Level:, Time Left:, Voltage[mV]:" 494 " Time:, Seconds:, Level:, Time Left:, Voltage[mV]:"
489#if CONFIG_CHARGING 495#if CONFIG_CHARGING
@@ -496,7 +502,7 @@ int main(void)
496 ", U:" 502 ", U:"
497#endif 503#endif
498 "\n" 504 "\n"
499 ,BATTERY_LOG,rb->global_settings->battery_capacity, 505 ,rb->global_settings->battery_capacity,
500 (int)BUF_ELEMENTS); 506 (int)BUF_ELEMENTS);
501 rb->close(fd); 507 rb->close(fd);
502 } 508 }
@@ -511,6 +517,9 @@ int main(void)
511 rb->close(fd); 517 rb->close(fd);
512 fd = rb->open(BATTERY_LOG, O_RDWR | O_APPEND); 518 fd = rb->open(BATTERY_LOG, O_RDWR | O_APPEND);
513 rb->fdprintf(fd, "\n--File already present. Resuming Benchmark--\n"); 519 rb->fdprintf(fd, "\n--File already present. Resuming Benchmark--\n");
520 rb->fdprintf(fd,
521 "Battery bench run for %s version %s\n\n"
522 ,MODEL_NAME,rb->appsversion);
514 rb->close(fd); 523 rb->close(fd);
515 } 524 }
516 525