例如,我需要找到总线中字节(1(的消息0x02。
当我使用时
on message 0x02
{
}
是这样吗?
on message *
{
if(this.id==0x02)
{
}
}
然后,我如何使用.byte(1)
的消息?
您的第二段代码是正确的方法。
on message *
{
if(this.id == 0x02)
{
write("%x", this.byte(1));
}
}
如上所示,即使对于this
关键字,也可以使用.byte(1)
。