summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Bayer <bbayer@multitech.com>2016-11-01 11:50:38 -0500
committerBrandon Bayer <bbayer@multitech.com>2016-11-01 11:50:38 -0500
commitc079205f0973d01b236cfe70db9c3eb33d32dde4 (patch)
tree45d9ef97a8d16e5946cad6e5c5b944c7f5a6d543
parent491dd23b232b61eb00d833edcd08c0101f3c978b (diff)
downloadmts-id-eeprom-0.2.8.tar.gz
mts-id-eeprom-0.2.8.tar.bz2
mts-id-eeprom-0.2.8.zip
feat: add lora-eui0.2.8
-rw-r--r--configure.in2
-rw-r--r--src/eeprom_main.c30
2 files changed, 26 insertions, 6 deletions
diff --git a/configure.in b/configure.in
index 8e3e1dd..1b58026 100644
--- a/configure.in
+++ b/configure.in
@@ -1,5 +1,5 @@
AC_INIT([src/eeprom_main.c])
-AM_INIT_AUTOMAKE([mts-id-eeprom], [0.2.7])
+AM_INIT_AUTOMAKE([mts-id-eeprom], [0.2.8])
AM_CONFIG_HEADER([config.h])
AC_PROG_CC
diff --git a/src/eeprom_main.c b/src/eeprom_main.c
index 2f7a819..ad81734 100644
--- a/src/eeprom_main.c
+++ b/src/eeprom_main.c
@@ -189,6 +189,17 @@ static int id_yaml_out(const char *name, struct mts_id_eeprom_layout *id_eeprom)
ptr += sprintf(ptr, "%02X", id_eeprom->uuid[i]);
}
fprintf(file, "uuid: \"%s\"\n", (char*)buf);
+
+ fprintf(file, "lora-eui: \"%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\"\n",
+ id_eeprom->lora_eui[0],
+ id_eeprom->lora_eui[1],
+ id_eeprom->lora_eui[2],
+ id_eeprom->lora_eui[3],
+ id_eeprom->lora_eui[4],
+ id_eeprom->lora_eui[5],
+ id_eeprom->lora_eui[6],
+ id_eeprom->lora_eui[7]);
+
fprintf(file, "...\n");
fclose(file);
@@ -317,6 +328,16 @@ static void mts_id_eeprom_inspect(struct mts_id_eeprom_layout *id_eeprom)
ptr += sprintf(ptr, "%02X", id_eeprom->uuid[i]);
}
log_info("uuid: %s", (char*)buf);
+
+ log_info("lora-eui: \"%02X:%02X:%02X:%02X:%02X:%02X:%02X:%02X\"\n",
+ id_eeprom->lora_eui[0],
+ id_eeprom->lora_eui[1],
+ id_eeprom->lora_eui[2],
+ id_eeprom->lora_eui[3],
+ id_eeprom->lora_eui[4],
+ id_eeprom->lora_eui[5],
+ id_eeprom->lora_eui[6],
+ id_eeprom->lora_eui[7]);
}
static void mts_ap_eeprom_inspect(struct mts_ap_eeprom_layout *ap_eeprom)
@@ -728,12 +749,11 @@ int main(int argc, char *argv[]) {
}
if (eui) {
if (!accessory_card) {
- log_error("EUI only supported on accessory card eeprom");
- usage(stderr);
- exit(1);
+ tmp = hwaddr_aton(eui, id_eeprom.lora_eui, sizeof(id_eeprom.lora_eui));
+ }
+ else {
+ tmp = hwaddr_aton(eui, ap_eeprom.eui, sizeof(ap_eeprom.eui));
}
-
- tmp = hwaddr_aton(eui, ap_eeprom.eui, sizeof(ap_eeprom.eui));
if (!tmp) {
log_error("invalid EUI %s", eui);
usage(stderr);