SDK  23.9.2
For IoT System Software Development
Macros | Typedefs | Enumerations
BLECommon.hpp File Reference

BLE common. More...

#include <typedef.h>

Macros

#define NULL_HANDLE   (0xffff)
 
#define BLE_GATT_PERM_READ   (1 << 0)
 
#define BLE_GATT_PERM_READ_ENCRYPTED   (1 << 1)
 
#define BLE_GATT_PERM_READ_ENC_MITM   (1 << 2)
 
#define BLE_GATT_PERM_WRITE   (1 << 4)
 
#define BLE_GATT_PERM_WRITE_ENCRYPTED   (1 << 5)
 
#define BLE_GATT_PERM_WRITE_ENC_MITM   (1 << 6)
 
#define BLE_GATT_PERM_WRITE_SIGNED   (1 << 7)
 
#define BLE_GATT_PERM_WRITE_SIGNED_MITM   (1 << 8)
 
#define BLE_GATT_CHAR_PROP_BIT_BROADCAST   (1 << 0) /* 0x01 */
 
#define BLE_GATT_CHAR_PROP_BIT_READ   (1 << 1) /* 0x02 */
 
#define BLE_GATT_CHAR_PROP_BIT_WRITE_NR   (1 << 2) /* 0x04 */
 
#define BLE_GATT_CHAR_PROP_BIT_WRITE   (1 << 3) /* 0x08 */
 
#define BLE_GATT_CHAR_PROP_BIT_NOTIFY   (1 << 4) /* 0x10 */
 
#define BLE_GATT_CHAR_PROP_BIT_INDICATE   (1 << 5) /* 0x20 */
 
#define BLE_GATT_CHAR_PROP_BIT_AUTH   (1 << 6) /* 0x40 */
 
#define BLE_GATT_CHAR_PROP_BIT_EXT_PROP   (1 << 7) /* 0x80 */
 
#define BLE_GATT_MAX_ATTR_LEN   600
 
#define BLE_AUTH_NO_BOND   0x00
 
#define BLE_AUTH_BOND   0x01
 
#define BLE_AUTH_REQ_MITM   (1 << 2)
 
#define BLE_AUTH_REQ_SC_ONLY   (1 << 3)
 
#define BLE_AUTH_REQ_SC_BOND   (BLE_AUTH_BOND | BLE_AUTH_REQ_SC_ONLY)
 
#define BLE_AUTH_REQ_SC_MITM   (BLE_AUTH_REQ_MITM | BLE_AUTH_REQ_SC_ONLY)
 
#define BLE_AUTH_REQ_SC_MITM_BOND   (BLE_AUTH_REQ_MITM | BLE_AUTH_REQ_SC_ONLY | BLE_AUTH_BOND)
 
#define BLE_IO_CAP_OUT   0
 
#define BLE_IO_CAP_IO   1
 
#define BLE_IO_CAP_IN   2
 
#define BLE_IO_CAP_NONE   3
 
#define BLE_IO_CAP_KBDISP   4
 
#define BLE_KEY_NONE   0
 
#define BLE_KEY_PENC   (1 << 0)
 
#define BLE_KEY_PID   (1 << 1)
 
#define BLE_KEY_PCSRK   (1 << 2)
 
#define BLE_KEY_PLK   (1 << 3)
 
#define BLE_KEY_LLK   (BLE_KEY_PLK << 4)
 
#define BLE_KEY_LENC   (BLE_KEY_PENC << 4)
 
#define BLE_KEY_LID   (BLE_KEY_PID << 4)
 
#define BLE_KEY_LCSRK   (BLE_KEY_PCSRK << 4)
 

Typedefs

typedef uint16_t ble_gatt_perm_t
 
typedef uint8_t ble_gatt_char_prop_t
 
typedef uint8_t ble_auth_req_t
 
typedef uint8_t ble_io_cap_t
 
typedef uint8_t ble_key_type_t
 

Enumerations

