nRF Connect SDK API 3.4.99
Loading...
Searching...
No Matches
dult.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 _DULT_DULT_H_
8#define _DULT_DULT_H_
9
10#include <stdbool.h>
11#include <stdint.h>
12#include <stddef.h>
13
14#include <zephyr/sys/slist.h>
15
29#ifdef __cplusplus
30extern "C" {
31#endif
32
36#define DULT_PRODUCT_DATA_LEN 8
37
45
60
64 uint16_t major;
65
67 uint8_t minor;
68
70 uint8_t revision;
71};
72
74struct dult_user {
78 const uint8_t *product_data;
79
81 const char *manufacturer_name;
82
84 const char *model_name;
85
88
91
94
97
106};
107
125int dult_user_register(const struct dult_user *user);
126
136int dult_user_unregister(const struct dult_user *user);
137
174int dult_battery_level_set(const struct dult_user *user, uint8_t percentage_level);
175
191 int (*payload_get)(uint8_t *buf, size_t *len);
192
199 void (*exited)(void);
200};
201
219 const struct dult_id_read_state_cb *cb);
220
230int dult_id_read_state_enter(const struct dult_user *user);
231
235#define DULT_SOUND_DURATION_BT_GATT_MIN_MS (5000U)
236
250
264 void (*sound_start)(enum dult_sound_src src);
265
277 void (*sound_stop)(enum dult_sound_src src);
278};
279
297int dult_sound_cb_register(const struct dult_user *user, const struct dult_sound_cb *cb);
298
315
341int dult_sound_state_update(const struct dult_user *user,
342 const struct dult_sound_state_param *param);
343
357 void (*start)(void);
358
372 bool (*period_expired)(void);
373
381 void (*stop)(void);
382};
383
405 const struct dult_motion_detector_cb *cb);
406
418
440
464int dult_enable(const struct dult_user *user);
465
496int dult_reset(const struct dult_user *user);
497
512bool dult_user_is_associated(const struct dult_user *user);
513
519
520#ifdef __cplusplus
521}
522#endif
523
528#endif /* _DULT_DULT_H_ */
dult_network_id
Definition dult.h:41
@ DULT_NETWORK_ID_APPLE
Definition dult.h:42
@ DULT_NETWORK_ID_GOOGLE
Definition dult.h:43
int dult_motion_detector_cb_register(const struct dult_user *user, const struct dult_motion_detector_cb *cb)
Register motion detector callbacks.
dult_near_owner_state_mode
Definition dult.h:408
@ DULT_NEAR_OWNER_STATE_MODE_COUNT
Definition dult.h:416
@ DULT_NEAR_OWNER_STATE_MODE_NEAR_OWNER
Definition dult.h:413
@ DULT_NEAR_OWNER_STATE_MODE_SEPARATED
Definition dult.h:410
int dult_sound_state_update(const struct dult_user *user, const struct dult_sound_state_param *param)
Update the sound state.
bool dult_user_is_associated(const struct dult_user *user)
Check if the DULT user is the associated user.
bool dult_is_any_associated(void)
Check whether any DULT user is currently associated.
dult_accessory_capability
Definition dult.h:47
@ DULT_ACCESSORY_CAPABILITY_MOTION_DETECTOR_UT_BIT_POS
Definition dult.h:52
@ DULT_ACCESSORY_CAPABILITY_ID_LOOKUP_BLE_BIT_POS
Definition dult.h:58
@ DULT_ACCESSORY_CAPABILITY_ID_LOOKUP_NFC_BIT_POS
Definition dult.h:55
@ DULT_ACCESSORY_CAPABILITY_PLAY_SOUND_BIT_POS
Definition dult.h:49
int dult_near_owner_state_set(const struct dult_user *user, enum dult_near_owner_state_mode mode)
Set the mode of the DULT near-owner state.
dult_sound_src
Definition dult.h:238
@ DULT_SOUND_SRC_MOTION_DETECTOR
Definition dult.h:245
@ DULT_SOUND_SRC_BT_GATT
Definition dult.h:240
@ DULT_SOUND_SRC_EXTERNAL
Definition dult.h:248
int dult_user_unregister(const struct dult_user *user)
Unregister a DULT user.
int dult_sound_cb_register(const struct dult_user *user, const struct dult_sound_cb *cb)
Register DULT sound callback structure.
int dult_user_register(const struct dult_user *user)
Register DULT user.
int dult_enable(const struct dult_user *user)
Enable DULT.
int dult_id_read_state_enter(const struct dult_user *user)
Enter DULT identifier read state.
int dult_id_read_state_cb_register(const struct dult_user *user, const struct dult_id_read_state_cb *cb)
Register DULT identifier read state callback structure.
int dult_battery_level_set(const struct dult_user *user, uint8_t percentage_level)
Set the current battery level.
int dult_reset(const struct dult_user *user)
Reset DULT.
void(* exited)(void)
Identifier read state exited.
Definition dult.h:199
int(* payload_get)(uint8_t *buf, size_t *len)
Get identifier payload.
Definition dult.h:191
Definition dult.h:177
void(* start)(void)
Request the user to start the motion detector.
Definition dult.h:357
bool(* period_expired)(void)
Notify the user that the motion detector period has expired.
Definition dult.h:372
void(* stop)(void)
Notify the user that the motion detector can be stopped.
Definition dult.h:381
Motion detector callback structure.
Definition dult.h:348
void(* sound_stop)(enum dult_sound_src src)
Request the user to stop the sound action.
Definition dult.h:277
void(* sound_start)(enum dult_sound_src src)
Request the user to start the sound action.
Definition dult.h:264
Definition dult.h:252
enum dult_sound_src src
Definition dult.h:313
bool active
Definition dult.h:305
Definition dult.h:300
uint8_t accessory_category
Definition dult.h:87
enum dult_network_id network_id
Definition dult.h:93
const struct dult_version * network_version
Definition dult.h:105
struct dult_version firmware_version
Definition dult.h:96
const char * model_name
Definition dult.h:84
uint32_t accessory_capabilities
Definition dult.h:90
const char * manufacturer_name
Definition dult.h:81
const uint8_t * product_data
Definition dult.h:78
Definition dult.h:74
uint8_t minor
Definition dult.h:67
uint16_t major
Definition dult.h:64
uint8_t revision
Definition dult.h:70
Definition dult.h:62