nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
dult.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 _DULT_H_
8#define _DULT_H_
9
10#include <stdint.h>
11#include <stddef.h>
12
26#ifdef __cplusplus
27extern "C" {
28#endif
29
33#define DULT_PRODUCT_DATA_LEN 8
34
41};
42
47
50
53
56};
57
61 uint16_t major;
62
64 uint8_t minor;
65
67 uint8_t revision;
68};
69
71struct dult_user {
75 const uint8_t *product_data;
76
78 const char *manufacturer_name;
79
81 const char *model_name;
82
85
88
91
94};
95
106int dult_user_register(const struct dult_user *user);
107
133int dult_battery_level_set(const struct dult_user *user, uint8_t percentage_level);
134
150 int (*payload_get)(uint8_t *buf, size_t *len);
151
158 void (*exited)(void);
159};
160
172 const struct dult_id_read_state_cb *cb);
173
183int dult_id_read_state_enter(const struct dult_user *user);
184
188#define DULT_SOUND_DURATION_BT_GATT_MIN_MS (5000U)
189
194
199
202};
203
217 void (*sound_start)(enum dult_sound_src src);
218
230 void (*sound_stop)(enum dult_sound_src src);
231};
232
244int dult_sound_cb_register(const struct dult_user *user, const struct dult_sound_cb *cb);
245
252 bool active;
253
261};
262
288int dult_sound_state_update(const struct dult_user *user,
289 const struct dult_sound_state_param *param);
290
304 void (*start)(void);
305
319 bool (*period_expired)(void);
320
328 void (*stop)(void);
329};
330
346 const struct dult_motion_detector_cb *cb);
347
352
355
358};
359
373
383int dult_enable(const struct dult_user *user);
384
395int dult_reset(const struct dult_user *user);
396
397#ifdef __cplusplus
398}
399#endif
400
405#endif /* _DULT_H_ */
dult_network_id
Definition: dult.h:38
@ DULT_NETWORK_ID_APPLE
Definition: dult.h:39
@ DULT_NETWORK_ID_GOOGLE
Definition: dult.h:40
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:349
@ DULT_NEAR_OWNER_STATE_MODE_COUNT
Definition: dult.h:357
@ DULT_NEAR_OWNER_STATE_MODE_NEAR_OWNER
Definition: dult.h:354
@ DULT_NEAR_OWNER_STATE_MODE_SEPARATED
Definition: dult.h:351
int dult_sound_state_update(const struct dult_user *user, const struct dult_sound_state_param *param)
Update the sound state.
dult_accessory_capability
Definition: dult.h:44
@ DULT_ACCESSORY_CAPABILITY_MOTION_DETECTOR_UT_BIT_POS
Definition: dult.h:49
@ DULT_ACCESSORY_CAPABILITY_ID_LOOKUP_BLE_BIT_POS
Definition: dult.h:55
@ DULT_ACCESSORY_CAPABILITY_ID_LOOKUP_NFC_BIT_POS
Definition: dult.h:52
@ DULT_ACCESSORY_CAPABILITY_PLAY_SOUND_BIT_POS
Definition: dult.h:46
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:191
@ DULT_SOUND_SRC_MOTION_DETECTOR
Definition: dult.h:198
@ DULT_SOUND_SRC_BT_GATT
Definition: dult.h:193
@ DULT_SOUND_SRC_EXTERNAL
Definition: dult.h:201
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.
uint8_t revision
Definition: dult.h:67
uint16_t major
Definition: dult.h:61
uint8_t minor
Definition: dult.h:64
Definition: dult.h:59
void(* exited)(void)
Identifier read state exited.
Definition: dult.h:158
int(* payload_get)(uint8_t *buf, size_t *len)
Get identifier payload.
Definition: dult.h:150
Definition: dult.h:136
void(* start)(void)
Request the user to start the motion detector.
Definition: dult.h:304
bool(* period_expired)(void)
Notify the user that the motion detector period has expired.
Definition: dult.h:319
void(* stop)(void)
Notify the user that the motion detector can be stopped.
Definition: dult.h:328
Motion detector callback structure.
Definition: dult.h:295
void(* sound_stop)(enum dult_sound_src src)
Request the user to stop the sound action.
Definition: dult.h:230
void(* sound_start)(enum dult_sound_src src)
Request the user to start the sound action.
Definition: dult.h:217
Definition: dult.h:205
enum dult_sound_src src
Definition: dult.h:260
bool active
Definition: dult.h:252
Definition: dult.h:247
uint8_t accessory_category
Definition: dult.h:84
enum dult_network_id network_id
Definition: dult.h:90
struct dult_firmware_version firmware_version
Definition: dult.h:93
const char * model_name
Definition: dult.h:81
uint32_t accessory_capabilities
Definition: dult.h:87
const char * manufacturer_name
Definition: dult.h:78
const uint8_t * product_data
Definition: dult.h:75
Definition: dult.h:71