Пример #1
0
        // Schedule the transmission of a message on the serial port at a
        // given time and priority.
        public void send(command_queue cq, ReadOnlySpan <byte> msg, ulong min_clock = 0, ulong req_clock = 0)
        {
            RawMessage qm = RawMessage.Create(msg);

            qm.min_clock = min_clock;
            qm.req_clock = req_clock;

            send_batch(cq, new Span <RawMessage>(&qm, 1));
        }
Пример #2
0
        public void send_batch(command_queue cq, Span <RawMessage> msgs)
        {
            // Make sure min_clock is set in list and calculate total bytes
            int len = 0;

            for (int i = 0; i < msgs.Length; i++)
            {
                ref var msg = ref msgs[i];
                if (msg.min_clock + (1L << 31) < msg.req_clock &&
                    msg.req_clock != BACKGROUND_PRIORITY_CLOCK)
                {
                    msg.min_clock = msg.req_clock - (1L << 31);
                }
                len += msg.len;
            }