Exemple #1
0
        public static FunctionHandle CreateFunction(FunctionDescriptionHandle descriptionHandle,
                                                    out RfcErrorInfo errorInfo)
        {
            var ptr = Interopt.RfcCreateFunction(descriptionHandle.Ptr, out errorInfo);

            return(ptr == IntPtr.Zero ? null : new FunctionHandle(ptr));
        }
Exemple #2
0
        public static void AllowStartOfPrograms(ConnectionHandle connectionHandle, StartProgramDelegate callback, out
                                                RfcErrorInfo errorInfo)
        {
            var descriptionHandle = new FunctionDescriptionHandle(Interopt.RfcCreateFunctionDesc("RFC_START_PROGRAM", out errorInfo));

            if (descriptionHandle.Ptr == IntPtr.Zero)
            {
                return;
            }

            var paramDesc = new Interopt.RFC_PARAMETER_DESC {
                Name = "COMMAND", Type = RfcType.CHAR, Direction = RfcDirection.Import, NucLength = 512, UcLength = 1024
            };
            var rc = Interopt.RfcAddParameter(descriptionHandle.Ptr, ref paramDesc, out errorInfo);

            if (rc != RfcRc.RFC_OK)
            {
                return;
            }

            rc = Interopt.RfcInstallServerFunction(null, descriptionHandle.Ptr, StartProgramHandler, out errorInfo);
            if (rc != RfcRc.RFC_OK)
            {
                return;
            }

            RegisteredCallbacks.AddOrUpdate(connectionHandle.Ptr, callback, (c, v) => v);
        }
Exemple #3
0
        public static RfcRc GetFunctionParameterCount(FunctionDescriptionHandle descriptionHandle, out int count,
                                                      out RfcErrorInfo errorInfo)
        {
            var rc = Interopt.RfcGetParameterCount(descriptionHandle.Ptr, out var uIntCount, out errorInfo);

            count = (int)uIntCount;
            return(rc);
        }
Exemple #4
0
        public static RfcRc GetFunctionParameterDescription(FunctionDescriptionHandle descriptionHandle,
                                                            int index, out RfcParameterInfo parameterInfo, out RfcErrorInfo errorInfo)
        {
            var rc = Interopt.RfcGetParameterDescByIndex(descriptionHandle.Ptr, (uint)index, out var parameterDescr, out errorInfo);

            parameterInfo = new RfcParameterInfo(
                parameterDescr.Name, parameterDescr.Type, parameterDescr.Direction, parameterDescr.NucLength, parameterDescr.UcLength, parameterDescr.Decimals, parameterDescr.DefaultValue, parameterDescr.ParameterText, parameterDescr.Optional == 'X');
            return(rc);
        }
Exemple #5
0
 public static RfcRc GetFunctionName(FunctionDescriptionHandle descriptionHandle, out string functionName,
                                     out RfcErrorInfo errorInfo)
 {
     return(Interopt.RfcGetFunctionName(descriptionHandle.Ptr, out functionName, out errorInfo));
 }