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

CoAP Server ModuleThe interface description of the CoAP Server. 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_CoapServer.h:
+ This graph shows which files directly or indirectly include this file:

Typedefs

typedef retcode_t(* CoapAppReqCallback_T )(Msg_T *msg_ptr, retcode_t status)
 

Functions

retcode_t CoapServer_closeSecureConn (Ip_Address_T *peerAddr_ptr, Ip_Port_T peerPort)
 
retcode_t CoapServer_getSecureConnError (Ip_Address_T *peerAddr_ptr, Ip_Port_T peerPort, retcode_t *rc_ptr)
 
retcode_t CoapServer_getSecureConnState (Ip_Address_T *peerAddr_ptr, Ip_Port_T peerPort, SecureConnectionState_T *state_ptr)
 
retcode_t CoapServer_initialize (void)
 
retcode_t CoapServer_initNotificationMsg (Ip_Address_T *addr_ptr, Ip_Port_T port, Msg_T **msg_pptr)
 
retcode_t CoapServer_initSecureNotificationMsg (Ip_Address_T *addr_ptr, Ip_Port_T port, Msg_T **msg_pptr)
 
void CoapServer_iterateSecureConnections (int16_t *iterator_ptr, bool onlyWithError, Ip_Address_T *ipAddr_ptr, Ip_Port_T *port_ptr)
 
retcode_t CoapServer_respond (Msg_T *msg_ptr, Callable_T *sentCallback_ptr)
 
retcode_t CoapServer_startInstance (Ip_Port_T port, CoapAppReqCallback_T appCallback_ptr)
 
retcode_t CoapServer_startSecureInstance (Ip_Port_T port, CoapAppReqCallback_T appCallback_ptr)
 

Typedef Documentation

typedef retcode_t(* CoapAppReqCallback_T)(Msg_T *msg_ptr, retcode_t status)

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

Function Documentation

retcode_t CoapServer_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 CoapServer_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 CoapServer_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 CoapServer_initialize ( void  )

This function is called to initialize CoAP server and related modules

Returns
, RC_OK, if successful RC_COAP_SERVER_INIT_ERROR, otherwise.
retcode_t CoapServer_initNotificationMsg ( Ip_Address_T addr_ptr,
Ip_Port_T  port,
Msg_T **  msg_pptr 
)

This function is called to initiate a notification from the CoAP server. This function checks for any previous active transaction with the given client 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_SERVER_INIT_REQ_ERROR, otherwise.
Since
1.4
retcode_t CoapServer_initSecureNotificationMsg ( Ip_Address_T addr_ptr,
Ip_Port_T  port,
Msg_T **  msg_pptr 
)

This function is called to initiate a secure notification from the CoAP server. This function checks for any previous active transaction with the given client 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_SERVER_INIT_REQ_ERROR, otherwise.
Since
1.4
void CoapServer_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 CoapServer_respond ( Msg_T msg_ptr,
Callable_T sentCallback_ptr 
)

This function is called to push a response from CoAP server. 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.
Returns
, RC_OK, if successful RC_COAP_SENDING_ERROR, otherwise.
retcode_t CoapServer_startInstance ( Ip_Port_T  port,
CoapAppReqCallback_T  appCallback_ptr 
)

This function is called to start the default CoAP server

Parameters
[in]portThe port the CoAP default server will listen on. The default port for CoAP is 5683.
[in]appCallback_ptrThis is the reference to the application callback for received message. It has to be a valid pointer.
Returns
, RC_OK, if successful RC_COAP_LISTEN_ERROR, otherwise.
retcode_t CoapServer_startSecureInstance ( Ip_Port_T  port,
CoapAppReqCallback_T  appCallback_ptr 
)

This function is called to start the secure CoAP server

Parameters
[in]portThe port the CoAP secure server will listen on.
[in]appCallback_ptrThis is the reference to the application callback for received message. It has to be a valid pointer.
Returns
, RC_OK, if successful RC_COAP_SECURE_CONNECTION_ERROR

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