Macros | Functions
ras.h File Reference

Ranging Service API. More...

`#include "gr_includes.h"`
`#include "custom_config.h"`
`#include "ble_prf_utils.h"`
`#include "ras_common.h"`
`#include <stdint.h>`
`#include <stdbool.h>`

Go to the source code of this file.

## Macros
#define | RAS_CACHE_PROC_NUM (2)

## Functions
sdk_err_t | ras_service_init (uint32_t features)
| Initialize Ranging Service. More...
void | ras_connect_handler (uint8_t conn_idx)
| Handle for the connection event. More...
void | ras_disconnect_handler (uint8_t conn_idx)
| Handle for the disconnection event. More...
void | ras_mtu_exch_handler (uint8_t conn_idx, uint16_t mtu)
| Handle for the mtu exchange event. More...
void | ras_rcv_subevt_data_handler (uint8_t conn_idx, uint8_t *p_data)
| Handle for receiving subevt data. More...
void | ras_set_cache_data_info (uint8_t conn_idx, uint8_t cfg_id, uint8_t proc_num, uint8_t subevt_num)
| Set cache data information. More...
void | ras_proc_disabled_handler (uint8_t conn_idx, uint8_t cfg_id)
| Set cache data information. More...
void | ras_write_subevt_data_free (void)

## Detailed Description

Ranging Service API.

Attention
  #####Copyright (c) 2024 GOODIX All rigras reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of GOODIX nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition in file ras.h.

## Macro Definition Documentation

## ◆ RAS_CACHE_PROC_NUM

#define RAS_CACHE_PROC_NUM (2)

Cache proc number.

Definition at line 41 of file ras.h.

## Function Documentation

## ◆ ras_connect_handler()

void ras_connect_handler | ( | uint8_t | conn_idx | ) |

Handle for the connection event.

Parameters

  [in] | conn_idx | Connection index.

## ◆ ras_disconnect_handler()

void ras_disconnect_handler | ( | uint8_t | conn_idx | ) |

Handle for the disconnection event.

Parameters

  [in] | conn_idx | Connection index.

## ◆ ras_mtu_exch_handler()

void ras_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_proc_disabled_handler()

void ras_proc_disabled_handler | ( | uint8_t | conn_idx,
|  | uint8_t | cfg_id
| ) |  |

Set cache data information.

Parameters

  [in] | conn_idx | Connection index.
  [in] | cfg_id | Procedure configure id.

## ◆ ras_rcv_subevt_data_handler()

void ras_rcv_subevt_data_handler | ( | uint8_t | conn_idx,
|  | uint8_t * | p_data
| ) |  |

Handle for receiving subevt data.

Parameters

  [in] | conn_idx | Connection index.
  [in] | p_data | Pointer to the data buffer.

## ◆ ras_service_init()

sdk_err_t ras_service_init | ( | uint32_t | features | ) |

Initialize Ranging Service.

Parameters

  [in] | features | Ranging Service support features, bit mask ras_fea_bit_mask_t.

Returns
  Result of service initialization.

## ◆ ras_set_cache_data_info()

void ras_set_cache_data_info | ( | uint8_t | conn_idx,
|  | uint8_t | cfg_id,
|  | uint8_t | proc_num,
|  | uint8_t | subevt_num
| ) |  |

Set cache data information.

Parameters

  [in] | conn_idx | Connection index.
  [in] | cfg_id | Procedure configure id.
  [in] | proc_num | Procedure number need to cache.
  [in] | subevt_num | Subevent number for per procedure.

## ◆ ras_write_subevt_data_free()

void ras_write_subevt_data_free | ( | void |  | ) |