
#ifndef SensorController_h
#define SensorController_h

#include <Arduino.h>
#include "MyTools.h"
#include "Cama_commands.h"
#define MAX_TEMPLATES 1700

class SensorController
{
private:
    MyTools tools;
    uint8_t outbuffer[REGULAR_PACKET_LENGTH];
    uint8_t inbuffer[REGULAR_PACKET_LENGTH];

public:
    // String template_buffer;
    uint8_t template_buffer[TEMPLATE_DATA_PACKET_LENGTH];
    SensorController();
    String getCommand(uint16_t cmd, uint16_t len, uint16_t slot_h, uint16_t slot_l, uint16_t buffer_id);
    String getData(uint16_t cmd, uint16_t len, String data);
    String getCommand(uint16_t cmd, uint16_t len, uint16_t begin, uint16_t end);
    String getCommand(uint16_t cmd, uint16_t len);
    uint16_t templatesCount();
    bool detectFinger();
    void camaTest();
    void setDuplicationCheck(bool check);
    void setSecurityLevel(uint8_t securityLevel);
    void setAutoLearn(bool learn);
    uint16_t identify();
    bool generateTemplate(uint16_t ram_buffer);
    bool mergeTemplate(uint16_t ram_buffer, uint16_t count);
    bool getImage();
    bool deleteAllTemplates();
    bool deleteTemplate(uint16_t slot);
    bool saveTemplate(uint16_t slot, String template_chars, uint16_t template_len);
    // getTemplateData(template); //TODO
    uint16_t enrollAndStore(); // TODO
};
#endif