BLE_API v2.1.3

Typedefs | Functions
BLE FOTA Definitions for Application
BLE Services » BLE Defined-Services » BLE FOTA Definitions » BLE FOTA Application Definitions

## Typedefs
typedef void(* | BleFOTA_EventCallBack) (uint8_t hostId, uint8_t cmdAccess, uint8_t *data, uint16_t length)

## Functions
BleStackStatus | setFOTA_ServiceInit (uint8_t hostId, BleGattRole gattRole, BLEATT_FOTA_Info *info, BleFOTA_EventCallBack callback)
BleStackStatus | getFOTA_ServiceHandles (uint8_t hostId, BLEATT_FOTA_Info *info)

## Detailed Description

Here shows the definitions of the FOTA service for application uses.

## Typedef Documentation

## ◆ BleFOTA_EventCallBack

typedef void(* BleFOTA_EventCallBack) (uint8_t hostId, uint8_t cmdAccess, uint8_t *data, uint16_t length)

BleFOTA_EventCallBack

Note
  This callback receives the FOTA events. Each of these events can be associated with parameters.

## Function Documentation

## ◆ getFOTA_ServiceHandles()

BleStackStatus getFOTA_ServiceHandles | ( | uint8_t | hostId,
|  | BLEATT_FOTA_Info * | info
| ) |  |

Get FOTA Service Handle Numbers

Attention
  - role = BLE_GATT_ROLE_CLIENT
    MUST call this API to get service information after received BLECMD_EVENT_ATT_DATABASE_PARSING_FINISHED
  - role = BLE_GATT_ROLE_SERVER
    MUST call this API to get service information before connection established.

Parameters

  [in] | hostId | : the link's host id.
  [out] | info | : a pointer to FOTA information

Return values

  BLESTACK_STATUS_ERR_INVALID_HOSTID | : Error host id.
  BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter.
  BLESTACK_STATUS_SUCCESS | : Setting success.

## ◆ setFOTA_ServiceInit()

BleStackStatus setFOTA_ServiceInit | ( | uint8_t | hostId,
|  | BleGattRole | gattRole,
|  | BLEATT_FOTA_Info * | info,
|  | BleFOTA_EventCallBack | callback
| ) |  |

FOTA Service Initialization

Parameters

  [in] | hostId | : the link's host id.
  [in] | gattRole | : BLE GATT role.
  [in] | info | : a pointer to FOTA information.
  [in] | callback | : a pointer to a callback function that receive the service events.

Return values

  BLESTACK_STATUS_ERR_INVALID_HOSTID | : Error host id.
  BLESTACK_STATUS_ERR_INVALID_PARAM | : Invalid parameter.
  BLESTACK_STATUS_ERR_NOT_SUPPORTED | : Registered services buffer full.
  BLESTACK_STATUS_SUCCESS | : Setting success.