4 * Created on: Oct 20, 2010
10 #include "W1Device.hh"
15 W1Device::W1Device(dirent *direntry, int family_code_param, string id_param) {
20 rootdir = W1_SCAN_ROOTDIR;
21 temp_str = W1_SLAVE_FILE;
22 dir_path = rootdir + "/" + direntry->d_name;
23 slave_file = dir_path + "/" + temp_str;
24 family_code = family_code_param;
29 W1Device::~W1Device() {
32 int W1Device::get_family_code() {
36 string W1Device::get_id() {
40 string W1Device::get_name() {
44 void W1Device::set_name(string name_param) {
48 string W1Device::get_time() {
55 ltime = localtime(&wtime);
56 strftime(buffer, 80, "%Y-%m-%d %H:%M:%S", ltime);
61 void W1Device::printout() {
64 text = get_time() + ": device type = <unknown>, id = " + id + ", value = " + get_value();