set addFilter as override

This commit is contained in:
lyon1998 2022-04-15 14:53:25 +08:00
parent da538a1a22
commit 69eee43c81
4 changed files with 16 additions and 8 deletions

View File

@ -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

View File

@ -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);

View File

@ -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

View File

@ -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);