#pragma once

#include <iostream>
#include <string>
#include <memory>
#include "StateBase.hpp"
#include <bsp.hpp>

class SecondState final : public StateBase
{
  public:
	SecondState(uint32_t timeout = 0);

	enum Actions
	{
		getGPSPosition,
		suspendTheSystem,
		deepSleepTheSystem,
		numActions
	};
	
	void doStateEntry() final;
	void doStateExit(bool timeout) final;

	StateNames doStateActions(const event_t& event) final;

	/// getGPSPosition action handler.
	/// This action tries to get a GPS position. When that is complete,
	/// it goes back to the first state (for demonstration)
	StateNames getGPSPositionActionHandler(const event_t& event);

	StateNames suspendTheSystemActionHandler(const event_t& event);

	StateNames deepSleepTheSystemActionHandler(const event_t& event);

	GPS& gps_ = getGPS1();

	Actions current_action_;
};
