#ifndef INCLUDE_SAM_H_
#define INCLUDE_SAM_H_
#include <klog.h>
#include <pthread.h>
#include <vector>

#include "node_port.h"
#include "sam_telemetry.h"
#include "ip_client.h"

class SAM
{
    cKlog logger;
    char mLabel[64];
    char mVersion[64];
    uint32_t mSerial;
	IPclient *mClient;
	SAMtelemetry *mTelemetry;

public:
	SAM(const char *label, uint32_t serial, const char *server_host, int server_port);
	virtual ~SAM();

	bool sample();

	std::vector<NodeDigitalInput*> getNodeDigitalInputs();
	std::vector<NodeAnalogInput*> getNodeAnalogInputs();
	void getHost(char *host, int *port);
	uint32_t getSerial(){ return mSerial; }
	const char *getLabel(){ return (const char*)mLabel; }
	const char *getVersionString(){ return (const char*)mVersion; }

	bool setupTelemetry(std::vector<char*> *alarm_labels);
	bool isTelemetrySet(){ return (mTelemetry > 0); }
};

#endif /* INCLUDE_SAM_H_ */
