Exemplo n.º 1
0
        private static bool ConnectorInitialize(string path, short logLevel)
        {
            var pPath = MarshalUtf8.StringToHGlobalUtf8(path);
            var msg   = PtrToDescr(Initialize(pPath, logLevel));

            Marshal.FreeHGlobal(pPath);
            Console.Out.WriteLine(msg != null ? $"failed to init connector {msg}" : $"Initialize() OK");
            return(msg == null);
        }
Exemplo n.º 2
0
        //--------------------------------------------------------------------------------
        public static Str ConnectorSendCommand(string command)
        {
            var pData = MarshalUtf8.StringToHGlobalUtf8(command);
            var msg   = PtrToDescr(SendCommand(pData));

            Marshal.FreeHGlobal(pData);
            return(new Str
            {
                Txt = msg
            });
        }