public void Reset() { State = eGSMState.Reset; TotalErrors = 0; TotalSuccess = 0; PhaseOffsetValue = 0; FN = -1; MNC = -1; MCC = -1; LAC = -1; CellIdent = -1; lock (ActiveBursts) { ActiveBursts.Clear(); } lock (UsedBursts) { UsedBursts.Clear(); } /* set up default arfcn map */ ArfcnMap.Clear(); ArfcnMapRev.Clear(); ArfcnMap.Add(-1, 0); ArfcnMapRev.Add(0, -1); /* and set up empty timeslot configs */ TimeSlotConfig = new sTimeSlotInfo[1, 2][]; for (int pos = 0; pos < TimeSlotConfig.Length; pos++) { TimeSlotConfig[pos / 2, pos % 2] = new sTimeSlotInfo[8]; } /* default is downlink of first ARFCN */ ARFCN = -1; Dir = eLinkDirection.Downlink; //CurrentTimeSlotConfig = new sTimeSlotInfo[8]; //CurrentTimeSlotHandlers = new sTimeSlotParam[8][]; AverageIdlePower = 0; AveragePower = 0; CurrentPower = 0; }
internal void EnsureARFCN(long arfcn) { /* the first time an ARFCN was assigned? */ if (ARFCN == -1) { /* this is our default ARFCN now */ ArfcnMap.Clear(); ArfcnMapRev.Clear(); ArfcnMap.Add(arfcn, 0); ArfcnMapRev.Add(0, arfcn); _ARFCN = arfcn; } /* a new, unconfigured ARFCN? */ if (!ArfcnMap.ContainsKey(arfcn)) { /* resize array */ int newIndex = (TimeSlotConfig.Length / 2); sTimeSlotInfo[, ][] tmp = new sTimeSlotInfo[newIndex + 1, 2][]; Array.Copy(TimeSlotConfig, tmp, TimeSlotConfig.Length); /* and set up new ARFCN timeslots */ for (int pos = 0; pos < 2; pos++) { tmp[newIndex, pos] = new sTimeSlotInfo[8]; for (int timeSlot = 0; timeSlot < 8; timeSlot++) { tmp[newIndex, pos][timeSlot].Type = eTimeSlotType.Unconfigured; tmp[newIndex, pos][timeSlot].SubChanAssignments = new int[8]; } } TimeSlotConfig = tmp; /* put reference */ ArfcnMap.Add(arfcn, newIndex); ArfcnMapRev.Add(newIndex, arfcn); } }