nRF Connect SDK API 3.3.99
Loading...
Searching...
No Matches
fhn.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2026 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef BT_FAST_PAIR_FHN_H_
8#define BT_FAST_PAIR_FHN_H_
9
10#include <zephyr/bluetooth/conn.h>
11#include <zephyr/sys/slist.h>
12#include <zephyr/sys/util.h>
13
27#ifdef __cplusplus
28extern "C" {
29#endif
30
51
63
67#define BT_FAST_PAIR_FHN_RING_COMP_BM_NONE (0x00)
68
74#define BT_FAST_PAIR_FHN_RING_COMP_BM_ALL (0xFF)
75
90
92#define BT_FAST_PAIR_FHN_RING_MSEC_PER_DSEC (100U)
93
100#define BT_FAST_PAIR_FHN_RING_TIMEOUT_DS_TO_MS(_timeout_ds) \
101 ((_timeout_ds) * BT_FAST_PAIR_FHN_RING_MSEC_PER_DSEC)
102
109#define BT_FAST_PAIR_FHN_RING_TIMEOUT_MS_TO_DS(_timeout_ms) \
110 ((_timeout_ms) / BT_FAST_PAIR_FHN_RING_MSEC_PER_DSEC)
111
125
229
248
266
283
309 const struct bt_fast_pair_fhn_ring_state_param *param);
310
325 void (*start)(void);
326
340 bool (*period_expired)(void);
341
349 void (*stop)(void);
350};
351
372 const struct bt_fast_pair_fhn_motion_detector_cb *cb);
373
375#define BT_FAST_PAIR_FHN_BATTERY_LEVEL_NONE (0xFF)
376
411int bt_fast_pair_fhn_battery_level_set(uint8_t percentage_level);
412
418#define BT_FAST_PAIR_FHN_ADV_PARAM_INIT(_int_min, _int_max) \
419{ \
420 .interval_min = (_int_min), \
421 .interval_max = (_int_max), \
422}
423
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( \
428 0x0C80, /* 2s min interval */ \
429 0x0C80 /* 2s max interval */ \
430 )})
431
437 uint32_t interval_min;
438
442 uint32_t interval_max;
443};
444
473 const struct bt_fast_pair_fhn_adv_param *adv_param);
474
490
508 void (*clock_synced)(void);
509
536 void (*conn_authenticated)(struct bt_conn *conn);
537
557 void (*provisioning_state_changed)(bool provisioned);
558
560 sys_snode_t node;
561};
562
576
592
603
615
631 const struct bt_fast_pair_fhn_read_mode_cb *cb);
632
643
644#ifdef __cplusplus
645}
646#endif
647
652#endif /* BT_FAST_PAIR_FHN_H_ */
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
Definition fhn.h:433
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
Definition fhn.h:492
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
Definition fhn.h:605
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
Definition fhn.h:127
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