using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NIDAQmx
{
    public class TCPIP : BaseDevice
    {
        internal TCPIP(DAQmxSession session, string deviceName) : base(session, deviceName)
        {
            byte[] bytes = new byte[1024];
            _Session.CheckResult(_Session.GetDelegate<Internal.Internal.DAQmxGetDevTCPIPHostname>()(DeviceName, ref bytes[0], (uint)bytes.Length));
            Hostname = System.Text.Encoding.UTF8.GetString(bytes).Trim('\0');
            Array.Fill<byte>(bytes, 0);
            _Session.CheckResult(_Session.GetDelegate<Internal.Internal.DAQmxGetDevTCPIPEthernetIP>()(DeviceName, ref bytes[0], (uint)(bytes.Length)));
            EthernetIP = System.Text.Encoding.UTF8.GetString(bytes).Trim('\0');
            Array.Fill<byte>(bytes, 0);
            _Session.CheckResult(_Session.GetDelegate<Internal.Internal.DAQmxGetDevTCPIPWirelessIP>()(DeviceName, ref bytes[0], (uint)(bytes.Length)));
            WirelessIP = System.Text.Encoding.UTF8.GetString(bytes).Trim('\0');
        }
        public string Hostname { get; }
        public string EthernetIP { get; }
        public string WirelessIP { get; }
    }
}
