This is an example of BLE GATT Client, which receives broadcast data from BLE_Server_BME280 ( a GATT server) , then transfers values up to mbed Device Connector (cloud).

Embed: (wiki syntax)

« Back to documentation index

M2MConnectionSecurityPimpl Class Reference

M2MConnectionSecurityPimpl Class Reference

The M2MConnectionSecurityPimpl class. More...

#include <m2mconnectionsecuritypimpl.h>

Inherits M2MTimerObserver.

Public Member Functions

 M2MConnectionSecurityPimpl (M2MConnectionSecurity::SecurityMode mode)
 Constructor.
virtual ~M2MConnectionSecurityPimpl ()
 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.
void set_random_number_callback (random_number_cb callback)
 Sets the function callback that will be called by mbed-client for fetching random number from application for ensuring strong entropy.
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.

Detailed Description

The M2MConnectionSecurityPimpl class.

Definition at line 49 of file m2mconnectionsecuritypimpl.h.


Constructor & Destructor Documentation

M2MConnectionSecurityPimpl ( M2MConnectionSecurity::SecurityMode  mode )

Constructor.

Definition at line 70 of file m2mconnectionsecuritypimpl.cpp.

~M2MConnectionSecurityPimpl (  ) [virtual]

Destructor.

Definition at line 86 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.

Definition at line 247 of file m2mconnectionsecuritypimpl.cpp.

int continue_connecting (  )

Continues connectivity logic for secure connection.

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

Definition at line 322 of file m2mconnectionsecuritypimpl.cpp.

int init ( const M2MSecurity *  security )

Initiatlizes the socket connection states.

Definition at line 125 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 358 of file m2mconnectionsecuritypimpl.cpp.

void reset ( void   )

Resets the socket connection states.

Definition at line 112 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 343 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);

Definition at line 450 of file m2mconnectionsecuritypimpl.cpp.

void set_random_number_callback ( random_number_cb  callback )

Sets the function callback that will be called by mbed-client for fetching random number from application for ensuring strong entropy.

Parameters:
random_callbackA function pointer that will be called by mbed-client while performing secure handshake. Function signature should be uint32_t (*random_number_callback)(void);

Definition at line 445 of file m2mconnectionsecuritypimpl.cpp.

int start_connecting_non_blocking ( M2MConnectionHandler *  connHandler )

Starts the connection in non-blocking mode.

Parameters:
connHandlerThe ConnectionHandler object that maintains the socket.
Returns:
Returns the state of the connection. Successful or not.

Definition at line 273 of file m2mconnectionsecuritypimpl.cpp.