#include "dtls.h"
#include "uarraylist.h"
-#include "camutex.h"
+#include "octhread.h"
#include "caadapterutils.h"
#include "cainterface.h"
#include "cacommon.h"
/**
- * Currently DTLS supported adapters(2) WIFI and ETHENET for linux platform.
+ * Currently DTLS supported adapters(3) WIFI, ETHENET and BLE for linux platform.
*/
-#define MAX_SUPPORTED_ADAPTERS 2
+#define MAX_SUPPORTED_ADAPTERS 3
typedef void (*CAPacketReceivedCallback)(const CASecureEndpoint_t *sep,
- const void *data, uint32_t dataLength);
+ const void *data, size_t dataLength);
typedef void (*CAPacketSendCallback)(CAEndpoint_t *endpoint,
- const void *data, uint32_t dataLength);
+ const void *data, size_t dataLength);
/**
* Data structure for holding the send and recv callbacks.
void CADTLSSetHandshakeCallback(CAErrorCallback dtlsHandshakeCallback);
/**
- * Register callback to get DTLS PSK credentials.
- * @param[in] credCallback callback to get DTLS PSK credentials.
- */
-void CADTLSSetCredentialsCallback(CAGetDTLSPskCredentialsHandler credCallback);
-
-/**
* Select the cipher suite for dtls handshake
*
* @param[in] cipher cipher suite
uint8_t *data,
uint32_t dataLen);
+
+/**
+ * API to get a secure connected peer information
+ * NOTE : This API use the mutex lock to access 'g_caDtlsContext',
+ * Please do not invoke this API for internal function of dtls adapter
+ *
+ * @param[in] peer peer information includs IP address and port.
+ *
+ * @ return secure connected peer information on success, otherwise NULL
+ */
+CASecureEndpoint_t *CAGetSecurePeerInfo(const CAEndpoint_t *peer);
+
#endif /* CA_ADAPTER_NET_DTLS_H_ */