Open satakagi opened 2 years ago
雑ですがこんな感じですか diff polyfill_patched.js polyfill.js
255,269d254
< addEventListener: function(ename,cbf){
< if ( ename != "change" || typeof cbf != "function"){
< return;
< }
< bone.registerEvent(0x14, this.portNumber, (buf) => {
< infoLog("change event");
< cbf({port:this,value:buf[5]});
< });
< },
< removeEventListener: function(ename,cbf){
< if ( ename != "change" || typeof cbf != "function"){
< return;
< }
< bone.removeEvent(0x14, this.portNumber);
< },
282c267
< this.onchange({port:this,value:buf[5]});
---
> this.onchange(buf[5]);
あ、bone.registerEventは一個しか登録できない・・ 雑過ぎか。
以下参照 https://github.com/chirimen-oh/node-web-gpio/issues/33
http://browserobo.github.io/WebGPIO/