Classes | Typedefs | Enumerations | Functions
ras_c.h File Reference
`#include <stdint.h>`
`#include "ble_error.h"`
`#include "ras_common.h"`

Go to the source code of this file.

## Classes
struct | ras_c_write_req_t
struct | ras_c_write_rsp_t
struct | ras_c_read_rsp_t
struct | ras_c_subevt_report_t
struct | ras_c_discover_rsp_t
struct | ras_c_evt_t

## Typedefs
typedef void(* | ras_c_evt_handler_t) (ras_c_evt_t *p_evt)

## Enumerations
enum | ras_c_evt_type_t { RAS_C_EVT_INVALID = 0x00, RAS_C_EVT_DISCOVER_COMPLETED = 0x01, RAS_C_EVT_DISCOVER_FAILED = 0x02, RAS_C_EVT_WRITE_RSP = 0x03, RAS_C_EVT_WRITE_ERR = 0x04, RAS_C_EVT_READ_RSP = 0x05, RAS_C_EVT_SUBEVT_REPORT = 0x06 }
enum | ras_c_write_type_t { RAS_C_WRITE_RT_RA_DATA_IND_NTF_CFG = 0x00, RAS_C_WRITE_ON_DEMAND_RA_DATA_IND_NTF_CFG = 0x01, RAS_C_WRITE_RAS_CP = 0x02, RAS_C_WRITE_RAS_CP_IND_NTF_CFG = 0x03, RAS_C_WRITE_RA_DATA_READY_IND_NTF_CFG = 0x04, RAS_C_WRITE_RA_DATA_OVERWRITE_IND_NTF_CFG = 0x05, RAS_C_WRITE_TYPE_INVALID = 0x06 }
enum | ras_c_read_type_t { RAS_C_READ_RAS_FEATURE = 0x00, RAS_C_READ_RT_RA_DATA_IND_NTF_CFG, RAS_C_READ_ON_DEMAND_RA_DATA_IND_NTF_CFG, RAS_C_READ_RAS_CP_IND_NTF_CFG, RAS_C_READ_RA_DATA_READY_IND_NTF_CFG, RAS_C_READ_RA_DATA_OVERWRITE_IND_NTF_CFG, RAS_C_READ_TYPE_INVALID = 0x06 }
enum | ras_c_cccd_value_type_t { RAS_C_DIS_NTF_IND = 0x0000, RAS_C_EN_NTF = 0x0001, RAS_C_EN_IND = 0x0002, RAS_C_EN_NTF_IND = 0x0003 }

## Functions
sdk_err_t | ras_c_init (ras_c_evt_handler_t evt_handler)
| Register RAS Client event handler. More...
sdk_err_t | ras_c_discov_srvc_start (uint8_t conn_idx)
| Discovery Ranging Service on peer. More...
sdk_err_t | ras_c_char_cccd_set (uint8_t conn_idx, ras_c_write_type_t cccd_type, ras_c_cccd_value_type_t cccd_value)
| Set characteristic cccd on peer service. More...
sdk_err_t | ras_c_operation_abort (uint8_t conn_idx)
| Abort current operation. More...
sdk_err_t | ras_c_filter_policy_set (uint8_t conn_idx, uint8_t cs_mode, uint16_t data_bit_mask)
| Set the filter policy for receiving ranging data. More...
void | ras_c_connect_handler (uint8_t conn_idx)
| Handle for the connection event. More...
void | ras_c_disconnect_handler (uint8_t conn_idx)
| Handle for the disconnection event. More...
void | ras_c_mtu_exch_handler (uint8_t conn_idx, uint16_t mtu)
| Handle for the mtu exchange event. More...
void | ras_c_set_remote_step_data_len (uint8_t conn_idx, uint8_t cfg_id, uint8_t mode0_len, uint8_t mode1_len, uint8_t mode2_len, uint8_t mode3_len)
| Set remote step data len. More...
void | ras_c_free_subevt_data_buff (void)

## Typedef Documentation

## ◆ ras_c_evt_handler_t

typedef void(* ras_c_evt_handler_t) (ras_c_evt_t *p_evt)

Definition at line 101 of file ras_c.h.

## Enumeration Type Documentation

## ◆ ras_c_cccd_value_type_t

enum ras_c_cccd_value_type_t

Enumerator
RAS_C_DIS_NTF_IND | Stop notification/indication.
RAS_C_EN_NTF | Start notification.
RAS_C_EN_IND | Start indication.
RAS_C_EN_NTF_IND | Start notification/indication.

Definition at line 46 of file ras_c.h.

## ◆ ras_c_evt_type_t

enum ras_c_evt_type_t

Enumerator
RAS_C_EVT_INVALID |
RAS_C_EVT_DISCOVER_COMPLETED |
RAS_C_EVT_DISCOVER_FAILED |
RAS_C_EVT_WRITE_RSP |
RAS_C_EVT_WRITE_ERR |
RAS_C_EVT_READ_RSP |
RAS_C_EVT_SUBEVT_REPORT |

