PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBNetwork
Wrapper Class for the INetwork interface.
#include <SFBNetwork.h.hpp>
class SFBNetwork : public SFBQuery;
SFMTYPEDEFWRAPPER(SFBNetwork)

Inheritance diagram

 Inheritance diagram of SFBNetworkClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
X X O O

Reference

BREW API IAddrInfo

Member

Public Functions
SFCError AddRetryCB( AEECallback * cbRetry )
This function should be used by clients in order to be notified when the SFBNetwork::Start() operation should be retried. It is used in conjunction with SFBNetwork::Start() to control a "Network Bring up" transaction.
SFCError ExtFunc( AEECLSID clsid , VoidPtr buffer , SInt32 length )
The extera function for the interchangeability with the interface that added in the future.
SFCError ExtFunc( AEECLSID clsid , SFXBufferConstRef buffer )
The extera function for the interchangeability with the interface that added in the future.
SFCError GenerateIPv6PrivAddr( Bool unique )
Request to generate a private IPv6 address.
SFCError GetBearerTechnology( AEEBearerTechType * tech )
Return the bearer technology type for this network.
SFCError GetBearerTechnologyOpts( SFBBearerTechnologySmpPtr techOpts )
Return the bearer technology options for this network.
SFCError GetIPv6PrefixInfo( INAddr6 * addr , AEEIPv6PrefixInfo * info )
Return the information regarding an IPv6 Prefix corresponding to a given address.
SFCError GetIPv6PrivAddrInfo( AEEIPv6PrivAddrInfo * info )
Return the information associated with the private IPv6 address generated using this INetwork interface.
SFCError GetLastNetDownReason( AEENetDownReason * reason )
Return the last network down reason.
SFCError GetMyIPAddrs( IPAddr * aipaAddr , SInt32Ptr number )
Returns the IP addresses of the local host or device, in network byte order.
SFCError GetOpt( SInt32 name , VoidPtr data , SInt32Ptr length )
This function provides the ability to query certain network options.
SFCError GetOpt( SInt32 name , SFXBufferPtr data )
This function provides the ability to query certain network options.
SFCError GetOutageInfo( AEEOutageInfo * info )
Return the information associated with the latest outage event associated with this data network.
SFCError GetSipServerAddr( IPAddr addresses[] , UInt08 num , UInt08Ptr required )
Return the SIP (Session Initiation Protocol) server IP addresses for this network.
SFCError GetSipServerDomainNames( AEENetDomainName domains[] , UInt08 num , UInt08Ptr required )
Return the SIP (Session Initiation Protocol) server Domain Names for this network.
SFCError GetSupportedQoSProfiles( UInt16 profiles , UInt08 num , UInt08Ptr required )
Return the current QoS Profiles supported by the network.
SFCError IsQoSAware( BoolPtr QoSAware )
This function is supported only for CDMA network. It queries whether the mobile is currently on a system which supports QoS (Aware System) or on a system which does not support QoS (Unaware system).
SFCError NetStatus( AEENetStatus * netstatus , AEENetStats * constatus )
Return the current network status.
static
SFBNetworkSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBNetwork instance.
static
SFBNetworkSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBNetwork instance.
SFCError OnEvent( SInt32 event , PFNNETWORKEVENT eventfn , VoidPtr user , Bool reg )
This function allows the caller to register to receive notifications of network status changes and events.
SFCError RefreshDHCPConfigInfo( Void )
Ask the network to refresh the DHCP config info.
SFCError SelectNetworkEx( SInt32 network , SInt16 family )
Select a specific data network.
SFCError SetDormancyTimeout( UInt08 seconds )
Set the IS-707 (cdma2000 1x) packet data dormancy timeout for the network connection to the value specified by ucSecs.
SFCError SetLinger( UInt16 seconds , UInt16Ptr ldsecs )
Set the linger time for the network connection to the value specified by wSecs, and return the previous value in pwOldSecs
SFCError SetOpt( SInt32 name , VoidPtr data , SInt32 length )
This function provides the ability to configure certain network options
SFCError SetOpt( SInt32 name , SFXBufferConstRef data )
This function provides the ability to configure certain network options
SFCError Start( Void )
This function is used to explicitly bring up a network connection.
SFCError QueryInterface( AEECLSID clsid , VoidHandle handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFCError QueryInterface( AEECLSID clsid , SFBBaseSmpPtr handle ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
SFBBaseSmp QueryInterface( AEECLSID clsid ) (inherits from SFBQuery)
Ask an object for another API contract from the object in question.
Void Self( AEECLSID clsidReq , SFBQuerySmpPtr clone , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
SFBQuerySmp Self( AEECLSID clsidReq , AEECLSID clsidImp ) (inherits from SFBQuery)
Helper macro for those implementing an object with a single interface.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBNetwork::AddRetryCB
This function should be used by clients in order to be notified when the SFBNetwork::Start() operation should be retried. It is used in conjunction with SFBNetwork::Start() to control a "Network Bring up" transaction.
[ public ]
SFCError AddRetryCB(
    AEECallback * cbRetry   // the client's callback
);

Return value

  • AEE_SUCCESS: client's callback was stored successfully.
  • AEE_EBADPARM: pcbRetry is NULL.

Reference

BREW API INetwork_AddRetryCB | SFBNetwork::Start


SFBNetwork::ExtFunc
The extera function for the interchangeability with the interface that added in the future.
[ public ]
SFCError ExtFunc(
    AEECLSID clsid   // Class ID
    VoidPtr buffer   // buffer
    SInt32 length    // size of buffer
);
[ public ]
SFCError ExtFunc(
    AEECLSID clsid             // Class ID
    SFXBufferConstRef buffer   // buffer
);

Reference

BREW API INETWORK_EXT_FUNC_GET_SELECTED_NETWORK | BREW API INETWORK_EXT_FUNC_IGNORE_TIMEOUT_VALS


SFBNetwork::GenerateIPv6PrivAddr
Request to generate a private IPv6 address.
[ public ]
SFCError GenerateIPv6PrivAddr(
    Bool unique   // true if the user wishes to generate a unique address, false if the user wishes to generate a shared address
);

Version

Introduced BREW Client 3.1.5 SP01, but not supported in BREW version 4.0

Reference

BREW API INetwork_GenerateIPv6PrivAddr


SFBNetwork::GetBearerTechnology
Return the bearer technology type for this network.
[ public ]
SFCError GetBearerTechnology(
    AEEBearerTechType * tech   // caller allocated struct, in which the bearer technology information is returned
);

Version

Introduced BREW Client 3.1.5 SP01

Reference

BREW API INetwork_GetBearerTechnology


SFBNetwork::GetBearerTechnologyOpts
Return the bearer technology options for this network.
[ public ]
SFCError GetBearerTechnologyOpts(
    SFBBearerTechnologySmpPtr techOpts   // SFBBearerTechnology object, in which the bearer technology information is returned.
);

Version

Introduced BREW Client 3.1.5 SP01

Reference

BREW API INetwork_GetBearerTechnologyOpts


SFBNetwork::GetIPv6PrefixInfo
Return the information regarding an IPv6 Prefix corresponding to a given address.
[ public ]
SFCError GetIPv6PrefixInfo(
    INAddr6 * addr             // the IPv6 address of interest
    AEEIPv6PrefixInfo * info   // the information regarding the prefix used to generate the address pointed by pAddr
);

Version

Introduced BREW Client 3.1.5 SP01, but not supported in BREW version 4.0

Reference

BREW API INetwork_GetIPv6PrefixInfo


SFBNetwork::GetIPv6PrivAddrInfo
Return the information associated with the private IPv6 address generated using this INetwork interface.
[ public ]
SFCError GetIPv6PrivAddrInfo(
    AEEIPv6PrivAddrInfo * info   // caller allocated struct, in which the address info is returned.
);

Version

Introduced BREW Client 3.1.5 SP01, but not supported in BREW version 4.0

Reference

BREW API INetwork_GetIPv6PrivAddrInfo


SFBNetwork::GetLastNetDownReason
Return the last network down reason.
[ public ]
SFCError GetLastNetDownReason(
    AEENetDownReason * reason   // pointer to the last network down reason
);

Argument

reason

On AEE_NET_SUCCESS will be filled with the reason value (pre-allocated by caller).

Return value

  • AEE_NET_SUCCESS: Success. pnNetDownReason filled with last network down reason.
  • AEE_NET_EFAULT: Lower layer returned an unexpected network down reason.

Other AEE designated error codes might be returned.

Reference

BREW API INetwork_GetLastNetDownReason


SFBNetwork::GetMyIPAddrs
Returns the IP addresses of the local host or device, in network byte order.
[ public ]
SFCError GetMyIPAddrs(
    IPAddr * aipaAddr   // Caller allocated IPAddr array in which the IP addresses of the local host or device are returned
    SInt32Ptr number    // The size (number of IPAddr entries) of aipaAddr
);

Return value

  • AEE_NET_SUCCESS: Current IP address(es) returned in aipaAddr.
  • AEE_NET_ENETNONET: network is not available.
  • AEE_NET_ENETDOWN: Network subsystem is not available. Other error codes are also possible.

Description

Most devices return a maximum of one IP address.

Reference

BREW API INetwork_GetMyIPAddrs


SFBNetwork::GetOpt
This function provides the ability to query certain network options.
[ public ]
SFCError GetOpt(
    SInt32 name        // option to get
    VoidPtr data       // filled with option-specific data. May be NULL
    SInt32Ptr length   // size of data
);
[ public ]
SFCError GetOpt(
    SInt32 name         // option to get
    SFXBufferPtr data   // filled with option-specific data. May be NULL
);

Return value

  • AEE_SUCCESS: option was retrieved successfully.
  • AEE_EPRIVLEVEL: if access to the option is prohibited by applet privilege
  • AEE_EUNSUPPORTED: if nOptName is unknown
  • AEE_EBADPARM: if pOptVal is not NULL and pnOptSize is set to something smaller than necessary to hold the option data.

Other error codes are also possible, depending on the option to get.

Reference

BREW API INetwork_GetOpt


SFBNetwork::GetOutageInfo
Return the information associated with the latest outage event associated with this data network.
[ public ]
SFCError GetOutageInfo(
    AEEOutageInfo * info   // caller allocated struct, in which the event info is returned
);

Version

Introduced BREW Client 3.1.5 SP01, but not supported in BREW version 4.0

Reference

BREW API INetwork_GetOutageInfo


SFBNetwork::GetSipServerAddr
Return the SIP (Session Initiation Protocol) server IP addresses for this network.
[ public ]
SFCError GetSipServerAddr(
    IPAddr addresses[]   // caller allocated array in which the SIP server addresses are returned
    UInt08 num           // the size of aSipServerAddresses (number of IPAddr items it can hold)
    UInt08Ptr required   // the size (number of entries) of aSipServerAddresses required to receive all SIP server addresses. If set to null, this value will not be filled
);

Version

Introduced BREW Client 3.1.5 SP01

Reference

BREW API INetwork_GetSipServerAddr


SFBNetwork::GetSipServerDomainNames
Return the SIP (Session Initiation Protocol) server Domain Names for this network.
[ public ]
SFCError GetSipServerDomainNames(
    AEENetDomainName domains[]   // caller allocated array in which the SIP server domain names are returned
    UInt08 num                   // the size of aSipServerDomainNames (number of AEENetDomainName items it can hold)
    UInt08Ptr required           // the size (number of entries) of aSipServerDomainNames required to receive all SIP server Domain Names. If set to null, this value will not be filled
);

Version

Introduced BREW Client 3.1.5 SP01

Reference

BREW API INetwork_GetSipServerDomainNames


SFBNetwork::GetSupportedQoSProfiles
Return the current QoS Profiles supported by the network.
[ public ]
SFCError GetSupportedQoSProfiles(
    UInt16 profiles      // caller allocated array in which the supported QoS Profile IDs are returned.
    UInt08 num           // the number of entries in awQoSProfiles (number of QoS Profile IDs it can hold)
    UInt08Ptr required   // the number of entries required to receive all the QoS Profile IDs. If set to null, this value will not be filled
);

Version

Introduced BREW Client 3.1.5 SP01, but not supported in BREW version 4.0

Reference

BREW API INetwork_GetSupportedQoSProfiles


SFBNetwork::IsQoSAware
This function is supported only for CDMA network. It queries whether the mobile is currently on a system which supports QoS (Aware System) or on a system which does not support QoS (Unaware system).
[ public ]
SFCError IsQoSAware(
    BoolPtr QoSAware   // Upon SUCCESS return, this parameter is set to TRUE if the mobile is on a QoS Aware system, and is set to FALSE if the mobile is on a QoS Unaware system
);

Return value

  • AEE_NET_SUCCESS: Success. The mobile is on a CDMA network. pbIsQoSAware indicates whether the mobile is on a QoS Aware (TRUE) or QoS Unaware (FALSE) system.
  • AEE_NET_EOPNOTSUPP: The mobile is on UMTS network. pbIsQoSAware is invalid.
  • AEE_NET_ENETNONET: Network subsystem unavailable.

Other AEE designated error codes might be returned.

Reference

BREW API INetwork_IsQoSAware


SFBNetwork::NetStatus
Return the current network status.
[ public ]
SFCError NetStatus(
    AEENetStatus * netstatus   // returns the current network status. May be NULL
    AEENetStats * constatus    // returns the network connection statistics. May be NULL
);

Return value

  • AEE_SUCCESS: network status was retrieved successfully.
  • AEE_EFAILED: failed to retrieve network status.

Other error codes are also possible.

Reference

BREW API INetwork_NetStatus


SFBNetwork::NewInstance
Create a new SFBNetwork instance.
[ public, static ]
SFBNetworkSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBNetworkSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBNetwork::OnEvent
This function allows the caller to register to receive notifications of network status changes and events.
[ public ]
SFCError OnEvent(
    SInt32 event              // Event to register for (NETWORK_EVENT_*)
    PFNNETWORKEVENT eventfn   // User callback to be called when an event of type nEvent occurs
    VoidPtr user              // User-specific data. This data shall be passed back to the application in the callback function
    Bool reg                  // TRUE to set up the registration. FALSE to cancel existing registration
);

Return value

  • SUCCESS: if registered
  • EBADPARM: if nEvent is invalid or pfn is NULL
  • ENOMEMORY: if allocation failure
  • EALREADY: if already registered

Other error codes are also possible

Reference

BREW API INetwork_OnEvent


SFBNetwork::RefreshDHCPConfigInfo
Ask the network to refresh the DHCP config info.
[ public ]
SFCError RefreshDHCPConfigInfo(Void);

Version

Introduced BREW Client 4.0.2, but not supported in BREW 4.0

Reference

BREW API INetwork_RefreshDHCPConfigInfo


SFBNetwork::SelectNetworkEx
Select a specific data network.
[ public ]
SFCError SelectNetworkEx(
    SInt32 network   // data network type (AEE_NETWORK_*) 
    SInt16 family    // address family (AEE_AF_*)
);

Return value

  • AEE_NET_SUCCESS: the data network was selected
  • AEE_NET_EINVAL: the specified network (or network-family combination) is not valid
  • AEE_NET_EOPNOTSUPP: the network has already been selected.
  • AEE_EFAILED: other error.

Other error codes are also possible.

Reference

BREW API INetwork_SelectNetworkEx


SFBNetwork::SetDormancyTimeout
Set the IS-707 (cdma2000 1x) packet data dormancy timeout for the network connection to the value specified by ucSecs.
[ public ]
SFCError SetDormancyTimeout(
    UInt08 seconds   // new dormancy timeout in seconds
);

Return value

  • AEE_NET_SUCCESS: dormancy timeout was set successfully.
  • AEE_NET_EOPNOTSUPP: operation is not supported (not a cdma2000 1x network)

Other error codes are also possible.

Description

When the connection is created, the default dormancy timeout is set to 30 seconds.

If no network traffic occurs during a period of time equals to the dormancy timeout then the mobile should perform mobile initiated dormancy.

Reference

BREW API INetwork_SetDormancyTimeout


SFBNetwork::SetLinger
Set the linger time for the network connection to the value specified by wSecs, and return the previous value in pwOldSecs
[ public ]
SFCError SetLinger(
    UInt16 seconds     // new linger time in seconds
    UInt16Ptr ldsecs   // returns the previous linger time in seconds. May be NULL
);

Return value

  • AEE_SUCCESS: linger time was set successfully.
  • AEE_EFAILED: operation failed.

Other error codes are also possible.

Description

When the connection is created, the default linger time is set to 30 seconds.

Reference

BREW API INetwork_SetLinger


SFBNetwork::SetOpt
This function provides the ability to configure certain network options
[ public ]
SFCError SetOpt(
    SInt32 name     // option to set
    VoidPtr data    // option-specific data to set 
    SInt32 length   // size of the option-specific data pointed to by data 
);
[ public ]
SFCError SetOpt(
    SInt32 name              // option to set
    SFXBufferConstRef data   // option-specific data to set 
);

Return value

  • AAEE_SUCCESS: option was set successfully.
  • AEE_EPRIVLEVEL: if access to the option is prohibited by applet privilege
  • AEE_EUNSUPPORTED: if nOptName is unknown
  • AEE_EBADPARM: if nOptSize is set to a size that does not correspond to the correct option data

Other error codes are also possible, depending on the option to set.

Reference

BREW API INetwork_SetOpt


SFBNetwork::Start
This function is used to explicitly bring up a network connection.
[ public ]
SFCError Start(Void);

Return value

  • SUCCESS: network connection successfully brought up.
  • AEE_NET_WOULDBLOCK: operation cannot be completed right now; use SFBNetwork::AddRetryCB() to try again later.
  • ENOMEMORY: out of memory.
  • AEE_NET_ENETNONET: network is not available.

Other error codes are also possible.

Description

Usually applications will not need to use this function since network bringup shall be carried out implicitly when using a network resource such as socket.

A transaction of bringing up the network connection is an asynchronous operation and so an AEE_NET_WOULDBLOCK may be returned. In that case, SFBNetwork::Start() should be called again to obtain the final result (error or success).

.

For notification of when to call SFBNetwork::Start() again, the client should register a callback through SFBNetwork::AddRetryCB().

Note that when the client's callback is resumed, it is not guaranteed that a subsequent call to SFBNetwork::Start() will complete, so the client must be prepared to receive AEE_NET_WOULDBLOCK again.

Reference

BREW API INetwork_Start | SFBNetwork::AddRetryCB