Source for file docsis_error.php

Documentation is available at docsis_error.php

  1. <?php
  2. /**
  3. * DOCSIS Error Encoder
  4. *
  5. * @author David Eder <david@eder.us>
  6. * @copyright 2004 David Eder
  7. * @package docsis_config
  8. * @version .1
  9. */
  10.  
  11. /**
  12. */
  13. require_once('docsis_common.php');
  14.  
  15. define('DOCSIS_ERROR_PARAMETER', 1);
  16. define('DOCSIS_ERROR_CODE', 2);
  17. define('DOCSIS_ERROR_MESSAGE', 3);
  18.  
  19. /**
  20. * DOCSIS Error Encoder
  21. *
  22. * @package docsis_config
  23. */
  24. class docsis_error extends docsis_encoder_complex
  25. {
  26. /**
  27. * Constructor
  28. *
  29. * @param int $code docsis code
  30. * @param array $value predefined values
  31. */
  32. function docsis_error($code, $value=array())
  33. {
  34. parent::docsis_encoder_complex($code, $value);
  35. $this->set_parameter(0);
  36. }
  37.  
  38. /**
  39. * Set Error Parameter
  40. *
  41. * The value of this parameter identifies the subtype in error.
  42. *
  43. * @param string $value
  44. */
  45. function set_parameter($value)
  46. {
  47. $this->value[DOCSIS_ERROR_PARAMETER] = new docsis_encoder_string(DOCSIS_ERROR_PARAMETER, $value);
  48. }
  49.  
  50. /**
  51. * Set Error Code
  52. *
  53. * @param int $value
  54. */
  55. function set_code($value)
  56. {
  57. $this->value[DOCSIS_ERROR_CODE] = new docsis_encoder_uchar(DOCSIS_ERROR_CODE, $value);
  58. }
  59.  
  60. /**
  61. * Set Error Message
  62. *
  63. * Set the text string to be displayed on the CM console and/or log.
  64. *
  65. * @param string $value
  66. */
  67. function set_message($value)
  68. {
  69. $this->value[DOCSIS_ERROR_MESSAGE] = new docsis_encoder_string(DOCSIS_ERROR_MESSAGE, $value . chr(0));
  70. }
  71. }
  72. ?>

Documentation generated on Mon, 14 Nov 2005 18:00:13 -0700 by phpDocumentor 1.3.0RC3