Subversion Repositories HomeAutomation

Rev

Rev 969 | Details | Compare with Previous | Last modification | View Log | SVN | RSS feed

Rev Author Line No. Line
969 runge 1
 
999 runge 2
function Debug(type, name, id)
969 runge 3
{
999 runge 4
    this.CanService(type, name, id);
969 runge 5
 
6
    this.myString = "";
7
}
8
 
9
extend(Debug, CanService);
10
 
11
Debug.prototype.myString = null;
12
 
13
Debug.prototype.canMessageHandler = function(canMessage)
14
{
15
    if (canMessage.getDirectionFlag() == "From_Owner")
16
    {
17
        switch (canMessage.getCommandName())
18
        {
19
        case "Printf":
20
        this.myString += unescape(canMessage.getData("Text"));
21
 
22
        if (this.myString[this.myString.length-1] == '\n')
23
        {
24
            log(this.myName + ":" + this.myId + "> Printf: " + this.myString);
25
            this.myString = "";
26
        }
27
        break;
28
        }
29
    }
30
 
31
    this.CanService.prototype.canMessageHandler.call(this, canMessage);
32
}