coap_client_transport.h File Reference

Transport protocol abstraction layer. More...

#include "core/net.h"
#include "coap/coap_client.h"

Go to the source code of this file.

Functions

error_t coapClientOpenConnection (CoapClientContext *context)
 Open network connection. More...
 
error_t coapClientEstablishConnection (CoapClientContext *context, const IpAddr *serverIpAddr, uint16_t serverPort)
 Establish network connection. More...
 
error_t coapClientShutdownConnection (CoapClientContext *context)
 Shutdown network connection. More...
 
void coapClientCloseConnection (CoapClientContext *context)
 Close network connection. More...
 
error_t coapClientSendDatagram (CoapClientContext *context, const void *data, size_t length)
 Send a datagram. More...
 
error_t coapClientReceiveDatagram (CoapClientContext *context, void *data, size_t size, size_t *received)
 Receive a datagram. More...
 
error_t coapClientWaitForDatagram (CoapClientContext *context, systime_t timeout)
 Wait for incoming datagrams. More...
 

Detailed Description

Transport protocol abstraction layer.

License

Copyright (C) 2010-2018 Oryx Embedded SARL. All rights reserved.

This file is part of CycloneTCP Open.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Author
Oryx Embedded SARL (www.oryx-embedded.com)
Version
1.9.0

Definition in file coap_client_transport.h.

Function Documentation

◆ coapClientCloseConnection()

void coapClientCloseConnection ( CoapClientContext context)

Close network connection.

Parameters
[in]contextPointer to the CoAP client context

Definition at line 203 of file coap_client_transport.c.

◆ coapClientEstablishConnection()

error_t coapClientEstablishConnection ( CoapClientContext context,
const IpAddr serverIpAddr,
uint16_t  serverPort 
)

Establish network connection.

Parameters
[in]contextPointer to the CoAP client context
[in]serverIpAddrIP address of the CoAP server
[in]serverPortUDP port number
Returns
Error code

Definition at line 137 of file coap_client_transport.c.

◆ coapClientOpenConnection()

error_t coapClientOpenConnection ( CoapClientContext context)

Open network connection.

Parameters
[in]contextPointer to the CoAP client context
Returns
Error code

Definition at line 48 of file coap_client_transport.c.

◆ coapClientReceiveDatagram()

error_t coapClientReceiveDatagram ( CoapClientContext context,
void *  data,
size_t  size,
size_t *  received 
)

Receive a datagram.

Parameters
[in]contextPointer to the CoAP client context
[out]dataBuffer into which the received datagram will be placed
[in]sizeMaximum number of bytes that can be received
[out]receivedNumber of bytes that have been received
Returns
Error code

Definition at line 271 of file coap_client_transport.c.

◆ coapClientSendDatagram()

error_t coapClientSendDatagram ( CoapClientContext context,
const void *  data,
size_t  length 
)

Send a datagram.

Parameters
[in]contextPointer to the CoAP client context
[in]dataPointer to a buffer containing the datagram to be transmitted
[in]lengthLength of the datagram, in bytes
Returns
Error code

Definition at line 237 of file coap_client_transport.c.

◆ coapClientShutdownConnection()

error_t coapClientShutdownConnection ( CoapClientContext context)

Shutdown network connection.

Parameters
[in]contextPointer to the CoAP client context
Returns
Error code

Definition at line 177 of file coap_client_transport.c.

◆ coapClientWaitForDatagram()

error_t coapClientWaitForDatagram ( CoapClientContext context,
systime_t  timeout 
)

Wait for incoming datagrams.

Parameters
[in]contextPointer to the CoAP client context
[in]timeoutMaximum time to wait before returning
Returns
Error code

Definition at line 306 of file coap_client_transport.c.