Okundu Omeni / Mbed OS wifi-https-ble-sm-uart-atcmd-5-13-1

Dependencies:   mbed-http

Embed: (wiki syntax)

« Back to documentation index

SMDeviceCentral Class Reference

SMDeviceCentral Class Reference

A central device will scan, connect to a peer and request pairing. More...

#include <BleManager.h>

Inherits SMDevice.

Public Member Functions

 SMDeviceCentral (BLE &ble, events::EventQueue &event_queue, BLEProtocol::AddressBytes_t &peer_address, MemoryPool< at_ble_msg_t, PQDSZ_BLE > *aT2BleDatamPool, Queue< at_ble_msg_t, PQDSZ_BLE > *aT2BleDataQueue, MemoryPool< ble_at_msg_t, PQDSZ_BLE > *ble2ATDatamPool, Queue< ble_at_msg_t, PQDSZ_BLE > *ble2ATDataQueue, ble_config_t *ble_config)
 A central device will scan, connect to a peer and request pairing.
virtual void start ()
 Override to start chosen activity when initialisation completes.
void on_scan (const Gap::AdvertisementCallbackParams_t *params)
 Look at scan payload to find a peer device and connect to it.
virtual void on_connect (const Gap::ConnectionCallbackParams_t *connection_event)
 This is called by Gap to notify the application we connected, in our case it immediately request pairing.
void run ()
 Start BLE interface initialisation.
virtual void pairingRequest (ble::connection_handle_t connectionHandle)
 Respond to a pairing request.
virtual void pairingResult (ble::connection_handle_t connectionHandle, SecurityManager::SecurityCompletionStatus_t result)
 Inform the application of a successful pairing.
virtual void linkEncryptionResult (ble::connection_handle_t connectionHandle, ble::link_encryption_t result)
 Inform the application of change in encryption status.
void sendBLEUartData (const uint8_t *buf, int len)
 Send data aynchronously using BLE.

Detailed Description

A central device will scan, connect to a peer and request pairing.

Definition at line 198 of file BleManager.h.


Constructor & Destructor Documentation

SMDeviceCentral ( BLE &  ble,
events::EventQueue &  event_queue,
BLEProtocol::AddressBytes_t &  peer_address,
MemoryPool< at_ble_msg_t, PQDSZ_BLE > *  aT2BleDatamPool,
Queue< at_ble_msg_t, PQDSZ_BLE > *  aT2BleDataQueue,
MemoryPool< ble_at_msg_t, PQDSZ_BLE > *  ble2ATDatamPool,
Queue< ble_at_msg_t, PQDSZ_BLE > *  ble2ATDataQueue,
ble_config_t ble_config 
)

A central device will scan, connect to a peer and request pairing.

Definition at line 742 of file BleManager.cpp.


Member Function Documentation

void linkEncryptionResult ( ble::connection_handle_t  connectionHandle,
ble::link_encryption_t  result 
) [virtual, inherited]

Inform the application of change in encryption status.

This will be communicated through the serial port

Definition at line 174 of file BleManager.cpp.

void on_connect ( const Gap::ConnectionCallbackParams_t *  connection_event ) [virtual]

This is called by Gap to notify the application we connected, in our case it immediately request pairing.

Implements SMDevice.

Definition at line 805 of file BleManager.cpp.

void on_scan ( const Gap::AdvertisementCallbackParams_t *  params )

Look at scan payload to find a peer device and connect to it.

Definition at line 772 of file BleManager.cpp.

void pairingRequest ( ble::connection_handle_t  connectionHandle ) [virtual, inherited]

Respond to a pairing request.

This will be called by the stack when a pairing request arrives and expects the application to call acceptPairingRequest or cancelPairingRequest

Definition at line 153 of file BleManager.cpp.

void pairingResult ( ble::connection_handle_t  connectionHandle,
SecurityManager::SecurityCompletionStatus_t  result 
) [virtual, inherited]

Inform the application of a successful pairing.

Terminate the demonstration.

Definition at line 161 of file BleManager.cpp.

void run (  ) [inherited]

Start BLE interface initialisation.

Definition at line 93 of file BleManager.cpp.

void sendBLEUartData ( const uint8_t *  buf,
int  len 
) [inherited]

Send data aynchronously using BLE.

Definition at line 319 of file BleManager.cpp.

void start (  ) [virtual]

Override to start chosen activity when initialisation completes.

Implements SMDevice.

Definition at line 753 of file BleManager.cpp.