this is using the mbed os version 5-13-1

Dependencies:   mbed-http

Embed: (wiki syntax)

« Back to documentation index

SMDevicePeripheral Class Reference

SMDevicePeripheral Class Reference

A peripheral device will advertise, accept the connection and request a change in link security. More...

#include <BleManager.h>

Inherits SMDevice.

Public Member Functions

 SMDevicePeripheral (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 peripheral device will advertise, accept the connection and request a change in link security.
virtual void start ()
 Override to start chosen activity when initialisation completes.
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 requests a change in link security.
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 peripheral device will advertise, accept the connection and request a change in link security.

Definition at line 170 of file BleManager.h.


Constructor & Destructor Documentation

SMDevicePeripheral ( 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 peripheral device will advertise, accept the connection and request a change in link security.

Definition at line 406 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 requests a change in link security.

Implements SMDevice.

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

This tells the stack to generate a pairingRequest event which will require this application to respond before pairing can proceed. Setting it to false will automatically accept pairing.

Implements SMDevice.

Definition at line 417 of file BleManager.cpp.