Exemplo n.º 1
0
        static void _decode_org_cubepilot_uwb_Observation(CanardRxTransfer transfer, ref uint32_t bit_ofs, org_cubepilot_uwb_Observation msg, bool tao)
        {
            canardDecodeScalar(transfer, bit_ofs, 56, false, ref msg.timestamp_us);
            bit_ofs += 56;

            _decode_org_cubepilot_uwb_Node(transfer, ref bit_ofs, msg.tx_node, false);

            canardDecodeScalar(transfer, bit_ofs, 40, false, ref msg.tx_timestamp);
            bit_ofs += 40;

            if (!tao)
            {
                canardDecodeScalar(transfer, bit_ofs, 4, false, ref msg.rx_timestamps_len);
                bit_ofs += 4;
            }


            if (tao)
            {
                msg.rx_timestamps_len = 0;
                while (((transfer.payload_len * 8) - bit_ofs) > 0)
                {
                    _decode_org_cubepilot_uwb_ReceiveTimestamp(transfer, ref bit_ofs, msg.rx_timestamps[msg.rx_timestamps_len], false);
                    msg.rx_timestamps_len++;
                }
            }
            else
            {
                for (int i = 0; i < msg.rx_timestamps_len; i++)
                {
                    _decode_org_cubepilot_uwb_ReceiveTimestamp(transfer, ref bit_ofs, msg.rx_timestamps[i], false);
                }
            }
        }
 static void encode_org_cubepilot_uwb_Observation(org_cubepilot_uwb_Observation msg, dronecan_serializer_chunk_cb_ptr_t chunk_cb, object ctx)
 {
     uint8_t[] buffer = new uint8_t[8];
     _encode_org_cubepilot_uwb_Observation(buffer, msg, chunk_cb, ctx, true);
 }
Exemplo n.º 3
0
        static uint32_t decode_org_cubepilot_uwb_Observation(CanardRxTransfer transfer, org_cubepilot_uwb_Observation msg)
        {
            uint32_t bit_ofs = 0;

            _decode_org_cubepilot_uwb_Observation(transfer, ref bit_ofs, msg, true);
            return((bit_ofs + 7) / 8);
        }