CEC-5618: add all diagnostic commands and resolve node 16 error (#494)
This commit is contained in:
@@ -13,13 +13,13 @@ import {
|
||||
useVehicleContext
|
||||
} from "../../Contexts/VehicleContext";
|
||||
|
||||
const commands = [
|
||||
export const DIAGNOSTIC_COMMANDS = [
|
||||
{ displayname: "Reset", val: "remote_reset" },
|
||||
{ displayname: "Set CAN Network State", val: "can_network" },
|
||||
{ displayname: "Set Remote Ignition", val: "remote_ignition" },
|
||||
{ displayname: "Send Wake Up SMS", val: "sms" },
|
||||
//{ displayname: "Update SecOC keys", val: "write_secoc_key" },
|
||||
{ displayname: "Read ECU versions", val: "read_ecu_versions" },
|
||||
// { displayname: "Update SecOC keys", val: "write_secoc_key" },
|
||||
{ displayname: "Read ECU versions", val: "read_ecu_versions", allowAll: true },
|
||||
]
|
||||
|
||||
const SendDiagnosticCommand = ({ vin, token, classes }) => {
|
||||
@@ -30,7 +30,7 @@ const SendDiagnosticCommand = ({ vin, token, classes }) => {
|
||||
const [ecus, setEcus] = useState([]);
|
||||
const { setMessage } = useStatusContext();
|
||||
|
||||
const [currentCommand, setCurrentCommand] = useState(commands[0].val);
|
||||
const [currentCommand, setCurrentCommand] = useState(DIAGNOSTIC_COMMANDS[0].val);
|
||||
const [currentECU, setCurrentECU] = useState("");
|
||||
const [canNetState, setCanNetState] = useState(false);
|
||||
const [ignitionState, setIgnitionState] = useState(false);
|
||||
@@ -154,7 +154,7 @@ const SendDiagnosticCommand = ({ vin, token, classes }) => {
|
||||
}}
|
||||
onChange={changeCommandHandler}
|
||||
>
|
||||
{commands.map((command, index) => (
|
||||
{DIAGNOSTIC_COMMANDS.map((command, index) => (
|
||||
<option key={index} value={command.val}>
|
||||
{command.displayname}
|
||||
</option>
|
||||
|
||||
Reference in New Issue
Block a user