TCPIP_HTTP_NET_ConnectionPostSmSet Function

C

void TCPIP_HTTP_NET_ConnectionPostSmSet(
    TCPIP_HTTP_NET_CONN_HANDLE connHandle, 
    uint16_t state
);

Description

This function sets the POST state machine state for the connection defined by connHandle. This state is maintained by the HTTP connection and can be used by the user of the HTTP to maintain its own POST state machine. The values of the POST state machine have significance only for the user of the HTTP connection.

Preconditions

None.

Parameters

ParametersDescription
connHandleHTTP connection handle.
state16-bit integer state for POST state machine.

Returns

None .

Remarks

None.

Example

uint8_t* httpDataBuff;
uint16_t httpBuffSize;
#define SM_POST_LCD_READ_NAME   1
#define SM_POST_LCD_READ_VALUE  2

switch(TCPIP_HTTP_NET_ConnectionPostSmGet(connHandle))
{
    // Find the name
    case SM_POST_LCD_READ_NAME:

        // Read a name
        httpBuffSize = TCPIP_HTTP_NET_ConnectionDataBufferSizeGet(connHandle);
        if(TCPIP_HTTP_NET_ConnectionPostNameRead(connHandle, httpDataBuff, 
            httpBuffSize) == TCPIP_HTTP_NET_READ_INCOMPLETE)
            return TCPIP_HTTP_NET_IO_RES_NEED_DATA;

        TCPIP_HTTP_NET_ConnectionPostSmSet(connHandle, SM_POST_LCD_READ_VALUE);
        // No break...continue reading value

    // Found the value, so store the LCD and return
    case SM_POST_LCD_READ_VALUE:
    .
    .
    .
}