예제 #1
0
 /// <summary>
 /// Convert to tuple
 /// </summary>
 public static void Deconstruct(IGattAttribute att, out Guid id, out GattAttributeType type,
                                out String description)
 {
     description = att.Description;
     id          = att.Id;
     type        = att.Type;
 }
예제 #2
0
        /// <summary>
        /// Add a <see cref="IGattAttribute" />
        /// </summary>
        public IGattAttribute Add(IGattAttribute item)
        {
            if (item == null)
            {
                return(null);
            }

            try
            {
                m_items.Add(item.Id, item);
            }
            catch (Exception ex)
            {
                Log.Warn(
                    "Error adding BLE attribute. type={3} att-1=\"{0}\" att-2=\"{1}\" error=\"{2}\"",
                    item.Description,
                    m_items.Get(item.Id)?.Description,
                    ex.Message,
                    item.Type);
                item = null;
            }
            return(item);
        }
예제 #3
0
 /// <inheritdoc />
 public Boolean Equals(IGattAttribute other)
 {
     return(!ReferenceEquals(null, other) && other.Id.Equals(Id));
 }