SmartSnippets DA1459x SDK
Data Structures | Macros | Typedefs | Enumerations | Functions
ble_common.h File Reference

Common definitions for BLE API. More...

#include <stdbool.h>
#include <stdint.h>
#include <string.h>
#include "cmsis_compiler.h"

Go to the source code of this file.

Data Structures

struct  ble_evt_hdr_t
 
struct  bd_address
 
struct  own_address
 
struct  irk_t
 
struct  ble_evt_reset_completed_t
 

Macros

#define BLE_APP_NOTIFY_MASK   (1 << 0)
 
#define BLE_EVT_CAT_FIRST(CAT)   (CAT << 8)
 
#define LOW_POWER_ALL_PHYS   ( 0x01 )
 
#define HIGH_PERFORMANCE_ALL_PHYS   ( 0x02 )
 

Typedefs

typedef enum addr_types addr_type_t
 
typedef enum own_addr_types own_addr_type_t
 
typedef struct bd_address bd_address_t
 
typedef struct own_address own_address_t
 

Enumerations

enum  ble_error_t {
  BLE_STATUS_OK = 0x00, BLE_ERROR_FAILED = 0x01, BLE_ERROR_ALREADY_DONE = 0x02, BLE_ERROR_IN_PROGRESS = 0x03,
  BLE_ERROR_INVALID_PARAM = 0x04, BLE_ERROR_NOT_ALLOWED = 0x05, BLE_ERROR_NOT_CONNECTED = 0x06, BLE_ERROR_NOT_SUPPORTED = 0x07,
  BLE_ERROR_NOT_ACCEPTED = 0x08, BLE_ERROR_BUSY = 0x09, BLE_ERROR_TIMEOUT = 0x0A, BLE_ERROR_NOT_SUPPORTED_BY_PEER = 0x0B,
  BLE_ERROR_CANCELED = 0x0C, BLE_ERROR_ENC_KEY_MISSING = 0x0D, BLE_ERROR_INS_RESOURCES = 0x0E, BLE_ERROR_NOT_FOUND = 0x0F,
  BLE_ERROR_L2CAP_NO_CREDITS = 0x10, BLE_ERROR_L2CAP_MTU_EXCEEDED = 0x11, BLE_ERROR_INS_BANDWIDTH = 0x12, BLE_ERROR_LMP_COLLISION = 0x13,
  BLE_ERROR_DIFF_TRANS_COLLISION = 0x14
}
 
