예제 #1
0
        /// <summary>Get the data for a port value</summary>
        /// <param name="data">Will be populated with the data</param>
        /// <param name="port">The port value to encode</param>
        /// <returns>`true` if successful</returns>
        public static bool ATPortGetData(Foundation.ATMutableBytes data, DeviceTypes.ATPortEnum port)
        {
            var _arg0 = ReferenceEquals(data, null) ? IntPtr.Zero : data._Instance;
            var _ret  = _Internal.ATPortGetData(_arg0, port);

            return(_ret);
        }
예제 #2
0
        /// <summary>Get a port value from data</summary>
        /// <param name="data">The data</param>
        /// <param name="port">On return, contains the port value</param>
        /// <returns>`true` if successful</returns>
        public static bool ATPortParseData(Foundation.ATBytesUnsafe data, ref DeviceTypes.ATPortEnum port)
        {
            if (ReferenceEquals(data, null))
            {
                throw new ArgumentNullException("data", "Cannot be null because it is passed by value.");
            }
            var _arg0 = data._Instance;

            fixed(DeviceTypes.ATPortEnum *_port1 = &port)
            {
                var _arg1 = _port1;
                var _ret  = _Internal.ATPortParseData(_arg0, _arg1);

                return(_ret);
            }
        }
예제 #3
0
        /// <summary>Get a description for a port value</summary>
        /// <param name="port">The port value</param>
        /// <returns>A null-terminated constant string</returns>
        public static string ATPortDescription(DeviceTypes.ATPortEnum port)
        {
            var _ret = _Internal.ATPortDescription(port);

            if (_ret == IntPtr.Zero)
            {
                return(default(string));
            }
            var _retPtr = (byte *)_ret;
            int _length = 0;

            while (*(_retPtr++) != 0)
            {
                _length += sizeof(byte);
            }
            return(Text.Encoding.UTF8.GetString((byte *)_ret, _length));
        }
예제 #4
0
        /// <summary>Validate a port value</summary>
        /// <param name="port">The port value to validate</param>
        /// <returns>`true` if valid</returns>
        public static bool ATPortValidate(DeviceTypes.ATPortEnum port)
        {
            var _ret = _Internal.ATPortValidate(port);

            return(_ret);
        }
예제 #5
0
 internal static extern IntPtr ATPortDescription(DeviceTypes.ATPortEnum port);
예제 #6
0
 internal static extern bool ATPortGetData(IntPtr data, DeviceTypes.ATPortEnum port);
예제 #7
0
 internal static extern bool ATPortValidate(DeviceTypes.ATPortEnum port);
 internal static extern byte ATPortsGetPortsForPort(DeviceTypes.ATPortEnum port);
 internal static extern bool ATPortsIsPortSet(byte ports, DeviceTypes.ATPortEnum port);
        /// <summary>Get the ports value for a port</summary>
        /// <param name="port">The port to get</param>
        /// <returns>`true` if set</returns>
        public static byte ATPortsGetPortsForPort(DeviceTypes.ATPortEnum port)
        {
            var _ret = _Internal.ATPortsGetPortsForPort(port);

            return(_ret);
        }
        /// <summary>Determine if a port is set in the port state</summary>
        /// <param name="ports">The digital port state</param>
        /// <param name="port">The port to check</param>
        /// <returns>`true` if set</returns>
        public static bool ATPortsIsPortSet(byte ports, DeviceTypes.ATPortEnum port)
        {
            var _ret = _Internal.ATPortsIsPortSet(ports, port);

            return(_ret);
        }