The functions described in this chapter implement SLAC protocol building blocks. Essentially, there is one function for each dataflow shown on the SLAC interface diagram. The implementations are not sophisticated. Customers must adapt them their own run-time environments.
To assist in adapting functions fo various environments, SLAC functions all accept three arguments. The first is a session variable that references information that supports a single PEV-EVSE SLAC interaction. The second is a channel variable that references information that supports ISO Layer 2 network communications. The third is a message variable that references an IEEE 802.3 frame buffer used to format, transmit, receive and interpret SLAC messages. Applications may create lists, stacks, queues or heaps of session variables to support multiple PEV-EVSE conversations. That has not been done here but may be done in the future.
PEV-HLE determines the application type and security type and stores them in the session variable before attempting a new SLAC session. PEV-HLE also generates and stores the run identifier in the session variable before attempting a new SLAC session. The run identifier is included in messages so that the EVSE-HLE can distinguish frames from different PEV-HLEs when transmitted in broadcast.
The session variable is a structure defined in slac.h. It stores the information needed to manage a single SLAC protocol session between PEV-HLE and EVSE-HLE. It is necessary because there are cases where multiple PEV-HLE attempt to communicate with one EVSE-HLE or vice verse and each communication involves multiple steps and some steps will fail or be abandoned.
A session identifier used to support multiple PEV-EVSE sessions.
The PEV-HLE defines a new value with each associateion attempt and broadcasts it to EVSE-HLE in CM_SLAC_PARAM.REQ
RunID
.
EVSE-HLE receive it and store it in their session variable.
Once association starts, subsequent messages, in both directions, include this identifier so that PEV-HLE and EVSE-HLE can detect and collate messages from the same conversation.
Indicates the context in which the SLAC process is being carried out.
Currently, the only context is PEV-EVSE association.
The PEV-HLE sends this value to the EVSE-HLE in EVSE-HLE in CM_SLAC_PARAM.REQ
message APPLICATION_TYPE
field.
EVSE-HLE receive it and store it in their session variable.
Indicates that the sender prefers Secure SLAC for PEV-EVSE matching.
Currently, the only value used in SLAC demonstration software is 0
for “No Security”.
The PEV-HLE defines this value as 0
on startup and broadcasts it to EVSE-HLE in in CM_SLAC_PARAM.REQ
message SECURITY_TYPE
field.
EVSE-HLE receive it and store it in their session variable for later use when sending SLAC messages.
The EVSE-HLE defines this value and sends it to the PEV-HLE in CM_SLAC_PARAM.CNF
message RESP_TYPE
field.
THe default is 0
but this can be changed using “response type =” in profile evse.ini
.
The number of CM_MNBC_SOUND.IND
messages that the PEV-HLE should send during sounding.
The EVSE-HLE defines this value and sends it to PEV-HLE in CM_SLAC_PARAM.CNF
message NUM_SOUNDS
field.
The default is 10
but this can be changed using “time to soundi =” in profile evse.ini
.
The total time allowed for all session sounding to complete.
Any msounds arriving after the timeout will be lost.
The time is expressed in 100 msec increments.
The EVSE-HLE defines this value and sends it to PEV_HLE in CM_SLAC_PARAM.CNF
.
The default is 8
but this can be changed using “number of sounds =” in profile evse.ini
.
The cumulative average attenuation across 58
groups of 16
carriers.
The EVSE-HLE computes these averages from multiple CM_ATTEN_PROFILE.IND
and forwards them to PEV-HLE in CM_ATTEN_CHAR.IND
.
PEV_HLE populates array from CM_ATTEN_CHAR.IND
message ACVarField.ATTEN_PROFILE.AAG
field and evaluates it by averaging all values in the array to determine the overall average attenuation.
If that values is less than or equal to session.limit
then a match may be attempted.
The number of elements in array session.AAG
.
This EVSE-HLE defines this number and sends it to PEV-HLE in CM_ATTEN_CHAR.IND
ACVarField.NumGroups
.
For practical purposes, this value of this variable is constant at 58
.
MAC address of EVSE-HLE that will receive CM_MNBC_SOUND.IND
messages.
The EVSE-HLE defines this address and broadcasts it to PEV-HLE in CM_SLAC_PARAM.CNF
message M-SOUND_TRAGET
field.
THe PEV-HLE stores this address in its session variable.
The default is FF:FF:FF:FF:FF:FF
and remains constant.
This value is not used at this time.
MAC address of PEV-HLE to receive CM_SLAC_PROFILE.IND
messages.
The EVSE-HLE defines this address and sends it to PEV-HLE in CM_SLAC_PARAM.CNF
message FORWARDING_STA
field.
THe PEV-HLE stores this address in its session variable.
The default is FF:FF:FF:FF:FF:FF
and remains constant.
This value is ignored when RESP_TYPE=0.
The vehicle identification number.
The PEV-HLE sends this value to the EVSE-HLE in CM_SLAC_MATCH.REQ
MatchVarField.PEV_ID
field.
The default is AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
but is can be changed using “vehicle identifier =” in profile pev.ini
.
The MatchVarField portion of the message forms the transaction record and may be encrypted.
PEV-HLE MAC address.
The PEV-HLE sends this address to the EVSE-HLE in CM_SLAC_MATCH.REQ
MatchVarField.PEV_MAC
field.
The MatchVarField portion of the message forms the transaction record and may be encrypted.
The station identification number.
The EVSE-HLE sends this value to PEV-HLE in CM_SLAC_MATCH.CNF
message MatchVarField.EVSE_ID
field.
The default is BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
but is can be changed using “station identifier =” in profile evse.ini
.
The MatchVarField portion of the message forms the transaction record and may be encrypted.
EVSE-HLE MAC address.
The EVSE-HLE sends this value to PEV-HLE in CM_SLAC_MATCH.CNF
message MatchVarField.EVSE_MAC
field.
The MatchVarField portion of the message forms the transaction record and may be encrypted.
The EVSE-PLC Network Membership Key.
The EVSE-HLE defines this value when the station powers on.
The EVSE-HLE sends the NMK to the PEV-HLE in CM_SLAC_MATCH.CNF
message MatchField.NMK
field.
The PEV-HLE uses this value to form a network with the EVSE-PLC during charging.
The MatchVarField portion of the message forms the transaction record and may be encrypted.
The default for PEV-HLE is 50D3E4933F855B7040784DF815AA8DB7
, which is the key derived from network password “HomePlugAV”, but that can be changed using “nwtwork membership key =” in profile pev.ini
.
The default for EVSE-HLE is B59319D7E8157BA001B018669CCEE30D
, which is the key derived from network password “HomePlugAV0123”, but that can be changed using “nwtwork membership key =” in profile evse.ini
.
The EVSE-PLC Network Identifier.
The EVSE-HLE defines this value when the station powers.
The EVSE-HLE sends the NID to the PEV-HLE in CM_SLAC_MATCH.CNF
message MatchField.NID
field.
The PEV-HLE uses this value to form a network with the EVSE-PLC during charging.
The MatchVarField portion of the message forms the transaction record and may be encrypted.
The default for PEV-HLE is B0F2E695666B03
, which is the key derived from network password “HomePlugAV”, but that can be changed using “nwtwork membership key =” in profile pev.ini
.
The default for EVSE-HLE is 026BCBA5354E08
, which is the key derived from network password “HomePlugAV0123”, but that can be changed using “nwtwork membership key =” in profile evse.ini
.
A random value.
PEV-HLE computes this value and sends it to EVSE-HLE in CM_MNBC_SOUND.IND
.
This value is not used at this time.
The original PEV-PLC Network Membership Key.
This is the original NMK of the PEV-HLE.
The PEV-HLE preserves this value before, and restores it after, the charging cycle.
The Qualcomm Atheros PEV-HLE and EVSE-HLE demonstration software reads these values from profile pev.ini
and evse.ini
, respectively, by “network membership key = ”.
The PLC Network Identifier (NID).
PEV-PLC and EVSE-PLC will each have a different NID at the start of the SLAC process.
This value must be preserved before, and restored after, charging.
Once charging is complete, PEV-HLE and EVSE-HLE restore this value to their respective PLC using CM_SET_KEY
.
In a real world implementation, PEV-HLE and EVSE-HLE would read this value from their repective PLC and save it in session.nmk
and session.NMK
.
The Qualcomm Atheros PEV-HLE and EVSE-HLE demonstration software reads these values from profile pev.ini
and evse.ini
, respectively, by “network identifier = ”.
The current SLAC protocol session state. Qualcomm Atheros PEV-HLE and EVSE-HLE demonstration programs use this value to direct internal state transitions.
Values range from 0
through 3
.
The number of MSounds captured received by EVSE-HLE.
This value may be less that NUM_SOUNDS
the requested by the EVSE_HLE due to network interruptions or EVSE-HLE overloading.
This is the denominator used when computing the average attenuation in array session.AAG
.
The values is set by PEV_HLE from CM_ATTEN_CHAR.IND
message NUM_SOUNDS
field.
The attenuation threshold.
If the average attenuation value in session.AAG
exceeds this value the PEV-HLE will make no attempt to connect the PEV-PLC to the EVSE-PLC.
The default value is 10
but this can be re-defined in profile pev.ini
by “attenuation threshold = ”.
The time in milliseconds between MSounds.
Sounding too frequently does not allow enough time for the EVSE-PLC to sample and compute values.
Sounding too infrequently wastes time.
The maximum sample rate may be limited by the quality of the powerline media and traffic passwing through the EVSE-PLC.
The default is 10
but can be re-defined in profile pev.ini
by “msound pause = ”.
The time in milliseconds allowed for the charging cycle to complete.
The default is 10
but this can be changed using “charge time =” in profile pev.ini
and evse.ini
.
The charge time should be the same for PEV-HLE and EVSE-HLE when running long tests.
The time in milliseconds allowed for the charging cycle to complete.
The default is 10
but this can be changed using “settle time =” in profile pev.ini
and evse.ini
.
The settle time should be the same for PEV-HLE and EVSE-HLE when running long tests.
The number of chaging session that have take place.
This variable is not part of the SLAC protocol.
The PEV-HLE and EVSE-HLE increment this counter each time they enter the “Charging” state and exchange this value in the unused CM_SLAC_PARAM.REW
and CM_SLAC_PARAM.CNF
message CipherSuite
field.
Runtime options can be used to instruct either the PEV-HLE or EVSE-HLE to terminate if their counts are out-of-sync.
A bit-mapped flagword used to control program flow based on user-specified command line options.
signed pev_cm_slac_param( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
PEV-HLE broadcasts CM_SLAC_PARAM.REQ
messages and waits for a CM_SLAC_PARAM.CNF
from EVSE-HLEs.
This is the first message sent and it initiates SLAC session one some EVSE-HLE responds.
Function pev_cm_slac_param copies session.APPLICATION_TYPE
, session.SECURITY_TYPE
and session.RunID
into CM_SLAC_PARAM.REQ
and broadcasts it to listening EVSE-HLE.
It is possible that multiple EVSE-HLEs will respond but one response is sufficient to proceed.
If a CM_SLAC_PARAM.CNF
is not received within a reasonable time, PEV-HLE sends another another CM_SLAC_PARAM.REQ
message.
PEV-HLE should compare the run identifier in the CM_SLAC_PARAM.CNF
to that stored in the session variable to ensure that it is not processing CM_SLAC_PARAM.CNF
messages from some other session.
PEV-HLE compares RunID
, APPLICATION_TYPE
and SECURITY_TYPE
from CM_SLAC_PARAM.CNF
to that stored in the session variable to ensure they have not changed.
PEV-HLE stores MSOUND_TARGET
, NUM_SOUNDS
and TIME_OUT
in the session variable for later use.
signed evse_cm_slac_param( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
EVSE-HLE receives a CM_SLAC_PARAM.REQ
and responds with a CM_SLAC_PARAM.CNF
message.
This function waits indefinitly for CM_SLAC_PARAM.REQ
then copies RunID
, APPLICATION_TYPE
and SECURITY_TYPE
from CM_SLAC_PARAM.REQ
to the session variable for later use.
It then copies session.MSOUND_TARGET
, session.NUM_SOUNDS
, session.TIME_OUT
, session.RESP_TYPE
, session.FORWARDING_STA
, session.APPLICATION_TYPE
, session.SECURITY_TYPE
and session.RunID
to CM_SLAC_PARAM.CNF
and sends it unicast to the requesting PEV-HLE.
signed evse_cm_start_atten_char( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
PEV-HLE informs listening EVSE-HLE that sounding is about to start by broadcasting CM_START_ATTEN_CHAR.IND
.
Function pev_cm_start_char copies session.NUM_SOUNDS
, session.TIME_OUT
, session.RESP_TYPE
, session.FORWARDING_STA
and session.RunID
to CM_START_ATTEN_CHAR.IND
.
The standard recommends that this message be sent three times. Our demonstration software does not do this.
signed evse_cm_start_atten_char( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
EVSE-HLE receives CM_START_ATTEN_CHAR
from PEV-HLE and prepares to receive sounds by initializing msound counters and starting a timer.
This function compares RunID
from CM_START_ATTEN_CHAR
to session.RunID
to ensure that this message belongs to a known session.
This function compares APPLICATION_TYPE
, SECURITY_TYPE
, NUM_SOUNDS
, TIME_OUT
, RESP_TYPE
and FORWARDING_STA
to the session variable to ensure that values have not changed.
signed pev_cm_mnbc_sound( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
PEV-HLE sends periodic CM_MNBC_SOUND.IND
to EVSE-HLE.
signed evse_cm_mnbc_sound( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
EVSE-HLE receives interleaved CM_MNBC_SOUND.IND
from PEV-HLE and CM_ATTEN_PROFILE.IND
messages from EVSE-PLC.
This function maintains a running average of attenuation values across each carrier group in array session.AAG
.
signed evse_cm_atten_char( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
EVSE-HLE sends CM_ATTEN_CHAR.IND
to PEV-HLE.
This function copies session.AAG
to CM_ATTEN_CHAR.IND
.
signed pev_cm_atten_char( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
PEV-HLE receives CM_ATTEN_CHAR.IND
from EVSE-HLE and acknwoledges with CM_ATTEN_CHAR.RSP
.
signed pev_cm_slac_match( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
PEV-HLE sends CM_SLAC_MATCH.REQ
to selected EVSE-HLE and waits for CM_SLAC_MATCH.CNF
.
This function evaluates sounds across all carrier groups and compares result to some threshold and selects one EVSE-HLE.
This function copies session.APPLICAION_TYPE
, session.SECURITY_TYPE
, session.PEV_ID
, session.PEV_MAC
and session.RunID
to CM_SLAC_PARAM.REQ
and sends it unicast to the selected EVSE-HLE.
signed evse_cm_slac_match( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;
EVSE-HLE listens for CM_SLAC_MATCH.REQ
from PEV-HLE and abandons the session if no indication is received within a reasonable time.
If an indication is received then this function compares RunID
from CM_SLAC_MATCH.REQ
to the session.RunID
to ensure the message is part of the current session.
This function compares APPLICATION_TYPE
and SECURITY_TYPE
to the session.APPLICATION_TYPE
and session.SECURITY_TYPE
to ensure that they have not changed.
This function copies PEV_ID
and PEV_MAC
from CM_SLAC_MATCH.REQ
to the session variable for later use.
This function updates session.NMK
and session.NID
with random values.
This function copies session.EVSE_ID
, session.EVSE_MAC
, session.NMK
and session.NID
to CM_SLAC_MATCH.RSP
and sends it unicast to the selecing PEV-HLE.
signed evse_cm_mnbc_sound( | session, | |
channel, | ||
message) ; |
struct session * session
;struct channel * channel
;struct message * message
;