FreeRTOS: BLE
BLE
Return to main page ↑
iot_ble_config_defaults.h File Reference

BLE config options. More...

#include <assert.h>

Go to the source code of this file.

Macros

#define IOT_BLE_SERVER_UUID   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
 UUID used to uniquely identify a GATT server instance. More...
 
#define IOT_BLE_DEVICE_INFO_SERVICE_UUID_MASK   0x32, 0xF9, 0x79, 0xE6, 0xB5, 0x83, 0xFB, 0x4E, 0xAF, 0x48, 0x68, 0x11, 0x7F, 0x8A
 UUID of FreeRTOS Device Information Service. More...
 
#define IOT_BLE_DEVICE_INFO_SERVICE_BASE_UUID   0x00, 0xFF
 
#define IOT_BLE_DEVICE_INFO_SERVICE_UUID   { IOT_BLE_DEVICE_INFO_SERVICE_BASE_UUID, IOT_BLE_DEVICE_INFO_SERVICE_UUID_MASK }
 
#define IOT_BLE_SET_CUSTOM_ADVERTISEMENT_MSG   ( 0 )
 Set to true if user wants to send its own advertisement message.
 
#define IOT_BLE_ADVERTISING_UUID   IOT_BLE_DEVICE_INFO_SERVICE_UUID
 Define the UUID that is going to be advertised.
 
#define IOT_BLE_ADVERTISING_UUID_SIZE   16
 
#define IOT_BLE_ADVERTISING_CONN_INTERVAL_MIN   0x20
 Define the connection interval.
 
#define IOT_BLE_ADVERTISING_CONN_INTERVAL_MAX   0x40
 
#define IOT_BLE_ADVERTISING_INTERVAL   300
 
#define IOT_BLE_ENCRYPT_KEY_SIZE_MIN   16
 
#define IOT_BLE_ADVERTISING_APPEARANCE   0
 Appearance of the device when advertising.
 
#define IOT_BLE_INPUT_OUTPUT   eBTIODisplayYesNo
 Supported input/output of the device. This define needs to be of type BTIOtypes_t.
 
#define IOT_BLE_DEVICE_SHORT_LOCAL_NAME_SIZE   4
 Device name that is broadcasted in advertising message. It is the truncated complete local name.
 
#define IOT_BLE_DEVICE_COMPLETE_LOCAL_NAME   "BLE"
 Device name that can be read from the name characteristic.
 
#define IOT_BLE_DEVICE_LOCAL_NAME_MAX_LENGTH   ( 248 )
 Max length BLE local device name. As per BLE4.2 SPEC, device name length can be between 0 and 248 octet in length.
 
#define IOT_BLE_PREFERRED_MTU_SIZE   ( 512 )
 Preferred MTU size for the device for a BLE connection. More...
 
#define IOT_BLE_ENABLE_BONDING   ( 1 )
 The flag to enable bonding for the device. More...
 
#define IOT_BLE_ENABLE_SECURE_CONNECTION   ( 1 )
 The flag to enable secure connection for the device. More...
 
#define IOT_BLE_ENCRYPTION_REQUIRED   ( 1 )
 Configuration to force encryption to access all characteristics of services.
 
#define IOT_BLE_ENABLE_NUMERIC_COMPARISON   ( 1 )
 Configuration to enable numeric comparison for authentication. More...
 
#define IOT_BLE_NUMERIC_COMPARISON_TIMEOUT_SEC   ( 30 )
 Timeout in seconds used for BLE numeric comparison.
 
#define IOT_BLE_MAX_BONDED_DEVICES   ( 5 )
 Maximum number of device this device can be bonded with.
 
#define IOT_BLE_CHAR_READ_PERM   eBTPermReadEncryptedMitm
 
#define IOT_BLE_CHAR_WRITE_PERM   eBTPermWriteEncryptedMitm
 
#define IOT_BLE_ENABLE_FREERTOS_GATT_SERVICES   ( 1 )
 This configuration flag can be used to enable or disable all FreeRTOS GATT services. Configuration is useful if a custom GATT service is used instead of the default GATT services.
 
#define IOT_BLE_ADD_CUSTOM_SERVICES   ( 0 )
 Set to true if user wants to add its own custom GATT services.
 
#define IOT_BLE_ENABLE_DEVICE_INFO_SERVICE   ( 1 )
 Flag to enable FreeRTOS Device Information Service. More...
 
#define IOT_BLE_ENABLE_WIFI_PROVISIONING   ( 0 )
 Enable WIFI provisioning GATT service. More...
 
#define IOT_BLE_ENABLE_MQTT   ( 1 )
 Enable MQTT over BLE GATT service. More...
 
#define IOT_BLE_ENABLE_DATA_TRANSFER_SERVICE   ( 1 )
 Flag to enable data transfer service. Data transfer service can be used to exchange raw data between FreeRTOS device and FreeRTOS Mobile SDK.
 
#define IOT_BLE_WIFI_PROVISIONIG_MAX_SCAN_NETWORKS   ( 10 )
 Controls the number of network that can be discovered for WIFI provisioning. More...
 
#define IOT_BLE_WIFI_PROVISIONING_MAX_SAVED_NETWORKS   ( 8 )
 
#define IOT_BLE_MQTT_CREATE_CONNECTION_WAIT_MS   ( 1000 * IOT_BLE_NUMERIC_COMPARISON_TIMEOUT_SEC )
 Waiting time between checks for connection established.
 
#define IOT_BLE_MQTT_CREATE_CONNECTION_RETRY   ( 60 )
 Number of retries if connection is not established.
 
