nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
fmdn.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2024 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef BT_FAST_PAIR_FMDN_H_
8#define BT_FAST_PAIR_FMDN_H_
9
10#include <zephyr/sys/slist.h>
11#include <zephyr/sys/util.h>
12
24#ifdef __cplusplus
25extern "C" {
26#endif
27
34
40
47};
48
53
56
59};
60
64#define BT_FAST_PAIR_FMDN_RING_COMP_BM_NONE (0x00)
65
71#define BT_FAST_PAIR_FMDN_RING_COMP_BM_ALL (0xFF)
72
77
80
83
86};
87
89#define BT_FAST_PAIR_FMDN_RING_MSEC_PER_DSEC (100U)
90
97#define BT_FAST_PAIR_FMDN_RING_TIMEOUT_DS_TO_MS(_timeout_ds) \
98 ((_timeout_ds) * BT_FAST_PAIR_FMDN_RING_MSEC_PER_DSEC)
99
106#define BT_FAST_PAIR_FMDN_RING_TIMEOUT_MS_TO_DS(_timeout_ms) \
107 ((_timeout_ms) / BT_FAST_PAIR_FMDN_RING_MSEC_PER_DSEC)
108
115
117 uint16_t timeout;
118
121};
122
166 const struct bt_fast_pair_fmdn_ring_req_param *param);
167
196
225};
226
242
247
250
253
256
259};
260
265
270
275 uint16_t timeout;
276};
277
303 const struct bt_fast_pair_fmdn_ring_state_param *param);
304
319 void (*start)(void);
320
334 bool (*period_expired)(void);
335
343 void (*stop)(void);
344};
345
363 const struct bt_fast_pair_fmdn_motion_detector_cb *cb);
364
366#define BT_FAST_PAIR_FMDN_BATTERY_LEVEL_NONE (0xFF)
367
402int bt_fast_pair_fmdn_battery_level_set(uint8_t percentage_level);
403
409#define BT_FAST_PAIR_FMDN_ADV_PARAM_INIT(_int_min, _int_max) \
410{ \
411 .interval_min = (_int_min), \
412 .interval_max = (_int_max), \
413}
414
416#define BT_FAST_PAIR_FMDN_ADV_PARAM_DEFAULT \
417 ((struct bt_fast_pair_fmdn_adv_param[]) { \
418 BT_FAST_PAIR_FMDN_ADV_PARAM_INIT( \
419 0x0C80, /* 2s min interval */ \
420 0x0C80 /* 2s max interval */ \
421 )})
422
428 uint32_t interval_min;
429
433 uint32_t interval_max;
434};
435
464 const struct bt_fast_pair_fmdn_adv_param *adv_param);
465
481
499 void (*clock_synced)(void);
500
519 void (*provisioning_state_changed)(bool provisioned);
520
522 sys_snode_t node;
523};
524
537
542
547};
548
559};
560
573 const struct bt_fast_pair_fmdn_read_mode_cb *cb);
574
585
586#ifdef __cplusplus
587}
588#endif
589
594#endif /* BT_FAST_PAIR_FMDN_H_ */
bt_fast_pair_fmdn_ring_volume
Definition: fmdn.h:74
@ BT_FAST_PAIR_FMDN_RING_VOLUME_LOW
Definition: fmdn.h:79
@ BT_FAST_PAIR_FMDN_RING_VOLUME_DEFAULT
Definition: fmdn.h:76
@ BT_FAST_PAIR_FMDN_RING_VOLUME_MEDIUM
Definition: fmdn.h:82
@ BT_FAST_PAIR_FMDN_RING_VOLUME_HIGH
Definition: fmdn.h:85
int bt_fast_pair_fmdn_read_mode_cb_register(const struct bt_fast_pair_fmdn_read_mode_cb *cb)
Register the read mode callbacks in the FMDN module.
bt_fast_pair_fmdn_ring_trigger
Definition: fmdn.h:244
@ BT_FAST_PAIR_FMDN_RING_TRIGGER_GATT_STOPPED
Definition: fmdn.h:258
@ BT_FAST_PAIR_FMDN_RING_TRIGGER_FAILED
Definition: fmdn.h:249
@ BT_FAST_PAIR_FMDN_RING_TRIGGER_UI_STOPPED
Definition: fmdn.h:255
@ BT_FAST_PAIR_FMDN_RING_TRIGGER_STARTED
Definition: fmdn.h:246
@ BT_FAST_PAIR_FMDN_RING_TRIGGER_TIMEOUT_STOPPED
Definition: fmdn.h:252
int bt_fast_pair_fmdn_ring_state_update(enum bt_fast_pair_fmdn_ring_src src, const struct bt_fast_pair_fmdn_ring_state_param *param)
Update the ringing state in the FMDN module.
bt_fast_pair_fmdn_ring_src
Ringing activity source types.
Definition: fmdn.h:29
@ BT_FAST_PAIR_FMDN_RING_SRC_FMDN_BT_GATT
Definition: fmdn.h:33
@ BT_FAST_PAIR_FMDN_RING_SRC_DULT_MOTION_DETECTOR
Definition: fmdn.h:46
@ BT_FAST_PAIR_FMDN_RING_SRC_DULT_BT_GATT
Definition: fmdn.h:39
int bt_fast_pair_fmdn_battery_level_set(uint8_t percentage_level)
Set the current battery level.
int bt_fast_pair_fmdn_motion_detector_cb_register(const struct bt_fast_pair_fmdn_motion_detector_cb *cb)
Register motion detector callbacks.
bt_fast_pair_fmdn_read_mode
Definition: fmdn.h:539
@ BT_FAST_PAIR_FMDN_READ_MODE_DULT_ID
Definition: fmdn.h:546
@ BT_FAST_PAIR_FMDN_READ_MODE_FMDN_RECOVERY
Definition: fmdn.h:541
int bt_fast_pair_fmdn_read_mode_enter(enum bt_fast_pair_fmdn_read_mode mode)
Enter read mode.
int bt_fast_pair_fmdn_adv_param_set(const struct bt_fast_pair_fmdn_adv_param *adv_param)
Set the FMDN advertising parameters.
int bt_fast_pair_fmdn_info_cb_register(struct bt_fast_pair_fmdn_info_cb *cb)
Register the information callbacks in the FMDN module.
int bt_fast_pair_fmdn_ring_cb_register(const struct bt_fast_pair_fmdn_ring_cb *cb)
Register the ringing callbacks in the FMDN module.
bt_fast_pair_fmdn_ring_comp
Definition: fmdn.h:50
@ BT_FAST_PAIR_FMDN_RING_COMP_RIGHT
Definition: fmdn.h:52
@ BT_FAST_PAIR_FMDN_RING_COMP_LEFT
Definition: fmdn.h:55
@ BT_FAST_PAIR_FMDN_RING_COMP_CASE
Definition: fmdn.h:58
int bt_fast_pair_fmdn_id_set(uint8_t id)
Set the Bluetooth identity for the FMDN extension.
uint32_t interval_max
Definition: fmdn.h:433
uint32_t interval_min
Definition: fmdn.h:428
Definition: fmdn.h:424
void(* provisioning_state_changed)(bool provisioned)
Indicate provisioning state changes.
Definition: fmdn.h:519
sys_snode_t node
Definition: fmdn.h:522
void(* clock_synced)(void)
Indicate that the peer was notified about the clock value.
Definition: fmdn.h:499
Definition: fmdn.h:483
bool(* period_expired)(void)
Notify the user that the motion detector period has expired.
Definition: fmdn.h:334
void(* stop)(void)
Notify the user that the motion detector can be stopped.
Definition: fmdn.h:343
void(* start)(void)
Request the user to start the motion detector.
Definition: fmdn.h:319
Motion detector callback structure.
Definition: fmdn.h:310
void(* exited)(enum bt_fast_pair_fmdn_read_mode mode)
Read mode exited.
Definition: fmdn.h:558
Definition: fmdn.h:550
void(* start_request)(enum bt_fast_pair_fmdn_ring_src src, const struct bt_fast_pair_fmdn_ring_req_param *param)
Request the user to start the ringing action.
Definition: fmdn.h:165
void(* stop_request)(enum bt_fast_pair_fmdn_ring_src src)
Request the user to stop the ringing action on GATT request.
Definition: fmdn.h:224
void(* timeout_expired)(enum bt_fast_pair_fmdn_ring_src src)
Request the user to stop the ringing action on timeout.
Definition: fmdn.h:195
Definition: fmdn.h:124
enum bt_fast_pair_fmdn_ring_volume volume
Definition: fmdn.h:120
uint16_t timeout
Definition: fmdn.h:117
uint8_t active_comp_bm
Definition: fmdn.h:114
Definition: fmdn.h:110
uint16_t timeout
Definition: fmdn.h:275
uint8_t active_comp_bm
Definition: fmdn.h:269
enum bt_fast_pair_fmdn_ring_trigger trigger
Definition: fmdn.h:264