Lines Matching refs:inst
907 void RecomputeTimeout(AdvertisingInstance* inst, TimeTicks now) {
908 TimeDelta duration = now - inst->enable_time;
910 if (inst->duration) {
912 if (durationDone + 1 >= inst->duration) {
913 inst->enable_status = false;
914 inst->timeout_cb.Run(0 /* TODO: STATUS HERE?*/);
917 inst->duration = inst->duration - durationDone;
921 if (inst->maxExtAdvEvents && !cb_fired) {
923 (duration.InMilliseconds() / (inst->advertising_interval * 5 / 8));
925 if (eventsDone + 1 >= inst->maxExtAdvEvents) {
926 inst->enable_status = false;
927 inst->timeout_cb.Run(0 /* TODO: STATUS HERE?*/);
929 inst->maxExtAdvEvents = inst->maxExtAdvEvents - eventsDone;
937 for (AdvertisingInstance& inst : adv_inst) {
938 if (!inst.in_use || !inst.enable_status) continue;
940 if (inst.duration || inst.maxExtAdvEvents)
941 RecomputeTimeout(&inst, TimeTicks::Now());
943 sets.emplace_back(SetEnableData{.handle = inst.inst_id});
952 for (const AdvertisingInstance& inst : adv_inst) {
953 if (inst.in_use && inst.enable_status) {
955 .handle = inst.inst_id,
956 .duration = inst.duration,
957 .max_extended_advertising_events = inst.maxExtAdvEvents});