Пример #1
0
        /// <summary>
        /// Converts the raw device field into an external field object for consumption by the service.
        /// </summary>
        /// <param name="field">The raw device field to convert.</param>
        /// <returns>The converted ICounter value if valid; otherwise returns null.</returns>
        public static field ToField(this IDeviceField field)
        {
            if (field == null)
            {
                return(null);
            }

            return(new field()
            {
                name = field.Name,
                type = field.GetExternalType(),
                value = field.GetExternalValue()
            });
        }