<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package GLPI::Agent::Task::Inventory::Generic::PCI::Modems;

use strict;
use warnings;

use parent 'GLPI::Agent::Task::Inventory::Module';

use GLPI::Agent::Tools;
use GLPI::Agent::Tools::Generic;

use constant    category    =&gt; "modem";

sub isEnabled {
    return 1;
}

sub doInventory {
    my (%params) = @_;

    my $inventory = $params{inventory};
    my $logger    = $params{logger};

    foreach my $modem (_getModems(logger =&gt; $logger)) {
        $inventory-&gt;addEntry(
            section =&gt; 'MODEMS',
            entry   =&gt; $modem
        );
    }
}

sub _getModems {
    my @modems;

    foreach my $device (getPCIDevices(@_)) {
        next unless $device-&gt;{NAME} =~ /modem/i;
        push @modems, {
            DESCRIPTION =&gt; $device-&gt;{NAME},
            NAME        =&gt; $device-&gt;{MANUFACTURER},
        };
    }

    return @modems;
}

1;
</pre></body></html>