コード例 #1
0
 private void DebugDumpPresentationFormats(GattCharacteristic ch, BLE_PresentationFormat f)
 {
     this.log.Info("DebugDumpPresentationFormats", () => string.Format("Characteristic : {0}", BLE_DisplayHelpers.GetCharacteristicName(ch)));
     this.log.Info("DebugDumpPresentationFormats", () => string.Format("    Description: {0}", f.Description));
     this.log.Info("DebugDumpPresentationFormats", () => string.Format("       Exponent: {0}", f.Exponent));
     this.log.Info("DebugDumpPresentationFormats", () => string.Format("         Format: {0}", f.Format));
     this.log.Info("DebugDumpPresentationFormats", () => string.Format("      Namespace: {0}", f.Namespace));
     this.log.Info("DebugDumpPresentationFormats", () => string.Format("          Units: {0}", f.Units));
 }
コード例 #2
0
        private List <BLE_PresentationFormat> BuildPresentationFormats(GattCharacteristic ch)
        {
            List <BLE_PresentationFormat> formats = new List <BLE_PresentationFormat>();

            foreach (var pf in ch.PresentationFormats)
            {
                BLE_PresentationFormat format = new BLE_PresentationFormat()
                {
                    Description = pf.Description,
                    Exponent    = pf.Exponent,
                    Format      = (DataFormatEnum)pf.FormatType,
                    Units       = (UnitsOfMeasurement)pf.Unit,
                    Namespace   = pf.Namespace,
                };
                formats.Add(format);
            }
            return(formats);
        }
コード例 #3
0
        private List <BLE_PresentationFormat> BuildPresentationFormats(GattCharacteristic ch)
        {
            this.log.InfoEntry("BuildPresentationFormats");
            List <BLE_PresentationFormat> formats = new List <BLE_PresentationFormat>();

            foreach (GattPresentationFormat pf in ch.PresentationFormats)
            {
                BLE_PresentationFormat format = new BLE_PresentationFormat()
                {
                    Description = pf.Description,
                    Exponent    = pf.Exponent,
                    Format      = (DataFormatEnum)pf.FormatType,
                    Units       = (UnitsOfMeasurement)pf.Unit,
                    Namespace   = pf.Namespace,
                };
                formats.Add(format);
                this.DebugDumpPresentationFormats(ch, format);
            }
            return(formats);
        }