enum  ble_hci_error_t {
  BLE_HCI_ERROR_NO_ERROR = 0x00, BLE_HCI_ERROR_UNKNOWN_HCI_COMMAND = 0x01, BLE_HCI_ERROR_UNKNOWN_CONNECTION_ID = 0x02, BLE_HCI_ERROR_HARDWARE_FAILURE = 0x03,
  BLE_HCI_ERROR_PAGE_TIMEOUT = 0x04, BLE_HCI_ERROR_AUTH_FAILURE = 0x05, BLE_HCI_ERROR_PIN_MISSING = 0x06, BLE_HCI_ERROR_MEMORY_CAPA_EXCEED = 0x07,
  BLE_HCI_ERROR_CON_TIMEOUT = 0x08, BLE_HCI_ERROR_CON_LIMIT_EXCEED = 0x09, BLE_HCI_ERROR_SYNC_CON_LIMIT_DEV_EXCEED = 0x0A, BLE_HCI_ERROR_ACL_CON_EXISTS = 0x0B,
  BLE_HCI_ERROR_COMMAND_DISALLOWED = 0x0C, BLE_HCI_ERROR_CONN_REJ_LIMITED_RESOURCES = 0x0D, BLE_HCI_ERROR_CONN_REJ_SECURITY_REASONS = 0x0E, BLE_HCI_ERROR_CONN_REJ_UNACCEPTABLE_BDADDR = 0x0F,
  BLE_HCI_ERROR_CONN_ACCEPT_TIMEOUT_EXCEED = 0x10, BLE_HCI_ERROR_UNSUPPORTED = 0x11, BLE_HCI_ERROR_INVALID_HCI_PARAM = 0x12, BLE_HCI_ERROR_REMOTE_USER_TERM_CON = 0x13,
  BLE_HCI_ERROR_REMOTE_DEV_TERM_LOW_RESOURCES = 0x14, BLE_HCI_ERROR_REMOTE_DEV_POWER_OFF = 0x15, BLE_HCI_ERROR_CON_TERM_BY_LOCAL_HOST = 0x16, BLE_HCI_ERROR_REPEATED_ATTEMPTS = 0x17,
  BLE_HCI_ERROR_PAIRING_NOT_ALLOWED = 0x18, BLE_HCI_ERROR_UNKNOWN_LMP_PDU = 0x19, BLE_HCI_ERROR_UNSUPPORTED_REMOTE_FEATURE = 0x1A, BLE_HCI_ERROR_SCO_OFFSET_REJECTED = 0x1B,
  BLE_HCI_ERROR_SCO_INTERVAL_REJECTED = 0x1C, BLE_HCI_ERROR_SCO_AIR_MODE_REJECTED = 0x1D, BLE_HCI_ERROR_INVALID_LMP_PARAM = 0x1E, BLE_HCI_ERROR_UNSPECIFIED_ERROR = 0x1F,
  BLE_HCI_ERROR_UNSUPPORTED_LMP_PARAM_VALUE = 0x20, BLE_HCI_ERROR_ROLE_CHANGE_NOT_ALLOWED = 0x21, BLE_HCI_ERROR_LMP_RSP_TIMEOUT = 0x22, BLE_HCI_ERROR_LMP_COLLISION = 0x23,
  BLE_HCI_ERROR_LMP_PDU_NOT_ALLOWED = 0x24, BLE_HCI_ERROR_ENC_MODE_NOT_ACCEPT = 0x25, BLE_HCI_ERROR_LINK_KEY_CANT_CHANGE = 0x26, BLE_HCI_ERROR_QOS_NOT_SUPPORTED = 0x27,
  BLE_HCI_ERROR_INSTANT_PASSED = 0x28, BLE_HCI_ERROR_PAIRING_WITH_UNIT_KEY_NOT_SUP = 0x29, BLE_HCI_ERROR_DIFF_TRANSACTION_COLLISION = 0x2A, BLE_HCI_ERROR_QOS_UNACCEPTABLE_PARAM = 0x2C,
  BLE_HCI_ERROR_QOS_REJECTED = 0x2D, BLE_HCI_ERROR_CHANNEL_CLASS_NOT_SUP = 0x2E, BLE_HCI_ERROR_INSUFFICIENT_SECURITY = 0x2F, BLE_HCI_ERROR_PARAM_OUT_OF_MAND_RANGE = 0x30,
  BLE_HCI_ERROR_ROLE_SWITCH_PEND = 0x32, BLE_HCI_ERROR_RESERVED_SLOT_VIOLATION = 0x34, BLE_HCI_ERROR_ROLE_SWITCH_FAIL = 0x35, BLE_HCI_ERROR_EIR_TOO_LARGE = 0x36,
  BLE_HCI_ERROR_SP_NOT_SUPPORTED_HOST = 0x37, BLE_HCI_ERROR_HOST_BUSY_PAIRING = 0x38, BLE_HCI_ERROR_CONN_REJ_NO_SUITABLE_CHANNEL = 0x39, BLE_HCI_ERROR_CONTROLLER_BUSY = 0x3A,
  BLE_HCI_ERROR_UNACCEPTABLE_CONN_INT = 0x3B, BLE_HCI_ERROR_DIRECT_ADV_TO = 0x3C, BLE_HCI_ERROR_TERMINATED_MIC_FAILURE = 0x3D, BLE_HCI_ERROR_CONN_FAILED_TO_BE_EST = 0x3E,
  BLE_HCI_ERROR_MAC_CONNECTION_FAILED = 0x3F, BLE_HCI_ERROR_COARSE_CLK_ADJUST_REJECTED = 0x40
}
 
