Skip to main content
Open topic with navigation

SCC_SLAC_SetNewKey

CAPL Functions » Smart Charging » SCC Modeling Libraries (Simulation Setup) » SLAC Simulation » EVSE Functions » SCC_SLAC_SetNewKey Valid for: CANoe DE • CANoe4SW DE

Function Syntax

long SCC_SLAC_SetNewKey(byte NMK[], byte NID[])

Description

This function stores the NMK and NID as user defined Key.

Parameters

  • NMK: Network Membership Key (16 byte)
  • NID: Network ID (7 byte hexadecimal number)

Return Values

  • 0: Not successful
  • 1: Successful

Example

StoreOwnKey()
{
  byte NMK[16];
  byte NID[7];

  // Generate random NMK and according NID
  SCC_GenerateRandomData(NMK, elcount(NMK));
  SCC_SLAC_GenerateNID(NMK, NID);

  // Store as user defined Key
  SCC_SLAC_SetNewKey(NMK, NID);
}