ohomeplug.xml 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  1. <chapter id='ohomeplug'>
  2. <title>
  3. Class ohomeplug
  4. </title>
  5. <section id="ohomeplug-class">
  6. <title>
  7. Introduction
  8. </title>
  9. <para>
  10. This class implements a HomePlug AV message header encoder/decoder. When instantiated, it provides access the Ethernet header plus the HomePlug AV version and message type field. 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. Encode and export methods write class properties to external memory in network byte order. Decode and import methods read class properties from external memory in network byte order. Encode and decode methods always return the next unencoded or undecoded memory byte. Import and Export methods always return the object instance reference allowing class methods to be chained.
  14. </para>
  15. <para>
  16. 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.
  17. </para>
  18. <para>
  19. This class is declared in <ulink url='ohomeplug.hpp.html'>ohomeplug.hpp</ulink> and defined in <ulink url='ohomeplug.cpp.html'>ohomeplug.cpp</ulink>.
  20. </para>
  21. <section id="ohomeplug-inheritance">
  22. <title>
  23. Inheritance
  24. </title>
  25. <para>
  26. This class inherits the <link linkend='oethernet'>oethernet</link> class to implement the ethernet header portion of the message.
  27. </para>
  28. </section>
  29. <section id="ohomeplug-dependence">
  30. <title>
  31. Dependence
  32. </title>
  33. <para>
  34. This class references static class <link linkend='omemory'>omemory</link> to manipulate memory.
  35. </para>
  36. </section>
  37. </section>
  38. <section id="ohomeplug-properties">
  39. <title>
  40. Properties
  41. </title>
  42. <para>
  43. Class properties include all <link linkend='oethernet-properties'>oethernet</link> properties plus those described below.
  44. </para>
  45. <section id="ohomeplug-HeaderLength">
  46. <title>
  47. ohomeplug::HeaderLength
  48. </title>
  49. <funcsynopsis>
  50. <funcprototype>
  51. <funcdef>unsigned <function>HeaderLength</function></funcdef>
  52. <paramdef>void</paramdef>
  53. </funcprototype>
  54. </funcsynopsis>
  55. <para>
  56. Return HomePlug AV header length in bytes. The header length includes the Ethernet <link linkend='oethernet-HeaderLength'>HeaderLength</link> plus the HomePlug <link linkend='ohomeplug-MessageVersion'>MessageVersion</link> and <link linkend='ohomeplug-MessageType'>MessageType</link> lengths. Use this property to allocate buffer space in application programs.
  57. </para>
  58. </section>
  59. <section id="ohomeplug-MessageType">
  60. <title>
  61. ohomeplug::MessageType
  62. </title>
  63. <funcsynopsis>
  64. <funcprototype>
  65. <funcdef>uint16_t <function>MessageType</function></funcdef>
  66. <paramdef>void</paramdef>
  67. </funcprototype>
  68. </funcsynopsis>
  69. <para>
  70. Return the HomePlug AV message type as an integer in host byte order. This property is the same as the <varname>MMTYPE</varname> field described in the <citetitle>HomePlug AV Specification</citetitle>. On instantiation, this property contains <constant>oHOMEPLUG_MMTYPE</constant>, as defined in <ulink url='ohomeplug.hpp.html'>ohomeplug.hpp</ulink>.
  71. </para>
  72. </section>
  73. <section id="ohomeplug-MessageTypeString">
  74. <title>
  75. ohomeplug::MessageTypeString
  76. </title>
  77. <funcsynopsis>
  78. <funcprototype>
  79. <funcdef>uint16_t <function>MessageTypeString</function></funcdef>
  80. <paramdef>void</paramdef>
  81. </funcprototype>
  82. </funcsynopsis>
  83. <para>
  84. Return the HomePlug AV message type as a string. The string is <constant>6</constant> characters long including the <constant>NUL</constant> terminator.
  85. </para>
  86. </section>
  87. <section id="ohomeplug-MessageVersion">
  88. <title>
  89. ohomeplug::MessageVersion
  90. </title>
  91. <funcsynopsis>
  92. <funcprototype>
  93. <funcdef>uint8_t <function>MessageVersion</function></funcdef>
  94. <paramdef>void</paramdef>
  95. </funcprototype>
  96. </funcsynopsis>
  97. <para>
  98. Return the HomePlug AV message version as an 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>oHOMEPLUG_MMV</constant>, as defined in header file <ulink url='ohomeplug.hpp'>ohomeplug.hpp</ulink>.
  99. </para>
  100. </section>
  101. </section>
  102. <section id="ohomeplug-methods">
  103. <title>
  104. Methods
  105. </title>
  106. <para>
  107. Class methods include all <link linkend='oethernet-methods'>oethernet</link> methods plus those described below.
  108. </para>
  109. <section id="ohomeplug-ImportHeader">
  110. <title>
  111. ohomeplug::ImportHeader
  112. </title>
  113. <funcsynopsis>
  114. <funcprototype>
  115. <funcdef>void const * <function>ImportHeader</function></funcdef>
  116. <paramdef>void const * <parameter>memory</parameter></paramdef>
  117. </funcprototype>
  118. </funcsynopsis>
  119. <para>
  120. Decode external memory containing an Ethernet header and HomePlug AV specific header. Return the address of the next undecoded memory byte. Header fields are unpacked and stored in their respective properties. External memory is not changed by this operation.
  121. The number of bytes decoded will equal the <link linkend='ohomeplug-HeaderLength'>HeaderLength</link> property. Consequently, the memory address returned will be incremented by that amount and may be used for subsequent decoding operations.
  122. </para>
  123. </section>
  124. <section id="ohomeplug-ExportHeader">
  125. <title>
  126. ohomeplug::ExportHeader
  127. </title>
  128. <funcsynopsis>
  129. <funcprototype>
  130. <funcdef>void * <function>ExportHeader</function></funcdef>
  131. <paramdef>void * <parameter>memory</parameter> </paramdef>
  132. </funcprototype>
  133. </funcsynopsis>
  134. <para>
  135. Encode external memory with a complete HomePlug AV header. Return the address of the next unencoded byte. The encoded memory will contain the Ethernet header plus the HomePlug AV specific <link linkend='ohomeplug-MessageVersion'>MessageVersion</link> and <link linkend='ohomeplug-MessageType'>MessageType</link>. Instance property values are not changed by the operation. The number of bytes encoded will equal the <link linkend='ohomeplug-HeaderLength'>HeaderLength</link> property. Consequently, the memory address returned will incremented by that amount and may be used for subsequent encoding operations.
  136. </para>
  137. </section>
  138. <section id="ohomeplug-SetMessageVersion">
  139. <title>
  140. ohomeplug::SetMessageVersion
  141. </title>
  142. <funcsynopsis>
  143. <funcprototype>
  144. <funcdef>ohomeplug &amp; <function>SetMessageVersion</function></funcdef>
  145. <paramdef>uint8_t <parameter>version</parameter></paramdef>
  146. </funcprototype>
  147. </funcsynopsis>
  148. <para>
  149. Assign a new value to the message version.
  150. </para>
  151. </section>
  152. <section id="ohomeplug-SetMessageType">
  153. <title>
  154. ohomeplug::SetMessageType
  155. </title>
  156. <funcsynopsis>
  157. <funcprototype>
  158. <funcdef>ohomeplug &amp; <function>SetMessageType</function></funcdef>
  159. <paramdef>uint16_t <parameter>message</parameter></paramdef>
  160. </funcprototype>
  161. </funcsynopsis>
  162. <para>
  163. Specify the HomePlug AV message type as an integer in host byte order. The message type is stored internally in little-endian order. Valid HomePlug AV message types are <constant>0x0000</constant> through <constant>0x9FFC</constant> but this method does not validate the argument so any 16-bit value is permitted.
  164. </para>
  165. </section>
  166. <section id="ohomeplug-Print">
  167. <title>
  168. ohomeplug::Print
  169. </title>
  170. <funcsynopsis>
  171. <funcprototype>
  172. <funcdef>ohomeplug &amp; <function>Print</function></funcdef>
  173. <paramdef>void</paramdef>
  174. </funcprototype>
  175. </funcsynopsis>
  176. <para>
  177. Print the HomePlug AV header on stdout in human-friendly format.
  178. </para>
  179. </section>
  180. </section>
  181. </chapter>