using System;
using System.Runtime.InteropServices;
using System.Text;

namespace BIXOLON
{
    public class MPosLookup
    {
        public String getNetworkDevices()
        {
            IntPtr ptr = MPosLookupLib.getNetworkDevices();
            return Marshal.PtrToStringAuto(ptr);
        }

        public String getBluetoothDevices()
        {
            IntPtr ptr = MPosLookupLib.getBluetoothDevices();
            return Marshal.PtrToStringAuto(ptr);
        }

        public String getUSBDevices()
        {
            IntPtr ptr = MPosLookupLib.getUSBDevices();
            return Marshal.PtrToStringAuto(ptr);
        }

        public String getSerialDevices()
        {
            IntPtr ptr = MPosLookupLib.getSerialDevices();
            return Marshal.PtrToStringAuto(ptr);
        }

        public String getParallelDevices()
        {
            IntPtr ptr = MPosLookupLib.getParallelDevices();
            return Marshal.PtrToStringAuto(ptr);
        }
    }

    public class MPosLookupLib
    {
        private const string MPOS_LIB_NAME = "MPosLookup.dll";

        [DllImport(MPOS_LIB_NAME, EntryPoint = "getNetworkDevices")]
        public extern static IntPtr getNetworkDevices();

        [DllImport(MPOS_LIB_NAME, EntryPoint = "getBluetoothDevices")]
        public extern static IntPtr getBluetoothDevices();

        [DllImport(MPOS_LIB_NAME, EntryPoint = "getUSBDevices")]
        public extern static IntPtr getUSBDevices();

        [DllImport(MPOS_LIB_NAME, EntryPoint = "getSerialDevices")]
        public extern static IntPtr getSerialDevices();

        [DllImport(MPOS_LIB_NAME, EntryPoint = "getParallelDevices")]
        public extern static IntPtr getParallelDevices();
    }
}
