NebraLtd / hm-diag

Helium Miner Diagnostics
https://nebra.io/hnt
MIT License
21 stars 23 forks source link

Uniformity in key naming? #278

Open kashifpk opened 2 years ago

kashifpk commented 2 years ago

A sample payload from /initFile.txt endpoint is given below:

{
  "diagnostics_passed": false,
  "errors": [
    "ECC"
  ],
  "serial_number": "0000000097f1bbe0",
  "ECC": "gateway_mfr test finished with error, {\"result\": \"fail\", \"tests\": [{\"output\": \"ok\", \"result\": \"pass\", \"test\": \"serial\"}, {\"output\": \"ok\", \"result\": \"pass\", \"test\": \"zone_locked(data)\"}, {\"output\": \"ok\", \"result\": \"pass\", \"test\": \"zone_locked(config)\"}, {\"output\": \"ok\", \"result\": \"pass\", \"test\": \"slot_config(0..=15, ecc)\"}, {\"output\": \"ok\", \"result\": \"pass\", \"test\": \"key_config(0..=15, ecc)\"}, {\"output\": \"ok\", \"result\": \"pass\", \"test\": \"miner_key(0)\"}, {\"output\": \"ok\", \"result\": \"pass\", \"test\": \"sign(0)\"}, {\"output\": \"elliptic_curve error\", \"result\": \"fail\", \"test\": \"ecdh(0)\"}]}",
  "E0": "00:BD:27:EF:81:01",
  "eth_mac_address": "00:BD:27:EF:81:01",
  "W0": "8C:88:6B:20:03:BA",
  "wifi_mac_address": "8C:88:6B:20:03:BA",
  "BN": "autumn-silence",
  "BALENA_DEVICE_NAME_AT_INIT": "autumn-silence",
  "ID": "b3e62a630698af1a59caf49b0b2d9c9b",
  "BALENA_DEVICE_UUID": "b3e62a630698af1a59caf49b0b2d9c9b",
  "BA": "HELIUM-TESTNET",
  "BALENA_APP_NAME": "HELIUM-TESTNET",
  "FR": "868",
  "FREQ": "868",
  "FW": "2021.12.14.0-2",
  "FIRMWARE_VERSION": "2021.12.14.0-2",
  "VA": "NEBHNT-OUT1",
  "VARIANT": "NEBHNT-OUT1",
  "BT": [
    {
      "Address": "00:1A:7D:DA:71:13",
      "Name": "b3e62a6",
      "Powered": "1",
      "Discoverable": "0",
      "Pairable": "0",
      "Discovering": "0"
    }
  ],
  "bluetooth": [
    {
      "Address": "00:1A:7D:DA:71:13",
      "Name": "b3e62a6",
      "Powered": "1",
      "Discoverable": "0",
      "Pairable": "0",
      "Discovering": "0"
    }
  ],
  "LTE": [
    {
      "Model": "QUECTEL Mobile Broadband Module",
      "Manufacturer": "QUALCOMM INCORPORATED",
      "EquipmentIdentifier": "867698046840453"
    }
  ],
  "lte": [
    {
      "Model": "QUECTEL Mobile Broadband Module",
      "Manufacturer": "QUALCOMM INCORPORATED",
      "EquipmentIdentifier": "867698046840453"
    }
  ],
  "LOR": true,
  "lora": true,
  "OK": "11AThXYfk9G2KfsRx1eGoFS5uTEDTCiqbpqiJ7jPwrfdp6RoRGR",
  "onboarding_key": "11AThXYfk9G2KfsRx1eGoFS5uTEDTCiqbpqiJ7jPwrfdp6RoRGR",
  "PK": "11AThXYfk9G2KfsRx1eGoFS5uTEDTCiqbpqiJ7jPwrfdp6RoRGR",
  "public_key": "11AThXYfk9G2KfsRx1eGoFS5uTEDTCiqbpqiJ7jPwrfdp6RoRGR",
  "PF": true,
  "legacy_pass_fail": true
}

Ignoring old style 2-character keys; some of the newer keys are in upper case while other are in lowercase. Is there a reason for this or is this a candidate for refactoring?

Some examples:

shawaj commented 2 years ago

No reason, just a legacy issue really