Net_UserAgent_Mobile
[ class tree: Net_UserAgent_Mobile ] [ index: Net_UserAgent_Mobile ] [ all elements ]

Class: Net_UserAgent_Mobile_DoCoMo

Source Location: /Net_UserAgent_Mobile-0.13/Mobile/DoCoMo.php

Class Overview

PEAR
   |
   --Net_UserAgent_Mobile_Common
      |
      --Net_UserAgent_Mobile_DoCoMo

NTT DoCoMo implementation


Author(s):

Version:

  • $Revision: 1.14 $

Methods


Inherited Variables

Inherited Methods

Class: Net_UserAgent_Mobile_Common

Net_UserAgent_Mobile_Common::Net_UserAgent_Mobile_Common()
constructor
Net_UserAgent_Mobile_Common::getDisplay()
returns Net_UserAgent_Mobile_Disply object
Net_UserAgent_Mobile_Common::getHeader()
returns a specified HTTP header
Net_UserAgent_Mobile_Common::getName()
returns User-Agent name like 'DoCoMo'
Net_UserAgent_Mobile_Common::getUserAgent()
returns User-Agent string
Net_UserAgent_Mobile_Common::getVersion()
returns User-Agent version number like '1.0'
Net_UserAgent_Mobile_Common::isAirHPhone()
returns true if the agent is AirH"PHONE
Net_UserAgent_Mobile_Common::isDoCoMo()
returns true if the agent is DoCoMo
Net_UserAgent_Mobile_Common::isEZweb()
returns true if the agent is EZweb
Net_UserAgent_Mobile_Common::isJPhone()
returns true if the agent is J-PHONE
Net_UserAgent_Mobile_Common::isNonMobile()
returns true if the agent is NonMobile
Net_UserAgent_Mobile_Common::isWAP1()
returns true if the agent can speak WAP1 protocol
Net_UserAgent_Mobile_Common::isWAP2()
returns true if the agent can speak WAP2 protocol
Net_UserAgent_Mobile_Common::makeDisplay()
create a new Net_UserAgent_Mobile_Display class instance (should be implemented in subclasses)
Net_UserAgent_Mobile_Common::noMatch()
generates a warning message for new variants
Net_UserAgent_Mobile_Common::parse()
parse HTTP_USER_AGENT string (should be implemented in subclasses)
Net_UserAgent_Mobile_Common::raiseError()
This method is used to communicate an error and invoke error callbacks etc. Basically a wrapper for PEAR::raiseError without the message string.

Class Details

[line 78]
NTT DoCoMo implementation

Net_UserAgent_Mobile_DoCoMo is a subclass of Net_UserAgent_Mobile_Common, which implements NTT docomo i-mode user agents.

SYNOPSIS:


1 require_once('Net/UserAgent/Mobile.php');
2
3 $_SERVER['HTTP_USER_AGENT'] = 'DoCoMo/1.0/P502i/c10';
4 $agent = &Net_UserAgent_Mobile::factory();
5
6 printf("Name: %s\n", $agent->getName()); // 'DoCoMo'
7 printf("Version: %s\n", $agent->getVersion()); // 1.0
8 printf("HTML version: %s\n", $agent->getHTMLVersion()); // 2.0
9 printf("Model: %s\n", $agent->getModel()); // 'P502i'
10 printf("Cache: %dk\n", $agent->getCacheSize()); // 10
11 if ($agent->isFOMA()) {
12 print "FOMA\n"; // false
13 }
14 printf("Vendor: %s\n", $agent->getVendor()); // 'P'
15 printf("Series: %s\n", $agent->getSeries()); // '502i'
16
17 // only available with <form utn>
18 // e.g.) 'DoCoMo/1.0/P503i/c10/serNMABH200331';
19 printf("Serial: %s\n", $agent->getSerialNumber()); // 'NMABH200331'
20
21 // e.g.) 'DoCoMo/2.0 N2001(c10;ser0123456789abcde;icc01234567890123456789)';
22 printf("Serial: %s\n", $agent->getSerialNumber()); // '0123456789abcde'
23 printf("Card ID: %s\n", $agent->getCardID()); // '01234567890123456789'
24
25 // e.g.) 'DoCoMo/1.0/P502i (Google CHTML Proxy/1.0)'
26 printf("Comment: %s\n", $agent->getComment()); // 'Google CHTML Proxy/1.0'
27
28 // only available in eggy/M-stage
29 // e.g.) 'DoCoMo/1.0/eggy/c300/s32/kPHS-K'
30 printf("Bandwidth: %dkbps\n", $agent->getBandwidth());



[ Top ]


Method Detail

getBandwidth   [line 341]

integer getBandwidth( )

returns bandwidth like 32 as killobytes unit. Only vailable in eggy, returns null otherwise.
  • Access: public

[ Top ]

getCacheSize   [line 258]

integer getCacheSize( )

returns cache size as killobytes unit. returns 5 if unknown.
  • Access: public

[ Top ]

getCardID   [line 397]

string getCardID( )

returns FOMA Card ID (20 digit alphanumeric). Only available in FOMA with <form utn> attribute. returns null otherwise.
  • Access: public

[ Top ]

getComment   [line 383]

string getComment( )

returns comment on user agent string like 'Google Proxy'. returns null otherwise.
  • Access: public

[ Top ]

getHTMLVersion   [line 228]

string getHTMLVersion( )

returns supported HTML version like '3.0'. retuns null if unknown.
  • Access: public

[ Top ]

getModel   [line 314]

string getModel( )

returns name of the model like 'P502i'
  • Access: public

[ Top ]

getSerialNumber   [line 356]

string getSerialNumber( )

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

returns null otherwise.

  • Access: public

[ Top ]

getSeries   [line 279]

string getSeries( )

returns series name like '502i'. returns null if unknown.
  • Access: public

[ Top ]

getStatus   [line 327]

string getStatus( )

returns status of the cache (TB, TD, TJ)
  • Access: public

[ Top ]

getVendor   [line 298]

string getVendor( )

returns vender code like 'SO' for Sony. returns null if unknown.
  • Access: public

[ Top ]

isDoCoMo   [line 155]

boolean isDoCoMo( )

returns true
  • Access: public

Overrides Net_UserAgent_Mobile_Common::isDoCoMo() (returns true if the agent is DoCoMo)
[ Top ]

isFOMA   [line 369]

boolean isFOMA( )

retuns whether it's FOMA or not
  • Access: public

[ Top ]

isGPS   [line 408]

boolean isGPS( )

  • Access: public

[ Top ]

makeDisplay   [line 208]

object a makeDisplay( )

create a new Net_UserAgent_Mobile_Display class instance

Overrides Net_UserAgent_Mobile_Common::makeDisplay() (create a new Net_UserAgent_Mobile_Display class instance (should be implemented in subclasses))
[ Top ]

parse   [line 168]

mixed parse( )

parse HTTP_USER_AGENT string
  • Return: void, or a PEAR error object on error
  • Access: public

Overrides Net_UserAgent_Mobile_Common::parse() (parse HTTP_USER_AGENT string (should be implemented in subclasses))
[ Top ]


Documentation generated on Sat, 1 May 2004 00:31:50 +0200 by phpDocumentor 1.2.3. PEAR Logo Copyright © PHP Group 2004.