Skip to content

SFD

Function: HasSfd

bool HasSfd()

Description:
Determine if the ECU has SFD (Schutz Fahrzeug Diagnose) protection enabled.

Return Value:
Returns true if the ECU has SFD protection enabled, otherwise false.

Usage Example
1
2
3
if (!OpenEcu(0x03)) return;
bool hasProtection = HasSfd();
PrintLine($"ECU has SFD protection: {hasProtection}");

Function: IsSfdUnlocked

bool IsSfdUnlocked()

Description:
Determine if the ECU SFD (Schutz Fahrzeug Diagnose) protection is unlocked.

Return Value:
Returns true if the ECU has SFD protection is unlocked, otherwise false.

Usage Example
1
2
3
if (!OpenEcu(0x03)) return;
bool isUnlocked = IsSfdUnlocked();
PrintLine($"ECU has SFD protection unlocked: {hasProtection}");

Function: GetSfdChallenge

byte[] GetSfdChallenge()

Description:
Retrieve the SFD challenge required for the token generation.

Return Value:
Returns a byte array containing the SFD challenge.

Usage Example
1
2
3
if (!OpenEcu(0x03)) return;
byte[] challenge = GetSfdChallenge();
PrintLine($"SFD Challenge: {BitConverter.ToString(challenge)}");

Function: SendToken

bool SendToken(byte[] token)

Description:
Send the generated token to the ECU in response to the SFD challenge.

Parameters:
- token: The byte array representing the generated token for the SFD challenge.

Return Value:
Returns true if the token was accepted by the ECU, otherwise false.

Usage Example
1
2
3
4
if (!OpenEcu(0x03)) return;
byte[] generatedToken = ...; // Some token generation logic
bool isTokenAccepted = SendToken(generatedToken);
PrintLine($"Token Accepted: {isTokenAccepted}");

Procedure: LockSfd

void LockSfd()

Description:
Lock the ECU with SFD protection.

Usage Example
1
2
3
if (!OpenEcu(0x03)) return;
LockSfd();
PrintLine("ECU locked with SFD protection.");

Procedure: InvokeSfdDialog

void InvokeSfdDialog(ushort diagAddr, bool onlyIfLocked = true)

Description:
Invoke the SFD dialog for the ECU.

Parameters:
- diagAddr: Diagnostic address of the ECU.
- onlyIfLocked (optional): If set to true, invokes the SFD dialog only if the ECU is locked. Default value is true.

Usage Example
1
2
3
if (!OpenEcu(0x03)) return;
InvokeSfdDialog(0x03, true);
PrintLine("SFD dialog invoked.");