diff options
Diffstat (limited to 'src/eeprom_main.c')
-rw-r--r-- | src/eeprom_main.c | 30 |
1 files changed, 25 insertions, 5 deletions
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); |