I am trying to add instance variables to my DriverKit class. I declare them in the class definition in the .iig file but when i try to access them in the .cpp file i get an error "Use of undeclared identifier". Is there a limitation that prevents instance variables in the classes defined for DriverKit?
.iig file
class VirtualJoystick: public IOUserUSBHostHIDDevice
{
public:
virtual kern_return_t
Start(IOService * provider) override;
virtual kern_return_t
Stop(IOService * provider) override;
virtual bool init() override;
virtual void free() override;
virtual OSDictionary * newDeviceDescription(void) override;
virtual OSData * newReportDescriptor(void) override;
virtual kern_return_t getReport(
IOMemoryDescriptor *report,
IOHIDReportType reportType,
IOOptionBits options,
uint32_t completionTimeout,
OSAction *action
) override;
private:
// the stored state of all the buttons
uint32_t _buttons = 0;
};
example Usage in .cpp
bool VirtualJoystick::init() {
this->_buttons = 0; // Use of undeclared identifier '_buttons'
}