Designing simple state machine in C++
That's typically how C enums are written, but it's done differently in C++.  The typedef keyword is no longer needed, and the name is given after the enum keyword.

enum State {
    Idle,
    Start,
    Stop,
    ChangeSpeed
};