Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions oxc.pl
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,21 @@ sub set_path {
# read the file for temp information. owfs format is slightly different than serial #s
# ie 103A8CE400080002 = 10.3A8CE400080000

for my $index (0..$#OWFS_hubs) {
&xAP::Util::debug("Testing OWFS for $sensor");
my $sensor_owfs_name = substr($sensor,0,2) . "." . substr($sensor,2,10) . "00";

foreach my $hub (@OWFS_hubs) {
my $hub_filename = $root . $hub;
&xAP::Util::debug("Testing OWFS: Looking in hub: $hub_filename");
my @file_list = glob($hub_filename . "*");

foreach my $filename (@file_list) {
if ($filename =~ /$sensor_owfs_name/) {
$self->{Path} = $hub_filename . $sensor_owfs_name;
last;
}
}

my $owfs_file = $root . $OWFS_hubs[$index] . substr($sensor,0,2) . "." . substr($sensor,2,10) . "00";
$self->{Path} = $owfs_file if (-e $owfs_file);
if ($self->{Path}) {
&xAP::Util::debug("OWFS Path for $sensor is $self->{Path}");
return $self->{Path};
Expand Down