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

Developer

API Reference

IPARAMETERSRO_GETPARAM()

Brew Release
Brew MP 1.0.2
See Also
IParameters_SetParam
Description
This method fetches a parameter value
Params
me
[]:
The interface pointer
nId
[]:
[in] the parameter to get
pParam
[]:
[out] pointer to buffer to which parameter is copied. May be NULL to get the length of the parameter that will be returned.
puParamLen
[]:
[in/out] on in, the size of buffer pointed to by pParam. on out, the size filled in
Interface
Prototype
  •    IParametersRO_GetParam(IParametersRO *me,
                              int nId, void *pParam,
                              unsigned *puParamLen)
    
Return
  • AEE_SUCCESS: if the value is returned AEE_EBADPARM: if puParamLen is NULL AEE_ENOSUCH: if nID is not known. AEE_EBUFFERTOOSMALL: if the buffer is too small for the parameter
    other return codes as per other implementations and parameters
Side Effect
  • None
Comments
The integer pointed to by puParamLen gives the length of the buffer pointed to by pParam when the function is called. The buffer must be large enough to copy the parameter into. On return the parameter value is copied into the buffer pointed to by pParam, and the integer pointed to by puParamLen is the number of bytes copied. All implementations must adhere to this no matter what type of data is returned. To find out the size of the parameter, pass pParam as NULL. The size of the parameter is filled into the integer pointed to by puParamLen. If the data being returned to is an integer, then pParam points to an integer variable into which the value is copied. The length pointed to by puParamLen will be sizeof(int) both in and out. If the data being returned is a structure then pParam points to a structure variable into which the data is copied. The length pointed to by puParamLen is the size of the structure both in and out. If the data being returned is a NUL terminated string, then pParam points to a buffer of some size that is believed to be large enough to hold the string. The length pointed to by puParamLen is the size of the buffer on in. On out it is the length of the string plus the NUL. For some parameters, it may be desirable to return a pointer to an internal buffer rather than copy the data out. When this is done, the length in and out is the length of the pointer, not the data. This is consistent with the behavior described in the above paragraph because the pointer is the data that is copied. If the length is to be provided to the caller in this situation, it should be by a different parameter ID. The documentation for each parameter type should say what the type of the data is.