Changed URIBeaconConfigService.h to work with ST board

Fork of BLE_API by Bluetooth Low Energy

Embed: (wiki syntax)

« Back to documentation index

DFUService Class Reference

Device Firmware Update Service. More...

#include <DFUService.h>

Public Types

typedef void(* ResetPrepare_t )(void)
 Signature for the handover callback.

Public Member Functions

 DFUService (BLE &_ble, ResetPrepare_t _handoverCallback=NULL)
 Adds Device Firmware Update service to an existing ble object.
uint16_t getControlHandle (void) const
 get the handle for the value attribute of the control characteristic.
virtual void onDataWritten (const GattWriteCallbackParams *params)
 This callback allows the DFU service to receive the initial trigger to handover control to the bootloader; but first the application is given a chance to clean up.

Protected Attributes

BLEble
 Writing to the control characteristic triggers the handover to dfu- bootloader.
WriteOnlyArrayGattCharacteristic
< uint8_t,
SIZEOF_CONTROL_BYTES > 
controlPoint
 The packet characteristic in this service doesn't do anything meaningful, but is only a placeholder to mimic the corresponding characteristic in the actual DFU service implemented by the bootloader.

Static Protected Attributes

static ResetPrepare_t handoverCallback = NULL
 application specific handover callback.

Detailed Description

Device Firmware Update Service.

Definition at line 37 of file DFUService.h.


Member Typedef Documentation

typedef void(* ResetPrepare_t)(void)

Signature for the handover callback.

The application may provide such a callback when setting up the DFU service, in which case it will be invoked before handing control over to the bootloader.

Definition at line 44 of file DFUService.h.


Constructor & Destructor Documentation

DFUService ( BLE _ble,
ResetPrepare_t  _handoverCallback = NULL 
)

Adds Device Firmware Update service to an existing ble object.

Parameters:
ref]_ble BLE object for the underlying controller.
[in]_handoverCallbackApplication specific handover callback.

Definition at line 55 of file DFUService.h.


Member Function Documentation

uint16_t getControlHandle ( void   ) const

get the handle for the value attribute of the control characteristic.

Definition at line 85 of file DFUService.h.

virtual void onDataWritten ( const GattWriteCallbackParams *  params ) [virtual]

This callback allows the DFU service to receive the initial trigger to handover control to the bootloader; but first the application is given a chance to clean up.

Parameters:
[in]paramsInformation about the characterisitc being updated.

Definition at line 97 of file DFUService.h.


Field Documentation

BLE& ble [protected]

Writing to the control characteristic triggers the handover to dfu- bootloader.

At present, writing anything will do the trick--this needs to be improved.

Definition at line 115 of file DFUService.h.

WriteOnlyArrayGattCharacteristic<uint8_t, SIZEOF_CONTROL_BYTES> controlPoint [protected]

The packet characteristic in this service doesn't do anything meaningful, but is only a placeholder to mimic the corresponding characteristic in the actual DFU service implemented by the bootloader.

Without this, some FOTA clients might get confused as service definitions change after handing control over to the bootloader.

Definition at line 120 of file DFUService.h.

DFUService::ResetPrepare_t handoverCallback = NULL [static, protected]

application specific handover callback.

Definition at line 130 of file DFUService.h.