X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=src%2FFactory.hh;h=a4c1c1f4683e10415a711a9e36f0aaeae3dd2088;hb=f280d6c6383f3642069fac8a490f827195619278;hp=595e271e1b9a717e637bff9c6ce611bd2e3c40fc;hpb=83dba70b46600014932da34e8744ba70584077aa;p=lib1wire.git diff --git a/src/Factory.hh b/src/Factory.hh index 595e271..a4c1c1f 100644 --- a/src/Factory.hh +++ b/src/Factory.hh @@ -9,19 +9,33 @@ #define FACTORY_HH_ #include +#include #include -#include "DeviceConfig.hh" -#include "W1Device.hh" +#include +#include +#include + +#ifndef W1_SCAN_ROOTDIR + #define W1_SCAN_ROOTDIR "/sys/bus/w1/devices" +#endif namespace w1 { class Factory { public: Factory(); virtual ~Factory(); - static W1Device *get_device(int family_code, std::string device_id, dirent *direntry_param); - static DeviceConfig *get_device_config(std::string device_id); + static std::list get_device_list(); + private: + //int parse_family_code(string folder_name); + static plp::Device *create_w1_device(int family_code_param, string device_type_param, string device_id_param, dirent *direntry_param); + static plp::Device *create_w1_device(int family_code, string device_id, dirent *direntry_param); + static plp::Device *create_w1_device(string device_type_param, string device_id_param); + static plp::Device *create_w1_device(dirent *direntry_param, int *err_code_param); + static std::list get_data_reader_list(); + static int get_family_code_by_device_type(string device_type_param); + static string get_device_type_by_family_code(int family_code_param); }; }