Definition at line 13 of file ras_c.h.

## ◆ ras_c_read_type_t

enum ras_c_read_type_t

Enumerator
RAS_C_READ_RAS_FEATURE |
RAS_C_READ_RT_RA_DATA_IND_NTF_CFG |
RAS_C_READ_ON_DEMAND_RA_DATA_IND_NTF_CFG |
RAS_C_READ_RAS_CP_IND_NTF_CFG |
RAS_C_READ_RA_DATA_READY_IND_NTF_CFG |
RAS_C_READ_RA_DATA_OVERWRITE_IND_NTF_CFG |
RAS_C_READ_TYPE_INVALID |

Definition at line 35 of file ras_c.h.

## ◆ ras_c_write_type_t

enum ras_c_write_type_t

Enumerator
RAS_C_WRITE_RT_RA_DATA_IND_NTF_CFG |
RAS_C_WRITE_ON_DEMAND_RA_DATA_IND_NTF_CFG |
RAS_C_WRITE_RAS_CP |
RAS_C_WRITE_RAS_CP_IND_NTF_CFG |
RAS_C_WRITE_RA_DATA_READY_IND_NTF_CFG |
RAS_C_WRITE_RA_DATA_OVERWRITE_IND_NTF_CFG |
RAS_C_WRITE_TYPE_INVALID |

Definition at line 24 of file ras_c.h.

## Function Documentation

## ◆ ras_c_char_cccd_set()

sdk_err_t ras_c_char_cccd_set | ( | uint8_t | conn_idx,
|  | ras_c_write_type_t | cccd_type,
|  | ras_c_cccd_value_type_t | cccd_value
| ) |  |

Set characteristic cccd on peer service.

Parameters

  [in] | conn_idx | Index of connection.
  [in] | cccd_type | Type of cccd, ras_c_write_type_t.
  [in] | cccd_value | Value of cccd, ras_c_cccd_value_type_t.

Returns
  Operation result.

## ◆ ras_c_connect_handler()

void ras_c_connect_handler | ( | uint8_t | conn_idx | ) |

Handle for the connection event.

Parameters

  [in] | conn_idx | Connection index.

## ◆ ras_c_disconnect_handler()

void ras_c_disconnect_handler | ( | uint8_t | conn_idx | ) |

Handle for the disconnection event.

Parameters

  [in] | conn_idx | Connection index.

## ◆ ras_c_discov_srvc_start()

sdk_err_t ras_c_discov_srvc_start | ( | uint8_t | conn_idx | ) |

Discovery Ranging Service on peer.

Parameters

  [in] | conn_idx | Index of connection.

Returns
  Operation result.

## ◆ ras_c_filter_policy_set()

sdk_err_t ras_c_filter_policy_set | ( | uint8_t | conn_idx,
|  | uint8_t | cs_mode,
|  | uint16_t | data_bit_mask
| ) |  |

Set the filter policy for receiving ranging data.

Parameters

  [in] | conn_idx | Index of connection.
  [in] | cs_mode | Channel sounding mode, ras_mode_type_t.
  [in] | data_bit_mask | filter data bit mask(bit = 1: not filter, bit = 0: filter), ras_mode0_data_bit_t, ras_mode1_data_bit_t, ras_mode2_data_bit_t, ras_mode3_data_bit_t.

Returns
  Operation result.

## ◆ ras_c_free_subevt_data_buff()

void ras_c_free_subevt_data_buff | ( | void |  | ) |

## ◆ ras_c_init()

sdk_err_t ras_c_init | ( | ras_c_evt_handler_t | evt_handler | ) |

Register RAS Client event handler.

Parameters

  [in] | evt_handler | Ranging Service Client event handler.

Returns
  Result of initialization.

## ◆ ras_c_mtu_exch_handler()

void ras_c_mtu_exch_handler | ( | uint8_t | conn_idx,
|  | uint16_t | mtu
| ) |  |

Handle for the mtu exchange event.

Parameters

  [in] | conn_idx | Connection index.
  [in] | mtu | exchange mtu value.

## ◆ ras_c_operation_abort()

sdk_err_t ras_c_operation_abort | ( | uint8_t | conn_idx | ) |

Abort current operation.

Parameters

  [in] | conn_idx | Index of connection.

Returns
  Operation result.

## ◆ ras_c_set_remote_step_data_len()

void ras_c_set_remote_step_data_len | ( | uint8_t | conn_idx,
|  | uint8_t | cfg_id,
|  | uint8_t | mode0_len,
|  | uint8_t | mode1_len,
|  | uint8_t | mode2_len,
|  | uint8_t | mode3_len
| ) |  |

Set remote step data len.

Parameters

  [in] | conn_idx | Connection index.
  [in] | cfg_id | Procedure configure id.
  [in] | mode0_len | Mode0 step data length.
  [in] | mode1_len | Mode1 step data length.
  [in] | mode2_len | Mode2 step data length.
  [in] | mode3_len | Mode3 step data length.