ointellon.xml 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <chapter id='ointellon'>
  2. <title>
  3. Class ointellon
  4. </title>
  5. <section id="ointellon-class">
  6. <title>
  7. Introduction
  8. </title>
  9. <para>
  10. This class implements a HomePlug AV vendor specific message header encoder/decoder. When instantiated, it provides access the Ethernet header plus the vendor specific version, message type and OUI. Class methods may be used to encode/decode or import/export a complete header or individual header fields stored in external memory in proper byte order.
  11. </para>
  12. <para>
  13. The <link linkend='ohomeplug-MessageType'>MessageType</link> property and <link linkend='ointellon-SetMessageType'>SetMessageType</link> method perform implicit integer host-to-little-endian and little-endian-to-host conversion.
  14. </para>
  15. <para>
  16. This class is declared in <ulink url='ointellon.hpp.html'>ointellon.hpp</ulink> and defined in <ulink url='ointellon.cpp.html'>ointellon.cpp</ulink>.
  17. </para>
  18. <section id="ointellon-inheritance">
  19. <title>
  20. Inheritance
  21. </title>
  22. <para>
  23. This class inherits the <link linkend='oethernet'>oethernet</link> class to implement the Ethernet portion of the message header.
  24. </para>
  25. </section>
  26. <section id="ointellon-dependence">
  27. <title>
  28. Dependence
  29. </title>
  30. <para>
  31. This class references static class <link linkend='omemory'>omemory</link> to manipulate memory.
  32. </para>
  33. </section>
  34. </section>
  35. <section id="ointellon-properties">
  36. <title>
  37. Properties
  38. </title>
  39. <para>
  40. Class properties include all <link linkend='oethernet-properties'>oethernet</link> properties plus those described below.
  41. </para>
  42. <section id="ointellon-HeaderLength">
  43. <title>
  44. ointellon::HeaderLength
  45. </title>
  46. <funcsynopsis>
  47. <funcprototype>
  48. <funcdef>unsigned <function>HeaderLength</function></funcdef>
  49. <paramdef>void</paramdef>
  50. </funcprototype>
  51. </funcsynopsis>
  52. <para>
  53. Return the HomePlug AV vendor specific header length in bytes. The header length includes the Ethernet <link linkend='oethernet-HeaderLength'>HeaderLength</link> plus the Atheros <link linkend='ointellon-MessageVersion'>MessageVersion</link>, <link linkend='ointellon-MessageType'>MessageType</link> and <link linkend='ointellon-VendorOUI'>VendorOUI</link> lengths. Use this property to allocate buffer space in application programs.
  54. </para>
  55. </section>
  56. <section id="ointellon-LocalcastAddress">
  57. <title>
  58. ointellon::LocalcastAddress
  59. </title>
  60. <funcsynopsis>
  61. <funcprototype>
  62. <funcdef>const uint8_t * <function>LocalcastAddress</function></funcdef>
  63. <paramdef></paramdef>
  64. </funcprototype>
  65. </funcsynopsis>
  66. <para>
  67. Return the Atheros localcast address as a constant 48-bit integer in network byte order. The value is <constant>00:B0:52:00:00:01</constant> and the length is <constant>ETHER_ADDR_LEN</constant> bytes. Although shown here as a property, this is implemented as a constant. Parentheses are omitted when referencing it.
  68. </para>
  69. </section>
  70. <section id="ointellon-MessageType">
  71. <title>
  72. ointellon::MessageType
  73. </title>
  74. <funcsynopsis>
  75. <funcprototype>
  76. <funcdef>uint16_t <function>MessageType</function></funcdef>
  77. <paramdef>void</paramdef>
  78. </funcprototype>
  79. </funcsynopsis>
  80. <para>
  81. Return the vendor specific message type as a 16-bit integer in host byte order. This property is the same as the <varname>MMTYPE</varname> field described in the <citetitle>Firmware Technical Reference Manual</citetitle>. On instantiation, this property constains <constant>oINTELLON_MMTYPE</constant>, as defined in <ulink url='ointellon.hpp.html'>ointellon.hpp</ulink>.
  82. </para>
  83. </section>
  84. <section id="ointellon-MessageTypeString">
  85. <title>
  86. ointellon::MessageTypeString
  87. </title>
  88. <funcsynopsis>
  89. <funcprototype>
  90. <funcdef>uint16_t <function>MessageTypeString</function></funcdef>
  91. <paramdef>void</paramdef>
  92. </funcprototype>
  93. </funcsynopsis>
  94. <para>
  95. Return the HomePlug AV message type as a string. The length is <constant>6</constant> characters including the <constant>NUL</constant> terminator. The string is formatted as colon-seperated, hexadecimal octets in little-endian order, as in <quote>00:A0</quote>.
  96. </para>
  97. </section>
  98. <section id="ointellon-MessageVersion">
  99. <title>
  100. ointellon::MessageVersion
  101. </title>
  102. <funcsynopsis>
  103. <funcprototype>
  104. <funcdef>uint8_t <function>MessageVersion</function></funcdef>
  105. <paramdef>void</paramdef>
  106. </funcprototype>
  107. </funcsynopsis>
  108. <para>
  109. Return the message version as an 8-bit integer. The message version indicates the revision of the <citetitle>HomePlug AV Specification</citetitle> that describes the message format. On instantiation, this property contains <constant>oINTELLON_MMV</constant>, as defined in header file <ulink url='ointellon.hpp'>ointellon.hpp</ulink>. No methods are provided for changing the value.
  110. </para>
  111. </section>
  112. <section id="ointellon-MessageVersionString">
  113. <title>
  114. ointellon::MessageVersionString
  115. </title>
  116. <funcsynopsis>
  117. <funcprototype>
  118. <funcdef>char const * <function>MessageVersionString</function></funcdef>
  119. <paramdef>void</paramdef>
  120. </funcprototype>
  121. </funcsynopsis>
  122. <para>
  123. Return the message version as a string. The length is <constant>3</constant> characters including the <constant>NUL</constant> terminator. The string is formatted as one hexadecimal octet.
  124. </para>
  125. </section>
  126. <section id="ointellon-VendorOUI">
  127. <title>
  128. ointellon::VendorOUI
  129. </title>
  130. <funcsynopsis>
  131. <funcprototype>
  132. <funcdef>uint8_t <function>VendorOUI</function></funcdef>
  133. <paramdef>void</paramdef>
  134. </funcprototype>
  135. </funcsynopsis>
  136. <para>
  137. Return the vendor OUI as a byte array in network byte order. The length is <constant>ETHER_ADDR_LEN/2</constant> bytes. On instantiation, this property contains <constant>00:B0:52</constant>. No methods are provided for changing the value.
  138. </para>
  139. </section>
  140. <section id="ointellon-VendorOUIString">
  141. <title>
  142. ointellon::VendorOUIString
  143. </title>
  144. <funcsynopsis>
  145. <funcprototype>
  146. <funcdef>char const * <function>VendorOUIString</function></funcdef>
  147. <paramdef>void</paramdef>
  148. </funcprototype>
  149. </funcsynopsis>
  150. <para>
  151. Return the vendor OUI as a string. The length is <constant>ETHER_ADDR_LEN*3/2</constant> characters including the <constant>NUL</constant> terminator. The string is formatted as colon-seperated, hexadecimal octets, as in <quote>00:B0:52</quote>.
  152. </para>
  153. </section>
  154. </section>
  155. <section id="ointellon-methods">
  156. <title>
  157. Methods
  158. </title>
  159. <para>
  160. Class methods include all <link linkend='oethernet-methods'>oethernet</link> methods plus those described below.
  161. </para>
  162. <section id="ointellon-ExportHeader">
  163. <title>
  164. ointellon::ExportHeader
  165. </title>
  166. <funcsynopsis>
  167. <funcprototype>
  168. <funcdef>void * <function>ExportHeader</function></funcdef>
  169. <paramdef>void * <parameter>memory</parameter> </paramdef>
  170. </funcprototype>
  171. </funcsynopsis>
  172. <para>
  173. Encode external memory with a HomePlug AV vendor specific message header. Return the address of the next unencoded memory byte. The number of bytes encoded will equal the <link linkend='ointellon-HeaderLength'>HeaderLength</link> property. The <varname>memory</varname> address is incremented by that amount and returned as the method value for subsequent export operations. The encoded header will include the Ethernet header plus the Atheros specific <link linkend='ointellon-MessageVersion'>MessageVersion</link> and <link linkend='ointellon-MessageType'>MessageType</link>. Instance properties are not modified by the operation.
  174. </para>
  175. </section>
  176. <section id="ointellon-ImportHeader">
  177. <title>
  178. ointellon::ImportHeader
  179. </title>
  180. <funcsynopsis>
  181. <funcprototype>
  182. <funcdef>void const * <function>ImportHeader</function></funcdef>
  183. <paramdef>void const * <parameter>memory</parameter></paramdef>
  184. </funcprototype>
  185. </funcsynopsis>
  186. <para>
  187. Decode external memory containing a HomePlug AV specific header. Return the address of the next undecoded memory byte. No length argument is required. The number of bytes decoded will be <link linkend='ointellon-HeaderLength'>HeaderLength</link>. The <varname>memory</varname> address is incremented by that amount and returned as the method value for subsequent import operations. External memory is unpacked and stored in Ethernet header properties and the Atheros <link linkend='ointellon-MessageVersion'>MessageVersion</link> and <link linkend='ointellon-MessageType'>MessageType</link> properties. External memory is not modified by this operation.
  188. </para>
  189. </section>
  190. <section id="ointellon-IsMessageType">
  191. <title>
  192. ointellon::IsMessageType
  193. </title>
  194. <funcsynopsis>
  195. <funcprototype>
  196. <funcdef>bool <function>IsMessageType</function></funcdef>
  197. <paramdef>uint16_t <parameter>type</parameter></paramdef>
  198. </funcprototype>
  199. </funcsynopsis>
  200. <para>
  201. Return <constant>true</constant> if this instance contains the expected Atheros vendor specific message header having the specified message <varname>type</varname>. This method may be called after importing an unknown message header to verify that the instance now contains the expected <link linkend='ointellon-MessageType'>MessageType</link> of <varname>type</varname> and the default <link linkend='ointellon-MessageVersion'>MessageVersion</link> and <link linkend='ointellon-VendorOUI'>VendorOUI</link>, all in one operation. It is typically used to detect, and possibly ignore, unexpected confirmation and indiction messages.
  202. </para>
  203. </section>
  204. <section id="ointellon-SetMessageVersion">
  205. <title>
  206. ointellon::SetMessageVersion
  207. </title>
  208. <funcsynopsis>
  209. <funcprototype>
  210. <funcdef>ointellon &amp; <function>SetMessageVersion</function></funcdef>
  211. <paramdef>uint8_t <parameter>version</parameter></paramdef>
  212. </funcprototype>
  213. </funcsynopsis>
  214. <para>
  215. Assign a new value to the message version.
  216. </para>
  217. </section>
  218. <section id="ointellon-SetMessageType">
  219. <title>
  220. ointellon::SetMessageType
  221. </title>
  222. <funcsynopsis>
  223. <funcprototype>
  224. <funcdef>ointellon &amp; <function>SetMessageType</function></funcdef>
  225. <paramdef>uint16_t <parameter>type</parameter></paramdef>
  226. </funcprototype>
  227. </funcsynopsis>
  228. <para>
  229. Specify the HomePlug AV vendor specific message type as an integer in host byte order. The <varname>type</varname> is stored internally in little-endian order. Valid HomePlug AV vendor specific message types are <constant>0xA000</constant> through <constant>0xBFFC</constant> but this method does not validate the argument so any 16-bit value is permitted.
  230. </para>
  231. </section>
  232. <section id="ointellon-Print">
  233. <title>
  234. ointellon::Print
  235. </title>
  236. <funcsynopsis>
  237. <funcprototype>
  238. <funcdef>ointellon &amp; <function>Print</function></funcdef>
  239. <paramdef>void</paramdef>
  240. </funcprototype>
  241. </funcsynopsis>
  242. <para>
  243. Print the HomePlug AV header on stdout in human-friendly format.
  244. </para>
  245. </section>
  246. </section>
  247. </chapter>