/*
 * ButtonStateSm.h
 *
 *  Created on: 19 nov. 2023
 *      Author: remi.heredero
 */

#ifndef BUTTON_BUTTONSTATESM_H_
#define BUTTON_BUTTONSTATESM_H_

#include "xf/behavior.h"

class ButtonStateSm : public XFBehavior {
public:
	ButtonStateSm();
	virtual ~ButtonStateSm() = default;
	void genButtonPressed();
	void genButtonReleased();

protected:
	void notifyShortPress();
	void notifyLongPress();
	void genNullTransition();

	typedef enum {
		evButtonPressed = 10,
		evButtonReleased,
		evReturn
	} event;

	const uint8_t buttonIndex_;

	XFState stWaitButtonPressed;
	XFState stButtonPressed;
	XFState stButtonShortPressed;
	XFState stButtonLongPressed;

private:
	static uint8_t getNbInstance();


};

#endif /* BUTTON_BUTTONSTATESM_H_ */
