I was wondering how I can configure anchors using dwm-simple. I have the following code for configuring anchors and tags, but only the tag configuration works:
void configure_module(int tag_anchor,bool init)
{
dwm_cfg_common_t * ptr_common;
//populate common config options (common to tags and anchors)
ptr_common->ble_en = true;
ptr_common->enc_en = false;
ptr_common->fw_update_en = true;
ptr_common->led_en = true;
ptr_common->uwb_mode = DWM_UWB_MODE_ACTIVE;
//populate tag specific config options
if(!tag_anchor){
dwm_cfg_tag_t * ptr_tag_cfg;
ptr_tag_cfg->common = *ptr_common;
ptr_tag_cfg->loc_engine_en = true;
ptr_tag_cfg->low_power_en = true;
ptr_tag_cfg->meas_mode = DWM_MEAS_MODE_TWR; //TWR
ptr_tag_cfg->stnry_en = false; //stationary detection disabled
dwm_cfg_tag_set(&ptr_tag_cfg);
}
//populate anchor specific config options
else{ //Doesn't work for anchor yet
dwm_cfg_anchor_t * ptr_anchor_cfg;
ptr_anchor_cfg->common = *ptr_common;
ptr_anchor_cfg->bridge = false;
ptr_anchor_cfg->initiator = init;
dwm_cfg_anchor_set(&ptr_anchor_cfg);
}
dwm_panid_set(26985);
}
When I use this function to configure anchors, LEDs D9, D10, and D11 blink continuously for as long as it is powered.