package H1::EasyGateway;

use Data::Dump qw(dump);

use SOAP::Lite;

sub info {
	my ( $self, $ip ) = @_;

	my $ret;

	my $soap = SOAP::Lite
		->service('http://10.99.0.74:9090/cpews/services/Cpe112DiagnosisSoapImpl?WSDL');

	my $out = $soap->getWanDslStatus( "IP=$ip" );

	$ret->{$_} = $out->{$_} foreach keys %$out;

	my $out = $soap->getCpeBasicInfo( "IP=$ip" ); # mac, username, uptime

	foreach ( keys %$out ) {
		next unless defined $out->{$_}; # skip undef values
		$ret->{$_} = $out->{$_};
	}

	warn "# $ip = ",dump($ret);

	return $ret;
}

1;
