Timothy Beight / Mbed 2 deprecated 6_songs-from-the-cloud

Dependencies:   mbed Socket lwip-eth lwip-sys lwip

Fork of 6_songs-from-the-cloud by MakingMusicWorkshop

Embed: (wiki syntax)

« Back to documentation index

M2MConnectionSecurity Class Reference

M2MConnectionSecurity Class Reference

M2MConnectionSecurity. More...

#include <m2mconnectionsecurity.h>

Public Member Functions

 M2MConnectionSecurity (SecurityMode mode)
 Default Constructor.
 ~M2MConnectionSecurity ()
 Default Destructor.
void reset ()
 Resets the socket connection states.
int init (const M2MSecurity *security)
 Initiatlizes the socket connection states.
int start_connecting_non_blocking (M2MConnectionHandler *connHandler)
 Starts the connection in non-blocking mode.
int continue_connecting ()
 Continues connectivity logic for secure connection.
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.

Detailed Description

M2MConnectionSecurity.

This class provides a method to create a secure socket connection to handle connectivity for the mbed Client. It will handle sending, receiving and establishing a secure connection for the mbed Client on top of the normal socket connection.

Definition at line 31 of file m2mconnectionsecurity.h.


Constructor & Destructor Documentation

M2MConnectionSecurity ( SecurityMode  mode )

Default Constructor.

Definition at line 24 of file m2mconnectionsecurity.cpp.

Default Destructor.

Definition at line 29 of file m2mconnectionsecurity.cpp.


Member Function Documentation

int connect ( M2MConnectionHandler connHandler )

Connects the client to the server.

Parameters:
connHandler,ConnectionHandlerobject that maintains the socket.
Returns:
Returns the state of the connection. Successful or not.

Definition at line 51 of file m2mconnectionsecurity.cpp.

int continue_connecting (  )

Continues connectivity logic for secure connection.

Returns:
Returns error code if any while continuing connection sequence.

Definition at line 46 of file m2mconnectionsecurity.cpp.

int init ( const M2MSecurity security )

Initiatlizes the socket connection states.

Definition at line 37 of file m2mconnectionsecurity.cpp.

int read ( unsigned char *  buffer,
uint16_t  len 
)

Reads the data received from the server.

Parameters:
message,Datato be read.
len,Lengthof the data.
Returns:
Indicates whether the data is read successfully or not.

Definition at line 59 of file m2mconnectionsecurity.cpp.

void reset (  )

Resets the socket connection states.

Definition at line 33 of file m2mconnectionsecurity.cpp.

int send_message ( unsigned char *  message,
int  len 
)

Sends data to the server.

Parameters:
message,Datato be sent.
len,Lengthof the data.
Returns:
Indicates whether the data is sent successfully or not.

Definition at line 55 of file m2mconnectionsecurity.cpp.

int start_connecting_non_blocking ( M2MConnectionHandler connHandler )

Starts the connection in non-blocking mode.

Parameters:
connHandler,ConnectionHandlerobject that maintains the socket.
Returns:
Returns the state of the connection. Successful or not.

Definition at line 41 of file m2mconnectionsecurity.cpp.