XDK API  3.6.0
Documentation
Typedefs | Functions
Serval_CoapClient.h File Reference

CoAP Client ModuleThe interface description of the CoAP Client. More...

#include <Serval_Defines.h>
#include <Serval_Exceptions.h>
#include <Serval_Msg.h>
#include <Serval_Coap.h>
#include <Serval_Security.h>
+ Include dependency graph for Serval_CoapClient.h:
+ This graph shows which files directly or indirectly include this file:

Typedefs

typedef retcode_t(* CoapAppRespCallback_T )(CoapSession_T *coapSession, Msg_T *msg_ptr, retcode_t status)
 

Functions

retcode_t CoapClient_closeSecureConn (Ip_Address_T *peerAddr_ptr, Ip_Port_T peerPort)
 
retcode_t CoapClient_connectSecure (Ip_Address_T *peerAddr_ptr, Ip_Port_T peerPort)
 
retcode_t CoapClient_getSecureConnError (Ip_Address_T *peerAddr_ptr, Ip_Port_T peerPort, retcode_t *rc_ptr)
 
retcode_t CoapClient_getSecureConnState (Ip_Address_T *peerAddr_ptr, Ip_Port_T peerPort, SecureConnectionState_T *state_ptr)
 
retcode_t CoapClient_initReqMsg (Ip_Address_T *addr_ptr, Ip_Port_T port, Msg_T **msg_pptr)
 
retcode_t CoapClient_initSecureReqMsg (Ip_Address_T *addr_ptr, Ip_Port_T port, Msg_T **msg_pptr)
 
void CoapClient_iterateSecureConnections (int16_t *iterator_ptr, bool onlyWithError, Ip_Address_T *ipAddr_ptr, Ip_Port_T *port_ptr)
 
retcode_t CoapClient_request (Msg_T *msg_ptr, Callable_T *sentCallback_ptr, CoapAppRespCallback_T respCallback)
 
retcode_t CoapClient_startSecureInstance (void)
 

Typedef Documentation

typedef retcode_t(* CoapAppRespCallback_T)(CoapSession_T *coapSession, Msg_T *msg_ptr, retcode_t status)

A data type representing a callback function pointer for CoAP application. The application uses such callback functions in order to be notified about the received messages.

Function Documentation

retcode_t CoapClient_closeSecureConn ( Ip_Address_T peerAddr_ptr,
Ip_Port_T  peerPort 
)

This function close and disconnect an existing secure COAP connection.

Parameters
[in]peerAddr_ptrip address of the remote server socket
[in]peerPortport number of the remote server socket
Returns
when error code available On success, RC_OK is returned.
RC_COAP_SECURE_CONNECTION_ERROR
retcode_t CoapClient_connectSecure ( Ip_Address_T peerAddr_ptr,
Ip_Port_T  peerPort 
)

This function connects and opens a secure COAP client connection.

Parameters
[in]peerAddr_ptrip address of the remote server socket
[in]peerPortport number of the remote server socket
Returns
when errorcode available On success, RC_OK is returned.
RC_COAP_SECURE_CONNECTION_ERROR
retcode_t CoapClient_getSecureConnError ( Ip_Address_T peerAddr_ptr,
Ip_Port_T  peerPort,
retcode_t rc_ptr 
)

This function reports the errors of a secure connection

Parameters
[in]peerAddr_ptrreturned ip address of the connection endpoint
[in]peerPortreturned port number of the connection endpoint
[out]rc_ptrstatus of this connection
Returns
On success, RC_OK is returned.
RC_COAP_SECURE_CONNECTION_ERROR
retcode_t CoapClient_getSecureConnState ( Ip_Address_T peerAddr_ptr,
Ip_Port_T  peerPort,
SecureConnectionState_T state_ptr 
)

This function reports the status of a secure connection

Parameters
[in]peerAddr_ptrreturned ip address of the connection endpoint
[in]peerPortreturned port number of the connection endpoint
[out]state_ptrstatus of this connection
Returns
On success, RC_OK is returned.
RC_COAP_SECURE_CONNECTION_ERROR
retcode_t CoapClient_initReqMsg ( Ip_Address_T addr_ptr,
Ip_Port_T  port,
Msg_T **  msg_pptr 
)

This function is called to initiate a request from CoAP client. This function checks for any previous active transaction with the given server and if not provides the message to be filled for sending the request.

Parameters
[in]addr_ptrThis is the reference to the IP address of the receiver.
[in]portThis is the server port of the receiver.
[out]msg_pptrThis holds message to be filled by application for request.
Returns
RC_OK, if successful
RC_COAP_CLIENT_INIT_REQ_ERROR, otherwise.
retcode_t CoapClient_initSecureReqMsg ( Ip_Address_T addr_ptr,
Ip_Port_T  port,
Msg_T **  msg_pptr 
)

This function is called to initiate a secure request from CoAP client. This function checks for any previous active transaction with the given server and if not provides the message to be filled for sending the request.

Parameters
[in]addr_ptrThis is the reference to the IP address of the receiver.
[in]portThis is the server port of the receiver.
[out]msg_pptrThis holds message to be filled by application for request.
Returns
RC_OK, if successful
RC_COAP_CLIENT_INIT_REQ_ERROR, otherwise.
void CoapClient_iterateSecureConnections ( int16_t *  iterator_ptr,
bool  onlyWithError,
Ip_Address_T ipAddr_ptr,
Ip_Port_T port_ptr 
)

This function reports the secure connections.

Parameters
[in]iterator_ptrIterator for this function. Initialized to -1 it reports the first connection. The next returned values will report the next connections. if -1 returns, no more connections are assigned to this socket. Example: int16_t iter = -1; while(1) { rc = _getSecureConnection(&iter,...); if(iter < 0) break; do_some_thing(...); }
[in]onlyWithErrortrue -> report only connections with failures. false -> report all connections
[out]ipAddr_ptrreturned ip address of the connection endpoint
[out]port_ptrreturned port number of the connection endpoint
retcode_t CoapClient_request ( Msg_T msg_ptr,
Callable_T sentCallback_ptr,
CoapAppRespCallback_T  respCallback 
)

This function is called to push a request from a CoAP client. This function prepares the message for further processing before passing it to the lower layers.

Parameters
[in]msg_ptrThis is the reference to the message to be pushed.
[in]sentCallback_ptrThis is the application callback to be called for informing application about status of sending.
[in]respCallbackThis is the application callback to be called for a received response message for this request. If the application does not expect a response for this request it should be set to NULL.
Returns
RC_OK, if successful
RC_COAP_SENDING_ERROR, otherwise.
retcode_t CoapClient_startSecureInstance ( void  )

This function is called to start the secure CoAP client

Returns
, RC_OK, if successful RC_COAP_SECURE_CONNECTION_ERROR, otherwise.

All rights reserved. The use is subject to the XDK SDK EULA by Bosch Connected Devices and Solutions GmbH.
This documentation file has been automatically generated on Thu Mar 14 2019 19:12:45 by doxygen 1.8.8