Пример #1
0
        public static byte[] JrReceive(int handle, ref uint arg1, ref int arg4, ref int arg5, ref ushort arg6)
        {
            byte[] buffer = new byte[0];
            uint   arg2   = 0;

            // Get the C-style pointer to the buffer from the native library
            IntPtr ptr = JuniorAPIPINVOKE.JrReceive(handle, ref arg1, ref arg2, ref arg4, ref arg5, ref arg6);

            try
            {
                if (ptr.ToInt64() != 0)
                {
                    buffer = new byte[(int)arg2];
                    // Copy the contents of the buffer.
                    Marshal.Copy(ptr, buffer, 0, (int)arg2);
                }
            }
            finally
            {
                if (ptr.ToInt64() != 0)
                {
                    // Release the pointer.
                    JuniorAPIPINVOKE.FreeAllocatedBuffer(ptr);
                }
            }

            return(buffer);
        }
Пример #2
0
        public static JrErrorCode JrSend(int handle, uint dest, uint size, byte[] BYTE)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrSend__SWIG_3(handle, dest, size, BYTE);

            return(ret);
        }
Пример #3
0
        public static JrErrorCode JrSend(int handle, uint dest, uint size, byte[] BYTE, int priority, int flags)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrSend__SWIG_1(handle, dest, size, BYTE, priority, flags);

            return(ret);
        }
Пример #4
0
        public static JrErrorCode JrConnect(int id, string cfg, ref int INOUT)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrConnect__SWIG_0(id, cfg, ref INOUT);

            return(ret);
        }
Пример #5
0
        public static JrErrorCode JrDisconnect(int handle)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrDisconnect(handle);

            return(ret);
        }
Пример #6
0
        public static JrErrorCode JrCheckAllHandles(SWIGTYPE_p_long list, SWIGTYPE_p_int size_of_list)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrCheckAllHandles(SWIGTYPE_p_long.getCPtr(list), SWIGTYPE_p_int.getCPtr(size_of_list));

            return(ret);
        }
Пример #7
0
        public static JrErrorCode JrBroadcast(int handle, uint size, string buffer, int priority, ushort msg_id)
        {
            JrErrorCode ret = (JrErrorCode)JuniorAPIPINVOKE.JrBroadcast(handle, size, buffer, priority, msg_id);

            return(ret);
        }