Subversion Repositories HomeAutomation

Rev

Rev 999 | Blame | Compare with Previous | Last modification | View Log | SVN | RSS feed

  1.  
  2. function CanService(type, name, id)
  3. {
  4.     this.Service(type, name, id);
  5.  
  6.     this.myNode = null;
  7. }
  8.  
  9. extend(CanService, Service);
  10.  
  11. CanService.prototype.myNode = null;
  12.  
  13. CanService.prototype.canMessageHandler = function(canMessage)
  14. {
  15. }
  16.  
  17. CanService.prototype.setOnline = function()
  18. {
  19.     log(this.myName + ":" + this.myId + "> Service went online\n");
  20.     this.callEvent("online", null);
  21. }
  22.  
  23. CanService.prototype.setOffline = function()
  24. {
  25.     log(this.myName + ":" + this.myId + "> Service went offline\n");
  26.     this.callEvent("offline", null);
  27. }
  28.  
  29. CanService.prototype.isOnline = function()
  30. {
  31.     if (this.myNode)
  32.     {
  33.         return this.myNode.isOnline();
  34.     }
  35.    
  36.     return false;
  37. }
  38.  
  39. CanService.prototype.setNode = function(node)
  40. {
  41.     this.myNode = node;
  42. }
  43.  
  44. CanService.prototype.getNode = function()
  45. {
  46.     return this.myNode;
  47. }
  48.