TCPIP_STACK_ModuleConfigGet Function

C

size_t TCPIP_STACK_ModuleConfigGet(
    TCPIP_STACK_MODULE modId, 
    void* configBuff, 
    size_t buffSize, 
    size_t* pNeededSize
);

Description

This function returns the current configuration data of the stack module specified by the corresponding module ID.

Preconditions

The TCP/IP stack should have been initialized by TCPIP_STACK_Initialize() and the TCPIP_STACK_Status() returned SYS_STATUS_READY.

Parameters

ParametersDescription
modIdThe ID that identifies the requested module.
configBuffPointer to a buffer that will receive the configuration data. If this pointer is 0, just the pNeededSize will be updated.
buffSizeSize of the provided buffer.
pNeededSizePointer to an address to store the number of bytes needed to store this module configuration data. Can be NULL if not needed.

Returns

  • The number of bytes copied to the user buffer:

    • -1 - If the module ID is invalid.

    • 0 - If the configBuff is NULL or buffSize is less than required.

    • > 0 - If the call succeeded and the configuration was copied.

Remarks

Currently, only the MAC modules implement this function.

Example

uint8_t configBuffer[200];
size_t configSize;
size_t copiedSize;
copiedSize = TCPIP_STACK_ModuleConfigGet(TCPIP_MODULE_MAC_MRF24WN, configBuffer, sizeof(configBuffer), &configSize);