package Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Controllers;
use strict;
use Ocsinventory::Agent::Backend::OS::BSD::Pcictl::Pcictl;

sub run {
	my $params = shift;
	my $inventory = $params->{inventory};

        foreach (runpcictl()) {
                if ($_ =~ m/^\S+:\s(.+)\s\(([^,]+)(,.+)?\)$/i) {
			my $name = $1;
			my $manufacturer = "";
			my $type = $2;
			$manufacturer =~ s/\ *$//; # clean up the end of the string

			$inventory->addController({
				'NAME'          => $name,
				'MANUFACTURER'  => $manufacturer,
				'TYPE'          => $type,
			});
		}
        }

}

1
