Infineon Logo AIROC BTSDK v4.6 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups
bleprofile.h File Reference

This file provides definitions and function prototypes for the Blueooth LE GATT profiles. More...

Macros

#define BD_ADDR_LEN   6
 
#define ADV_LEN_MAX   31
 
#define FLAGS_LEN   1
 
#define COD_LEN   3
 
#define APPEARANCE_LEN   2
 
#define UUID_LEN   2
 
#define LOCAL_NAME_LEN_MAX   17
 
#define TX_POWER_LEN   1
 
#define VERSION_LEN   6
 
#define TIMESTAMP_LEN   7
 
#define READ_UART_LEN   15
 
#define SECURITY_ENABLED   0x01
 
#define SECURITY_REQUEST   0x02
 
#define BLEPROFILE_GENERIC_APP_TIMER   0
 
#define HANDLE_NUM_MAX   5
 
#define GPIO_NUM_MAX   16
 
#define GPIO_INPUT   0x0000
 
#define GPIO_OUTPUT   0x0001
 
#define GPIO_INIT_LOW   0x0000
 
#define GPIO_INIT_HIGH   0x0002
 
#define GPIO_POLL   0x0000
 
#define GPIO_INT   0x0004
 
#define GPIO_BOTHEDGE_INT   0x0008
 
#define GPIO_WP   0x0010
 
#define GPIO_BAT   0x0020
 
#define GPIO_BUTTON   0x0100
 
#define GPIO_BUTTON1   0x0100
 
#define GPIO_BUTTON2   0x0200
 
#define GPIO_BUTTON3   0x0400
 
#define GPIO_LED   0x1000
 
#define GPIO_BUZ   0x2000
 
#define PWM_START_GPIO   0
 
#define PWM_END_GPIO   0
 
#define BIT16_TO_8(val)
 
#define BIT32_TO_8(val)
 
#define ATTRIBUTE16(handle, permission, datalen, uuid)
 
#define ATTRIBUTE128(handle, permission, len, uuid, data)   Not implemented
 
#define PRIMARY_SERVICE_UUID16(handle, service)
 
#define PRIMARY_SERVICE_UUID128(handle, service)
 
#define SECONDARY_SERVICE_UUID16(handle, service)
 
#define SECONDARY_SERVICE_UUID128(handle, service)
 
#define INCLUDE_SERVICE_UUID16(handle, service_handle, end_group_handle, service)
 
#define CHARACTERISTIC_UUID16(handle, handle_value, uuid, properties, permission, value_len)
 
#define CHARACTERISTIC_UUID128(handle, handle_value, uuid, properties, permission, value_len)
 
#define CHARACTERISTIC_UUID16_WRITABLE(handle, handle_value, uuid, properties, permission, value_len)
 
#define CHARACTERISTIC_UUID128_WRITABLE(handle, handle_value, uuid, properties, permission, value_len)
 
#define CHAR_DESCRIPTOR_UUID16_WRITABLE(handle, uuid, permission, value_len)
 
#define CHAR_DESCRIPTOR_UUID16(handle, uuid, permission, value_len)
 
#define ADV_DATA_MASK_FLAGS   0x01
 
#define ADV_DATA_MASK_SERVICE_UUID   0x02
 
#define ADV_DATA_MASK_APPEARANCE   0x04
 
#define ADV_DATA_MASK_NAME   0x08
 
#define SCAN_RSP_MASK_TX_POWER   0x01
 
#define LE_LIMITED_DISCOVERABLE   0x01
 
#define LE_GENERAL_DISCOVERABLE   0x02
 
#define BR_EDR_NOT_SUPPORTED   0x04
 
#define SIMUL_LE_BR_EDR_CONTROLLER   0x08
 
#define SIMUL_LE_BR_EDR_HOST   0x10
 

Typedefs

typedef UINT8 BD_ADDR [BD_ADDR_LEN]
 
typedef UINT8 * BD_ADDR_PTR
 
struct {
   UINT8   len
 
   UINT8   val
 
   UINT8   data [ADV_LEN_MAX-2]
 
BLE_ADV_FIELD
 
struct {
   UINT16   fine_timer_interval
 
   UINT8   default_adv
 
   UINT8   button_adv_toggle
 
   UINT16   high_undirect_adv_interval
 