enum  ble_ad_t {
  BLE_AD_TYPE_FLAG = 0x01, BLE_AD_TYPE_16SRV_PART = 0x02, BLE_AD_TYPE_16SRV_CMPL = 0x03, BLE_AD_TYPE_32SRV_PART = 0x04,
  BLE_AD_TYPE_32SRV_CMPL = 0x05, BLE_AD_TYPE_128SRV_PART = 0x06, BLE_AD_TYPE_128SRV_CMPL = 0x07, BLE_AD_TYPE_NAME_SHORT = 0x08,
  BLE_AD_TYPE_NAME_CMPL = 0x09, BLE_AD_TYPE_TX_PWR = 0x0A, BLE_AD_TYPE_DEV_CLASS = 0x0D, BLE_AD_TYPE_SM_TK = 0x10,
  BLE_AD_TYPE_SM_OOB_FLAG = 0x11, BLE_AD_TYPE_INT_RANGE = 0x12, BLE_AD_TYPE_SOL_SRV_UUID = 0x14, BLE_AD_TYPE_128SOL_SRV_UUID = 0x15,
  BLE_AD_TYPE_SERVICE_DATA = 0x16, BLE_AD_TYPE_PUBLIC_TARGET = 0x17, BLE_AD_TYPE_RANDOM_TARGET = 0x18, BLE_AD_TYPE_APPEARANCE = 0x19,
  BLE_AD_TYPE_ADV_INT = 0x1A, BLE_AD_TYPE_LE_DEV_ADDR = 0x1b, BLE_AD_TYPE_LE_ROLE = 0x1c, BLE_AD_TYPE_SPAIR_C256 = 0x1d,
  BLE_AD_TYPE_SPAIR_R256 = 0x1e, BLE_AD_TYPE_32SOL_SRV_UUID = 0x1f, BLE_AD_TYPE_32SERVICE_DATA = 0x20, BLE_AD_TYPE_128SERVICE_DATA = 0x21,
  BLE_AD_TYPE_LE_SECURE_CONFIRM = 0x22, BLE_AD_TYPE_LE_SECURE_RANDOM = 0x23, BLE_AD_TYPE_URI = 0x24, BLE_AD_TYPE_INDOOR_POSITION = 0x25,
  BLE_AD_TYPE_TRANS_DISC_DATA = 0x26, BLE_AD_TYPE_LE_SUPPORT_FEATURE = 0x27, BLE_AD_TYPE_CHAN_MAP_UPDATE = 0x28, BLE_AD_TYPE_MANUFACTURER_SPECIFIC = 0xFF
}
 The type of advertising data(not adv_type)
 
