Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Remove const qualifier from NetworkContext_t* in send/recv #2613

Merged
merged 1 commit into from
Oct 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions demos/coreMQTT/mqtt_demo_serializer.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ static BaseType_t prvMQTTProcessIncomingPacket( Socket_t xMQTTSocket );
* @return Number of bytes received or zero to indicate transportTimeout;
* negative value on error.
*/
static int32_t prvTransportRecv( const NetworkContext_t * pxContext,
static int32_t prvTransportRecv( NetworkContext_t * pxContext,
void * pvBuffer,
size_t xBytesToRecv );

Expand Down Expand Up @@ -577,7 +577,7 @@ static void prvGracefulShutDown( Socket_t xSocket )
}
/*-----------------------------------------------------------*/

static int32_t prvTransportRecv( const NetworkContext_t * pxContext,
static int32_t prvTransportRecv( NetworkContext_t * pxContext,
void * pvBuffer,
size_t xBytesToRecv )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
* <br><br>
* <b>Example code:</b>
* @code{c}
* int32_t myNetworkRecvImplementation( const NetworkContext_t * pNetworkContext,
* int32_t myNetworkRecvImplementation( NetworkContext_t * pNetworkContext,
* void * pBuffer,
* size_t bytesToRecv )
* {
Expand Down Expand Up @@ -123,7 +123,7 @@
* <br><br>
* <b>Example code:</b>
* @code{c}
* int32_t myNetworkSendImplementation( const NetworkContext_t * pNetworkContext,
* int32_t myNetworkSendImplementation( NetworkContext_t * pNetworkContext,
* const void * pBuffer,
* size_t bytesToSend )
* {
Expand Down Expand Up @@ -166,7 +166,7 @@ typedef struct NetworkContext NetworkContext_t;
* @return The number of bytes received or a negative error code.
*/
/* @[define_transportrecv] */
typedef int32_t ( * TransportRecv_t )( const NetworkContext_t * pNetworkContext,
typedef int32_t ( * TransportRecv_t )( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv );
/* @[define_transportrecv] */
Expand All @@ -182,7 +182,7 @@ typedef int32_t ( * TransportRecv_t )( const NetworkContext_t * pNetworkContext,
* @return The number of bytes sent or a negative error code.
*/
/* @[define_transportsend] */
typedef int32_t ( * TransportSend_t )( const NetworkContext_t * pNetworkContext,
typedef int32_t ( * TransportSend_t )( NetworkContext_t * pNetworkContext,
const void * pBuffer,
size_t bytesToSend );
/* @[define_transportsend] */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static TransportSocketStatus_t connectToServer( Socket_t tcpSocket,

/*-----------------------------------------------------------*/

int32_t SecureSocketsTransport_Send( const NetworkContext_t * pNetworkContext,
int32_t SecureSocketsTransport_Send( NetworkContext_t * pNetworkContext,
const void * pMessage,
size_t bytesToSend )
{
Expand Down Expand Up @@ -145,7 +145,7 @@ int32_t SecureSocketsTransport_Send( const NetworkContext_t * pNetworkContext,

/*-----------------------------------------------------------*/

int32_t SecureSocketsTransport_Recv( const NetworkContext_t * pNetworkContext,
int32_t SecureSocketsTransport_Recv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ TransportSocketStatus_t SecureSocketsTransport_Disconnect( const NetworkContext_
* 0 if the socket times out without reading any bytes;
* negative value on error.
*/
int32_t SecureSocketsTransport_Recv( const NetworkContext_t * pNetworkContext,
int32_t SecureSocketsTransport_Recv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv );

Expand All @@ -201,7 +201,7 @@ int32_t SecureSocketsTransport_Recv( const NetworkContext_t * pNetworkContext,
*
* @return Number of bytes sent if successful; negative value on error.
*/
int32_t SecureSocketsTransport_Send( const NetworkContext_t * pNetworkContext,
int32_t SecureSocketsTransport_Send( NetworkContext_t * pNetworkContext,
const void * pMessage,
size_t bytesToSend );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ static void eventCallback( MQTTContext_t * pContext,
/**
* @brief Transport send interface provided to the MQTT context used in calling MQTT LTS APIs.
*/
static int32_t transportSend( const NetworkContext_t * pNetworkContext,
static int32_t transportSend( NetworkContext_t * pNetworkContext,
const void * pMessage,
size_t bytesToSend )
{
Expand Down Expand Up @@ -529,7 +529,7 @@ static int32_t transportSend( const NetworkContext_t * pNetworkContext,
*
* @return The number of bytes received or a negative error code.
*/
static int32_t transportRecv( const NetworkContext_t * pNetworkContext,
static int32_t transportRecv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv )
{
Expand Down
4 changes: 2 additions & 2 deletions libraries/c_sdk/standard/ble/include/iot_ble_mqtt_transport.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ MQTTStatus_t IotBleMqttTransportAcceptData( const NetworkContext_t * pContext );
* @param[in] bytesToWrite number of bytes to write from the buffer.
* @return the number of bytes sent.
*/
int32_t IotBleMqttTransportSend( const NetworkContext_t * pContext,
int32_t IotBleMqttTransportSend( NetworkContext_t * pContext,
const void * pBuffer,
size_t bytesToWrite );

Expand All @@ -103,7 +103,7 @@ int32_t IotBleMqttTransportSend( const NetworkContext_t * pContext,
* @param[in] bytesToRead number of bytes to read from the transport layer.
* @return the number of bytes successfully read.
*/
int32_t IotBleMqttTransportReceive( const NetworkContext_t * pContext,
int32_t IotBleMqttTransportReceive( NetworkContext_t * pContext,
void * pBuffer,
size_t bytesToRead );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ static MQTTStatus_t handleIncomingPingresp( StreamBufferHandle_t streamBuffer,
* @param[in] pBuffer A pointer to a buffer containing data to be sent out.
* @param[in] bytesToWrite number of bytes to write from the buffer.
*/
int32_t IotBleMqttTransportSend( const NetworkContext_t * pContext,
int32_t IotBleMqttTransportSend( NetworkContext_t * pContext,
const void * pBuffer,
size_t bytesToWrite )
{
Expand Down Expand Up @@ -1142,7 +1142,7 @@ MQTTStatus_t IotBleMqttTransportAcceptData( const NetworkContext_t * pContext )
* @param[out] buf A pointer to a buffer where incoming data will be stored.
* @param[in] bytesToRead number of bytes to read from the transport layer.
*/
int32_t IotBleMqttTransportReceive( const NetworkContext_t * pContext,
int32_t IotBleMqttTransportReceive( NetworkContext_t * pContext,
void * pBuffer,
size_t bytesToRead )
{
Expand Down
8 changes: 4 additions & 4 deletions libraries/c_sdk/standard/mqtt/src/iot_mqtt_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ static void eventCallback( MQTTContext_t * pContext,
*
* @return The number of bytes received or a negative error code.
*/
static int32_t transportRecv( const NetworkContext_t * pNetworkContext,
static int32_t transportRecv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv );

Expand All @@ -206,7 +206,7 @@ static int32_t transportRecv( const NetworkContext_t * pNetworkContext,
*
* @return The number of bytes sent or a negative error code.
*/
static int32_t transportSend( const NetworkContext_t * pNetworkContext,
static int32_t transportSend( NetworkContext_t * pNetworkContext,
const void * pMessage,
size_t bytesToSend );

Expand Down Expand Up @@ -898,7 +898,7 @@ static void eventCallback( MQTTContext_t * pContext,

/*-----------------------------------------------------------*/

static int32_t transportSend( const NetworkContext_t * pNetworkContext,
static int32_t transportSend( NetworkContext_t * pNetworkContext,
const void * pMessage,
size_t bytesToSend )
{
Expand All @@ -923,7 +923,7 @@ static int32_t transportSend( const NetworkContext_t * pNetworkContext,

/*-----------------------------------------------------------*/

static int32_t transportRecv( const NetworkContext_t * pNetworkContext,
static int32_t transportRecv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv )
{
Expand Down
4 changes: 2 additions & 2 deletions libraries/c_sdk/standard/mqtt/test/mock/iot_tests_mqtt_mock.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ static void eventCallback( MQTTContext_t * pContext,
/**
* @brief Transport send interface provided to the MQTT context used in calling MQTT LTS APIs.
*/
static int32_t transportSend( const NetworkContext_t * pNetworkContext,
static int32_t transportSend( NetworkContext_t * pNetworkContext,
const void * pMessage,
size_t bytesToSend )
{
Expand Down Expand Up @@ -486,7 +486,7 @@ static int32_t transportSend( const NetworkContext_t * pNetworkContext,
*
* @return The number of bytes received or a negative error code.
*/
static int32_t transportRecv( const NetworkContext_t * pNetworkContext,
static int32_t transportRecv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv )
{
Expand Down
6 changes: 3 additions & 3 deletions libraries/c_sdk/standard/mqtt/test/unit/iot_tests_mqtt_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ static void _decrementReferencesJob( IotTaskPool_t pTaskPool,
/**
* @brief Transport send interface provided to the MQTT context used in calling MQTT LTS APIs.
*/
static int32_t transportSend( const NetworkContext_t * pNetworkContext,
static int32_t transportSend( NetworkContext_t * pNetworkContext,
const void * pMessage,
size_t bytesToSend )
{
Expand Down Expand Up @@ -585,7 +585,7 @@ static int32_t transportSend( const NetworkContext_t * pNetworkContext,
/**
* @brief A transport send function that delays.
*/
static int32_t transportSendDelay( const NetworkContext_t * pSendContext,
static int32_t transportSendDelay( NetworkContext_t * pSendContext,
const void * pMessage,
size_t messageLength )
{
Expand Down Expand Up @@ -620,7 +620,7 @@ static int32_t transportSendDelay( const NetworkContext_t * pSendContext,
*
* @return The number of bytes received or a negative error code.
*/
static int32_t transportRecv( const NetworkContext_t * pNetworkContext,
static int32_t transportRecv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ static void _disconnectCallback( void * pCallbackContext,
*
* @return The number of bytes received or a negative error code.
*/
static int32_t transportSend( const NetworkContext_t * pNetworkContext,
static int32_t transportSend( NetworkContext_t * pNetworkContext,
const void * pMessage,
size_t bytesToSend )
{
Expand All @@ -551,7 +551,7 @@ static int32_t transportSend( const NetworkContext_t * pNetworkContext,
*
* @return The number of bytes received or a negative error code.
*/
static int32_t transportRecv( const NetworkContext_t * pNetworkContext,
static int32_t transportRecv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv )
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ static void eventCallback( MQTTContext_t * pContext,
/**
* @brief Transport send interface provided to the MQTT context used in calling MQTT LTS APIs.
*/
static int32_t transportSend( const NetworkContext_t * pNetworkContext,
static int32_t transportSend( NetworkContext_t * pNetworkContext,
const void * pMessage,
size_t bytesToSend )
{
Expand Down Expand Up @@ -398,7 +398,7 @@ static int32_t transportSend( const NetworkContext_t * pNetworkContext,
*
* @return The number of bytes received or a negative error code.
*/
static int32_t transportRecv( const NetworkContext_t * pNetworkContext,
static int32_t transportRecv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv )
{
Expand Down
4 changes: 2 additions & 2 deletions tests/integration_test/core_mqtt_system_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ static void eventCallback( MQTTContext_t * pContext,
*
* @return -1 to represent failure.
*/
static int32_t failedRecv( const NetworkContext_t * pNetworkContext,
static int32_t failedRecv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv );

Expand Down Expand Up @@ -756,7 +756,7 @@ static MQTTStatus_t publishToTopic( MQTTContext_t * pContext,
packetId );
}

static int32_t failedRecv( const NetworkContext_t * pNetworkContext,
static int32_t failedRecv( NetworkContext_t * pNetworkContext,
void * pBuffer,
size_t bytesToRecv )
{
Expand Down