The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

HTTP::MobileAgent::DoCoMo - NTT DoCoMo implementation

SYNOPSIS

use HTTP::MobileAgent;

local $ENV{HTTP_USER_AGENT} = "DoCoMo/1.0/P502i/c10";
my $agent = HTTP::MobileAgent->new;

printf "Name: %s\n", $agent->name;       		# "DoCoMo"
printf "Ver: %s\n", $agent->version; 			# 1.0
printf "HTML ver: %s\n", $agent->html_version;	# 2.0
printf "Model: %s\n", $agent->model;			# "P502i"
printf "Cache: %dk\n", $agent->cache_size;		# 10
print  "FOMA\n" if $agent->is_foma;			# false
printf "Vendor: %s\n", $agent->vendor;		# 'P'
printf "Series: %s\n", $agent->series;		# "502i"

# only available with <form utn>
# e.g.) "DoCoMo/1.0/P503i/c10/serNMABH200331";
printf "Serial: %s\n", $agent->serial_number;		# "NMABH200331"

# e.g.) "DoCoMo/2.0 N2001(c10;ser0123456789abcde;icc01234567890123456789)";
printf "Serial: %s\n", $agent->serial_number;		# "0123456789abcde"
printf "Card ID: %s\n", $agent->card_id;		# "01234567890123456789"

# e.g.) "DoCoMo/1.0/P502i (Google CHTML Proxy/1.0)"
printf "Comment: %s\n", $agent->comment;		# "Google CHTML Proxy/1.0

# e.g.) "DoCoMo/1.0/D505i/c20/TB/W20H10"
printf "Status: %s\n", $agent->status;                # "TB"

# only available in eggy/M-stage
# e.g.) "DoCoMo/1.0/eggy/c300/s32/kPHS-K"
printf "Bandwidth: %dkbps\n", $agent->bandwidth;	# 32

# e.g.) "DoCoMo/2.0 SO902i(c100;TB;W30H16)"
print "XHTML compiant!\n" if $agent->xhtml_compliant;	# true

# e.g.) "DoCoMo/2.0 P07A(c500;TB;W24H15)"
printf "Browser ver: %s\n", $agent->browser_version   # 2.0

DESCRIPTION

HTTP::MobileAgent::DoCoMo is a subclass of HTTP::MobileAgent, which implements NTT docomo i-mode user agents.

METHODS

See "METHODS" in HTTP::MobileAgent for common methods. Here are HTTP::MobileAgent::DoCoMo specific methods.

version
$version = $agent->version;

returns DoCoMo version number like "1.0".

html_version
$html_version = $agent->html_version;

returns supported HTML version like '3.0'. retuns undef if unknown.

model
$model = $agent->model;

returns name of the model like 'P502i'.

cache_size
$cache_size = $agent->cache_size;

returns cache size as killobytes unit. returns 5 if unknown.

is_foma
if ($agent->is_foma) { }

retuns whether it's FOMA or not.

vendor
$vendor = $agent->vendor;

returns vender code like 'SO' for Sony. returns undef if unknown.

series
$series = $agent->series;

returns series name like '502i'. returns undef if unknown.

serial_number
$serial_number = $agent->serial_number;

returns hardware unique serial number (15 digit in FOMA, 11 digit otherwise alphanumeric). Only available with <form utn> attribute. returns undef otherwise.

card_id
$card_id = $agent->card_id;

returns FOMA Card ID (20 digit alphanumeric). Only available in FOMA with <form utn> attribute. returns undef otherwise.

comment
$comment = $agent->comment;

returns comment on user agent string like 'Google Proxy'. returns undef otherwise.

bandwidth
$bandwidth = $agent->bandwidth;

returns bandwidth like 32 as killobytes unit. Only vailable in eggy, returns undef otherwise.

status
$status = $agent->status;

returns status like "TB", "TC", "TD" or "TJ", which means:

TB | Browsers
TC | Browsers with image off (only Available in HTML 5.0)
TD | Fetching JAR
TJ | i-Appli
xhtml_compliant
if ($agent->xhtml_compliant) { }

returns if the agent is XHTML compliant.

browser_version
if ($agent->browser_version > 2.0) { }

returns browser version(1.0 or 2.0).

AUTHOR

Tatsuhiko Miyagawa <miyagawa@bulknews.net>

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

HTTP::MobileAgent

http://www.nttdocomo.co.jp/p_s/imode/spec/useragent.html

http://www.nttdocomo.co.jp/p_s/imode/spec/ryouiki.html

http://www.nttdocomo.co.jp/p_s/imode/tag/utn.html

http://www.nttdocomo.co.jp/p_s/mstage/visual/contents/cnt_mpage.html