summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolodymyr Vorobiov <volodymyr.vorobiov@globallogic.com>2020-11-23 13:55:11 +0200
committerJohn Klug <john.klug@multitech.com>2020-11-23 09:52:11 -0600
commitbe3801e3be202ed02d1e84e8cb8def5c016468cb (patch)
tree74424c620a680d89c06de7ff004b0a10434b9951
parent10f8b9c9ce6e4d06341bed6b694fa4d2cb82e224 (diff)
downloadmts-id-eeprom-be3801e3be202ed02d1e84e8cb8def5c016468cb.tar.gz
mts-id-eeprom-be3801e3be202ed02d1e84e8cb8def5c016468cb.tar.bz2
mts-id-eeprom-be3801e3be202ed02d1e84e8cb8def5c016468cb.zip
[MTX-3702] Conduit 300: fix delimeter
-rw-r--r--src/eeprom_main.c49
1 files changed, 23 insertions, 26 deletions
diff --git a/src/eeprom_main.c b/src/eeprom_main.c
index a51aaa9..d8a81e8 100644
--- a/src/eeprom_main.c
+++ b/src/eeprom_main.c
@@ -319,13 +319,13 @@ static int mtcdt3b_yaml_out(const char *name, struct mtcdt3b_eeprom_layout *mtcd
fprintf(file, "capa-eth-switch: %s\n", DEVICE_CAPA(mtcdt3b_eeprom->capa, MTCDT3B_CAPA_ETH_SWITCH) ? "true" : "false");
fprintf(file, "hw-version-eth-switch: %hu\n", mtcdt3b_eeprom->hw_version_eth_switch);
fprintf(file, "mac-eth-switch: \"%02X:%02X:%02X:%02X:%02X:%02X\"\n",
- mtcdt3b_eeprom->mac_eth_switch[0],
- mtcdt3b_eeprom->mac_eth_switch[1],
- mtcdt3b_eeprom->mac_eth_switch[2],
- mtcdt3b_eeprom->mac_eth_switch[3],
- mtcdt3b_eeprom->mac_eth_switch[4],
- mtcdt3b_eeprom->mac_eth_switch[5]);
- fprintf(file, "...\n");
+ mtcdt3b_eeprom->mac_eth_switch[0],
+ mtcdt3b_eeprom->mac_eth_switch[1],
+ mtcdt3b_eeprom->mac_eth_switch[2],
+ mtcdt3b_eeprom->mac_eth_switch[3],
+ mtcdt3b_eeprom->mac_eth_switch[4],
+ mtcdt3b_eeprom->mac_eth_switch[5]);
+ fprintf(file, "...\n");
fclose(file);
@@ -497,8 +497,8 @@ static void mtcdt3b_eeprom_inspect(struct mtcdt3b_eeprom_layout *mtcdt3b_eeprom)
log_info("capa-eth-switch: %s", DEVICE_CAPA(mtcdt3b_eeprom->capa, MTCDT3B_CAPA_ETH_SWITCH) ? "yes" : "no");
log_info("hw-version-eth-switch: %hu", mtcdt3b_eeprom->hw_version_eth_switch);
log_info("mac-eth-switch: \"%02X:%02X:%02X:%02X:%02X:%02X\"",
- mtcdt3b_eeprom->mac_eth_switch[0],
- mtcdt3b_eeprom->mac_eth_switch[1],
+ mtcdt3b_eeprom->mac_eth_switch[0],
+ mtcdt3b_eeprom->mac_eth_switch[1],
mtcdt3b_eeprom->mac_eth_switch[2],
mtcdt3b_eeprom->mac_eth_switch[3],
mtcdt3b_eeprom->mac_eth_switch[4],
@@ -549,11 +549,11 @@ static void usage(FILE *out) {
fprintf(out, " --update |\n");
fprintf(out, " --accessory-card\n");
#ifdef MTCDT3B
- fprintf(out, " --base-board\n");
- fprintf(out, " --slot i=0,device-id=<device-id>,lora-eui=<EUI-64>,i=1,...\n");
- fprintf(out, " --capa-eth-switch \n");
- fprintf(out, " --eth-switch-version <switch-version> \n");
- fprintf(out, " --eth-switch-mac-addr <switch-mac-addr> \n");
+ fprintf(out, " --base-board\n");
+ fprintf(out, " --slot i=0,device-id=<device-id>,lora-eui=<EUI-64>,i=1,...\n");
+ fprintf(out, " --capa-eth-switch \n");
+ fprintf(out, " --eth-switch-version <switch-version> \n");
+ fprintf(out, " --eth-switch-mac-addr <switch-mac-addr> \n");
#endif
fprintf(out, " }\n");
fprintf(out, "\n");
@@ -978,26 +978,24 @@ int main(int argc, char *argv[]) {
case CMD_OPT_CAPA_ETH_SWITCH:
if (base_board) {
DEVICE_CAPA_SET(mtcdt3b_eeprom.capa, MTCDT3B_CAPA_ETH_SWITCH);
- break;
}
- break;
+ break;
case CMD_OPT_ETH_SWITCH_VERSION:
if (base_board) {
uint16_t u16;
if (sscanf(optarg, "%hu", &u16) != 1) {
- log_error("invalid eth-switch-version %s", optarg);
- usage(stderr);
- exit(1);
+ log_error("invalid eth-switch-version %s", optarg);
+ usage(stderr);
+ exit(1);
}
if (u16 < ETH_SWITCH_MIN || u16 >= ETH_SWITCH_MAX) {
- log_error("invalid eth-switch-version %s", optarg);
- usage(stderr);
- exit(1);
+ log_error("invalid eth-switch-version %s", optarg);
+ usage(stderr);
+ exit(1);
}
mtcdt3b_eeprom.hw_version_eth_switch = u16;
- break;
}
- break;
+ break;
case CMD_OPT_ETH_SWITCH_MAC_ADDR:
if (base_board) {
tmp = hwaddr_aton(optarg, mtcdt3b_eeprom.mac_eth_switch, sizeof(mtcdt3b_eeprom.mac_eth_switch));
@@ -1006,9 +1004,8 @@ int main(int argc, char *argv[]) {
usage(stderr);
exit(1);
}
- break;
}
- break;
+ break;
#endif
default:
usage(stderr);