   UINT16   low_undirect_adv_interval
 
   UINT16   high_undirect_adv_duration
 
   UINT16   low_undirect_adv_duration
 
   UINT16   high_direct_adv_interval
 
   UINT16   low_direct_adv_interval
 
   UINT16   high_direct_adv_duration
 
   UINT16   low_direct_adv_duration
 
   char   local_name [LOCAL_NAME_LEN_MAX]
 
   char   cod [COD_LEN]
 
   char   ver [VERSION_LEN]
 
   UINT8   encr_required
 
   UINT8   disc_required
 
   UINT8   test_enable
 
   UINT8   tx_power_level
 
   UINT8   con_idle_timeout
 
   UINT8   powersave_timeout
 
   UINT16   hdl [HANDLE_NUM_MAX]
 
   UINT16   serv [HANDLE_NUM_MAX]
 
   UINT16   cha [HANDLE_NUM_MAX]
 
   UINT8   findme_locator_enable
 
   UINT8   findme_alert_level
 
   UINT8   client_grouptype_enable
 
   UINT8   linkloss_button_enable
 
   UINT8   pathloss_check_interval
 
   UINT8   alert_interval
 
   UINT8   high_alert_num
 
   UINT8   mild_alert_num
 
   UINT8   status_led_enable
 
   UINT8   status_led_interval
 
   UINT8   status_led_con_blink
 
   UINT8   status_led_dir_adv_blink
 
   UINT8   status_led_un_adv_blink
 
   UINT16   led_on_ms
 
   UINT16   led_off_ms
 
   UINT16   buz_on_ms
 
   UINT8   button_power_timeout
 
   UINT8   button_client_timeout
 
   UINT8   button_discover_timeout
 
   UINT8   button_filter_timeout
 
BLE_PROFILE_CFG
 Bluetooth LE Profile Configuration. More...
 
struct {
   UINT32   baudrate
 
   UINT8   txpin
 
   UINT8   rxpin
 
BLE_PROFILE_PUART_CFG
 UART Configuration. More...
 
struct {
   INT8   gpio_pin [GPIO_NUM_MAX]
 
   UINT16   gpio_flag [GPIO_NUM_MAX]
 
BLE_PROFILE_GPIO_CFG
 GPIO Configuration. More...
 
struct {
   UINT8   len
 
   UINT8   header
 
   UINT8   pdu [LEATT_ATT_MTU-1]
 
BLEPROFILE_DB_PDU
 
typedef UINT8 TIMESTAMP [TIMESTAMP_LEN]
 
struct {
   UINT8   count
 
   UINT8   interval
 
   UINT8   blinknum
 
   UINT8   duration
 
   UINT8   timeout
 
BLE_PROFILE_TIMER_CONTROL
 
struct {
   BD_ADDR   bdAddr
 
   UINT16   serv
 
   UINT16   cha
 
   UINT16   cli_cha_desc
 
BLEPROFILE_HOSTINFO
 
struct {
   UINT8   freq
 
   UINT16   init_value
 
