API Reference | developer.brewmp.com API Reference | developer.brewmp.com

Developer

API Reference

IQOSSESSION_OPEN()

Brew Release
Brew MP 1.0.2
See Also
IQoSSession_AddRetryCB() IQoSSession_Close() IQoSSession_AddListener() IQoSSession_SelectNetwork() IQoSSession_GetError() IQoSSpec
Description
This function issues a request for establishing a new QoS Session. The request is forwarded to lower layers in order to establish a new QoS link.
If a network was not yet selected for the IQoSSession instance, AEE_NETWORK_DEFAULT will be implicitly selected.
Note that a return value of AEE_SUCCESS indicates that the request was successfully issued but it doesn't indicate that QoS is already available. After IQoSSession_Open() returns AEE_SUCCESS, the client should listen (see IQoSSession_AddListener()) for QoS events and wait for a QoS event which indicates success (AEE_QOS_AVAILABLE_EV or AEE_QOS_AVAILABLE_MODIFIED_EV). Receiving one of these events indicates that QoS was granted and the client can start sending or receiving data using the granted QoS.
After IQoSSession_Open() returns AEE_SUCCESS, IQoSSession_Open() shall not be called again. However, IQoSSession instance is re-usable, meaning that the client may call IQoSSession_Open() again after a QoS event which indicates that the QoS was released (AEE_QOS_UNAVAILABLE_EV) is received.
Also note the possibility of an AEE_NET_WOULDBLOCK return value. This occurs in cases where a network connection, such as a PPP link, must be established. In that case, IQoSSession_Open() returns AEE_NET_WOULDBLOCK, and should be called again to obtain the final result (error or success).
For notification of when to call IQoSSession_Open() again, the client should register a callback through IQoSSession_AddRetryCB(). Note that when the client's callback is resumed, it is not guaranteed that a subsequent call to IQoSSession_Open() will complete, so the client must be prepared to receive AEE_NET_WOULDBLOCK again.
Params
po
[]:
the interface pointer
piRequestedQoSSpec
[]:
the desired QoS specification for the new session.
Interface
Prototype
  •    int IQoSSession_Open(IQoSSession *po, IQoSSpec* piRequestedQoSSpec);
    
Return
  • AEE_SUCCESS: the request was successfully issued. This doesn't indicate that QoS is already available.
    AEE_NET_WOULDBLOCK: operation cannot be completed right now; try again later.
    AEE_EBADPARM: the desired QoS specification is not valid (e.g. piRequestedQoSSpec is NULL)
    AEE_NET_EQOS_SPEC_INVALID_OPT: the desired QoS specification contains invalid options. Use IQoSSession_GetError() to identify which option was invalid.
    AEE_NET_EQOSUNAWARE: the current network is QoS Unaware System (does not support QoS). This is relevant for CDMA and WLAN networks.
    AEE_EBADSTATE: QoSSession state is not suitable for this operation.
    AEE_ENOMEMORY: out of memory.
    AEE_NET_ENETNONET: network is not available.
    Other error codes are also possible.
Side Effect
  • None.
Comments
None.