Exemplo n.º 1
0
        /// <summary>
        /// CAN发送一帧数据
        /// </summary>
        /// <param name="id"></param>
        /// <param name="dat"></param>
        /// <param name="dlc"></param>
        /// <param name="time"></param>
        /// <returns></returns>
        public bool WriteData(int id, byte[] dat, int dlc, out long time)
        {
            time = 0;
            Canlib.canStatus canStatus = Canlib.canWrite(canHandler, id, dat, dlc, 0);
            if (canStatus != Canlib.canStatus.canOK)
            {
                return(false);
            }
            int ttime = 0;

            Canlib.kvReadTimer(canHandler, out ttime);
            time = (long)ttime;
            return(true);
        }