Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
11 years, 3 months ago.
CAN Class inheritance
Hello
I am trying to implement CAN with mbed as on of the nodes. I created the following three classes:
class myCanSignal { stores signal attributes such as min value, max value ,bit position, length,value etc.} class myCanMessage { array of signals,ID,format,type,length,Data, etc} class myCanBus{ speed,address}
In order to send CAN messages from mbed, I defined "myCanMessage" as a child of the mbed class CANMessage and "myCanBus" as a child to mbed class CAN respectively. The problem that I am facing is my classes are unable to inherit the member functions of the mbed classes.
Following is one of the instances where i see this error:
constructor myCanBus::myCANBus(PinName rd,PinName td) : CAN(rd,td) frequency(Bauud_rate); }
Compiling this code I get an error that frequency is an unknown identifier (frequency is a member function of class CAN). Is this the wrong way to inherit member functions of an mbed class?
1 Answer
11 years, 3 months ago.
It's hard to tell where the problem is without seeing your code. Are you inheriting from CAN in your header file like this?
class MyClass : public BaseClass { public: //Your declarations here };