#define IOT_BLE_DATA_TRANSFER_SERVICE_UUID_MASK   0xC3, 0x4C, 0x04, 0x48, 0x02, 0xA0, 0xA9, 0x40, 0x2E, 0xD7, 0x6A, 0x16, 0xD7, 0xA9
 
#define IOT_BLE_DATA_TRANSFER_SERVICE_TYPE_MQTT   0x00
 Type for MQTT data transfer service. Type will be part of the service UUID.
 
#define IOT_BLE_DATA_TRANSFER_SERVICE_TYPE_WIFI_PROVISIONING   0x01
 Type for wifi provisioning data transfer service. Type will be part of the service UUID.
 
#define IOT_BLE_DATA_TRANSFER_TX_BUFFER_SIZE   ( 1024 )
 Size of the buffer to store pending bytes to be sent out through data transfer service.
 
#define IOT_BLE_DATA_TRANSFER_RX_BUFFER_SIZE   ( 1024 )
 Initial size of the buffer used to store the data received through data transfer service. The buffer size grows exponentially ( powers of 2 ).
 
#define IOT_BLE_DATA_TRANSFER_TIMEOUT_MS   ( 2000 )
 The timeout in milliseconds for sending a message through data transfer service.
 
#define IOT_BLE_MESG_ENCODER   ( _IotSerializerCborEncoder )
 
#define IOT_BLE_MESG_DECODER   ( _IotSerializerCborDecoder )
 
#define IotBle_MallocDataBuffer   malloc
 Default configuration for memory allocation of data transfer service buffers.
 
#define IotBle_FreeDataBuffer   free
 
#define IotBle_Assert(expression)   assert( expression )
 Default configuration for assert statements.
 

Detailed Description

BLE config options.

Ensures that the config options for BLE are set to sensible default values if the user does not provide one.

Macro Definition Documentation

◆ IOT_BLE_SERVER_UUID

#define IOT_BLE_SERVER_UUID   { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }

UUID used to uniquely identify a GATT server instance.

Currently only one server instance is supported.

◆ IOT_BLE_DEVICE_INFO_SERVICE_UUID_MASK

#define IOT_BLE_DEVICE_INFO_SERVICE_UUID_MASK   0x32, 0xF9, 0x79, 0xE6, 0xB5, 0x83, 0xFB, 0x4E, 0xAF, 0x48, 0x68, 0x11, 0x7F, 0x8A

UUID of FreeRTOS Device Information Service.

This 128 bit UUID used by all FreeRTOS for devices information. using this UUID.

The UUID is defined as a base + a mask. The mask is used to compute all the 128 bit UUIDs in the attribute table

◆ IOT_BLE_ADVERTISING_CONN_INTERVAL_MAX

#define IOT_BLE_ADVERTISING_CONN_INTERVAL_MAX   0x40

The advertising interval (in units of 0.625 ms. This value corresponds to 187.5 ms).

◆ IOT_BLE_ADVERTISING_INTERVAL

#define IOT_BLE_ADVERTISING_INTERVAL   300

Min encryption key size.

◆ IOT_BLE_PREFERRED_MTU_SIZE

#define IOT_BLE_PREFERRED_MTU_SIZE   ( 512 )

Preferred MTU size for the device for a BLE connection.

Upon new BLE connection both peers will negotiate their preferred MTU size. MTU size for the ble connection will be set to minimum of the negotiated values.

◆ IOT_BLE_ENABLE_BONDING

#define IOT_BLE_ENABLE_BONDING   ( 1 )

The flag to enable bonding for the device.

By default bonding will be enabled on all device.

◆ IOT_BLE_ENABLE_SECURE_CONNECTION

#define IOT_BLE_ENABLE_SECURE_CONNECTION   ( 1 )

The flag to enable secure connection for the device.

By default secure connection will be enable on all device.

◆ IOT_BLE_ENABLE_NUMERIC_COMPARISON

#define IOT_BLE_ENABLE_NUMERIC_COMPARISON   ( 1 )

Configuration to enable numeric comparison for authentication.

If the configuration is set to 0 and IOT_BLE_ENABLE_SECURE_CONNECTION is set to 1, then device will use just works pairing.

◆ IOT_BLE_ENABLE_DEVICE_INFO_SERVICE

#define IOT_BLE_ENABLE_DEVICE_INFO_SERVICE   ( 1 )

Flag to enable FreeRTOS Device Information Service.

Device Information service is used by the FreeRTOS mobile SDK to fetch device related information.

◆ IOT_BLE_ENABLE_WIFI_PROVISIONING

#define IOT_BLE_ENABLE_WIFI_PROVISIONING   ( 0 )

Enable WIFI provisioning GATT service.

By default WIFI provisioning will be disabled. The flag will enable the GATT service which communicates with FreeRTOS Mobile SDK to provision WiFi Networks.

◆ IOT_BLE_ENABLE_MQTT

#define IOT_BLE_ENABLE_MQTT   ( 1 )

Enable MQTT over BLE GATT service.

The flag will enable the GATT service which communicates with FreeRTOS Mobile SDK, which acts as a proxy to forward MQTT packets to AWS IoT.

◆ IOT_BLE_WIFI_PROVISIONIG_MAX_SCAN_NETWORKS

#define IOT_BLE_WIFI_PROVISIONIG_MAX_SCAN_NETWORKS   ( 10 )

Controls the number of network that can be discovered for WIFI provisioning.

A higher number will consume more stack space. The size increase in multiple of sizeof(WIFIScanResult_t).