   UINT16   toggle_val
 
BLE_PROFILE_PWM_CFG
 
typedef UINT16 SFLOAT
 
typedef UINT32 FLOAT32
 
typedef UINT32(* BLEPROFILE_QUERY_PARAM_CB )(UINT32, UINT32)
 
typedef UINT8(* BLEPROFILE_DOUBLE_PARAM_CB )(UINT8 *, UINT8 *)
 
typedef UINT32(* BLEPROFILE_SINGLE_PARAM_CB )(UINT32)
 
typedef UINT8(* BLEPROFILE_NO_PARAM_CB )(void)
 

Enumerations

enum  ble_adv_flag_value {
  ADV_FLAGS = 0x01, ADV_SERVICE_UUID16_MORE = 0x02, ADV_SERVICE_UUID16_COMP = 0x03, ADV_SERVICE_UUID32_MORE = 0x04,
  ADV_SERVICE_UUID32_COMP = 0x05, ADV_SERVICE_UUID128_MORE = 0x06, ADV_SERVICE_UUID128_COMP = 0x07, ADV_LOCAL_NAME_SHORT = 0x08,
  ADV_LOCAL_NAME_COMP = 0x09, ADV_TX_POWER_LEVEL = 0x0A, ADV_CLASS_OF_DEVICE = 0x0D, ADV_SIMPLE_PAIRING_HASH_C = 0x0E,
  ADV_SIMPLE_PAIRING_RANDOMIZER_R = 0x0F, ADV_TK_VALUE = 0x10, ADV_OOB_FLAGS = 0x11, ADV_PERIPHERAL_CONNECTION_INTERVAL_RANGE = 0x12,
  ADV_SERVICE_SOLICITATION_UUID16 = 0x14, ADV_SERVICE_SOLICITATION_UUID128 = 0x15, ADV_SERVICE_DATA = 0x16, ADV_TARGET_PUBLIC_ADR = 0x17,
  ADV_TARGET_RANDOM_ADR = 0x18, ADV_APPEARANCE = 0x19, ADV_ADVERTISING_INTERVAL = 0x1A, ADV_SERVICE_SOLICITATION_UUID32 = 0x1F,
  ADV_SERVICE_DATA_UUID32 = 0x20, ADV_SERVICE_DATA_UUID128 = 0x21, ADV_SECURE_CONNECTION_CONF_VALUE = 0x22, ADV_SECURE_CONNECTION_RANDOM_VALUE = 0x23,
  ADV_INDOOR_POSITION = 0x24, ADV_3D_INFORMATION_DATA = 0x3D, ADV_MANUFACTURER_DATA = 0xFF
}
 
enum  ble_appearance_value {
  APPEARANCE_GENERIC_PHONE = 64, APPEARANCE_GENERIC_COMPUTER = 128, APPEARANCE_GENERIC_WATCH = 192, APPEARANCE_WATCH_SPORTS = 193,
  APPEARANCE_GENERIC_CLOCK = 256, APPEARANCE_GENERIC_DISPLAY = 320, APPEARANCE_GENERIC_REMOTE_CONTROL = 384, APPEARANCE_GENERIC_EYE_GLASSES = 448,
  APPEARANCE_GENERIC_TAG = 512, APPEARANCE_GENERIC_KEYRING = 576, APPEARANCE_GENERIC_MEDIA_PLAYER = 640, APPEARANCE_GENERIC_BARCODE_SCANNER = 704,
  APPEARANCE_GENERIC_THERMOMETER = 768, APPEARANCE_THERMOMETER_EAR = 769, APPEARANCE_GENERIC_HEART_RATE_SENSOR = 832, APPEARANCE_HEART_RATE_BELT = 833,
  APPEARANCE_GENERIC_BLOOD_PRESSURE = 896, APPEARANCE_BLOOD_PRESSURE_ARM = 897, APPEARANCE_BLOOD_PRESSURE_WRIST = 898, APPEARANCE_GENERIC_HID_DEVICE = 960,
  APPEARANCE_HID_KEYBOARD = 961, APPEARANCE_HID_MOUSE = 962, APPEARANCE_HID_JOYSTICK = 963, APPEARANCE_HID_GAMEPAD = 964,
  APPEARANCE_HID_DIGITIZER_TABLET = 965, APPEARANCE_HID_CARD_READER = 966, APPEARANCE_HID_DIGITAL_PEN = 967, APPEARANCE_HID_BARCODE_SCANNER = 968,
  APPEARANCE_GENERIC_GLUCOSE_METER = 1024, APPEARANCE_GENERIC_RUNNING_WALKING_SENSOR = 1088, APPEARANCE_RUNNING_WALKING_SENSOR_IN_SHOE = 1089, APPEARANCE_RUNNING_WALKING_SENSOR_ON_SHOE = 1090,
  APPEARANCE_RUNNING_WALKING_SENSOR_ON_HIP = 1091, APPEARANCE_GENERIC_CYCLING = 1152, APPEARANCE_CYCLING_COMPUTER = 1153, APPEARANCE_CYCLING_SPEED_SENSOR = 1154,
  APPEARANCE_CYCLING_CADENCE_SENSOR = 1155, APPEARANCE_CYCLING_POWER_SENSOR = 1156, APPEARANCE_CYCLING_SPEED_AND_CADENCE_SENSOR = 1157, APPEARANCE_LOCATION_AND_NAVIGATION_POD = 5188
}
 
enum  bleprofile_puart_rx_int { PUART_RX_INT_ENABLE = 0x01, PUART_RX_FIFO_INT_ENABLE = 0x02, PUART_RX_CTS_ENABLE = 0x04 }
 
enum  ble_discover_mode {
  NO_DISCOVERABLE = 0, LOW_DIRECTED_DISCOVERABLE = 1, HIGH_DIRECTED_DISCOVERABLE = 2, LOW_UNDIRECTED_DISCOVERABLE = 3,
  HIGH_UNDIRECTED_DISCOVERABLE = 4, MANDATORY_DISCOVERABLE = 0xFF
}
 
enum  ble_findme_state {
  FINDME_IDLE = 0, FINDME_WAIT_READ_PRIMARY_SERVICE_DEFER = 1, FINDME_WAIT_READ_PRIMARY_SERVICE = 2, FINDME_WAIT_READ_CHARACTERISTIC_DEFER = 3,
  FINDME_WAIT_READ_CHARACTERISTIC = 4, FINDME_WAIT_WRITE_ALERTLEVEL_DEFER = 5
}
 
enum  ble_timeclient_state {
  TIMECLIENT_IDLE = 0, TIMECLIENT_WAIT_READ_PRIMARY_SERVICE_DEFER = 1, TIMECLIENT_WAIT_READ_PRIMARY_SERVICE = 2, TIMECLIENT_WAIT_READ_CHARACTERISTIC_DEFER = 3,
  TIMECLIENT_WAIT_READ_CHARACTERISTIC = 4, TIMECLIENT_WAIT_READ_DESC_DEFER = 5, TIMECLIENT_WAIT_READ_DESC = 6, TIMECLIENT_WAIT_READ_CURRENTTIME_DEFER = 7,
  TIMECLIENT_WAIT_READ_CURRENTTIME = 8
}
 
enum  ble_client_state {
  CLIENT_IDLE = 0, CLIENT_WAIT_READ_PRIMARY_SERVICE_DEFER = 1, CLIENT_WAIT_READ_PRIMARY_SERVICE = 2, CLIENT_WAIT_READ_CHARACTERISTIC_DEFER = 3,
  CLIENT_WAIT_READ_CHARACTERISTIC = 4, CLIENT_WAIT_READ_DESC_DEFER = 5, CLIENT_WAIT_READ_DESC = 6, CLIENT_WAIT_ACTION_DEFER = 7,
  CLIENT_WAIT_ACTION = 8, CLIENT_WAIT_READ = 9, CLIENT_WAIT_WRITE = 10
}
 
enum  ble_client_action { CLIENT_READREQ = 0, CLIENT_WRITECMD = 1, CLIENT_WRITEREQ = 2 }
 
enum  ble_ccc_mode { CCC_NONE = 0x00, CCC_NOTIFICATION = 0x01, CCC_INDICATION = 0x02, CCC_RESERVED = 0x04 }
 
enum  ble_scc_mode { SCC_NONE = 0x00, SCC_BROADCAST = 0x01 }
 
enum  ble_disc_setting { DISC_NONE = 0x00, DISC_AFTER_CONFIRM = 0x01, DISC_ATT_TIMEOUT = 0x02, DISABLE_ATT_TIMEOUT = 0x04 }
 
enum  ble_button_function {
  BUTTON_PRESS = 0, BUTTON_RELEASE = 1, BUTTON_POWER = 2, BUTTON_CLIENT = 3,
  BUTTON_DISCOVER = 4, BUTTON_FILTER = 5, TIMEOUT_POWER = 10
}
 
enum  ble_puart_disable { PUARTENABLE = 0x00, PUARTDISABLE = 0x80 }
 
enum  ble_pwmbuz_freq {
  PWMBUZ_125 = 0, PWMBUZ_250 = 1, PWMBUZ_500 = 2, PWMBUZ_1000 = 3,
  PWMBUZ_2000 = 4, PWMBUZ_4000 = 5, PWMBUZ_8000 = 6, PWMBUZ_FREQ_MAX = 7,
  PWMBUZ_FREQ_MANUAL = 0xFF
}
 

Functions

void bleprofile_GenerateADVData (BLE_ADV_FIELD *p_adv, UINT8 number)
 Generate Advertisement data. More...
 
void bleprofile_GenerateScanRspData (BLE_ADV_FIELD *p_adv, UINT8 number)
 Generate Scan Response data. More...
 
void bleprofile_DBRegister (UINT8 *p_db, UINT16 db_size)
 
void bleprofile_DBInit (UINT8 **startPtr, UINT8 **endPtr)
 
void bleprofile_CFGRegister (BLE_PROFILE_CFG *p_cfg)
 Register Configuration. More...
 
void bleprofile_PUARTRegister (BLE_PROFILE_PUART_CFG *p_puart_cfg)
 Register Peripheral UART Configuration. More...
 
void bleprofile_GPIORegister (BLE_PROFILE_GPIO_CFG *p_gpio_cfg)
 Register GPIO Configuration. More...
 
void bleprofile_Init (BLE_PROFILE_CFG *p_cfg)
 Initialize Blueooth LE profile. More...
 
void bleprofile_GPIOWPInit (BLE_PROFILE_GPIO_CFG *p_gpio_cfg)
 
void bleprofile_GPIOInit (BLE_PROFILE_GPIO_CFG *p_gpio_cfg)
 Initialize GPIO. More...
 
UINT8 bleprofile_ReadNVRAM (UINT8 vsID, UINT8 itemLength, UINT8 *payload)
 Read NVRAM. More...
 
UINT8 bleprofile_WriteNVRAM (UINT8 vsID, UINT8 itemLength, UINT8 *payload)
 Write NVRAM. More...
 
BOOL32 bleprofile_DeleteNVRAM (UINT8 vsID)
 Delete NVRAM. More...
 
void bleprofile_WPEnable (UINT8 wp_enable)
 Sets NVRAM Write Protection. More...
 
void bleprofile_ReadUART (char *data)
 Read UART. More...
 
INT32 bleprofile_ReadHandle (UINT16 hdl, BLEPROFILE_DB_PDU *p_pdu)
 Read local GATT database by handle. More...
 
INT32 bleprofile_WriteHandle (UINT16 hdl, BLEPROFILE_DB_PDU *p_pdu)
 Write data to GATT database by handle. More...
 
void bleprofile_sendWriteReq (UINT16 attrHandle, UINT8 *attr, INT32 len)
 Send Write Request. More...
 
void bleprofile_sendWriteCmd (UINT16 attrHandle, UINT8 *data, INT32 len)
 Send Write Command. More...
 
void bleprofile_sendReadReq (UINT16 Handle)
 Send Read Request. More...
 
void bleprofile_sendReadByTypeReq (UINT16 startHandle, UINT16 endHandle, UINT16 uuid16)
 Send Read by Type Request. More...
 
void bleprofile_sendReadByGroupTypeReq (UINT16 startHandle, UINT16 endHandle, UINT16 uuid16)
 Send Read by Group Type Request. More...
 
void bleprofile_sendHandleValueConf (void)
 Send Handle Value Confirmation. More...
 
void bleprofile_sendIndication (UINT16 attrHandle, UINT8 *attr, INT32 len, LEATT_NO_PARAM_CB cb)
 Send Indication. More...
 
void bleprofile_sendNotification (UINT16 attrHandle, UINT8 *attr, INT32 len)
 Send Notification. More...
 
void bleprofile_LEDOn (void)
 Turn LED On. More...
 
void bleprofile_LEDOff (void)
 Turn LED Off. More...
 
void bleprofile_LEDBlink (UINT16 on_ms, UINT16 off_ms, UINT8 num)
 Perform LED blinking. More...
 
void bleprofile_BUZOn (void)
 Turn Buzzer On. More...
 
void bleprofile_BUZOff (void)
 Turn Buzzer Off. More...
 
void bleprofile_BUZBeep (UINT16 duration_ms)
 Play a Buzzer beep. More...
 
void bleprofile_PWMBUZFreq (UINT8 preset, UINT16 init_value, UINT16 toggle_val)
 Change Buzzer beeping frequency. More...
 
void bleprofile_BatOn (void)
 Turn Battery monitoring on. More...
 
void bleprofile_BatOff (void)
 Turn Battery monitoring off. More...
 
void bleprofile_UARTOn (void)
 Turn UART on. More...
 
void bleprofile_UARTOff (void)
 Turn UART off. More...
 
void bleprofile_PUARTTxOn (void)
 Turn on Peripheral UART TX. More...
 
void bleprofile_PUARTTxOff (void)
 Turn off Peripheral UART TX. More...
 
void bleprofile_PUARTRxOn (void)
 Turn on Peripheral UART RX. More...
 
void bleprofile_PUARTRxOff (void)
 Turn off Peripheral UART RX. More...
 
INT8 bleprofile_ReadBut (void)
 Read button. More...
 
INT8 bleprofile_ReadBut1 (void)
 Read button 1. More...
 
INT8 bleprofile_ReadBut2 (void)
 Read button 2. More...
 
INT8 bleprofile_ReadBut3 (void)
 Read button 3. More...
 
SFLOAT bleprofile_UINT16toSFLOAT (UINT16 uin)
 Convert UINT16 to SFLOAT. More...
 
UINT16 bleprofile_SFLOATtoUINT16 (SFLOAT sfl)
 Convert SFLOAT to UINT16. More...
 
SFLOAT bleprofile_UINT8_UINT8toSFLOAT (UINT8 minus, UINT8 uin, UINT8 bdp)
 Creates SFLOAT value. More...
 
FLOAT32 bleprofile_UINT32toFLOAT32 (UINT32 uin)
 Convert UINT32 to FLOAT32. More...
 
UINT32 bleprofile_FLOAT32toUINT32 (FLOAT32 fl)
 Convert FLOAT32 to UINT32. More...
 
FLOAT32 bleprofile_UINT16_UINT16toFLOAT32 (UINT8 minus, UINT16 uin, UINT16 bdp)
 Creates FLOAT32 value. More...
 
UINT8 bleprofile_GetDiscoverable (void)
 Get Discoverable State. More...
 
void bleprofile_Discoverable (UINT8 Discoverable, BD_ADDR paired_addr)
 Set Discoverable. More...
 
void bleprofile_enteringDiscLowPowerMode (UINT32 lowPowerMode)
 
void bleprofile_abortingDiscLowPowerMode (UINT32 lowPowerMode)
 
void bleprofile_PrepareHidOff (void)
 
void bleprofile_regHandleUARTCb (BLEPROFILE_DOUBLE_PARAM_CB cb)
 Register callback to receive UART data. More...
 
void bleprofile_regIntCb (BLEPROFILE_SINGLE_PARAM_CB callback)
 Register receive GPIO Interrupt. More...
 
void bleprofile_regButtonFunctionCb (BLEPROFILE_SINGLE_PARAM_CB cb)
 Register receive polling button callback. More...
 
void bleprofile_ReadButton (void)
 Callback function for polling button functionality. More...
 
void bleprofile_regTimerCb (BLEAPP_TIMER_CB fine_cb, BLEAPP_TIMER_CB normal_cb)
 Register receive timer callbacks. More...
 
void bleprofile_StartTimer (void)
 Start timers. More...
 
void bleprofile_KillTimer (void)
 Stop timers. More...
 
void bleprofile_regAppEvtHandler (BLECM_APP_EVT_ENUM idx, BLECM_NO_PARAM_FUNC func)
 Register application event handler. More...
 
void bleprofile_InitPowersave (void)
 Init Powersave. More...
 
UINT8 bleprofile_pollPowersave (void)
 Poll Powersave. More...
 
void bleprofile_StartPowersave (void)
 Start Powersave. More...
 
void bleprofile_StopPowersave (void)
 Stop Powersave. More...
 
void bleprofile_PreparePowersave (void)
 Prepare Powersave. More...
 
void bleprofile_setupTargetAdrInScanRsp (void)
 Setup Scan Response. More...
 
void bleprofile_appTimerCb (UINT32 arg)
 Application Timer Callback. More...
 
void bleprofile_setidletimer_withNotification (void)
 Configure Idle timer depending on the notification state. More...
 
void bleprofile_StartConnIdleTimer (UINT8 timeout, BLEAPP_TIMER_CB cb)
 Start Connection Idle Timer. More...
 
void bleprofile_StopConnIdleTimer (void)
 Stop Connection Idle Timer. More...
 
void bleprofile_SendConnParamUpdateReq (UINT16 minInterval, UINT16 maxInterval, UINT16 peripheralLatency, UINT16 timeout)
 Send Connection Parameters Update Request. More...
 
void bleprofile_Sleep (UINT8 hund_us)
 
int bleprofile_PUARTTx (char *data, UINT8 len)
 
int bleprofile_PUARTTxMaxWait (char *data, UINT8 len, UINT8 ms)
 
int bleprofile_PUARTTxEchoMaxWait (char *data, UINT8 len, UINT8 tx_ms, UINT8 rx_ms, UINT8 flush)
 
int bleprofile_PUARTRx (char *data, UINT8 len)
 
int bleprofile_PUARTRxMaxFail (char *data, UINT8 len, UINT8 max)
 
int bleprofile_PUARTRxMaxWait (char *data, UINT8 len, UINT8 ms)
 
void bleprofile_PUARTInitTxWaterlevel (UINT8 puart_tx_waterlevel)
 
void bleprofile_PUARTSetTxWaterlevel (UINT8 puart_tx_waterlevel)
 
void bleprofile_PUART_EnableRxInt (UINT8 rxpin, void(*userfn)(void *))
 
void bleprofile_PUART_EnableRxFIFOInt (void(*userfn)(void *))
 
void bleprofile_PUARTSetRxWaterlevel (UINT8 puart_rx_waterlevel)
 
void bleprofile_PUARTRegisterRxHandler (void(*RxHandler)(void))
 
void bleprofile_PUARTRegisterCSARxHandler (void(*userfn)(void *))
 
void bleprofile_PUARTEnableAFFInt (void)
 
void bleprofile_PUART_deassertCts (void)
 
void bleprofile_PUART_assertCts (void)
 
void bleprofile_PUART_ConfigRTS (BOOL enabled, UINT8 rtsPortPin, UINT8 assertvalue)
 
void bleprofile_PUART_EnableRxFIFOCTSInt (UINT8 ctsPortPin, UINT8 waterLevel, UINT8 assertvalue, UINT8 disableINT)
 
INT32 bleprofile_PUARTRxCTS (char *data, UINT8 len)
 
INT32 bleprofile_PUARTRxMaxWaitCTS (char *data, UINT8 len, UINT16 us)
 
void bleprofile_PUART_RxIntCb (void *ptr, UINT8 portPin)
 

Variables

BLE_PROFILE_CFG bleprofile_cfg
 
BLE_PROFILE_PUART_CFG bleprofile_puart_cfg
 
BLE_PROFILE_GPIO_CFG bleprofile_gpio_cfg
 
BLE_PROFILE_PWM_CFG bleprofile_pwm_cfg
 
UINT8 * bleprofile_p_db
 
UINT16 bleprofile_db_size
 
BLE_PROFILE_PUART_CFGbleprofile_puart_p_cfg
 
BLE_PROFILE_GPIO_CFGbleprofile_gpio_p_cfg
 
BLE_PROFILE_CFGbleprofile_p_cfg
 
BD_ADDR bleprofile_remote_addr
 
UINT8 bleapp_trace_enable
 
BLEPROFILE_DOUBLE_PARAM_CB bleprofile_handleUARTCb
 
UINT8 bleprofile_PUART_RxInt_Enable
 
UINT8 bleprofile_puart_tx_waterlevel
 

Detailed Description

This file provides definitions and function prototypes for the Blueooth LE GATT profiles.

Macro Definition Documentation

#define ATTRIBUTE16 (   handle,
  permission,
  datalen,
  uuid 
)
Value:
BIT16_TO_8(handle), \
(UINT8)(permission), \
(UINT8)(datalen + 2), \
BIT16_TO_8(uuid)
#define BIT16_TO_8 (   val)
Value:
(UINT8)( (val) & 0xff),/* LSB */ \
(UINT8)(( (val) >> 8 ) & 0xff) /* MSB */
#define BIT32_TO_8 (   val)
Value:
(UINT8)( (val) & 0xff),/* LSB */ \
(UINT8)(( (val) >> 8 ) & 0xff), \
(UINT8)( (val) >> 16 & 0xff), \
(UINT8)(( (val) >> 24 ) & 0xff) /* MSB */
#define CHAR_DESCRIPTOR_UUID16 (   handle,
  uuid,
  permission,
  value_len 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
(UINT8)(permission), \
(UINT8)(value_len+2), \
BIT16_TO_8(uuid)
#define CHAR_DESCRIPTOR_UUID16_WRITABLE (   handle,
  uuid,
  permission,
  value_len 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
(UINT8)(permission), \
(UINT8)(value_len+2), \
(UINT8)(value_len), \
BIT16_TO_8(uuid)
#define CHARACTERISTIC_UUID128 (   handle,
  handle_value,
  uuid,
  properties,
  permission,
  value_len 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
LEGATTDB_PERM_READABLE, \
21, \
BIT16_TO_8(UUID_ATTRIBUTE_CHARACTERISTIC), \
(UINT8)(properties), \
BIT16_TO_8((UINT16)(handle_value)), \
uuid, \
BIT16_TO_8((UINT16)(handle_value)), \
(UINT8)(permission | LEGATTDB_PERM_SERVCIE_UUID_128), \
(UINT8)(value_len+16), \
uuid
#define CHARACTERISTIC_UUID128_WRITABLE (   handle,
  handle_value,
  uuid,
  properties,
  permission,
  value_len 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
LEGATTDB_PERM_READABLE, \
21, \
BIT16_TO_8(UUID_ATTRIBUTE_CHARACTERISTIC), \
(UINT8)(properties), \
BIT16_TO_8((UINT16)(handle_value)), \
uuid, \
BIT16_TO_8((UINT16)(handle_value)), \
(UINT8)(permission | LEGATTDB_PERM_SERVCIE_UUID_128), \
(UINT8)(value_len+16), \
(UINT8)(value_len), \
uuid
#define CHARACTERISTIC_UUID16 (   handle,
  handle_value,
  uuid,
  properties,
  permission,
  value_len 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
LEGATTDB_PERM_READABLE, \
0x07, \
BIT16_TO_8(UUID_ATTRIBUTE_CHARACTERISTIC), \
(UINT8)(properties), \
BIT16_TO_8((UINT16)(handle_value)), \
BIT16_TO_8(uuid), \
BIT16_TO_8((UINT16)(handle_value)), \
(UINT8)(permission), \
(UINT8)(value_len+2), \
BIT16_TO_8(uuid)
#define CHARACTERISTIC_UUID16_WRITABLE (   handle,
  handle_value,
  uuid,
  properties,
  permission,
  value_len 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
LEGATTDB_PERM_READABLE, \
0x07, \
BIT16_TO_8(UUID_ATTRIBUTE_CHARACTERISTIC), \
(UINT8)(properties), \
BIT16_TO_8((UINT16)(handle_value)), \
BIT16_TO_8(uuid), \
BIT16_TO_8((UINT16)(handle_value)), \
(UINT8)(permission), \
(UINT8)(value_len+2), \
(UINT8)(value_len), \
BIT16_TO_8(uuid)
#define INCLUDE_SERVICE_UUID16 (   handle,
  service_handle,
  end_group_handle,
  service 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
LEGATTDB_PERM_READABLE, \
8, \
BIT16_TO_8(UUID_ATTRIBUTE_INCLUDE), \
BIT16_TO_8(service_handle), \
BIT16_TO_8(end_group_handle), \
BIT16_TO_8(service)
#define PRIMARY_SERVICE_UUID128 (   handle,
  service 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
LEGATTDB_PERM_READABLE, \
18, \
BIT16_TO_8(UUID_ATTRIBUTE_PRIMARY_SERVICE), \
service
#define PRIMARY_SERVICE_UUID16 (   handle,
  service 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
LEGATTDB_PERM_READABLE, \
4, \
BIT16_TO_8((UUID_ATTRIBUTE_PRIMARY_SERVICE)), \
BIT16_TO_8((service))
#define SECONDARY_SERVICE_UUID128 (   handle,
  service 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
LEGATTDB_PERM_READABLE, \
18, \
BIT16_TO_8(UUID_ATTRIBUTE_SECONDARY_SERVICE), \
service
#define SECONDARY_SERVICE_UUID16 (   handle,
  service 
)
Value:
BIT16_TO_8((UINT16)(handle)), \
LEGATTDB_PERM_READABLE, \
4, \
BIT16_TO_8((UUID_ATTRIBUTE_SECONDARY_SERVICE)), \
BIT16_TO_8((service))