Example #1
0
 public DataTypeDisplay(BLE_DataType dataType, string min, string max)
 {
     this.DataTypeEnum = dataType;
     this.DataType     = dataType.ToStr().UnderlineToSpaces();
     this.Min          = min;
     this.Max          = max;
 }
        public void ValidateBLEValue(BLE_DataType dataType, string command, Action onSuccess, OnErr onError)
        {
            ErrReport report;

            WrapErr.ToErrReport(out report, 9999, () => {
                this.log.Info("", () => string.Format("Validate:{0} '{1}'", dataType.ToStr(), command));


                RangeValidationResult result = this.bleRangeValidator.Validate(command, dataType);
                if (result.Status == BLE_DataValidationStatus.Success)
                {
                    onSuccess.Invoke();
                }
                else
                {
                    onError.Invoke(this.Translate(result));
                }
            });
            if (report.Code != 0)
            {
                onError.Invoke(this.GetText(MsgCode.UnknownError));
            }
        }