summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Nicholson <mike.nicholson@multitech.com>2020-08-28 16:53:23 -0500
committerMike Nicholson <mike.nicholson@multitech.com>2020-08-28 16:53:23 -0500
commita516824061c30d5029d94a08f438ea23b7c5ca0e (patch)
tree1e31a8cffa4dece145a90c4ea7b89497e77a0baa
parentbf15aaa42522efb214c57e82767597c53f720ef5 (diff)
downloadmts-id-eeprom-a516824061c30d5029d94a08f438ea23b7c5ca0e.tar.gz
mts-id-eeprom-a516824061c30d5029d94a08f438ea23b7c5ca0e.tar.bz2
mts-id-eeprom-a516824061c30d5029d94a08f438ea23b7c5ca0e.zip
Add supercap capability
-rw-r--r--src/eeprom_main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/eeprom_main.c b/src/eeprom_main.c
index 3204c33..b5fef52 100644
--- a/src/eeprom_main.c
+++ b/src/eeprom_main.c
@@ -167,6 +167,7 @@ static int id_yaml_out(const char *name, struct mts_id_eeprom_layout *id_eeprom)
fprintf(file, "capa-bluetooth: %s\n", DEVICE_CAPA(id_eeprom->capa, CAPA_BLUETOOTH) ? "true" : "false");
fprintf(file, "capa-lora: %s\n", DEVICE_CAPA(id_eeprom->capa, CAPA_LORA) ? "true" : "false");
fprintf(file, "capa-battery: %s\n", DEVICE_CAPA(id_eeprom->capa, CAPA_BATTERY) ? "true" : "false");
+ fprintf(file, "capa-supercap: %s\n", DEVICE_CAPA(id_eeprom->capa, CAPA_SUPERCAP) ? "true" : "false");
fprintf(file, "capa: \"");
@@ -375,7 +376,7 @@ static void mts_id_eeprom_inspect(struct mts_id_eeprom_layout *id_eeprom)
log_info("capa-wifi: %s", DEVICE_CAPA(id_eeprom->capa, CAPA_WIFI) ? "yes" : "no");
log_info("capa-bluetooth: %s", DEVICE_CAPA(id_eeprom->capa, CAPA_BLUETOOTH) ? "yes" : "no");
log_info("capa-lora: %s", DEVICE_CAPA(id_eeprom->capa, CAPA_LORA) ? "yes" : "no");
- log_info("capa-battery: %s", DEVICE_CAPA(id_eeprom->capa, CAPA_BATTERY) ? "yes" : "no");
+ log_info("capa-supercap: %s", DEVICE_CAPA(id_eeprom->capa, CAPA_SUPERCAP) ? "yes" : "no");
log_info("mac-bluetooth: %02X:%02X:%02X:%02X:%02X:%02X",
id_eeprom->mac_bluetooth[0],
@@ -516,6 +517,7 @@ static void usage(FILE *out) {
fprintf(out, " --capa-bluetooth |\n");
fprintf(out, " --capa-lora |\n");
fprintf(out, " --capa-battery |\n");
+ fprintf(out, " --capa-supercap |\n");
fprintf(out, " --capa-clear (clears all flags) |\n");
fprintf(out, " --hex-to-bin | \n");
fprintf(out, " --out-format { bin | yaml (default) } |\n");
@@ -552,6 +554,7 @@ enum {
CMD_OPT_CAPA_BLUETOOTH,
CMD_OPT_CAPA_LORA,
CMD_OPT_CAPA_BATTERY,
+ CMD_OPT_CAPA_SUPERCAP,
CMD_OPT_CAPA_CLEAR,
CMD_OPT_OUT_FORMAT,
CMD_OPT_UPDATE,
@@ -589,6 +592,7 @@ static struct option long_options[] = {
{"capa-bluetooth", 0, NULL, CMD_OPT_CAPA_BLUETOOTH},
{"capa-lora", 0, NULL, CMD_OPT_CAPA_LORA},
{"capa-battery", 0, NULL, CMD_OPT_CAPA_BATTERY},
+ {"capa-supercap", 0, NULL, CMD_OPT_CAPA_SUPERCAP},
{"capa-clear", 0, NULL, CMD_OPT_CAPA_CLEAR},
{"hex-to-bin", 0, NULL, CMD_OPT_HEX_TO_BIN},
{"out-format", 1, NULL, CMD_OPT_OUT_FORMAT},
@@ -897,6 +901,10 @@ int main(int argc, char *argv[]) {
case CMD_OPT_CAPA_BATTERY:
DEVICE_CAPA_SET(id_eeprom.capa, CAPA_BATTERY);
break;
+
+ case CMD_OPT_CAPA_SUPERCAP:
+ DEVICE_CAPA_SET(id_eeprom.capa, CAPA_SUPERCAP);
+ break;
case CMD_OPT_CAPA_CLEAR:
memset(id_eeprom.capa, 0, sizeof(id_eeprom.capa));