#ifndef SRC_SAM_PROTOCOL_H_
#define SRC_SAM_PROTOCOL_H_
#include <klog.h>

#include "ip_client.h"
#include "sam_alarms.h"

class SAMprotocol
{
	cKlog logger;
	IPclient *mClient;

	int readRAM(uint16_t ramStart, uint8_t len, uint8_t *data, int data_len);
	int readNVRAM(uint16_t ramStart, uint8_t len, uint8_t *data, int data_len);

	int readAlarmLabel(uint8_t alarm_number, char *label);

public:
	SAMprotocol(IPclient *client);
	virtual ~SAMprotocol();

	bool getFirmware(char *version);
	bool getSiteID(char *id);
	bool getSnapshot();
	bool getEnvironment(std::vector<NodeAnalogInput*> env);
	bool getBattery(float *voltage, float *charge, float *discharge);
	bool getAlarmStatus(SAMalarms *alarms);
	bool getDPP();
	bool getEMU();
	bool getHEM();
	bool readAlarmLabels(std::vector<char*> *labels);
};

#endif /* SRC_SAM_PROTOCOL_H_ */
