Example #1
0
    public static proto_hdle_t proto_master_create(proto_IfaceIODevice_t iodevice)
    {
        global::System.IntPtr cPtr = protocommPINVOKE.proto_master_create(proto_IfaceIODevice_t.getCPtr(iodevice));
        proto_hdle_t          ret  = (cPtr == global::System.IntPtr.Zero) ? null : new proto_hdle_t(cPtr, false);

        return(ret);
    }
Example #2
0
    public static proto_hdle_t proto_cio_open(string szDev)
    {
        global::System.IntPtr cPtr = protocommPINVOKE.proto_cio_open(szDev);
        proto_hdle_t          ret  = (cPtr == global::System.IntPtr.Zero) ? null : new proto_hdle_t(cPtr, false);

        return(ret);
    }
Example #3
0
 /// <summary>
 /// Fermeture de la connexion
 /// </summary>
 /// <returns> 0 si pas d'erreur et autre si une erreur </returns>
 public void Close()
 {
     //On ferme la connexion
     protocomm.proto_master_close(m_handle);
     protocomm.proto_master_destroy(m_handle);
     //On met l'handle à null pour signifier qu'on s'est déconnecté
     m_handle = null;
 }
Example #4
0
        /// <summary>
        /// Initialize library
        /// </summary>
        /// <param name="device"> device pour la connexion </param>
        /// <param name="szPath"> path à passer au protocole </param>
        /// <returns> 0 if OK, otherwise < 0</returns>
        public int Open(proto_IfaceIODevice_t device, string szPath)
        {
            int ret = 0;

            m_device = device;

            // On cree l'instance de protocole
            m_handle = protocomm.proto_master_create(m_device); //5s de timeout TODO a moditifer plus tard pour le rendre paramètrable
            //On vérifie qu'il n'y a pas eu de problème lors de la connexion
            if (m_handle == null)
            {
                return(-1);
            }
            ret = protocomm.proto_master_open(m_handle, szPath);
            if (ret != 0)
            {
                return(-1);
            }

            return(ret);
        }
Example #5
0
    public static int proto_master_open(proto_hdle_t _this, string szPath)
    {
        int ret = protocommPINVOKE.proto_master_open(proto_hdle_t.getCPtr(_this), szPath);

        return(ret);
    }
Example #6
0
 public static void proto_master_destroy(proto_hdle_t _this)
 {
     protocommPINVOKE.proto_master_destroy(proto_hdle_t.getCPtr(_this));
 }
Example #7
0
    public static int proto_pushToFrame(proto_hdle_t _this, byte[] buf, uint len)
    {
        int ret = protocommPINVOKE.proto_pushToFrame(proto_hdle_t.getCPtr(_this), buf, len);

        return(ret);
    }
Example #8
0
    public static int proto_writeFrame(proto_hdle_t _this, proto_Command_t command, proto_frame_data_t args)
    {
        int ret = protocommPINVOKE.proto_writeFrame(proto_hdle_t.getCPtr(_this), (int)command, proto_frame_data_t.getCPtr(args));

        return(ret);
    }
Example #9
0
 public static void proto_setReceiver(proto_hdle_t _this, SWIGTYPE_p_f_p_void_enum_proto_Command_p_union_proto_frame_data__int callback, SWIGTYPE_p_void userdata)
 {
     protocommPINVOKE.proto_setReceiver(proto_hdle_t.getCPtr(_this), SWIGTYPE_p_f_p_void_enum_proto_Command_p_union_proto_frame_data__int.getCPtr(callback), SWIGTYPE_p_void.getCPtr(userdata));
 }
Example #10
0
    public static proto_Status_t proto_readFrame(proto_hdle_t _this, short tout_ms)
    {
        proto_Status_t ret = (proto_Status_t)protocommPINVOKE.proto_readFrame(proto_hdle_t.getCPtr(_this), tout_ms);

        return(ret);
    }
Example #11
0
    public static proto_DecodeStatus_t proto_decodeFrame(proto_hdle_t _this, SWIGTYPE_p_proto_Command cmd, proto_frame_data_t arg)
    {
        proto_DecodeStatus_t ret = (proto_DecodeStatus_t)protocommPINVOKE.proto_decodeFrame(proto_hdle_t.getCPtr(_this), SWIGTYPE_p_proto_Command.getCPtr(cmd), proto_frame_data_t.getCPtr(arg));

        return(ret);
    }
Example #12
0
    public static int proto_close(proto_hdle_t _this)
    {
        int ret = protocommPINVOKE.proto_close(proto_hdle_t.getCPtr(_this));

        return(ret);
    }
Example #13
0
 public static void proto_init(proto_hdle_t _this, proto_IfaceIODevice_t iodevice)
 {
     protocommPINVOKE.proto_init(proto_hdle_t.getCPtr(_this), proto_IfaceIODevice_t.getCPtr(iodevice));
 }
Example #14
0
    public static proto_Status_t proto_master_set(proto_hdle_t _this, byte register_, byte value)
    {
        proto_Status_t ret = (proto_Status_t)protocommPINVOKE.proto_master_set(proto_hdle_t.getCPtr(_this), register_, value);

        return(ret);
    }
Example #15
0
    public static proto_Status_t proto_master_get(proto_hdle_t _this, byte register_, SWIGTYPE_p_unsigned_char value)
    {
        proto_Status_t ret = (proto_Status_t)protocommPINVOKE.proto_master_get(proto_hdle_t.getCPtr(_this), register_, SWIGTYPE_p_unsigned_char.getCPtr(value));

        return(ret);
    }
Example #16
0
 internal static global::System.Runtime.InteropServices.HandleRef getCPtr(proto_hdle_t obj)
 {
     return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr);
 }