diff --git a/package/PikaStdDevice/PikaStdDevice.py b/package/PikaStdDevice/PikaStdDevice.py index 7cc0f82fe..62aad51c9 100644 --- a/package/PikaStdDevice/PikaStdDevice.py +++ b/package/PikaStdDevice/PikaStdDevice.py @@ -329,9 +329,6 @@ class CAN(TinyObj): def setMode(self, mode: str): pass - def addFilter(self, id:int, ide:int, rtr:int, mode:int,mask:int, hdr:int): - pass - def enable(self): pass @@ -344,6 +341,10 @@ class CAN(TinyObj): def read(self, length: int) -> str: pass + # need override + def addFilter(self, id:int, ide:int, rtr:int, mode:int,mask:int, hdr:int): + pass + # need override def platformEnable(self): pass diff --git a/package/PikaStdDevice/PikaStdDevice_CAN.c b/package/PikaStdDevice/PikaStdDevice_CAN.c index 5ec849674..417f2d86f 100644 --- a/package/PikaStdDevice/PikaStdDevice_CAN.c +++ b/package/PikaStdDevice/PikaStdDevice_CAN.c @@ -7,7 +7,10 @@ void PikaStdDevice_CAN_addFilter(PikaObj* self, int ide, int mask, int mode, - int rtr) {} + int rtr) { + obj_setErrorCode(self, 1); + obj_setSysOut(self, "[error] platform method need to be override."); +} void PikaStdDevice_CAN_disable(PikaObj* self) { obj_runNativeMethod(self, "platformDisable", NULL); diff --git a/port/linux/package/pikascript/PikaStdDevice.py b/port/linux/package/pikascript/PikaStdDevice.py index 7cc0f82fe..62aad51c9 100644 --- a/port/linux/package/pikascript/PikaStdDevice.py +++ b/port/linux/package/pikascript/PikaStdDevice.py @@ -329,9 +329,6 @@ class CAN(TinyObj): def setMode(self, mode: str): pass - def addFilter(self, id:int, ide:int, rtr:int, mode:int,mask:int, hdr:int): - pass - def enable(self): pass @@ -344,6 +341,10 @@ class CAN(TinyObj): def read(self, length: int) -> str: pass + # need override + def addFilter(self, id:int, ide:int, rtr:int, mode:int,mask:int, hdr:int): + pass + # need override def platformEnable(self): pass diff --git a/port/linux/package/pikascript/pikascript-lib/PikaStdDevice/PikaStdDevice_CAN.c b/port/linux/package/pikascript/pikascript-lib/PikaStdDevice/PikaStdDevice_CAN.c index 5ec849674..417f2d86f 100644 --- a/port/linux/package/pikascript/pikascript-lib/PikaStdDevice/PikaStdDevice_CAN.c +++ b/port/linux/package/pikascript/pikascript-lib/PikaStdDevice/PikaStdDevice_CAN.c @@ -7,7 +7,10 @@ void PikaStdDevice_CAN_addFilter(PikaObj* self, int ide, int mask, int mode, - int rtr) {} + int rtr) { + obj_setErrorCode(self, 1); + obj_setSysOut(self, "[error] platform method need to be override."); +} void PikaStdDevice_CAN_disable(PikaObj* self) { obj_runNativeMethod(self, "platformDisable", NULL);