Exemplo n.º 1
0
            public static ardupilot_gnss_MovingBaselineData ByteArrayToDroneCANMsg(byte[] transfer, int startoffset)
            {
                var ans = new ardupilot_gnss_MovingBaselineData();

                ans.decode(new DroneCAN.CanardRxTransfer(transfer.Skip(startoffset).ToArray()));
                return(ans);
            }
Exemplo n.º 2
0
 static void _encode_ardupilot_gnss_MovingBaselineData(uint8_t[] buffer, ardupilot_gnss_MovingBaselineData msg, dronecan_serializer_chunk_cb_ptr_t chunk_cb, object ctx, bool tao)
 {
     if (!tao)
     {
         memset(buffer, 0, 8);
         canardEncodeScalar(buffer, 0, 9, msg.data_len);
         chunk_cb(buffer, 9, ctx);
     }
     for (int i = 0; i < msg.data_len; i++)
     {
         memset(buffer, 0, 8);
         canardEncodeScalar(buffer, 0, 8, msg.data[i]);
         chunk_cb(buffer, 8, ctx);
     }
 }
Exemplo n.º 3
0
        static void _decode_ardupilot_gnss_MovingBaselineData(CanardRxTransfer transfer, ref uint32_t bit_ofs, ardupilot_gnss_MovingBaselineData msg, bool tao)
        {
            if (!tao)
            {
                canardDecodeScalar(transfer, bit_ofs, 9, false, ref msg.data_len);
                bit_ofs += 9;
            }
            else
            {
                msg.data_len = (uint16_t)(((transfer.payload_len * 8) - bit_ofs) / 8);
            }

            msg.data = new uint8_t[msg.data_len];
            for (int i = 0; i < msg.data_len; i++)
            {
                canardDecodeScalar(transfer, bit_ofs, 8, false, ref msg.data[i]);
                bit_ofs += 8;
            }
        }
Exemplo n.º 4
0
        static uint32_t decode_ardupilot_gnss_MovingBaselineData(CanardRxTransfer transfer, ardupilot_gnss_MovingBaselineData msg)
        {
            uint32_t bit_ofs = 0;

            _decode_ardupilot_gnss_MovingBaselineData(transfer, ref bit_ofs, msg, true);
            return((bit_ofs + 7) / 8);
        }
Exemplo n.º 5
0
 static void encode_ardupilot_gnss_MovingBaselineData(ardupilot_gnss_MovingBaselineData msg, dronecan_serializer_chunk_cb_ptr_t chunk_cb, object ctx)
 {
     uint8_t[] buffer = new uint8_t[8];
     _encode_ardupilot_gnss_MovingBaselineData(buffer, msg, chunk_cb, ctx, true);
 }