diff --git a/source/cellular_common_api.c b/source/cellular_common_api.c index d6a7e167..cc13f06a 100644 --- a/source/cellular_common_api.c +++ b/source/cellular_common_api.c @@ -438,14 +438,15 @@ CellularError_t Cellular_CommonSocketSetSockOpt( CellularHandle_t cellularHandle } else { - if( optionLevel == CELLULAR_SOCKET_OPTION_LEVEL_IP ) + if( optionLevel == CELLULAR_SOCKET_OPTION_LEVEL_TRANSPORT ) { - LogError( ( "Cellular_SocketSetSockOpt: Option not supported" ) ); - cellularStatus = CELLULAR_UNSUPPORTED; + cellularStatus = _socketSetSockOptLevelTransport( option, socketHandle, pOptionValue, optionValueLength ); } - else /* optionLevel CELLULAR_SOCKET_OPTION_LEVEL_TRANSPORT. */ + else { - cellularStatus = _socketSetSockOptLevelTransport( option, socketHandle, pOptionValue, optionValueLength ); + /* Other socket option levels are not supported in common layer. Modem ports + * can use their own implementation for these options. */ + cellularStatus = CELLULAR_UNSUPPORTED; } } diff --git a/source/include/cellular_types.h b/source/include/cellular_types.h index c8e04c09..89dbca7a 100644 --- a/source/include/cellular_types.h +++ b/source/include/cellular_types.h @@ -313,8 +313,9 @@ typedef enum CellularIPAddressType */ typedef enum CellularSocketOptionLevel { - CELLULAR_SOCKET_OPTION_LEVEL_IP, /**< IP layer options. */ - CELLULAR_SOCKET_OPTION_LEVEL_TRANSPORT /**< Transport (TCP/UDP) layer options. */ + CELLULAR_SOCKET_OPTION_LEVEL_IP, /**< IP layer options. */ + CELLULAR_SOCKET_OPTION_LEVEL_TRANSPORT, /**< Transport (TCP/UDP) layer options. */ + CELLULAR_SOCKET_OPTION_LEVEL_SECURE /**< Secure sockets layer options. */ } CellularSocketOptionLevel_t; /** @@ -327,6 +328,8 @@ typedef enum CellularSocketOption CELLULAR_SOCKET_OPTION_SEND_TIMEOUT, /**< Set send timeout (in milliseconds). */ CELLULAR_SOCKET_OPTION_RECV_TIMEOUT, /**< Set receive timeout (in milliseconds). */ CELLULAR_SOCKET_OPTION_PDN_CONTEXT_ID, /**< Set PDN Context ID to use for the socket. */ + CELLULAR_SOCKET_OPTION_SSL_CONTEXT_ID, /**< Set secure sockets layer context ID to use for the socket. */ + CELLULAR_SOCKET_OPTION_SSL_USAGE, /**< Set secure sockets layer usage for the socket. */ CELLULAR_SOCKET_OPTION_SET_LOCAL_PORT /**< Set local port. */ } CellularSocketOption_t;