enum  {
  APPEARANCE_UNKNOWN = 0x0000, APPEARANCE_GENERIC_PHONE = 0x0040, APPEARANCE_GENERIC_COMPUTER = 0x0080, APPEARANCE_GENERIC_WATCH = 0x00C0,
  APPEARANCE_SPORTS_WATCH = 0x00C1, APPEARANCE_GENERIC_CLOCK = 0x0100, APPEARANCE_GENERIC_DISPLAY = 0x0140, APPEARANCE_GENERIC_REMOTE = 0x0180,
  APPEARANCE_GENERIC_EYEGLASSES = 0x01C0, APPEARANCE_GENERIC_TAG = 0x0200, APPEARANCE_GENERIC_KEYRING = 0x0240, APPEARANCE_GENERIC_MEDIA_PLAYER = 0x0280,
  APPEARANCE_GENERIC_BARCODE_SCANNER = 0x02C0, APPEARANCE_GENERIC_THERMOMETER = 0x0300, APPEARANCE_THERMOMETER_EAR = 0x0301, APPEARANCE_GENERIC_HEART_RATE = 0x0340,
  APPEARANCE_HEART_RATE_BELT = 0x0341, APPEARANCE_GENERIC_BLOOD_PRESSURE = 0x0380, APPEARANCE_BLOOD_PRESSURE_ARM = 0x0381, APPEARANCE_BLOOD_PRESSURE_WRIST = 0x0382,
  APPEARANCE_GENERIC_HID = 0x03C0, APPEARANCE_HID_KEYBOARD = 0x03C1, APPEARANCE_HID_MOUSE = 0x03C2, APPEARANCE_HID_JOYSTICK = 0x03C3,
  APPEARANCE_HID_GAMEPAD = 0x03C4, APPEARANCE_HID_DIGITIZER_TABLET = 0x03C5, APPEARANCE_HID_CARD_READER = 0x03C6, APPEARANCE_HID_DIGITAL_PEN = 0x03C7,
  APPEARANCE_HID_BARCODE_SCANNER = 0x03C8, APPEARANCE_GENERIC_GLUCOSE = 0x0400, APPEARANCE_GENERIC_WALKING = 0x0440, APPEARANCE_WALKING_IN_SHOE = 0x0441,
  APPEARANCE_WALKING_ON_SHOE = 0x0442, APPEARANCE_WALKING_ON_HIP = 0x0443, APPEARANCE_GENERIC_CYCLING = 0x0480, APPEARANCE_CYCLING_COMPUTER = 0x0481,
  APPEARANCE_CYCLING_SPEED = 0x0482, APPEARANCE_CYCLING_CADENCE = 0x0483, APPEARANCE_CYCLING_POWER = 0x0484, APPEARANCE_CYCLING_SPEED_CADENCE = 0x0485,
  APPEARANCE_GENERIC_PULSE_OXIMETER = 0x0C40, APPEARANCE_PULSE_OXIMETER_FINGERTIP = 0x0C41, APPEARANCE_PULSE_OXIMETER_WRIST = 0x0C42, APPEARANCE_GENERIC_WEIGHT = 0x0C80,
  APPEARANCE_GENERIC_PERSONAL_MOBILITY_DEVICE = 0x0CC0, APPEARANCE_POWERED_WHEELCHAIR = 0x0CC1, APPEARANCE_MOBILITY_SCOOTER = 0x0CC2, APPEARANCE_GENERIC_CONTINUOUS_GLUCOSE_MONITOR = 0x0D00,
  APPEARANCE_GENERIC_INSULIN_PUMP = 0x0D40, APPEARANCE_INSULIN_PUMP_DURABLE_PUMP = 0x0D41, APPEARANCE_INSULIN_PUMP_PATCH_PUMP = 0x0D44, APPEARANCE_INSULIN_PEN = 0x0D48,
  APPEARANCE_GENERIC_MEDICATION_DELIVERY = 0x0D80, APPEARANCE_GENERIC_OUTDOOR_SPORTS = 0x1440, APPEARANCE_OUTDOOR_SPORTS_LOCATION = 0x1441, APPEARANCE_OUTDOOR_SPORTS_LOCATION_AND_NAV = 0x1442,
  APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD = 0x1443, APPEARANCE_OUTDOOR_SPORTS_LOCATION_POD_AND_NAV = 0x1444
}
 
enum  ble_adv_filter_t { BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY = 0x00, BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_ANY, BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST, BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST }
 
enum  ble_sec_act_t { BLE_SEC_ENCRYPT = 1, BLE_SEC_ENCRYPT_NO_MITM, BLE_SEC_ENCRYPT_MITM }
 

Detailed Description

BLE common.

Author
Jongsoo Jeong (CoXlab)
Date
2018. 9. 27.

Macro Definition Documentation

◆ BLE_IO_CAP_IN

#define BLE_IO_CAP_IN   2

KeyboardOnly

◆ BLE_IO_CAP_IO

#define BLE_IO_CAP_IO   1

DisplayYesNo

◆ BLE_IO_CAP_KBDISP

#define BLE_IO_CAP_KBDISP   4

Keyboard display

◆ BLE_IO_CAP_NONE

#define BLE_IO_CAP_NONE   3

NoInputNoOutput

◆ BLE_IO_CAP_OUT

#define BLE_IO_CAP_OUT   0

DisplayOnly

Enumeration Type Documentation

◆ ble_adv_filter_t

Enumerator
BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY 

Allow both scan and connection requests from anyone.

BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_ANY 

Allow both scan req from White List devices only and connection req from anyone.

BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST 

Allow both scan req from anyone and connection req from White List devices only.

BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST 

Allow scan and connection requests from White List devices only.

BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST
@ BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_WLST
Allow scan and connection requests from White List devices only.
Definition: BLECommon.hpp:211
ble_adv_filter_t
ble_adv_filter_t
Definition: BLECommon.hpp:203
BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY
@ BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_ANY
Allow both scan and connection requests from anyone.
Definition: BLECommon.hpp:205
BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_ANY
@ BLE_ADV_FILTER_ALLOW_SCAN_WLST_CON_ANY
Allow both scan req from White List devices only and connection req from anyone.
Definition: BLECommon.hpp:207
BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST
@ BLE_ADV_FILTER_ALLOW_SCAN_ANY_CON_WLST
Allow both scan req from anyone and connection req from White List devices only.
Definition: BLECommon.hpp:209