7#ifndef BT_FAST_PAIR_FHN_H_
8#define BT_FAST_PAIR_FHN_H_
10#include <zephyr/bluetooth/conn.h>
11#include <zephyr/sys/slist.h>
12#include <zephyr/sys/util.h>
67#define BT_FAST_PAIR_FHN_RING_COMP_BM_NONE (0x00)
74#define BT_FAST_PAIR_FHN_RING_COMP_BM_ALL (0xFF)
92#define BT_FAST_PAIR_FHN_RING_MSEC_PER_DSEC (100U)
100#define BT_FAST_PAIR_FHN_RING_TIMEOUT_DS_TO_MS(_timeout_ds) \
101 ((_timeout_ds) * BT_FAST_PAIR_FHN_RING_MSEC_PER_DSEC)
109#define BT_FAST_PAIR_FHN_RING_TIMEOUT_MS_TO_DS(_timeout_ms) \
110 ((_timeout_ms) / BT_FAST_PAIR_FHN_RING_MSEC_PER_DSEC)
375#define BT_FAST_PAIR_FHN_BATTERY_LEVEL_NONE (0xFF)
418#define BT_FAST_PAIR_FHN_ADV_PARAM_INIT(_int_min, _int_max) \
420 .interval_min = (_int_min), \
421 .interval_max = (_int_max), \
425#define BT_FAST_PAIR_FHN_ADV_PARAM_DEFAULT \
426 ((struct bt_fast_pair_fhn_adv_param[]) { \
427 BT_FAST_PAIR_FHN_ADV_PARAM_INIT( \
int bt_fast_pair_fhn_info_cb_register(struct bt_fast_pair_fhn_info_cb *cb)
Register the information callbacks in the FHN module.
bt_fast_pair_fhn_ring_trigger
Definition fhn.h:250
@ BT_FAST_PAIR_FHN_RING_TRIGGER_GATT_STOPPED
Definition fhn.h:264
@ BT_FAST_PAIR_FHN_RING_TRIGGER_FAILED
Definition fhn.h:255
@ BT_FAST_PAIR_FHN_RING_TRIGGER_UI_STOPPED
Definition fhn.h:261
@ BT_FAST_PAIR_FHN_RING_TRIGGER_TIMEOUT_STOPPED
Definition fhn.h:258
@ BT_FAST_PAIR_FHN_RING_TRIGGER_STARTED
Definition fhn.h:252
int bt_fast_pair_fhn_read_mode_cb_register(const struct bt_fast_pair_fhn_read_mode_cb *cb)
Register the read mode callbacks in the FHN module.
bt_fast_pair_fhn_ring_src
Ringing activity source types.
Definition fhn.h:32
@ BT_FAST_PAIR_FHN_RING_SRC_DULT_MOTION_DETECTOR
Definition fhn.h:49
@ BT_FAST_PAIR_FHN_RING_SRC_FHN_BT_GATT
Definition fhn.h:36
@ BT_FAST_PAIR_FHN_RING_SRC_DULT_BT_GATT
Definition fhn.h:42
bool bt_fast_pair_fhn_is_provisioned(void)
Check the FHN provisioning state.
int bt_fast_pair_fhn_id_set(uint8_t id)
Set the Bluetooth identity for the FHN extension.
bt_fast_pair_fhn_read_mode
Definition fhn.h:594
@ BT_FAST_PAIR_FHN_READ_MODE_DULT_ID
Definition fhn.h:601
@ BT_FAST_PAIR_FHN_READ_MODE_FHN_RECOVERY
Definition fhn.h:596
int bt_fast_pair_fhn_motion_detector_cb_register(const struct bt_fast_pair_fhn_motion_detector_cb *cb)
Register motion detector callbacks.
int bt_fast_pair_fhn_ring_state_update(enum bt_fast_pair_fhn_ring_src src, const struct bt_fast_pair_fhn_ring_state_param *param)
Update the ringing state in the FHN module.
bt_fast_pair_fhn_ring_comp
Definition fhn.h:53
@ BT_FAST_PAIR_FHN_RING_COMP_LEFT
Definition fhn.h:58
@ BT_FAST_PAIR_FHN_RING_COMP_RIGHT
Definition fhn.h:55
@ BT_FAST_PAIR_FHN_RING_COMP_CASE
Definition fhn.h:61
int bt_fast_pair_fhn_adv_param_set(const struct bt_fast_pair_fhn_adv_param *adv_param)
Set the FHN advertising parameters.
bt_fast_pair_fhn_ring_volume
Definition fhn.h:77
@ BT_FAST_PAIR_FHN_RING_VOLUME_LOW
Definition fhn.h:82
@ BT_FAST_PAIR_FHN_RING_VOLUME_DEFAULT
Definition fhn.h:79
@ BT_FAST_PAIR_FHN_RING_VOLUME_MEDIUM
Definition fhn.h:85
@ BT_FAST_PAIR_FHN_RING_VOLUME_HIGH
Definition fhn.h:88
int bt_fast_pair_fhn_ring_cb_register(const struct bt_fast_pair_fhn_ring_cb *cb)
Register the ringing callbacks in the FHN module.
int bt_fast_pair_fhn_read_mode_enter(enum bt_fast_pair_fhn_read_mode mode)
Enter read mode.
int bt_fast_pair_fhn_battery_level_set(uint8_t percentage_level)
Set the current battery level.
uint32_t interval_max
Definition fhn.h:442
uint32_t interval_min
Definition fhn.h:437
void(* clock_synced)(void)
Indicate that the peer was notified about the clock value.
Definition fhn.h:508
void(* conn_authenticated)(struct bt_conn *conn)
Indicate that the peer was authenticated locally.
Definition fhn.h:536
void(* provisioning_state_changed)(bool provisioned)
Indicate provisioning state changes.
Definition fhn.h:557
sys_snode_t node
Definition fhn.h:560
bool(* period_expired)(void)
Notify the user that the motion detector period has expired.
Definition fhn.h:340
void(* start)(void)
Request the user to start the motion detector.
Definition fhn.h:325
void(* stop)(void)
Notify the user that the motion detector can be stopped.
Definition fhn.h:349
Motion detector callback structure.
Definition fhn.h:316
void(* exited)(enum bt_fast_pair_fhn_read_mode mode)
Read mode exited.
Definition fhn.h:613
void(* timeout_expired)(enum bt_fast_pair_fhn_ring_src src)
Request the user to stop the ringing action on timeout.
Definition fhn.h:198
void(* stop_request)(enum bt_fast_pair_fhn_ring_src src)
Request the user to stop the ringing action on GATT request.
Definition fhn.h:227
void(* start_request)(enum bt_fast_pair_fhn_ring_src src, const struct bt_fast_pair_fhn_ring_req_param *param)
Request the user to start the ringing action.
Definition fhn.h:168
uint8_t active_comp_bm
Definition fhn.h:117
enum bt_fast_pair_fhn_ring_volume volume
Definition fhn.h:123
uint16_t timeout
Definition fhn.h:120
uint8_t active_comp_bm
Definition fhn.h:275
uint16_t timeout
Definition fhn.h:281
enum bt_fast_pair_fhn_ring_trigger trigger
Definition fhn.h:270