enum  ble_evt_cat
 
enum  ble_evt_common { BLE_EVT_RESET_COMPLETED = BLE_EVT_CAT_FIRST(BLE_EVT_CAT_COMMON) }
 Common events. More...
 
enum  ble_status_t
 
enum  addr_types { PUBLIC_ADDRESS = 0x00, PRIVATE_ADDRESS = 0x01 }
 
enum  own_addr_types { PUBLIC_STATIC_ADDRESS, PRIVATE_STATIC_ADDRESS, PRIVATE_RANDOM_RESOLVABLE_ADDRESS, PRIVATE_RANDOM_NONRESOLVABLE_ADDRESS }
 
enum  tx_power_level_type_t
 

Functions

ble_error_t ble_register_app (void)
 Register application in BLE framework. More...
 
ble_error_t ble_enable (void)
 Enable BLE module. More...
 
ble_error_t ble_reset (void)
 Reset BLE module. More...
 
ble_error_t ble_central_start (void)
 Start the BLE module as a central device. More...
 
ble_error_t ble_peripheral_start (void)
 Start the BLE module as a peripheral device. More...
 
ble_evt_hdr_tble_get_event (bool wait)
 Get event from BLE event queue. More...
 
bool ble_has_event (void)
 Checks if there's event pending in event queue. More...
 
void ble_handle_event_default (ble_evt_hdr_t *hdr)
 Execute default event handler. More...
 
ble_error_t ble_read_tx_power (uint16_t conn_idx, tx_power_level_type_t type, uint8_t *tx_power)
 Read controller TX power. More...
 
__STATIC_INLINE bool ble_address_cmp (const bd_address_t *addr1, const bd_address_t *addr2)
 Compare two BD Addresses. More...
 
const char * ble_address_to_string (const bd_address_t *address)
 Convert bd_address to string. More...
 
bool ble_address_from_string (const char *str, addr_type_t addr_type, bd_address_t *address)
 Convert string to bd_address. More...
 
ble_error_t ble_set_fem_voltage_trim (uint8_t channel, uint8_t value)
 Set FEM Voltage GPIO values for a specific channel. More...
 

Detailed Description

Common definitions for BLE API.

Copyright (C) 2015-2023 Renesas Electronics Corporation and/or its affiliates. All rights reserved. Confidential Information.

This software ("Software") is supplied by Renesas Electronics Corporation and/or its affiliates ("Renesas"). Renesas grants you a personal, non-exclusive, non-transferable, revocable, non-sub-licensable right and license to use the Software, solely if used in or together with Renesas products. You may make copies of this Software, provided this copyright notice and disclaimer ("Notice") is included in all such copies. Renesas reserves the right to change or discontinue the Software at any time without notice.

THE SOFTWARE IS PROVIDED "AS IS". RENESAS DISCLAIMS ALL WARRANTIES OF ANY KIND, WHETHER EXPRESS, IMPLIED, OR STATUTORY, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. TO THE MAXIMUM EXTENT PERMITTED UNDER LAW, IN NO EVENT SHALL RENESAS BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE, EVEN IF RENESAS HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. USE OF THIS SOFTWARE MAY BE SUBJECT TO TERMS AND CONDITIONS CONTAINED IN AN ADDITIONAL AGREEMENT BETWEEN YOU AND RENESAS. IN CASE OF CONFLICT BETWEEN THE TERMS OF THIS NOTICE AND ANY SUCH ADDITIONAL LICENSE AGREEMENT, THE TERMS OF THE AGREEMENT SHALL TAKE PRECEDENCE. BY CONTINUING TO USE THIS SOFTWARE, YOU AGREE TO THE TERMS OF THIS NOTICE.IF YOU DO NOT AGREE TO THESE TERMS, YOU ARE NOT PERMITTED TO USE THIS SOFTWARE.