Simulated product dispenser

Dependencies:   HTS221

Fork of mbed-cloud-workshop-connect-HTS221 by Jim Carver

Embed: (wiki syntax)

« Back to documentation index

M2MConnectionSecurityPimpl Class Reference

M2MConnectionSecurityPimpl Class Reference

The M2MConnectionSecurityPimpl class. More...

#include <m2mconnectionsecuritypimpl.h>

Public Member Functions

 M2MConnectionSecurityPimpl (M2MConnectionSecurity::SecurityMode mode)
 Constructor.
virtual ~M2MConnectionSecurityPimpl ()
 Destructor.
void reset ()
 Resets the socket connection states.
int init (const M2MSecurity *security, uint16_t security_instance_id)
 Initiatlizes the socket connection states.
int connect (M2MConnectionHandler *connHandler)
 Connects the client to the server.
int send_message (unsigned char *message, int len)
 Sends data to the server.
int read (unsigned char *buffer, uint16_t len)
 Reads the data received from the server.
void set_random_number_callback (random_number_cb callback)
 This function is no longer used.
void set_entropy_callback (entropy_cb callback)
 Sets the function callback that will be called by mbed-client for providing entropy source from application for ensuring strong entropy.
void set_socket (palSocket_t socket, palSocketAddress_t *address)
 Set socket information for this secure connection.

Detailed Description

The M2MConnectionSecurityPimpl class.

Definition at line 33 of file m2mconnectionsecuritypimpl.h.


Constructor & Destructor Documentation

M2MConnectionSecurityPimpl ( M2MConnectionSecurity::SecurityMode  mode )

Constructor.

Definition at line 42 of file m2mconnectionsecuritypimpl.cpp.

~M2MConnectionSecurityPimpl (  ) [virtual]

Destructor.

Definition at line 52 of file m2mconnectionsecuritypimpl.cpp.


Member Function Documentation

int connect ( M2MConnectionHandler *  connHandler )

Connects the client to the server.

Parameters:
connHandlerThe ConnectionHandler object that maintains the socket.
Returns:
Returns the state of the connection. Successful or not. If 2MConnectionHandlerCONNECTION_ERROR_WANTS_READ is returned this function must be called again later to continue the handshake.

Definition at line 235 of file m2mconnectionsecuritypimpl.cpp.

int init ( const M2MSecurity *  security,
uint16_t  security_instance_id 
)

Initiatlizes the socket connection states.

Definition at line 73 of file m2mconnectionsecuritypimpl.cpp.

int read ( unsigned char *  buffer,
uint16_t  len 
)

Reads the data received from the server.

Parameters:
messageThe data to be read.
lenThe length of the data.
Returns:
Indicates whether the data is read successfully or not.

Definition at line 279 of file m2mconnectionsecuritypimpl.cpp.

void reset (  )

Resets the socket connection states.

Definition at line 62 of file m2mconnectionsecuritypimpl.cpp.

int send_message ( unsigned char *  message,
int  len 
)

Sends data to the server.

Parameters:
messageThe data to be sent.
lenThe length of the data.
Returns:
Indicates whether the data is sent successfully or not.

Definition at line 250 of file m2mconnectionsecuritypimpl.cpp.

void set_entropy_callback ( entropy_cb  callback )

Sets the function callback that will be called by mbed-client for providing entropy source from application for ensuring strong entropy.

Parameters:
entropy_callbackA function pointer that will be called by mbed-client while performing secure handshake. Function signature , if using mbed-client-mbedtls should be int (*mbedtls_entropy_f_source_ptr)(void *data, unsigned char *output, size_t len, size_t *olen);

NOTE: This function is only used if MBED_CLOUD_CLIENT_CUSTOM_MBEDTLS_ENTROPY is defined and mbed TLS is used.

Definition at line 310 of file m2mconnectionsecuritypimpl.cpp.

void set_random_number_callback ( random_number_cb  callback )

This function is no longer used.

Definition at line 305 of file m2mconnectionsecuritypimpl.cpp.

void set_socket ( palSocket_t  socket,
palSocketAddress_t *  address 
)

Set socket information for this secure connection.

Parameters:
socketSocket used with this TLS session.
addressPointer to the address of the server.
Returns:
Indicates whether the data is read successfully or not.

Definition at line 317 of file m2mconnectionsecuritypimpl.cpp.