ch07s12.html 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  1. <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>SLAC Functions and Variables</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"><meta name="keywords" content="Intellon, Atheros, Qualcomm, HomePlug, powerline, communications, INT6000, INT6300, INT6400, AR7400, AR7420"><link rel="home" href="index.html" title="Qualcomm Atheros Open Powerline Toolkit"><link rel="up" href="ch07.html" title="Chapter 7.  Support Function Reference"><link rel="prev" href="ch07s11.html" title="Traffic Functions"><link rel="next" href="ch08.html" title="Chapter 8.  Serial Drivers"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
  2. SLAC Functions and Variables
  3. </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch07s11.html">Prev</a> </td><th width="60%" align="center">Chapter 7. 
  4. Support Function Reference
  5. </th><td width="20%" align="right"> <a accesskey="n" href="ch08.html">Next</a></td></tr></table><hr></div><div class="section" title="SLAC Functions and Variables"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="slac"></a>
  6. SLAC Functions and Variables
  7. </h2></div></div></div><p>
  8. The functions described in this chapter implement <acronym class="acronym">SLAC</acronym> 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.
  9. </p><p>
  10. 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 <a class="link" href="ch07s03.html" title="Ethernet Functions">channel</a> 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.
  11. </p><p>
  12. 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.
  13. </p><div class="section" title="The Session Variable"><div class="titlepage"><div><div><h3 class="title"><a name="session-variable"></a>
  14. The Session Variable
  15. </h3></div></div></div><p>
  16. The session variable is a structure defined in <a class="ulink" href="" target="_top">slac.h</a>. It stores the information needed to manage a single <acronym class="acronym">SLAC</acronym> 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.
  17. </p><div class="variablelist"><dl><dt><a name="session-RunID"></a><span class="term">
  18. session.RunID
  19. </span></dt><dd><p>
  20. A session identifier used to support multiple PEV-EVSE sessions.
  21. The PEV-HLE defines a new value with each associateion attempt and broadcasts it to EVSE-HLE in <code class="constant">CM_SLAC_PARAM.REQ</code> <code class="constant">RunID</code>.
  22. EVSE-HLE receive it and store it in their session variable.
  23. 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.
  24. </p></dd><dt><a name="session-ApplicationType"></a><span class="term">
  25. session.APPLICATION_TYPE
  26. </span></dt><dd><p>
  27. Indicates the context in which the SLAC process is being carried out.
  28. Currently, the only context is PEV-EVSE association.
  29. The PEV-HLE sends this value to the EVSE-HLE in EVSE-HLE in <code class="constant">CM_SLAC_PARAM.REQ</code> message <code class="constant">APPLICATION_TYPE</code> field.
  30. EVSE-HLE receive it and store it in their session variable.
  31. </p></dd><dt><a name="session-SecurityType"></a><span class="term">
  32. session.SECURITY_TYPE
  33. </span></dt><dd><p>
  34. Indicates that the sender prefers Secure <acronym class="acronym">SLAC</acronym> for PEV-EVSE matching.
  35. Currently, the only value used in <acronym class="acronym">SLAC</acronym> demonstration software is <code class="constant">0</code> for <span class="quote">“<span class="quote">No Security</span>”</span>.
  36. The PEV-HLE defines this value as <code class="constant">0</code> on startup and broadcasts it to EVSE-HLE in in <code class="constant">CM_SLAC_PARAM.REQ</code> message <code class="constant">SECURITY_TYPE</code> field.
  37. EVSE-HLE receive it and store it in their session variable for later use when sending <acronym class="acronym">SLAC</acronym> messages.
  38. </p></dd><dt><a name="session-ResponseType"></a><span class="term">
  39. session.RESP_TYPE
  40. </span></dt><dd><p>
  41. The EVSE-HLE defines this value and sends it to the PEV-HLE in <code class="constant">CM_SLAC_PARAM.CNF</code> message <code class="constant">RESP_TYPE</code> field.
  42. THe default is <code class="constant">0</code> but this can be changed using <span class="quote">“<span class="quote">response type =</span>”</span> in profile <code class="filename">evse.ini</code>.
  43. </p></dd><dt><a name="session-NUM-SOUNDS"></a><span class="term">
  44. session.NUM_SOUNDS
  45. </span></dt><dd><p>
  46. The number of <code class="constant">CM_MNBC_SOUND.IND</code> messages that the PEV-HLE should send during sounding.
  47. The EVSE-HLE defines this value and sends it to PEV-HLE in <code class="constant">CM_SLAC_PARAM.CNF</code> message <code class="constant">NUM_SOUNDS</code> field.
  48. The default is <code class="constant">10</code> but this can be changed using <span class="quote">“<span class="quote">time to soundi =</span>”</span> in profile <code class="filename">evse.ini</code>.
  49. </p></dd><dt><a name="session-TIME-OUT"></a><span class="term">
  50. session.TIME_OUT
  51. </span></dt><dd><p>
  52. The total time allowed for all session sounding to complete.
  53. Any msounds arriving after the timeout will be lost.
  54. The time is expressed in 100 msec increments.
  55. The EVSE-HLE defines this value and sends it to PEV_HLE in <code class="constant">CM_SLAC_PARAM.CNF</code>.
  56. The default is <code class="constant">8</code> but this can be changed using <span class="quote">“<span class="quote">number of sounds =</span>”</span> in profile <code class="filename">evse.ini</code>.
  57. </p></dd><dt><a name="session-AAG"></a><span class="term">
  58. session.AAG []
  59. </span></dt><dd><p>
  60. The cumulative average attenuation across <code class="constant">58</code> groups of <code class="constant">16</code> carriers.
  61. The EVSE-HLE computes these averages from multiple <code class="constant">CM_ATTEN_PROFILE.IND</code> and forwards them to PEV-HLE in <code class="constant">CM_ATTEN_CHAR.IND</code>.
  62. PEV_HLE populates array from <code class="constant">CM_ATTEN_CHAR.IND</code> message <code class="varname">ACVarField.ATTEN_PROFILE.AAG</code> field and evaluates it by averaging all values in the array to determine the overall average attenuation.
  63. If that values is less than or equal to <span class="structname">session</span>.<em class="structfield"><code>limit</code></em> then a match may be attempted.
  64. </p></dd><dt><a name="session-NumGroups"></a><span class="term">
  65. session.NumGroups
  66. </span></dt><dd><p>
  67. The number of elements in array <span class="structname">session</span>.<em class="structfield"><code>AAG</code></em>.
  68. This EVSE-HLE defines this number and sends it to PEV-HLE in <code class="constant">CM_ATTEN_CHAR.IND</code> <code class="constant">ACVarField.NumGroups</code>.
  69. For practical purposes, this value of this variable is constant at <code class="constant">58</code>.
  70. </p></dd><dt><a name="session-MSOUND-TARGET"></a><span class="term">
  71. session.MSOUND_TARGET
  72. </span></dt><dd><p>
  73. MAC address of EVSE-HLE that will receive <code class="constant">CM_MNBC_SOUND.IND</code> messages.
  74. The EVSE-HLE defines this address and broadcasts it to PEV-HLE in <code class="constant">CM_SLAC_PARAM.CNF</code> message <code class="constant">M-SOUND_TRAGET</code> field.
  75. THe PEV-HLE stores this address in its session variable.
  76. The default is <code class="constant">FF:FF:FF:FF:FF:FF</code> and remains constant.
  77. This value is not used at this time.
  78. </p></dd><dt><a name="session-FORWARDING_STA"></a><span class="term">
  79. session.FORWARDING_STA
  80. </span></dt><dd><p>
  81. MAC address of PEV-HLE to receive <code class="constant">CM_SLAC_PROFILE.IND</code> messages.
  82. The EVSE-HLE defines this address and sends it to PEV-HLE in <code class="constant">CM_SLAC_PARAM.CNF</code> message <code class="constant">FORWARDING_STA</code> field.
  83. THe PEV-HLE stores this address in its session variable.
  84. The default is <code class="constant">FF:FF:FF:FF:FF:FF</code> and remains constant.
  85. This value is ignored when RESP_TYPE=0.
  86. </p></dd><dt><a name="session-PEV_ID"></a><span class="term">
  87. session.PEV_ID
  88. </span></dt><dd><p>
  89. The vehicle identification number.
  90. The PEV-HLE sends this value to the EVSE-HLE in <code class="constant">CM_SLAC_MATCH.REQ</code> <code class="constant">MatchVarField.PEV_ID</code> field.
  91. The default is <code class="constant">AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA</code> but is can be changed using <span class="quote">“<span class="quote">vehicle identifier =</span>”</span> in profile <code class="filename">pev.ini</code>.
  92. The MatchVarField portion of the message forms the transaction record and may be encrypted.
  93. </p></dd><dt><a name="session-PEV_MAC"></a><span class="term">
  94. session.PEV_MAC
  95. </span></dt><dd><p>
  96. PEV-HLE MAC address.
  97. The PEV-HLE sends this address to the EVSE-HLE in <code class="constant">CM_SLAC_MATCH.REQ</code> <code class="constant">MatchVarField.PEV_MAC</code> field.
  98. The MatchVarField portion of the message forms the transaction record and may be encrypted.
  99. </p></dd><dt><a name="session-EVSE_ID"></a><span class="term">
  100. session.EVSE_ID
  101. </span></dt><dd><p>
  102. The station identification number.
  103. The EVSE-HLE sends this value to PEV-HLE in <code class="constant">CM_SLAC_MATCH.CNF</code> message <code class="constant">MatchVarField.EVSE_ID</code> field.
  104. The default is <code class="constant">BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB</code> but is can be changed using <span class="quote">“<span class="quote">station identifier =</span>”</span> in profile <code class="filename">evse.ini</code>.
  105. The MatchVarField portion of the message forms the transaction record and may be encrypted.
  106. </p></dd><dt><a name="session-EVSE_MAC"></a><span class="term">
  107. session.EVSE_MAC
  108. </span></dt><dd><p>
  109. EVSE-HLE MAC address.
  110. The EVSE-HLE sends this value to PEV-HLE in <code class="constant">CM_SLAC_MATCH.CNF</code> message <code class="constant">MatchVarField.EVSE_MAC</code> field.
  111. The MatchVarField portion of the message forms the transaction record and may be encrypted.
  112. </p></dd><dt><a name="session-NMK"></a><span class="term">
  113. session.NMK
  114. </span></dt><dd><p>
  115. The EVSE-PLC Network Membership Key.
  116. The EVSE-HLE defines this value when the station powers on.
  117. The EVSE-HLE sends the NMK to the PEV-HLE in <code class="constant">CM_SLAC_MATCH.CNF</code> message <code class="constant">MatchField.NMK</code> field.
  118. The PEV-HLE uses this value to form a network with the EVSE-PLC during charging.
  119. The MatchVarField portion of the message forms the transaction record and may be encrypted.
  120. </p><p>
  121. The default for PEV-HLE is <code class="constant">50D3E4933F855B7040784DF815AA8DB7</code>, which is the key derived from network password <span class="quote">“<span class="quote">HomePlugAV</span>”</span>, but that can be changed using <span class="quote">“<span class="quote">nwtwork membership key =</span>”</span> in profile <code class="filename">pev.ini</code>.
  122. </p><p>
  123. The default for EVSE-HLE is <code class="constant">B59319D7E8157BA001B018669CCEE30D</code>, which is the key derived from network password <span class="quote">“<span class="quote">HomePlugAV0123</span>”</span>, but that can be changed using <span class="quote">“<span class="quote">nwtwork membership key =</span>”</span> in profile <code class="filename">evse.ini</code>.
  124. </p></dd><dt><a name="session-NID"></a><span class="term">
  125. session.NID
  126. </span></dt><dd><p>
  127. The EVSE-PLC Network Identifier.
  128. The EVSE-HLE defines this value when the station powers.
  129. The EVSE-HLE sends the NID to the PEV-HLE in <code class="constant">CM_SLAC_MATCH.CNF</code> message <code class="constant">MatchField.NID</code> field.
  130. The PEV-HLE uses this value to form a network with the EVSE-PLC during charging.
  131. The MatchVarField portion of the message forms the transaction record and may be encrypted.
  132. </p><p>
  133. The default for PEV-HLE is <code class="constant">B0F2E695666B03</code>, which is the key derived from network password <span class="quote">“<span class="quote">HomePlugAV</span>”</span>, but that can be changed using <span class="quote">“<span class="quote">nwtwork membership key =</span>”</span> in profile <code class="filename">pev.ini</code>.
  134. </p><p>
  135. The default for EVSE-HLE is <code class="constant">026BCBA5354E08</code>, which is the key derived from network password <span class="quote">“<span class="quote">HomePlugAV0123</span>”</span>, but that can be changed using <span class="quote">“<span class="quote">nwtwork membership key =</span>”</span> in profile <code class="filename">evse.ini</code>.
  136. </p></dd><dt><a name="session-RND"></a><span class="term">
  137. session.RND
  138. </span></dt><dd><p>
  139. A random value.
  140. PEV-HLE computes this value and sends it to EVSE-HLE in <code class="constant">CM_MNBC_SOUND.IND</code>.
  141. This value is not used at this time.
  142. </p></dd><dt><a name="session-nmk"></a><span class="term">
  143. session.original_nmk
  144. </span></dt><dd><p>
  145. The original PEV-PLC Network Membership Key.
  146. This is the original NMK of the PEV-HLE.
  147. The PEV-HLE preserves this value before, and restores it after, the charging cycle.
  148. The Qualcomm Atheros PEV-HLE and EVSE-HLE demonstration software reads these values from profile <code class="filename">pev.ini</code> and <code class="filename">evse.ini</code>, respectively, by <span class="quote">“<span class="quote">network membership key = </span>”</span>.
  149. </p></dd><dt><a name="session-nid"></a><span class="term">
  150. session.original_nid
  151. </span></dt><dd><p>
  152. The PLC Network Identifier (<acronym class="acronym">NID</acronym>).
  153. PEV-PLC and EVSE-PLC will each have a different <acronym class="acronym">NID</acronym> at the start of the SLAC process.
  154. This value must be preserved before, and restored after, charging.
  155. Once charging is complete, PEV-HLE and EVSE-HLE restore this value to their respective PLC using <code class="constant">CM_SET_KEY</code>.
  156. In a real world implementation, PEV-HLE and EVSE-HLE would read this value from their repective PLC and save it in <span class="structname">session</span>.<em class="structfield"><code>nmk</code></em> and <span class="structname">session</span>.<em class="structfield"><code>NMK</code></em>.
  157. The Qualcomm Atheros PEV-HLE and EVSE-HLE demonstration software reads these values from profile <code class="filename">pev.ini</code> and <code class="filename">evse.ini</code>, respectively, by <span class="quote">“<span class="quote">network identifier = </span>”</span>.
  158. </p></dd><dt><a name="session-state"></a><span class="term">
  159. session.state
  160. </span></dt><dd><p>
  161. The current <acronym class="acronym">SLAC</acronym> protocol session state. Qualcomm Atheros PEV-HLE and EVSE-HLE demonstration programs use this value to direct internal state transitions.
  162. Values range from <code class="constant">0</code> through <code class="constant">3</code>.
  163. </p></dd><dt><a name="session-sounds"></a><span class="term">
  164. session.sounds
  165. </span></dt><dd><p>
  166. The number of MSounds captured received by EVSE-HLE.
  167. This value may be less that <em class="structfield"><code>NUM_SOUNDS</code></em> the requested by the EVSE_HLE due to network interruptions or EVSE-HLE overloading.
  168. This is the denominator used when computing the average attenuation in array <span class="structname">session</span>.<em class="structfield"><code>AAG</code></em>.
  169. The values is set by PEV_HLE from <code class="constant">CM_ATTEN_CHAR.IND</code> message <code class="varname">NUM_SOUNDS</code> field.
  170. </p></dd><dt><a name="session-limit"></a><span class="term">
  171. session.limit
  172. </span></dt><dd><p>
  173. The attenuation threshold.
  174. If the average attenuation value in <span class="structname">session</span>.<em class="structfield"><code>AAG</code></em> exceeds this value the PEV-HLE will make no attempt to connect the PEV-PLC to the EVSE-PLC.
  175. The default value is <code class="constant">10</code> but this can be re-defined in profile <code class="filename">pev.ini</code> by <span class="quote">“<span class="quote">attenuation threshold = </span>”</span>.
  176. </p></dd><dt><a name="session-pause"></a><span class="term">
  177. session.pause
  178. </span></dt><dd><p>
  179. The time in milliseconds between MSounds.
  180. Sounding too frequently does not allow enough time for the EVSE-PLC to sample and compute values.
  181. Sounding too infrequently wastes time.
  182. The maximum sample rate may be limited by the quality of the powerline media and traffic passwing through the EVSE-PLC.
  183. The default is <code class="constant">10</code> but can be re-defined in profile <code class="filename">pev.ini</code> by <span class="quote">“<span class="quote">msound pause = </span>”</span>.
  184. </p></dd><dt><a name="session-chargetime"></a><span class="term">
  185. session.chargetime
  186. </span></dt><dd><p>
  187. The time in milliseconds allowed for the charging cycle to complete.
  188. The default is <code class="constant">10</code> but this can be changed using <span class="quote">“<span class="quote">charge time =</span>”</span> in profile <code class="filename">pev.ini</code> and <code class="filename">evse.ini</code>.
  189. The charge time should be the same for PEV-HLE and EVSE-HLE when running long tests.
  190. </p></dd><dt><a name="session-settletime"></a><span class="term">
  191. session.settletime
  192. </span></dt><dd><p>
  193. The time in milliseconds allowed for the charging cycle to complete.
  194. The default is <code class="constant">10</code> but this can be changed using <span class="quote">“<span class="quote">settle time =</span>”</span> in profile <code class="filename">pev.ini</code> and <code class="filename">evse.ini</code>.
  195. The settle time should be the same for PEV-HLE and EVSE-HLE when running long tests.
  196. </p></dd><dt><a name="session-counter"></a><span class="term">
  197. session.counter
  198. </span></dt><dd><p>
  199. The number of chaging session that have take place.
  200. This variable is not part of the SLAC protocol.
  201. The PEV-HLE and EVSE-HLE increment this counter each time they enter the <span class="quote">“<span class="quote">Charging</span>”</span> state and exchange this value in the unused <code class="constant">CM_SLAC_PARAM.REW</code> and <code class="constant">CM_SLAC_PARAM.CNF</code> message <code class="constant">CipherSuite</code> field.
  202. Runtime options can be used to instruct either the PEV-HLE or EVSE-HLE to terminate if their counts are out-of-sync.
  203. </p></dd><dt><a name="session-flags"></a><span class="term">
  204. session.flags
  205. </span></dt><dd><p>
  206. A bit-mapped flagword used to control program flow based on user-specified command line options.
  207. </p></dd></dl></div></div><div class="section" title="pev_cm_slac_param"><div class="titlepage"><div><div><h3 class="title"><a name="pev_cm_slac_param"></a>
  208. pev_cm_slac_param
  209. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">pev_cm_slac_param</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  210. PEV-HLE broadcasts <code class="constant">CM_SLAC_PARAM.REQ</code> messages and waits for a <code class="constant">CM_SLAC_PARAM.CNF</code> from EVSE-HLEs.
  211. This is the first message sent and it initiates SLAC session one some EVSE-HLE responds.
  212. Function pev_cm_slac_param copies session.<em class="structfield"><code>APPLICATION_TYPE</code></em>, session.<em class="structfield"><code>SECURITY_TYPE</code></em> and session.<em class="structfield"><code>RunID</code></em> into <code class="constant">CM_SLAC_PARAM.REQ</code> and broadcasts it to listening EVSE-HLE.
  213. </p><p>
  214. It is possible that multiple EVSE-HLEs will respond but one response is sufficient to proceed.
  215. If a <code class="constant">CM_SLAC_PARAM.CNF</code> is not received within a reasonable time, PEV-HLE sends another another <code class="constant">CM_SLAC_PARAM.REQ</code> message.
  216. PEV-HLE should compare the run identifier in the <code class="constant">CM_SLAC_PARAM.CNF</code> to that stored in the session variable to ensure that it is not processing <code class="constant">CM_SLAC_PARAM.CNF</code> messages from some other session.
  217. PEV-HLE compares <code class="varname">RunID</code>, <code class="varname">APPLICATION_TYPE</code> and <code class="varname">SECURITY_TYPE</code> from <code class="constant">CM_SLAC_PARAM.CNF</code> to that stored in the session variable to ensure they have not changed.
  218. PEV-HLE stores <code class="varname">MSOUND_TARGET</code>, <code class="varname">NUM_SOUNDS</code> and <code class="varname">TIME_OUT</code> in the session variable for later use.
  219. </p></div><div class="section" title="evse_cm_slac_param"><div class="titlepage"><div><div><h3 class="title"><a name="evse_cm_slac_param"></a>
  220. evse_cm_slac_param
  221. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">evse_cm_slac_param</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  222. EVSE-HLE receives a <code class="constant">CM_SLAC_PARAM.REQ</code> and responds with a <code class="constant">CM_SLAC_PARAM.CNF</code> message.
  223. This function waits indefinitly for <code class="constant">CM_SLAC_PARAM.REQ</code> then copies <code class="varname">RunID</code>, <code class="varname">APPLICATION_TYPE</code> and <code class="varname">SECURITY_TYPE</code> from <code class="constant">CM_SLAC_PARAM.REQ</code> to the session variable for later use.
  224. It then copies session.<em class="structfield"><code>MSOUND_TARGET</code></em>, session.<em class="structfield"><code>NUM_SOUNDS</code></em>, session.<em class="structfield"><code>TIME_OUT</code></em>, session.<em class="structfield"><code>RESP_TYPE</code></em>, session.<em class="structfield"><code>FORWARDING_STA</code></em>, session.<em class="structfield"><code>APPLICATION_TYPE</code></em>, session.<em class="structfield"><code>SECURITY_TYPE</code></em> and session.<em class="structfield"><code>RunID</code></em> to <code class="constant">CM_SLAC_PARAM.CNF</code> and sends it unicast to the requesting PEV-HLE.
  225. </p></div><div class="section" title="pev_cm_start_atten_char"><div class="titlepage"><div><div><h3 class="title"><a name="pev_cm_start_atten_char"></a>
  226. pev_cm_start_atten_char
  227. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">evse_cm_start_atten_char</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  228. PEV-HLE informs listening EVSE-HLE that sounding is about to start by broadcasting <code class="constant">CM_START_ATTEN_CHAR.IND</code>.
  229. Function pev_cm_start_char copies session.<em class="structfield"><code>NUM_SOUNDS</code></em>, session.<em class="structfield"><code>TIME_OUT</code></em>, session.<em class="structfield"><code>RESP_TYPE</code></em>, session.<em class="structfield"><code>FORWARDING_STA</code></em> and session.<em class="structfield"><code>RunID</code></em> to <code class="constant">CM_START_ATTEN_CHAR.IND</code>.
  230. </p><p>
  231. The standard recommends that this message be sent three times. Our demonstration software does not do this.
  232. </p></div><div class="section" title="evse_cm_start_atten_char"><div class="titlepage"><div><div><h3 class="title"><a name="evse_cm_start_atten_char"></a>
  233. evse_cm_start_atten_char
  234. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">evse_cm_start_atten_char</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  235. EVSE-HLE receives <code class="constant">CM_START_ATTEN_CHAR</code> from PEV-HLE and prepares to receive sounds by initializing msound counters and starting a timer.
  236. This function compares <code class="varname">RunID</code> from <code class="constant">CM_START_ATTEN_CHAR</code> to session.<em class="structfield"><code>RunID</code></em> to ensure that this message belongs to a known session.
  237. This function compares <code class="varname">APPLICATION_TYPE</code>, <code class="varname">SECURITY_TYPE</code>, <code class="varname">NUM_SOUNDS</code>, <code class="varname">TIME_OUT</code>, <code class="varname">RESP_TYPE</code> and <code class="varname">FORWARDING_STA</code> to the session variable to ensure that values have not changed.
  238. </p></div><div class="section" title="pev_cm_mnbc_sound"><div class="titlepage"><div><div><h3 class="title"><a name="pev_cm_mnbc_sound"></a>
  239. pev_cm_mnbc_sound
  240. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">pev_cm_mnbc_sound</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  241. PEV-HLE sends periodic <code class="constant">CM_MNBC_SOUND.IND</code> to EVSE-HLE.
  242. </p></div><div class="section" title="evse_cm_mnbc_sound"><div class="titlepage"><div><div><h3 class="title"><a name="evse_cm_mnbc_sound"></a>
  243. evse_cm_mnbc_sound
  244. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">evse_cm_mnbc_sound</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  245. EVSE-HLE receives interleaved <code class="constant">CM_MNBC_SOUND.IND</code> from PEV-HLE and <code class="constant">CM_ATTEN_PROFILE.IND</code> messages from EVSE-PLC.
  246. This function maintains a running average of attenuation values across each carrier group in array session.<em class="structfield"><code>AAG</code></em>.
  247. </p></div><div class="section" title="evse_cm_atten_char"><div class="titlepage"><div><div><h3 class="title"><a name="evse_cm_atten_char"></a>
  248. evse_cm_atten_char
  249. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">evse_cm_atten_char</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  250. EVSE-HLE sends <code class="constant">CM_ATTEN_CHAR.IND</code> to PEV-HLE.
  251. This function copies session.<em class="structfield"><code>AAG</code></em> to <code class="constant">CM_ATTEN_CHAR.IND</code>.
  252. </p></div><div class="section" title="pev_cm_atten_char"><div class="titlepage"><div><div><h3 class="title"><a name="pev_cm_atten_char"></a>
  253. pev_cm_atten_char
  254. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">pev_cm_atten_char</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  255. PEV-HLE receives <code class="constant">CM_ATTEN_CHAR.IND</code> from EVSE-HLE and acknwoledges with <code class="constant">CM_ATTEN_CHAR.RSP</code>.
  256. </p></div><div class="section" title="pev_cm_slac_match"><div class="titlepage"><div><div><h3 class="title"><a name="pev_cm_slac_match"></a>
  257. pev_cm_slac_match
  258. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">pev_cm_slac_match</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  259. PEV-HLE sends <code class="constant">CM_SLAC_MATCH.REQ</code> to selected EVSE-HLE and waits for <code class="constant">CM_SLAC_MATCH.CNF</code>.
  260. This function evaluates sounds across all carrier groups and compares result to some threshold and selects one EVSE-HLE.
  261. This function copies session.<em class="structfield"><code>APPLICAION_TYPE</code></em>, session.<em class="structfield"><code>SECURITY_TYPE</code></em>, session.<em class="structfield"><code>PEV_ID</code></em>, session.<em class="structfield"><code>PEV_MAC</code></em> and session.<em class="structfield"><code>RunID</code></em> to <code class="constant">CM_SLAC_PARAM.REQ</code> and sends it unicast to the selected EVSE-HLE.
  262. </p></div><div class="section" title="evse_cm_slac_match"><div class="titlepage"><div><div><h3 class="title"><a name="evse_cm_slac_match"></a>
  263. evse_cm_slac_match
  264. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">evse_cm_slac_match</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  265. EVSE-HLE listens for <code class="constant">CM_SLAC_MATCH.REQ</code> from PEV-HLE and abandons the session if no indication is received within a reasonable time.
  266. If an indication is received then this function compares <code class="varname">RunID</code> from <code class="constant">CM_SLAC_MATCH.REQ</code> to the session.<em class="structfield"><code>RunID</code></em> to ensure the message is part of the current session.
  267. This function compares <code class="varname">APPLICATION_TYPE</code> and <code class="varname">SECURITY_TYPE</code> to the session.<em class="structfield"><code>APPLICATION_TYPE</code></em> and session.<em class="structfield"><code>SECURITY_TYPE</code></em> to ensure that they have not changed.
  268. This function copies <code class="varname">PEV_ID</code> and <code class="varname">PEV_MAC</code> from <code class="constant">CM_SLAC_MATCH.REQ</code> to the session variable for later use.
  269. This function updates session.<em class="structfield"><code>NMK</code></em> and session.<em class="structfield"><code>NID</code></em> with random values.
  270. This function copies session.<em class="structfield"><code>EVSE_ID</code></em>, session.<em class="structfield"><code>EVSE_MAC</code></em>, session.<em class="structfield"><code>NMK</code></em> and session.<em class="structfield"><code>NID</code></em> to <code class="constant">CM_SLAC_MATCH.RSP</code> and sends it unicast to the selecing PEV-HLE.
  271. </p></div><div class="section" title="evse_cm_set_key"><div class="titlepage"><div><div><h3 class="title"><a name="evse_cm_set_key"></a>
  272. evse_cm_set_key
  273. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">evse_cm_mnbc_sound</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  274. </p></div><div class="section" title="pev_cm_set_key"><div class="titlepage"><div><div><h3 class="title"><a name="pev_cm_set_key"></a>
  275. pev_cm_set_key
  276. </h3></div></div></div><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">signed <b class="fsfunc">pev_cm_mnbc_sound</b>(</code></td><td><var class="pdparam">session</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">channel</var>, </td><td> </td></tr><tr><td> </td><td><var class="pdparam">message</var><code>)</code>;</td><td> </td></tr></table><div class="paramdef-list"><code>struct session * <var class="pdparam">session</var></code>;<br><code>struct channel * <var class="pdparam">channel</var></code>;<br><code>struct message * <var class="pdparam">message</var></code>;</div><div class="funcprototype-spacer"> </div></div><p>
  277. </p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch07s11.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch07.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch08.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
  278. Traffic Functions
  279.  </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 8. 
  280. Serial Drivers
  281. </td></tr></table></div></body></html>