newtx/scanner/scanner_const_opts.h

29 lines
754 B
C
Raw Normal View History

2023-12-18 01:39:48 +00:00
// scanner const attributes definitions:
//
// Contains: vid, pid, serial-number, ip, mac, firmware-ver, roll-life, name, family
//
// Date: 2023-12-16
#include <sane_opt_json/base_opt.h>
class scanner_const_opts : public sane_opt_provider
{
std::string root_;
std::string get_device_content(const char* path);
std::string get_ip(void);
std::string get_mac(void);
void init(void);
public:
scanner_const_opts(const char* dev_path = "/opt/cfg/usb_gadget/g1");
protected:
~scanner_const_opts();
public:
// return malloc(), real data size stored in parameter 'size'. invoker should free() the returned value
virtual char* get_value(const char* name, void* value, size_t* size, int* err = nullptr) override;
};