dwm_cfg_tag_set
Configures node as a tag with given options. The BLE option cannot be enabled with encryption. otherwise, the configuration is considered invalid and will not be used. Encryption can’t be enabled if encryption key is not set. This call requires a reset for the new configuration to take effect (dwm_reset). Normally, this call writes to internal flash when setting a new value. Hence, it should not be used frequently and can take hundreds of milliseconds in the worst case,!
-
void dwm_cfg_tag_set(dwm_cfg_tag_t *cfg_tag);
- Parameters
input – cfg_tag
cfg_tag – stnry_en, low_power_en, meas_mode, loc_engine_en, led_en, ble_en, uwb_mode, fw_update_en, enc_en
stnry_en – ‘0’ | ‘1’ (Stationary detection enabled, if enabled, the stationary update rate is used instead of normal update rate if node is :param not moving)
meas_mode – ‘0’ | ‘1’ | ‘2’ | ‘3’ (0 - Two way ranging, 1,2,3 - reserved)
low_power_en – ‘0’ | ‘1’ (Low-power mode enable)
loc_engine_en – ‘0’ | ‘1’ (0 means do not use internal Location Engine, 1 means internal Location Engine)
enc_en – ‘0’ | ‘1’ (encryption enable)
led_en – ‘0’ | ‘1’ (general purpose LEDs enable)
ble_en – ‘0’ | ‘1’ (BLE enable)
uwb_mode – ‘0’ | ‘1’ | ‘2’ (0-off, 1-passive, 2-active)
fw_update_en – ‘0’ | ‘1’ (Firmware update enable)
output – Status code
C code example
dwm_cfg_tag_t cfg;
cfg.stnry_en = 1;
cfg.meas_mode = DWM_MEAS_MODE_TWR;
cfg.low_power_en = 0;
cfg.loc_engine_en = 1;
cfg.common.enc_en = 1;
cfg.common.led_en = 1;
cfg.common.ble_en = 0;
cfg.common.fw_update_en = 0;
cfg.common.uwb_mode = DWM_UWB_MODE_ACTIVE;
dwm_cfg_tag_set(&cfg);
SPI/UART example
TLV Request |
||
---|---|---|
Type |
Length |
Value |
(* BYTE 1 *)
(bits 3-7)
reserved
(bit 2) stnry_en
(bits 0-#.
meas_mode : 0 -
TWR, 1-3
reserved (*
BYTE 0 *)
(bit 7)
low_power_en
(bit 6)
loc_engine_en
(bit 5) enc_en
(bit 4) led_en
(bit 3) ble_en
(bit 2)
fw_update_en
(bits 0-#.
uwb_mode
|
||
0x05 |
0x02 |
0x72 0x04 |
Type 0x05 means command dwm_cfg_tag_set
TLV Response |
||
---|---|---|
Type |
Length |
Value (see error codes) |
0x40 |
0x01 |
0x00 |