Browse Source

Revert "doc"

This reverts commit 7468300932b320b4f2b832db8f02265cc3a90b28.
z8359531l 23 hours ago
parent
commit
c5757de976
51 changed files with 135 additions and 2844 deletions
  1. 0 5
      Core/Src/main.c
  2. 5 9
      Makefile
  3. 1 1
      uav_can/user_inc/dronecan.h
  4. 0 105
      uav_can/user_inc/dronecan.remoteid.ArmStatus.h
  5. 0 154
      uav_can/user_inc/dronecan.remoteid.BasicID.h
  6. 0 232
      uav_can/user_inc/dronecan.remoteid.Location.h
  7. 0 128
      uav_can/user_inc/dronecan.remoteid.OperatorID.h
  8. 0 11
      uav_can/user_inc/dronecan.remoteid.SecureCommand.h
  9. 0 121
      uav_can/user_inc/dronecan.remoteid.SecureCommand_req.h
  10. 0 119
      uav_can/user_inc/dronecan.remoteid.SecureCommand_res.h
  11. 0 128
      uav_can/user_inc/dronecan.remoteid.SelfID.h
  12. 0 178
      uav_can/user_inc/dronecan.remoteid.System.h
  13. 0 8
      uav_can/user_inc/dronecan_msgs.h
  14. 0 108
      uav_can/user_inc/uavcan.protocol.NodeStatus.h
  15. 0 121
      uav_can/user_inc/user_rid.h
  16. 1 1
      uav_can/user_src/dronecan.c
  17. 0 68
      uav_can/user_src/dronecan.remoteid.ArmStatus.c
  18. 0 73
      uav_can/user_src/dronecan.remoteid.BasicID.c
  19. 0 83
      uav_can/user_src/dronecan.remoteid.Location.c
  20. 0 72
      uav_can/user_src/dronecan.remoteid.OperatorID.c
  21. 0 71
      uav_can/user_src/dronecan.remoteid.SecureCommand_req.c
  22. 0 70
      uav_can/user_src/dronecan.remoteid.SecureCommand_res.c
  23. 0 72
      uav_can/user_src/dronecan.remoteid.SelfID.c
  24. 0 79
      uav_can/user_src/dronecan.remoteid.System.c
  25. 24 24
      uav_can/user_src/drv_vkweigher_vls300.c
  26. 0 68
      uav_can/user_src/uavcan.protocol.NodeStatus.c
  27. 0 293
      uav_can/user_src/user_rid.c
  28. 3 3
      user_inc/soft_can.h
  29. 0 4
      user_inc/soft_eft.h
  30. 0 2
      user_inc/soft_flash.h
  31. 1 4
      user_inc/soft_flow.h
  32. 1 1
      user_inc/soft_obstacle.h
  33. 0 2
      user_inc/soft_p_2_c.h
  34. 0 1
      user_inc/soft_seed_device.h
  35. 1 1
      user_inc/soft_terrain.h
  36. 1 2
      user_inc/soft_timer.h
  37. 2 30
      user_inc/soft_water_device.h
  38. 2 6
      user_src/soft_can.c
  39. 3 4
      user_src/soft_eft.c
  40. 3 16
      user_src/soft_flash.c
  41. 2 4
      user_src/soft_flow.c
  42. 8 8
      user_src/soft_obstacle.c
  43. 1 91
      user_src/soft_p_2_c.c
  44. 44 71
      user_src/soft_seed_device.c
  45. 19 57
      user_src/soft_terrain.c
  46. 1 1
      user_src/soft_test.c
  47. 1 2
      user_src/soft_timer.c
  48. 1 0
      user_src/soft_uart.c
  49. 3 35
      user_src/soft_update.c
  50. 3 3
      user_src/soft_version.c
  51. 4 94
      user_src/soft_water_device.c

+ 0 - 5
Core/Src/main.c

@@ -55,8 +55,6 @@
 #include "soft_update.h"
 #include "can_debug.h"
 #include "dronecan.h"
-#include "user_rid.h"
-
 
 
 /* USER CODE END Includes */
@@ -203,7 +201,6 @@ int main(void)
     
     //串口发送
     send_uartfifo_msg();
-    send_msg_to_remoteid();
     //dronecan发送
     //dronecan_tx_processing(); //test
     //CAN DEBUG
@@ -212,8 +209,6 @@ int main(void)
       seek_can_debug_buf_adr();
     }
 
-
-
     /* USER CODE BEGIN 3 */
   }
   /* USER CODE END 3 */

+ 5 - 9
Makefile

@@ -173,6 +173,7 @@ LDFLAGS = $(MCU) -specs=nano.specs -T$(LDSCRIPT) $(LIBDIR) $(LIBS) -Wl,-Map=$(BU
 # default action: build all
 all: $(BUILD_DIR)/$(TARGET).elf $(BUILD_DIR)/$(TARGET).hex $(BUILD_DIR)/$(TARGET).bin
 
+
 #######################################
 # build the application
 #######################################
@@ -186,20 +187,15 @@ OBJECTS += $(addprefix $(BUILD_DIR)/,$(notdir $(ASMM_SOURCES:.S=.o)))
 vpath %.S $(sort $(dir $(ASMM_SOURCES)))
 
 $(BUILD_DIR)/%.o: %.c Makefile | $(BUILD_DIR) 
-	@$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
-	@echo $(notdir $(<:.c=.o))
+	$(CC) -c $(CFLAGS) -Wa,-a,-ad,-alms=$(BUILD_DIR)/$(notdir $(<:.c=.lst)) $< -o $@
 
 $(BUILD_DIR)/%.o: %.s Makefile | $(BUILD_DIR)
-	@$(AS) -c $(CFLAGS) $< -o $@
-	@echo $(notdir $(<:.s=.o))
-
+	$(AS) -c $(CFLAGS) $< -o $@
 $(BUILD_DIR)/%.o: %.S Makefile | $(BUILD_DIR)
-	@$(AS) -c $(CFLAGS) $< -o $@
-	@echo $(notdir $(<:.S=.o))
+	$(AS) -c $(CFLAGS) $< -o $@
 
 $(BUILD_DIR)/$(TARGET).elf: $(OBJECTS) Makefile
-	@$(CC) $(OBJECTS) $(LDFLAGS) -o $@
-	@echo linking...
+	$(CC) $(OBJECTS) $(LDFLAGS) -o $@
 	$(SZ) $@
 
 $(BUILD_DIR)/%.hex: $(BUILD_DIR)/%.elf | $(BUILD_DIR)

+ 1 - 1
uav_can/user_inc/dronecan.h

@@ -74,7 +74,7 @@ void dronecan_tx_processing(void);
  * @param tx_transfer
  * @return int
  */
-int dronecan_broadcast(CanardTxTransfer *tx_transfer);
+int dronecan_broadcast(struct dronecan *dcan, CanardTxTransfer *tx_transfer);
 
 /**
  * @brief dronecan 发送请求或应答消息

+ 0 - 105
uav_can/user_inc/dronecan.remoteid.ArmStatus.h

@@ -1,105 +0,0 @@
-#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <canard.h>
-
-
-#define DRONECAN_REMOTEID_ARMSTATUS_MAX_SIZE 52
-#define DRONECAN_REMOTEID_ARMSTATUS_SIGNATURE (0xFEDF72CCF06F3BDDULL)
-#define DRONECAN_REMOTEID_ARMSTATUS_ID 20035
-
-#define DRONECAN_REMOTEID_ARMSTATUS_ODID_ARM_STATUS_GOOD_TO_ARM 0
-#define DRONECAN_REMOTEID_ARMSTATUS_ODID_ARM_STATUS_FAIL_GENERIC 1
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-class dronecan_remoteid_ArmStatus_cxx_iface;
-#endif
-
-struct dronecan_remoteid_ArmStatus {
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-    using cxx_iface = dronecan_remoteid_ArmStatus_cxx_iface;
-#endif
-    uint8_t status;
-    struct { uint8_t len; uint8_t data[50]; }error;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-uint32_t dronecan_remoteid_ArmStatus_encode(struct dronecan_remoteid_ArmStatus* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-);
-bool dronecan_remoteid_ArmStatus_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_ArmStatus* msg);
-
-#if defined(CANARD_DSDLC_INTERNAL)
-static inline void _dronecan_remoteid_ArmStatus_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_ArmStatus* msg, bool tao);
-static inline bool _dronecan_remoteid_ArmStatus_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_ArmStatus* msg, bool tao);
-void _dronecan_remoteid_ArmStatus_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_ArmStatus* msg, bool tao) {
-    (void)buffer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->status);
-    *bit_ofs += 8;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t error_len = msg->error.len > 50 ? 50 : msg->error.len;
-#pragma GCC diagnostic pop
-    if (!tao) {
-        canardEncodeScalar(buffer, *bit_ofs, 6, &error_len);
-        *bit_ofs += 6;
-    }
-    for (size_t i=0; i < error_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->error.data[i]);
-        *bit_ofs += 8;
-    }
-}
-
-/*
- decode dronecan_remoteid_ArmStatus, return true on failure, false on success
-*/
-bool _dronecan_remoteid_ArmStatus_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_ArmStatus* msg, bool tao) {
-    (void)transfer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->status);
-    *bit_ofs += 8;
-
-    if (!tao) {
-        canardDecodeScalar(transfer, *bit_ofs, 6, false, &msg->error.len);
-        *bit_ofs += 6;
-    } else {
-        msg->error.len = ((transfer->payload_len*8)-*bit_ofs)/8;
-    }
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->error.len > 50) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->error.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->error.data[i]);
-        *bit_ofs += 8;
-    }
-
-    return false; /* success */
-}
-#endif
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_ArmStatus sample_dronecan_remoteid_ArmStatus_msg(void);
-#endif
-#ifdef __cplusplus
-} // extern "C"
-
-#ifdef DRONECAN_CXX_WRAPPERS
-#include <canard/cxx_wrappers.h>
-BROADCAST_MESSAGE_CXX_IFACE(dronecan_remoteid_ArmStatus, DRONECAN_REMOTEID_ARMSTATUS_ID, DRONECAN_REMOTEID_ARMSTATUS_SIGNATURE, DRONECAN_REMOTEID_ARMSTATUS_MAX_SIZE);
-#endif
-#endif

+ 0 - 154
uav_can/user_inc/dronecan.remoteid.BasicID.h

@@ -1,154 +0,0 @@
-#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <canard.h>
-
-
-#define DRONECAN_REMOTEID_BASICID_MAX_SIZE 44
-#define DRONECAN_REMOTEID_BASICID_SIGNATURE (0x5B1C624A8E4FC533ULL)
-#define DRONECAN_REMOTEID_BASICID_ID 20030
-
-#define DRONECAN_REMOTEID_BASICID_ODID_ID_TYPE_NONE 0
-#define DRONECAN_REMOTEID_BASICID_ODID_ID_TYPE_SERIAL_NUMBER 1
-#define DRONECAN_REMOTEID_BASICID_ODID_ID_TYPE_CAA_REGISTRATION_ID 2
-#define DRONECAN_REMOTEID_BASICID_ODID_ID_TYPE_UTM_ASSIGNED_UUID 3
-#define DRONECAN_REMOTEID_BASICID_ODID_ID_TYPE_SPECIFIC_SESSION_ID 4
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_NONE 0
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_AEROPLANE 1
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_HELICOPTER_OR_MULTIROTOR 2
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_GYROPLANE 3
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_HYBRID_LIFT 4
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_ORNITHOPTER 5
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_GLIDER 6
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_KITE 7
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_FREE_BALLOON 8
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_CAPTIVE_BALLOON 9
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_AIRSHIP 10
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_FREE_FALL_PARACHUTE 11
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_ROCKET 12
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_TETHERED_POWERED_AIRCRAFT 13
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_GROUND_OBSTACLE 14
-#define DRONECAN_REMOTEID_BASICID_ODID_UA_TYPE_OTHER 15
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-class dronecan_remoteid_BasicID_cxx_iface;
-#endif
-
-struct dronecan_remoteid_BasicID {
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-    using cxx_iface = dronecan_remoteid_BasicID_cxx_iface;
-#endif
-    struct { uint8_t len; uint8_t data[20]; }id_or_mac;
-    uint8_t id_type;
-    uint8_t ua_type;
-    struct { uint8_t len; uint8_t data[20]; }uas_id;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-uint32_t dronecan_remoteid_BasicID_encode(struct dronecan_remoteid_BasicID* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-);
-bool dronecan_remoteid_BasicID_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_BasicID* msg);
-
-#if defined(CANARD_DSDLC_INTERNAL)
-static inline void _dronecan_remoteid_BasicID_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_BasicID* msg, bool tao);
-static inline bool _dronecan_remoteid_BasicID_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_BasicID* msg, bool tao);
-void _dronecan_remoteid_BasicID_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_BasicID* msg, bool tao) {
-    (void)buffer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t id_or_mac_len = msg->id_or_mac.len > 20 ? 20 : msg->id_or_mac.len;
-#pragma GCC diagnostic pop
-    canardEncodeScalar(buffer, *bit_ofs, 5, &id_or_mac_len);
-    *bit_ofs += 5;
-    for (size_t i=0; i < id_or_mac_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->id_type);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->ua_type);
-    *bit_ofs += 8;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t uas_id_len = msg->uas_id.len > 20 ? 20 : msg->uas_id.len;
-#pragma GCC diagnostic pop
-    if (!tao) {
-        canardEncodeScalar(buffer, *bit_ofs, 5, &uas_id_len);
-        *bit_ofs += 5;
-    }
-    for (size_t i=0; i < uas_id_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->uas_id.data[i]);
-        *bit_ofs += 8;
-    }
-}
-
-/*
- decode dronecan_remoteid_BasicID, return true on failure, false on success
-*/
-bool _dronecan_remoteid_BasicID_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_BasicID* msg, bool tao) {
-    (void)transfer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-    canardDecodeScalar(transfer, *bit_ofs, 5, false, &msg->id_or_mac.len);
-    *bit_ofs += 5;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->id_or_mac.len > 20) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->id_or_mac.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->id_type);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->ua_type);
-    *bit_ofs += 8;
-
-    if (!tao) {
-        canardDecodeScalar(transfer, *bit_ofs, 5, false, &msg->uas_id.len);
-        *bit_ofs += 5;
-    } else {
-        msg->uas_id.len = ((transfer->payload_len*8)-*bit_ofs)/8;
-    }
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->uas_id.len > 20) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->uas_id.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->uas_id.data[i]);
-        *bit_ofs += 8;
-    }
-
-    return false; /* success */
-}
-#endif
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_BasicID sample_dronecan_remoteid_BasicID_msg(void);
-#endif
-#ifdef __cplusplus
-} // extern "C"
-
-#ifdef DRONECAN_CXX_WRAPPERS
-#include <canard/cxx_wrappers.h>
-BROADCAST_MESSAGE_CXX_IFACE(dronecan_remoteid_BasicID, DRONECAN_REMOTEID_BASICID_ID, DRONECAN_REMOTEID_BASICID_SIGNATURE, DRONECAN_REMOTEID_BASICID_MAX_SIZE);
-#endif
-#endif

+ 0 - 232
uav_can/user_inc/dronecan.remoteid.Location.h

@@ -1,232 +0,0 @@
-#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <canard.h>
-
-
-#define DRONECAN_REMOTEID_LOCATION_MAX_SIZE 58
-#define DRONECAN_REMOTEID_LOCATION_SIGNATURE (0xEAA3A2C5BCB14CAAULL)
-#define DRONECAN_REMOTEID_LOCATION_ID 20031
-
-#define DRONECAN_REMOTEID_LOCATION_ODID_STATUS_UNDECLARED 0
-#define DRONECAN_REMOTEID_LOCATION_ODID_STATUS_GROUND 1
-#define DRONECAN_REMOTEID_LOCATION_ODID_STATUS_AIRBORNE 2
-#define DRONECAN_REMOTEID_LOCATION_ODID_STATUS_EMERGENCY 3
-#define DRONECAN_REMOTEID_LOCATION_ODID_HEIGHT_REF_OVER_TAKEOFF 0
-#define DRONECAN_REMOTEID_LOCATION_ODID_HEIGHT_REF_OVER_GROUND 1
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_UNKNOWN 0
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_10NM 1
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_4NM 2
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_2NM 3
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_1NM 4
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_0_5NM 5
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_0_3NM 6
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_0_1NM 7
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_0_05NM 8
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_30_METER 9
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_10_METER 10
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_3_METER 11
-#define DRONECAN_REMOTEID_LOCATION_ODID_HOR_ACC_1_METER 12
-#define DRONECAN_REMOTEID_LOCATION_ODID_VER_ACC_UNKNOWN 0
-#define DRONECAN_REMOTEID_LOCATION_ODID_VER_ACC_150_METER 1
-#define DRONECAN_REMOTEID_LOCATION_ODID_VER_ACC_45_METER 2
-#define DRONECAN_REMOTEID_LOCATION_ODID_VER_ACC_25_METER 3
-#define DRONECAN_REMOTEID_LOCATION_ODID_VER_ACC_10_METER 4
-#define DRONECAN_REMOTEID_LOCATION_ODID_VER_ACC_3_METER 5
-#define DRONECAN_REMOTEID_LOCATION_ODID_VER_ACC_1_METER 6
-#define DRONECAN_REMOTEID_LOCATION_ODID_SPEED_ACC_UNKNOWN 0
-#define DRONECAN_REMOTEID_LOCATION_ODID_SPEED_ACC_10_METERS_PER_SECOND 1
-#define DRONECAN_REMOTEID_LOCATION_ODID_SPEED_ACC_3_METERS_PER_SECOND 2
-#define DRONECAN_REMOTEID_LOCATION_ODID_SPEED_ACC_1_METERS_PER_SECOND 3
-#define DRONECAN_REMOTEID_LOCATION_ODID_SPEED_ACC_0_3_METERS_PER_SECOND 4
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_0_1_SECOND 1
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_0_2_SECOND 2
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_0_3_SECOND 3
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_0_4_SECOND 4
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_0_5_SECOND 5
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_0_6_SECOND 6
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_0_7_SECOND 7
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_0_8_SECOND 8
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_0_9_SECOND 9
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_1_0_SECOND 10
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_1_1_SECOND 11
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_1_2_SECOND 12
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_1_3_SECOND 13
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_1_4_SECOND 14
-#define DRONECAN_REMOTEID_LOCATION_ODID_TIME_ACC_1_5_SECOND 15
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-class dronecan_remoteid_Location_cxx_iface;
-#endif
-
-struct dronecan_remoteid_Location {
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-    using cxx_iface = dronecan_remoteid_Location_cxx_iface;
-#endif
-    struct { uint8_t len; uint8_t data[20]; }id_or_mac;
-    uint8_t status;
-    uint16_t direction;
-    uint16_t speed_horizontal;
-    int16_t speed_vertical;
-    int32_t latitude;
-    int32_t longitude;
-    float altitude_barometric;
-    float altitude_geodetic;
-    uint8_t height_reference;
-    float height;
-    uint8_t horizontal_accuracy;
-    uint8_t vertical_accuracy;
-    uint8_t barometer_accuracy;
-    uint8_t speed_accuracy;
-    float timestamp;
-    uint8_t timestamp_accuracy;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-uint32_t dronecan_remoteid_Location_encode(struct dronecan_remoteid_Location* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-);
-bool dronecan_remoteid_Location_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_Location* msg);
-
-#if defined(CANARD_DSDLC_INTERNAL)
-static inline void _dronecan_remoteid_Location_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_Location* msg, bool tao);
-static inline bool _dronecan_remoteid_Location_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_Location* msg, bool tao);
-void _dronecan_remoteid_Location_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_Location* msg, bool tao) {
-    (void)buffer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t id_or_mac_len = msg->id_or_mac.len > 20 ? 20 : msg->id_or_mac.len;
-#pragma GCC diagnostic pop
-    canardEncodeScalar(buffer, *bit_ofs, 5, &id_or_mac_len);
-    *bit_ofs += 5;
-    for (size_t i=0; i < id_or_mac_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->status);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 16, &msg->direction);
-    *bit_ofs += 16;
-    canardEncodeScalar(buffer, *bit_ofs, 16, &msg->speed_horizontal);
-    *bit_ofs += 16;
-    canardEncodeScalar(buffer, *bit_ofs, 16, &msg->speed_vertical);
-    *bit_ofs += 16;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->latitude);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->longitude);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->altitude_barometric);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->altitude_geodetic);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->height_reference);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->height);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->horizontal_accuracy);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->vertical_accuracy);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->barometer_accuracy);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->speed_accuracy);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->timestamp);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->timestamp_accuracy);
-    *bit_ofs += 8;
-}
-
-/*
- decode dronecan_remoteid_Location, return true on failure, false on success
-*/
-bool _dronecan_remoteid_Location_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_Location* msg, bool tao) {
-    (void)transfer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-    canardDecodeScalar(transfer, *bit_ofs, 5, false, &msg->id_or_mac.len);
-    *bit_ofs += 5;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->id_or_mac.len > 20) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->id_or_mac.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->status);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 16, false, &msg->direction);
-    *bit_ofs += 16;
-
-    canardDecodeScalar(transfer, *bit_ofs, 16, false, &msg->speed_horizontal);
-    *bit_ofs += 16;
-
-    canardDecodeScalar(transfer, *bit_ofs, 16, true, &msg->speed_vertical);
-    *bit_ofs += 16;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->latitude);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->longitude);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->altitude_barometric);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->altitude_geodetic);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->height_reference);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->height);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->horizontal_accuracy);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->vertical_accuracy);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->barometer_accuracy);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->speed_accuracy);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->timestamp);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->timestamp_accuracy);
-    *bit_ofs += 8;
-
-    return false; /* success */
-}
-#endif
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_Location sample_dronecan_remoteid_Location_msg(void);
-#endif
-#ifdef __cplusplus
-} // extern "C"
-
-#ifdef DRONECAN_CXX_WRAPPERS
-#include <canard/cxx_wrappers.h>
-BROADCAST_MESSAGE_CXX_IFACE(dronecan_remoteid_Location, DRONECAN_REMOTEID_LOCATION_ID, DRONECAN_REMOTEID_LOCATION_SIGNATURE, DRONECAN_REMOTEID_LOCATION_MAX_SIZE);
-#endif
-#endif

+ 0 - 128
uav_can/user_inc/dronecan.remoteid.OperatorID.h

@@ -1,128 +0,0 @@
-#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <canard.h>
-
-
-#define DRONECAN_REMOTEID_OPERATORID_MAX_SIZE 43
-#define DRONECAN_REMOTEID_OPERATORID_SIGNATURE (0x581E7FC7F03AF935ULL)
-#define DRONECAN_REMOTEID_OPERATORID_ID 20034
-
-#define DRONECAN_REMOTEID_OPERATORID_ODID_OPERATOR_ID_TYPE_CAA 0
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-class dronecan_remoteid_OperatorID_cxx_iface;
-#endif
-
-struct dronecan_remoteid_OperatorID {
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-    using cxx_iface = dronecan_remoteid_OperatorID_cxx_iface;
-#endif
-    struct { uint8_t len; uint8_t data[20]; }id_or_mac;
-    uint8_t operator_id_type;
-    struct { uint8_t len; uint8_t data[20]; }operator_id;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-uint32_t dronecan_remoteid_OperatorID_encode(struct dronecan_remoteid_OperatorID* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-);
-bool dronecan_remoteid_OperatorID_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_OperatorID* msg);
-
-#if defined(CANARD_DSDLC_INTERNAL)
-static inline void _dronecan_remoteid_OperatorID_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_OperatorID* msg, bool tao);
-static inline bool _dronecan_remoteid_OperatorID_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_OperatorID* msg, bool tao);
-void _dronecan_remoteid_OperatorID_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_OperatorID* msg, bool tao) {
-    (void)buffer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t id_or_mac_len = msg->id_or_mac.len > 20 ? 20 : msg->id_or_mac.len;
-#pragma GCC diagnostic pop
-    canardEncodeScalar(buffer, *bit_ofs, 5, &id_or_mac_len);
-    *bit_ofs += 5;
-    for (size_t i=0; i < id_or_mac_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->operator_id_type);
-    *bit_ofs += 8;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t operator_id_len = msg->operator_id.len > 20 ? 20 : msg->operator_id.len;
-#pragma GCC diagnostic pop
-    if (!tao) {
-        canardEncodeScalar(buffer, *bit_ofs, 5, &operator_id_len);
-        *bit_ofs += 5;
-    }
-    for (size_t i=0; i < operator_id_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->operator_id.data[i]);
-        *bit_ofs += 8;
-    }
-}
-
-/*
- decode dronecan_remoteid_OperatorID, return true on failure, false on success
-*/
-bool _dronecan_remoteid_OperatorID_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_OperatorID* msg, bool tao) {
-    (void)transfer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-    canardDecodeScalar(transfer, *bit_ofs, 5, false, &msg->id_or_mac.len);
-    *bit_ofs += 5;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->id_or_mac.len > 20) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->id_or_mac.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->operator_id_type);
-    *bit_ofs += 8;
-
-    if (!tao) {
-        canardDecodeScalar(transfer, *bit_ofs, 5, false, &msg->operator_id.len);
-        *bit_ofs += 5;
-    } else {
-        msg->operator_id.len = ((transfer->payload_len*8)-*bit_ofs)/8;
-    }
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->operator_id.len > 20) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->operator_id.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->operator_id.data[i]);
-        *bit_ofs += 8;
-    }
-
-    return false; /* success */
-}
-#endif
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_OperatorID sample_dronecan_remoteid_OperatorID_msg(void);
-#endif
-#ifdef __cplusplus
-} // extern "C"
-
-#ifdef DRONECAN_CXX_WRAPPERS
-#include <canard/cxx_wrappers.h>
-BROADCAST_MESSAGE_CXX_IFACE(dronecan_remoteid_OperatorID, DRONECAN_REMOTEID_OPERATORID_ID, DRONECAN_REMOTEID_OPERATORID_SIGNATURE, DRONECAN_REMOTEID_OPERATORID_MAX_SIZE);
-#endif
-#endif

+ 0 - 11
uav_can/user_inc/dronecan.remoteid.SecureCommand.h

@@ -1,11 +0,0 @@
-#pragma once
-#include <dronecan.remoteid.SecureCommand_req.h>
-#include <dronecan.remoteid.SecureCommand_res.h>
-
-#define DRONECAN_REMOTEID_SECURECOMMAND_ID 64
-#define DRONECAN_REMOTEID_SECURECOMMAND_SIGNATURE (0x126A47C9C17A8BD7ULL)
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-#include <canard/cxx_wrappers.h>
-SERVICE_MESSAGE_CXX_IFACE(dronecan_remoteid_SecureCommand, DRONECAN_REMOTEID_SECURECOMMAND_ID, DRONECAN_REMOTEID_SECURECOMMAND_SIGNATURE, DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_MAX_SIZE, DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_MAX_SIZE);
-#endif

+ 0 - 121
uav_can/user_inc/dronecan.remoteid.SecureCommand_req.h

@@ -1,121 +0,0 @@
-#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <canard.h>
-
-
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_MAX_SIZE 230
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_SIGNATURE (0x126A47C9C17A8BD7ULL)
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_ID 64
-
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_SECURE_COMMAND_GET_SESSION_KEY 0
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_SECURE_COMMAND_GET_REMOTEID_SESSION_KEY 1
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_SECURE_COMMAND_REMOVE_PUBLIC_KEYS 2
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_SECURE_COMMAND_GET_PUBLIC_KEYS 3
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_SECURE_COMMAND_SET_PUBLIC_KEYS 4
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_SECURE_COMMAND_GET_REMOTEID_CONFIG 5
-#define DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_SECURE_COMMAND_SET_REMOTEID_CONFIG 6
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-class dronecan_remoteid_SecureCommand_cxx_iface;
-#endif
-
-struct dronecan_remoteid_SecureCommandRequest {
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-    using cxx_iface = dronecan_remoteid_SecureCommand_cxx_iface;
-#endif
-    uint32_t sequence;
-    uint32_t operation;
-    uint8_t sig_length;
-    struct { uint8_t len; uint8_t data[220]; }data;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-uint32_t dronecan_remoteid_SecureCommandRequest_encode(struct dronecan_remoteid_SecureCommandRequest* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-);
-bool dronecan_remoteid_SecureCommandRequest_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_SecureCommandRequest* msg);
-
-#if defined(CANARD_DSDLC_INTERNAL)
-static inline void _dronecan_remoteid_SecureCommandRequest_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_SecureCommandRequest* msg, bool tao);
-static inline bool _dronecan_remoteid_SecureCommandRequest_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_SecureCommandRequest* msg, bool tao);
-void _dronecan_remoteid_SecureCommandRequest_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_SecureCommandRequest* msg, bool tao) {
-    (void)buffer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->sequence);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->operation);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->sig_length);
-    *bit_ofs += 8;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t data_len = msg->data.len > 220 ? 220 : msg->data.len;
-#pragma GCC diagnostic pop
-    if (!tao) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &data_len);
-        *bit_ofs += 8;
-    }
-    for (size_t i=0; i < data_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->data.data[i]);
-        *bit_ofs += 8;
-    }
-}
-
-/*
- decode dronecan_remoteid_SecureCommandRequest, return true on failure, false on success
-*/
-bool _dronecan_remoteid_SecureCommandRequest_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_SecureCommandRequest* msg, bool tao) {
-    (void)transfer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-    canardDecodeScalar(transfer, *bit_ofs, 32, false, &msg->sequence);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, false, &msg->operation);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->sig_length);
-    *bit_ofs += 8;
-
-    if (!tao) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->data.len);
-        *bit_ofs += 8;
-    } else {
-        msg->data.len = ((transfer->payload_len*8)-*bit_ofs)/8;
-    }
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->data.len > 220) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->data.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->data.data[i]);
-        *bit_ofs += 8;
-    }
-
-    return false; /* success */
-}
-#endif
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_SecureCommandRequest sample_dronecan_remoteid_SecureCommandRequest_msg(void);
-#endif
-#ifdef __cplusplus
-} // extern "C"
-
-#ifdef DRONECAN_CXX_WRAPPERS
-#include <canard/cxx_wrappers.h>
-#endif
-#endif

+ 0 - 119
uav_can/user_inc/dronecan.remoteid.SecureCommand_res.h

@@ -1,119 +0,0 @@
-#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <canard.h>
-
-
-#define DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_MAX_SIZE 230
-#define DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_SIGNATURE (0x126A47C9C17A8BD7ULL)
-#define DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_ID 64
-
-#define DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_RESULT_ACCEPTED 0
-#define DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_RESULT_TEMPORARILY_REJECTED 1
-#define DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_RESULT_DENIED 2
-#define DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_RESULT_UNSUPPORTED 3
-#define DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_RESULT_FAILED 4
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-class dronecan_remoteid_SecureCommand_cxx_iface;
-#endif
-
-struct dronecan_remoteid_SecureCommandResponse {
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-    using cxx_iface = dronecan_remoteid_SecureCommand_cxx_iface;
-#endif
-    uint32_t sequence;
-    uint32_t operation;
-    uint8_t result;
-    struct { uint8_t len; uint8_t data[220]; }data;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-uint32_t dronecan_remoteid_SecureCommandResponse_encode(struct dronecan_remoteid_SecureCommandResponse* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-);
-bool dronecan_remoteid_SecureCommandResponse_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_SecureCommandResponse* msg);
-
-#if defined(CANARD_DSDLC_INTERNAL)
-static inline void _dronecan_remoteid_SecureCommandResponse_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_SecureCommandResponse* msg, bool tao);
-static inline bool _dronecan_remoteid_SecureCommandResponse_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_SecureCommandResponse* msg, bool tao);
-void _dronecan_remoteid_SecureCommandResponse_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_SecureCommandResponse* msg, bool tao) {
-    (void)buffer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->sequence);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->operation);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->result);
-    *bit_ofs += 8;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t data_len = msg->data.len > 220 ? 220 : msg->data.len;
-#pragma GCC diagnostic pop
-    if (!tao) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &data_len);
-        *bit_ofs += 8;
-    }
-    for (size_t i=0; i < data_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->data.data[i]);
-        *bit_ofs += 8;
-    }
-}
-
-/*
- decode dronecan_remoteid_SecureCommandResponse, return true on failure, false on success
-*/
-bool _dronecan_remoteid_SecureCommandResponse_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_SecureCommandResponse* msg, bool tao) {
-    (void)transfer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-    canardDecodeScalar(transfer, *bit_ofs, 32, false, &msg->sequence);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, false, &msg->operation);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->result);
-    *bit_ofs += 8;
-
-    if (!tao) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->data.len);
-        *bit_ofs += 8;
-    } else {
-        msg->data.len = ((transfer->payload_len*8)-*bit_ofs)/8;
-    }
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->data.len > 220) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->data.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->data.data[i]);
-        *bit_ofs += 8;
-    }
-
-    return false; /* success */
-}
-#endif
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_SecureCommandResponse sample_dronecan_remoteid_SecureCommandResponse_msg(void);
-#endif
-#ifdef __cplusplus
-} // extern "C"
-
-#ifdef DRONECAN_CXX_WRAPPERS
-#include <canard/cxx_wrappers.h>
-#endif
-#endif

+ 0 - 128
uav_can/user_inc/dronecan.remoteid.SelfID.h

@@ -1,128 +0,0 @@
-#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <canard.h>
-
-
-#define DRONECAN_REMOTEID_SELFID_MAX_SIZE 46
-#define DRONECAN_REMOTEID_SELFID_SIGNATURE (0x59BE81DC4C06A185ULL)
-#define DRONECAN_REMOTEID_SELFID_ID 20032
-
-#define DRONECAN_REMOTEID_SELFID_ODID_DESC_TYPE_TEXT 0
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-class dronecan_remoteid_SelfID_cxx_iface;
-#endif
-
-struct dronecan_remoteid_SelfID {
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-    using cxx_iface = dronecan_remoteid_SelfID_cxx_iface;
-#endif
-    struct { uint8_t len; uint8_t data[20]; }id_or_mac;
-    uint8_t description_type;
-    struct { uint8_t len; uint8_t data[23]; }description;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-uint32_t dronecan_remoteid_SelfID_encode(struct dronecan_remoteid_SelfID* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-);
-bool dronecan_remoteid_SelfID_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_SelfID* msg);
-
-#if defined(CANARD_DSDLC_INTERNAL)
-static inline void _dronecan_remoteid_SelfID_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_SelfID* msg, bool tao);
-static inline bool _dronecan_remoteid_SelfID_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_SelfID* msg, bool tao);
-void _dronecan_remoteid_SelfID_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_SelfID* msg, bool tao) {
-    (void)buffer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t id_or_mac_len = msg->id_or_mac.len > 20 ? 20 : msg->id_or_mac.len;
-#pragma GCC diagnostic pop
-    canardEncodeScalar(buffer, *bit_ofs, 5, &id_or_mac_len);
-    *bit_ofs += 5;
-    for (size_t i=0; i < id_or_mac_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->description_type);
-    *bit_ofs += 8;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t description_len = msg->description.len > 23 ? 23 : msg->description.len;
-#pragma GCC diagnostic pop
-    if (!tao) {
-        canardEncodeScalar(buffer, *bit_ofs, 5, &description_len);
-        *bit_ofs += 5;
-    }
-    for (size_t i=0; i < description_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->description.data[i]);
-        *bit_ofs += 8;
-    }
-}
-
-/*
- decode dronecan_remoteid_SelfID, return true on failure, false on success
-*/
-bool _dronecan_remoteid_SelfID_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_SelfID* msg, bool tao) {
-    (void)transfer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-    canardDecodeScalar(transfer, *bit_ofs, 5, false, &msg->id_or_mac.len);
-    *bit_ofs += 5;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->id_or_mac.len > 20) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->id_or_mac.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->description_type);
-    *bit_ofs += 8;
-
-    if (!tao) {
-        canardDecodeScalar(transfer, *bit_ofs, 5, false, &msg->description.len);
-        *bit_ofs += 5;
-    } else {
-        msg->description.len = ((transfer->payload_len*8)-*bit_ofs)/8;
-    }
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->description.len > 23) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->description.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->description.data[i]);
-        *bit_ofs += 8;
-    }
-
-    return false; /* success */
-}
-#endif
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_SelfID sample_dronecan_remoteid_SelfID_msg(void);
-#endif
-#ifdef __cplusplus
-} // extern "C"
-
-#ifdef DRONECAN_CXX_WRAPPERS
-#include <canard/cxx_wrappers.h>
-BROADCAST_MESSAGE_CXX_IFACE(dronecan_remoteid_SelfID, DRONECAN_REMOTEID_SELFID_ID, DRONECAN_REMOTEID_SELFID_SIGNATURE, DRONECAN_REMOTEID_SELFID_MAX_SIZE);
-#endif
-#endif

+ 0 - 178
uav_can/user_inc/dronecan.remoteid.System.h

@@ -1,178 +0,0 @@
-#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <canard.h>
-
-
-#define DRONECAN_REMOTEID_SYSTEM_MAX_SIZE 53
-#define DRONECAN_REMOTEID_SYSTEM_SIGNATURE (0x9AC872F49BF32437ULL)
-#define DRONECAN_REMOTEID_SYSTEM_ID 20033
-
-#define DRONECAN_REMOTEID_SYSTEM_ODID_OPERATOR_LOCATION_TYPE_TAKEOFF 0
-#define DRONECAN_REMOTEID_SYSTEM_ODID_OPERATOR_LOCATION_TYPE_LIVE_GNSS 1
-#define DRONECAN_REMOTEID_SYSTEM_ODID_OPERATOR_LOCATION_TYPE_FIXED 2
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CLASSIFICATION_TYPE_EU 0
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CATEGORY_EU_UNDECLARED 0
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CATEGORY_EU_OPEN 1
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CATEGORY_EU_SPECIFIC 2
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CATEGORY_EU_CERTIFIED 3
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CLASS_EU_UNDECLARED 0
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CLASS_EU_CLASS_0 1
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CLASS_EU_CLASS_1 2
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CLASS_EU_CLASS_2 3
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CLASS_EU_CLASS_3 4
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CLASS_EU_CLASS_4 5
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CLASS_EU_CLASS_5 6
-#define DRONECAN_REMOTEID_SYSTEM_ODID_CLASS_EU_CLASS_6 7
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-class dronecan_remoteid_System_cxx_iface;
-#endif
-
-struct dronecan_remoteid_System {
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-    using cxx_iface = dronecan_remoteid_System_cxx_iface;
-#endif
-    struct { uint8_t len; uint8_t data[20]; }id_or_mac;
-    uint8_t operator_location_type;
-    uint8_t classification_type;
-    int32_t operator_latitude;
-    int32_t operator_longitude;
-    uint16_t area_count;
-    uint16_t area_radius;
-    float area_ceiling;
-    float area_floor;
-    uint8_t category_eu;
-    uint8_t class_eu;
-    float operator_altitude_geo;
-    uint32_t timestamp;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-uint32_t dronecan_remoteid_System_encode(struct dronecan_remoteid_System* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-);
-bool dronecan_remoteid_System_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_System* msg);
-
-#if defined(CANARD_DSDLC_INTERNAL)
-static inline void _dronecan_remoteid_System_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_System* msg, bool tao);
-static inline bool _dronecan_remoteid_System_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_System* msg, bool tao);
-void _dronecan_remoteid_System_encode(uint8_t* buffer, uint32_t* bit_ofs, struct dronecan_remoteid_System* msg, bool tao) {
-    (void)buffer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    const uint8_t id_or_mac_len = msg->id_or_mac.len > 20 ? 20 : msg->id_or_mac.len;
-#pragma GCC diagnostic pop
-    canardEncodeScalar(buffer, *bit_ofs, 5, &id_or_mac_len);
-    *bit_ofs += 5;
-    for (size_t i=0; i < id_or_mac_len; i++) {
-        canardEncodeScalar(buffer, *bit_ofs, 8, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->operator_location_type);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->classification_type);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->operator_latitude);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->operator_longitude);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 16, &msg->area_count);
-    *bit_ofs += 16;
-    canardEncodeScalar(buffer, *bit_ofs, 16, &msg->area_radius);
-    *bit_ofs += 16;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->area_ceiling);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->area_floor);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->category_eu);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 8, &msg->class_eu);
-    *bit_ofs += 8;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->operator_altitude_geo);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->timestamp);
-    *bit_ofs += 32;
-}
-
-/*
- decode dronecan_remoteid_System, return true on failure, false on success
-*/
-bool _dronecan_remoteid_System_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct dronecan_remoteid_System* msg, bool tao) {
-    (void)transfer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-    canardDecodeScalar(transfer, *bit_ofs, 5, false, &msg->id_or_mac.len);
-    *bit_ofs += 5;
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wtype-limits"
-    if (msg->id_or_mac.len > 20) {
-        return true; /* invalid value */
-    }
-#pragma GCC diagnostic pop
-    for (size_t i=0; i < msg->id_or_mac.len; i++) {
-        canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->id_or_mac.data[i]);
-        *bit_ofs += 8;
-    }
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->operator_location_type);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->classification_type);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->operator_latitude);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->operator_longitude);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 16, false, &msg->area_count);
-    *bit_ofs += 16;
-
-    canardDecodeScalar(transfer, *bit_ofs, 16, false, &msg->area_radius);
-    *bit_ofs += 16;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->area_ceiling);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->area_floor);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->category_eu);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 8, false, &msg->class_eu);
-    *bit_ofs += 8;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, true, &msg->operator_altitude_geo);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 32, false, &msg->timestamp);
-    *bit_ofs += 32;
-
-    return false; /* success */
-}
-#endif
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_System sample_dronecan_remoteid_System_msg(void);
-#endif
-#ifdef __cplusplus
-} // extern "C"
-
-#ifdef DRONECAN_CXX_WRAPPERS
-#include <canard/cxx_wrappers.h>
-BROADCAST_MESSAGE_CXX_IFACE(dronecan_remoteid_System, DRONECAN_REMOTEID_SYSTEM_ID, DRONECAN_REMOTEID_SYSTEM_SIGNATURE, DRONECAN_REMOTEID_SYSTEM_MAX_SIZE);
-#endif
-#endif

+ 0 - 8
uav_can/user_inc/dronecan_msgs.h

@@ -1,8 +0,0 @@
-#pragma once
-#include "remoteid.ArmStatus.h"
-#include "remoteid.BasicID.h"
-#include "remoteid.Location.h"
-#include "remoteid.OperatorID.h"
-#include "remoteid.SecureCommand.h"
-#include "remoteid.SelfID.h"
-#include "remoteid.System.h"

+ 0 - 108
uav_can/user_inc/uavcan.protocol.NodeStatus.h

@@ -1,108 +0,0 @@
-#pragma once
-#include <stdbool.h>
-#include <stdint.h>
-#include <canard.h>
-
-
-#define UAVCAN_PROTOCOL_NODESTATUS_MAX_SIZE 7
-#define UAVCAN_PROTOCOL_NODESTATUS_SIGNATURE (0xF0868D0C1A7C6F1ULL)
-#define UAVCAN_PROTOCOL_NODESTATUS_ID 341
-
-#define UAVCAN_PROTOCOL_NODESTATUS_MAX_BROADCASTING_PERIOD_MS 1000
-#define UAVCAN_PROTOCOL_NODESTATUS_MIN_BROADCASTING_PERIOD_MS 2
-#define UAVCAN_PROTOCOL_NODESTATUS_OFFLINE_TIMEOUT_MS 3000
-#define UAVCAN_PROTOCOL_NODESTATUS_HEALTH_OK 0
-#define UAVCAN_PROTOCOL_NODESTATUS_HEALTH_WARNING 1
-#define UAVCAN_PROTOCOL_NODESTATUS_HEALTH_ERROR 2
-#define UAVCAN_PROTOCOL_NODESTATUS_HEALTH_CRITICAL 3
-#define UAVCAN_PROTOCOL_NODESTATUS_MODE_OPERATIONAL 0
-#define UAVCAN_PROTOCOL_NODESTATUS_MODE_INITIALIZATION 1
-#define UAVCAN_PROTOCOL_NODESTATUS_MODE_MAINTENANCE 2
-#define UAVCAN_PROTOCOL_NODESTATUS_MODE_SOFTWARE_UPDATE 3
-#define UAVCAN_PROTOCOL_NODESTATUS_MODE_OFFLINE 7
-
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-class uavcan_protocol_NodeStatus_cxx_iface;
-#endif
-
-struct uavcan_protocol_NodeStatus {
-#if defined(__cplusplus) && defined(DRONECAN_CXX_WRAPPERS)
-    using cxx_iface = uavcan_protocol_NodeStatus_cxx_iface;
-#endif
-    uint32_t uptime_sec;
-    uint8_t health;
-    uint8_t mode;
-    uint8_t sub_mode;
-    uint16_t vendor_specific_status_code;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-uint32_t uavcan_protocol_NodeStatus_encode(struct uavcan_protocol_NodeStatus* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-);
-bool uavcan_protocol_NodeStatus_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_NodeStatus* msg);
-
-#if defined(CANARD_DSDLC_INTERNAL)
-static inline void _uavcan_protocol_NodeStatus_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_NodeStatus* msg, bool tao);
-static inline bool _uavcan_protocol_NodeStatus_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_NodeStatus* msg, bool tao);
-void _uavcan_protocol_NodeStatus_encode(uint8_t* buffer, uint32_t* bit_ofs, struct uavcan_protocol_NodeStatus* msg, bool tao) {
-    (void)buffer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-
-    canardEncodeScalar(buffer, *bit_ofs, 32, &msg->uptime_sec);
-    *bit_ofs += 32;
-    canardEncodeScalar(buffer, *bit_ofs, 2, &msg->health);
-    *bit_ofs += 2;
-    canardEncodeScalar(buffer, *bit_ofs, 3, &msg->mode);
-    *bit_ofs += 3;
-    canardEncodeScalar(buffer, *bit_ofs, 3, &msg->sub_mode);
-    *bit_ofs += 3;
-    canardEncodeScalar(buffer, *bit_ofs, 16, &msg->vendor_specific_status_code);
-    *bit_ofs += 16;
-}
-
-/*
- decode uavcan_protocol_NodeStatus, return true on failure, false on success
-*/
-bool _uavcan_protocol_NodeStatus_decode(const CanardRxTransfer* transfer, uint32_t* bit_ofs, struct uavcan_protocol_NodeStatus* msg, bool tao) {
-    (void)transfer;
-    (void)bit_ofs;
-    (void)msg;
-    (void)tao;
-    canardDecodeScalar(transfer, *bit_ofs, 32, false, &msg->uptime_sec);
-    *bit_ofs += 32;
-
-    canardDecodeScalar(transfer, *bit_ofs, 2, false, &msg->health);
-    *bit_ofs += 2;
-
-    canardDecodeScalar(transfer, *bit_ofs, 3, false, &msg->mode);
-    *bit_ofs += 3;
-
-    canardDecodeScalar(transfer, *bit_ofs, 3, false, &msg->sub_mode);
-    *bit_ofs += 3;
-
-    canardDecodeScalar(transfer, *bit_ofs, 16, false, &msg->vendor_specific_status_code);
-    *bit_ofs += 16;
-
-    return false; /* success */
-}
-#endif
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct uavcan_protocol_NodeStatus sample_uavcan_protocol_NodeStatus_msg(void);
-#endif
-#ifdef __cplusplus
-} // extern "C"
-
-#ifdef DRONECAN_CXX_WRAPPERS
-#include <canard/cxx_wrappers.h>
-BROADCAST_MESSAGE_CXX_IFACE(uavcan_protocol_NodeStatus, UAVCAN_PROTOCOL_NODESTATUS_ID, UAVCAN_PROTOCOL_NODESTATUS_SIGNATURE, UAVCAN_PROTOCOL_NODESTATUS_MAX_SIZE);
-#endif
-#endif

+ 0 - 121
uav_can/user_inc/user_rid.h

@@ -1,121 +0,0 @@
-#ifndef _USER_RID_H
-#define _USER_RID_H
-
-#include "stdint.h"
-#include "stdbool.h"
-#include "common.h"
-#include "canard.h"
-void send_msg_to_remoteid(void);
-
-enum Remoteid_type
-{
-    LOCATION_TYPE = 1,
-    SYS_OPERATOR_TYPE = 2,
-    BASICID_TYPE = 3,
-    SELFID_TYPE = 4,
-    OPERATOR_TYPE = 5,
-    ARMSTATUS_TYPE = 6,
-
-    RID_TYPE_END,
-};
-
-bool remoteid_shouldAcceptTransfer(const CanardInstance *ins,
-                                           uint64_t *out_data_type_signature,
-                                           uint16_t data_type_id,
-                                           CanardTransferType transfer_type,
-                                           uint8_t source_node_id);
-int remoteid_OnRecieved(CanardInstance *canardIns,
-                                CanardRxTransfer *transfer);
-extern Connect_check remoteid_link;
-//remoteid
-#pragma pack(1)
-typedef struct{
- int32_t latitude; /*< [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).*/
- int32_t longitude; /*< [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).*/
- float altitude_barometric; /*< [m] The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.*/
- float altitude_geodetic; /*< [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.*/
- float height; /*< [m] The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m.*/
- float timestamp; /*< [s] Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF.*/
- uint16_t direction; /*< [cdeg] Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees.*/
- uint16_t speed_horizontal; /*< [cm/s] Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.*/
- int16_t speed_vertical; /*< [cm/s] The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s.*/
- uint8_t target_system; /*<  System ID (0 for broadcast).*/
- uint8_t target_component; /*<  Component ID (0 for broadcast).*/
- uint8_t id_or_mac[20]; /*<  Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. */
- uint8_t status; /*<  Indicates whether the unmanned aircraft is on the ground or in the air.*/
- uint8_t height_reference; /*<  Indicates the reference point for the height field.*/
- uint8_t horizontal_accuracy; /*<  The accuracy of the horizontal position.*/
- uint8_t vertical_accuracy; /*<  The accuracy of the vertical position.*/
- uint8_t barometer_accuracy; /*<  The accuracy of the barometric altitude.*/
- uint8_t speed_accuracy; /*<  The accuracy of the horizontal and vertical speed.*/
- uint8_t timestamp_accuracy; /*<  The accuracy of the timestamps.*/
-} _location_msg;
-#pragma pack()
-extern _location_msg locationId;
-
-#pragma pack(1)
-typedef struct{
- int32_t operator_latitude; /*< [degE7] Latitude of the operator. If unknown: 0 (both Lat/Lon).*/
- int32_t operator_longitude; /*< [degE7] Longitude of the operator. If unknown: 0 (both Lat/Lon).*/
- float area_ceiling; /*< [m] Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.*/
- float area_floor; /*< [m] Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.*/
- float operator_altitude_geo; /*< [m] Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m.*/
- uint32_t timestamp; /*< [s] 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.*/
- uint16_t area_count; /*<  Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA.*/
- uint16_t area_radius; /*< [m] Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA.*/
- uint8_t target_system; /*<  System ID (0 for broadcast).*/
- uint8_t target_component; /*<  Component ID (0 for broadcast).*/
- uint8_t id_or_mac[20]; /*<  Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. */
- uint8_t operator_location_type; /*<  Specifies the operator location type.*/
- uint8_t classification_type; /*<  Specifies the classification type of the UA.*/
- uint8_t category_eu; /*<  When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA.*/
- uint8_t class_eu; /*<  When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA.*/
-} _sys_operator_msg;
-#pragma pack()
-extern _sys_operator_msg systemId;
-
-#pragma pack(1)
-typedef struct  {
- uint8_t target_system; /*<  System ID (0 for broadcast).*/
- uint8_t target_component; /*<  Component ID (0 for broadcast).*/
- uint8_t id_or_mac[20]; /*<  Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. */
- uint8_t id_type; /*<  Indicates the format for the uas_id field of this message.*/
- uint8_t ua_type; /*<  Indicates the type of UA (Unmanned Aircraft).*/
- uint8_t uas_id[20]; /*<  UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.*/
-} _basicId_msg;
-#pragma pack()
-extern _basicId_msg basicId;
-
-
-#pragma pack(1)
-typedef struct{
- uint8_t target_system; /*<  System ID (0 for broadcast).*/
- uint8_t target_component; /*<  Component ID (0 for broadcast).*/
- uint8_t id_or_mac[20]; /*<  Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. */
- uint8_t description_type; /*<  Indicates the type of the description field.*/
- char description[23]; /*<  Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field.*/
-} _selfId_msg;
-#pragma pack()
-extern _selfId_msg selfId;
-
-#pragma pack(1)
-typedef struct{
- uint8_t target_system; /*<  System ID (0 for broadcast).*/
- uint8_t target_component; /*<  Component ID (0 for broadcast).*/
- uint8_t id_or_mac[20]; /*<  Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. */
- uint8_t operator_id_type; /*<  Indicates the type of the operator_id field.*/
- char operator_id[20]; /*<  Text description or numeric value expressed as ASCII characters. Shall be filled with nulls in the unused portion of the field.*/
-} _operatorId_msg;
-#pragma pack()
-extern _operatorId_msg operatorId;
-
-#pragma pack(1)
-typedef struct{
- uint8_t status;
- uint8_t len; 
- uint8_t data[50];
-} _armStatusID_msg;
-#pragma pack()
-extern _armStatusID_msg StatusId;
-
-#endif

+ 1 - 1
uav_can/user_src/dronecan.c

@@ -237,7 +237,7 @@ void dronecan_init(void) {
  * @param tx_transfer 发送消息对象
  * @return int 发送到 canard 发送队列的消息计数
  */
-int dronecan_broadcast(CanardTxTransfer *tx_transfer) {
+int dronecan_broadcast(struct dronecan *dcan, CanardTxTransfer *tx_transfer) {
   int ret = 0;
 
   if (dronecan_lock_status == UNLOCK) {

+ 0 - 68
uav_can/user_src/dronecan.remoteid.ArmStatus.c

@@ -1,68 +0,0 @@
-#define CANARD_DSDLC_INTERNAL
-#include <dronecan.remoteid.ArmStatus.h>
-#include <string.h>
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-#include <test_helpers.h>
-#endif
-
-uint32_t dronecan_remoteid_ArmStatus_encode(struct dronecan_remoteid_ArmStatus* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-) {
-    uint32_t bit_ofs = 0;
-    memset(buffer, 0, DRONECAN_REMOTEID_ARMSTATUS_MAX_SIZE);
-    _dronecan_remoteid_ArmStatus_encode(buffer, &bit_ofs, msg, 
-#if CANARD_ENABLE_TAO_OPTION
-    tao
-#else
-    true
-#endif
-    );
-    return ((bit_ofs+7)/8);
-}
-
-/*
-  return true if the decode is invalid
- */
-bool dronecan_remoteid_ArmStatus_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_ArmStatus* msg) {
-#if CANARD_ENABLE_TAO_OPTION
-    if (transfer->tao && (transfer->payload_len > DRONECAN_REMOTEID_ARMSTATUS_MAX_SIZE)) {
-        return true; /* invalid payload length */
-    }
-#endif
-    uint32_t bit_ofs = 0;
-    if (_dronecan_remoteid_ArmStatus_decode(transfer, &bit_ofs, msg,
-#if CANARD_ENABLE_TAO_OPTION
-    transfer->tao
-#else
-    true
-#endif
-    )) {
-        return true; /* invalid payload */
-    }
-
-    const uint32_t byte_len = (bit_ofs+7U)/8U;
-#if CANARD_ENABLE_TAO_OPTION
-    // if this could be CANFD then the dlc could indicating more bytes than
-    // we actually have
-    if (!transfer->tao) {
-        return byte_len > transfer->payload_len;
-    }
-#endif
-    return byte_len != transfer->payload_len;
-}
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_ArmStatus sample_dronecan_remoteid_ArmStatus_msg(void) {
-    struct dronecan_remoteid_ArmStatus msg;
-
-    msg.status = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.error.len = (uint8_t)random_range_unsigned_val(0, 50);
-    for (size_t i=0; i < msg.error.len; i++) {
-        msg.error.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    return msg;
-}
-#endif

+ 0 - 73
uav_can/user_src/dronecan.remoteid.BasicID.c

@@ -1,73 +0,0 @@
-#define CANARD_DSDLC_INTERNAL
-#include <dronecan.remoteid.BasicID.h>
-#include <string.h>
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-#include <test_helpers.h>
-#endif
-
-uint32_t dronecan_remoteid_BasicID_encode(struct dronecan_remoteid_BasicID* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-) {
-    uint32_t bit_ofs = 0;
-    memset(buffer, 0, DRONECAN_REMOTEID_BASICID_MAX_SIZE);
-    _dronecan_remoteid_BasicID_encode(buffer, &bit_ofs, msg, 
-#if CANARD_ENABLE_TAO_OPTION
-    tao
-#else
-    true
-#endif
-    );
-    return ((bit_ofs+7)/8);
-}
-
-/*
-  return true if the decode is invalid
- */
-bool dronecan_remoteid_BasicID_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_BasicID* msg) {
-#if CANARD_ENABLE_TAO_OPTION
-    if (transfer->tao && (transfer->payload_len > DRONECAN_REMOTEID_BASICID_MAX_SIZE)) {
-        return true; /* invalid payload length */
-    }
-#endif
-    uint32_t bit_ofs = 0;
-    if (_dronecan_remoteid_BasicID_decode(transfer, &bit_ofs, msg,
-#if CANARD_ENABLE_TAO_OPTION
-    transfer->tao
-#else
-    true
-#endif
-    )) {
-        return true; /* invalid payload */
-    }
-
-    const uint32_t byte_len = (bit_ofs+7U)/8U;
-#if CANARD_ENABLE_TAO_OPTION
-    // if this could be CANFD then the dlc could indicating more bytes than
-    // we actually have
-    if (!transfer->tao) {
-        return byte_len > transfer->payload_len;
-    }
-#endif
-    return byte_len != transfer->payload_len;
-}
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_BasicID sample_dronecan_remoteid_BasicID_msg(void) {
-    struct dronecan_remoteid_BasicID msg;
-
-    msg.id_or_mac.len = (uint8_t)random_range_unsigned_val(0, 20);
-    for (size_t i=0; i < msg.id_or_mac.len; i++) {
-        msg.id_or_mac.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    msg.id_type = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.ua_type = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.uas_id.len = (uint8_t)random_range_unsigned_val(0, 20);
-    for (size_t i=0; i < msg.uas_id.len; i++) {
-        msg.uas_id.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    return msg;
-}
-#endif

+ 0 - 83
uav_can/user_src/dronecan.remoteid.Location.c

@@ -1,83 +0,0 @@
-#define CANARD_DSDLC_INTERNAL
-#include <dronecan.remoteid.Location.h>
-#include <string.h>
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-#include <test_helpers.h>
-#endif
-
-uint32_t dronecan_remoteid_Location_encode(struct dronecan_remoteid_Location* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-) {
-    uint32_t bit_ofs = 0;
-    memset(buffer, 0, DRONECAN_REMOTEID_LOCATION_MAX_SIZE);
-    _dronecan_remoteid_Location_encode(buffer, &bit_ofs, msg, 
-#if CANARD_ENABLE_TAO_OPTION
-    tao
-#else
-    true
-#endif
-    );
-    return ((bit_ofs+7)/8);
-}
-
-/*
-  return true if the decode is invalid
- */
-bool dronecan_remoteid_Location_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_Location* msg) {
-#if CANARD_ENABLE_TAO_OPTION
-    if (transfer->tao && (transfer->payload_len > DRONECAN_REMOTEID_LOCATION_MAX_SIZE)) {
-        return true; /* invalid payload length */
-    }
-#endif
-    uint32_t bit_ofs = 0;
-    if (_dronecan_remoteid_Location_decode(transfer, &bit_ofs, msg,
-#if CANARD_ENABLE_TAO_OPTION
-    transfer->tao
-#else
-    true
-#endif
-    )) {
-        return true; /* invalid payload */
-    }
-
-    const uint32_t byte_len = (bit_ofs+7U)/8U;
-#if CANARD_ENABLE_TAO_OPTION
-    // if this could be CANFD then the dlc could indicating more bytes than
-    // we actually have
-    if (!transfer->tao) {
-        return byte_len > transfer->payload_len;
-    }
-#endif
-    return byte_len != transfer->payload_len;
-}
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_Location sample_dronecan_remoteid_Location_msg(void) {
-    struct dronecan_remoteid_Location msg;
-
-    msg.id_or_mac.len = (uint8_t)random_range_unsigned_val(0, 20);
-    for (size_t i=0; i < msg.id_or_mac.len; i++) {
-        msg.id_or_mac.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    msg.status = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.direction = (uint16_t)random_bitlen_unsigned_val(16);
-    msg.speed_horizontal = (uint16_t)random_bitlen_unsigned_val(16);
-    msg.speed_vertical = (int16_t)random_bitlen_signed_val(16);
-    msg.latitude = (int32_t)random_bitlen_signed_val(32);
-    msg.longitude = (int32_t)random_bitlen_signed_val(32);
-    msg.altitude_barometric = random_float_val();
-    msg.altitude_geodetic = random_float_val();
-    msg.height_reference = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.height = random_float_val();
-    msg.horizontal_accuracy = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.vertical_accuracy = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.barometer_accuracy = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.speed_accuracy = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.timestamp = random_float_val();
-    msg.timestamp_accuracy = (uint8_t)random_bitlen_unsigned_val(8);
-    return msg;
-}
-#endif

+ 0 - 72
uav_can/user_src/dronecan.remoteid.OperatorID.c

@@ -1,72 +0,0 @@
-#define CANARD_DSDLC_INTERNAL
-#include <dronecan.remoteid.OperatorID.h>
-#include <string.h>
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-#include <test_helpers.h>
-#endif
-
-uint32_t dronecan_remoteid_OperatorID_encode(struct dronecan_remoteid_OperatorID* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-) {
-    uint32_t bit_ofs = 0;
-    memset(buffer, 0, DRONECAN_REMOTEID_OPERATORID_MAX_SIZE);
-    _dronecan_remoteid_OperatorID_encode(buffer, &bit_ofs, msg, 
-#if CANARD_ENABLE_TAO_OPTION
-    tao
-#else
-    true
-#endif
-    );
-    return ((bit_ofs+7)/8);
-}
-
-/*
-  return true if the decode is invalid
- */
-bool dronecan_remoteid_OperatorID_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_OperatorID* msg) {
-#if CANARD_ENABLE_TAO_OPTION
-    if (transfer->tao && (transfer->payload_len > DRONECAN_REMOTEID_OPERATORID_MAX_SIZE)) {
-        return true; /* invalid payload length */
-    }
-#endif
-    uint32_t bit_ofs = 0;
-    if (_dronecan_remoteid_OperatorID_decode(transfer, &bit_ofs, msg,
-#if CANARD_ENABLE_TAO_OPTION
-    transfer->tao
-#else
-    true
-#endif
-    )) {
-        return true; /* invalid payload */
-    }
-
-    const uint32_t byte_len = (bit_ofs+7U)/8U;
-#if CANARD_ENABLE_TAO_OPTION
-    // if this could be CANFD then the dlc could indicating more bytes than
-    // we actually have
-    if (!transfer->tao) {
-        return byte_len > transfer->payload_len;
-    }
-#endif
-    return byte_len != transfer->payload_len;
-}
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_OperatorID sample_dronecan_remoteid_OperatorID_msg(void) {
-    struct dronecan_remoteid_OperatorID msg;
-
-    msg.id_or_mac.len = (uint8_t)random_range_unsigned_val(0, 20);
-    for (size_t i=0; i < msg.id_or_mac.len; i++) {
-        msg.id_or_mac.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    msg.operator_id_type = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.operator_id.len = (uint8_t)random_range_unsigned_val(0, 20);
-    for (size_t i=0; i < msg.operator_id.len; i++) {
-        msg.operator_id.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    return msg;
-}
-#endif

+ 0 - 71
uav_can/user_src/dronecan.remoteid.SecureCommand_req.c

@@ -1,71 +0,0 @@
-#define CANARD_DSDLC_INTERNAL
-#include <dronecan.remoteid.SecureCommand_req.h>
-#include <dronecan.remoteid.SecureCommand_res.h>
-#include <string.h>
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-#include <test_helpers.h>
-#endif
-
-uint32_t dronecan_remoteid_SecureCommandRequest_encode(struct dronecan_remoteid_SecureCommandRequest* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-) {
-    uint32_t bit_ofs = 0;
-    memset(buffer, 0, DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_MAX_SIZE);
-    _dronecan_remoteid_SecureCommandRequest_encode(buffer, &bit_ofs, msg, 
-#if CANARD_ENABLE_TAO_OPTION
-    tao
-#else
-    true
-#endif
-    );
-    return ((bit_ofs+7)/8);
-}
-
-/*
-  return true if the decode is invalid
- */
-bool dronecan_remoteid_SecureCommandRequest_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_SecureCommandRequest* msg) {
-#if CANARD_ENABLE_TAO_OPTION
-    if (transfer->tao && (transfer->payload_len > DRONECAN_REMOTEID_SECURECOMMAND_REQUEST_MAX_SIZE)) {
-        return true; /* invalid payload length */
-    }
-#endif
-    uint32_t bit_ofs = 0;
-    if (_dronecan_remoteid_SecureCommandRequest_decode(transfer, &bit_ofs, msg,
-#if CANARD_ENABLE_TAO_OPTION
-    transfer->tao
-#else
-    true
-#endif
-    )) {
-        return true; /* invalid payload */
-    }
-
-    const uint32_t byte_len = (bit_ofs+7U)/8U;
-#if CANARD_ENABLE_TAO_OPTION
-    // if this could be CANFD then the dlc could indicating more bytes than
-    // we actually have
-    if (!transfer->tao) {
-        return byte_len > transfer->payload_len;
-    }
-#endif
-    return byte_len != transfer->payload_len;
-}
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_SecureCommandRequest sample_dronecan_remoteid_SecureCommandRequest_msg(void) {
-    struct dronecan_remoteid_SecureCommandRequest msg;
-
-    msg.sequence = (uint32_t)random_bitlen_unsigned_val(32);
-    msg.operation = (uint32_t)random_bitlen_unsigned_val(32);
-    msg.sig_length = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.data.len = (uint8_t)random_range_unsigned_val(0, 220);
-    for (size_t i=0; i < msg.data.len; i++) {
-        msg.data.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    return msg;
-}
-#endif

+ 0 - 70
uav_can/user_src/dronecan.remoteid.SecureCommand_res.c

@@ -1,70 +0,0 @@
-#define CANARD_DSDLC_INTERNAL
-#include <dronecan.remoteid.SecureCommand_res.h>
-#include <string.h>
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-#include <test_helpers.h>
-#endif
-
-uint32_t dronecan_remoteid_SecureCommandResponse_encode(struct dronecan_remoteid_SecureCommandResponse* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-) {
-    uint32_t bit_ofs = 0;
-    memset(buffer, 0, DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_MAX_SIZE);
-    _dronecan_remoteid_SecureCommandResponse_encode(buffer, &bit_ofs, msg, 
-#if CANARD_ENABLE_TAO_OPTION
-    tao
-#else
-    true
-#endif
-    );
-    return ((bit_ofs+7)/8);
-}
-
-/*
-  return true if the decode is invalid
- */
-bool dronecan_remoteid_SecureCommandResponse_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_SecureCommandResponse* msg) {
-#if CANARD_ENABLE_TAO_OPTION
-    if (transfer->tao && (transfer->payload_len > DRONECAN_REMOTEID_SECURECOMMAND_RESPONSE_MAX_SIZE)) {
-        return true; /* invalid payload length */
-    }
-#endif
-    uint32_t bit_ofs = 0;
-    if (_dronecan_remoteid_SecureCommandResponse_decode(transfer, &bit_ofs, msg,
-#if CANARD_ENABLE_TAO_OPTION
-    transfer->tao
-#else
-    true
-#endif
-    )) {
-        return true; /* invalid payload */
-    }
-
-    const uint32_t byte_len = (bit_ofs+7U)/8U;
-#if CANARD_ENABLE_TAO_OPTION
-    // if this could be CANFD then the dlc could indicating more bytes than
-    // we actually have
-    if (!transfer->tao) {
-        return byte_len > transfer->payload_len;
-    }
-#endif
-    return byte_len != transfer->payload_len;
-}
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_SecureCommandResponse sample_dronecan_remoteid_SecureCommandResponse_msg(void) {
-    struct dronecan_remoteid_SecureCommandResponse msg;
-
-    msg.sequence = (uint32_t)random_bitlen_unsigned_val(32);
-    msg.operation = (uint32_t)random_bitlen_unsigned_val(32);
-    msg.result = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.data.len = (uint8_t)random_range_unsigned_val(0, 220);
-    for (size_t i=0; i < msg.data.len; i++) {
-        msg.data.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    return msg;
-}
-#endif

+ 0 - 72
uav_can/user_src/dronecan.remoteid.SelfID.c

@@ -1,72 +0,0 @@
-#define CANARD_DSDLC_INTERNAL
-#include <dronecan.remoteid.SelfID.h>
-#include <string.h>
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-#include <test_helpers.h>
-#endif
-
-uint32_t dronecan_remoteid_SelfID_encode(struct dronecan_remoteid_SelfID* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-) {
-    uint32_t bit_ofs = 0;
-    memset(buffer, 0, DRONECAN_REMOTEID_SELFID_MAX_SIZE);
-    _dronecan_remoteid_SelfID_encode(buffer, &bit_ofs, msg, 
-#if CANARD_ENABLE_TAO_OPTION
-    tao
-#else
-    true
-#endif
-    );
-    return ((bit_ofs+7)/8);
-}
-
-/*
-  return true if the decode is invalid
- */
-bool dronecan_remoteid_SelfID_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_SelfID* msg) {
-#if CANARD_ENABLE_TAO_OPTION
-    if (transfer->tao && (transfer->payload_len > DRONECAN_REMOTEID_SELFID_MAX_SIZE)) {
-        return true; /* invalid payload length */
-    }
-#endif
-    uint32_t bit_ofs = 0;
-    if (_dronecan_remoteid_SelfID_decode(transfer, &bit_ofs, msg,
-#if CANARD_ENABLE_TAO_OPTION
-    transfer->tao
-#else
-    true
-#endif
-    )) {
-        return true; /* invalid payload */
-    }
-
-    const uint32_t byte_len = (bit_ofs+7U)/8U;
-#if CANARD_ENABLE_TAO_OPTION
-    // if this could be CANFD then the dlc could indicating more bytes than
-    // we actually have
-    if (!transfer->tao) {
-        return byte_len > transfer->payload_len;
-    }
-#endif
-    return byte_len != transfer->payload_len;
-}
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_SelfID sample_dronecan_remoteid_SelfID_msg(void) {
-    struct dronecan_remoteid_SelfID msg;
-
-    msg.id_or_mac.len = (uint8_t)random_range_unsigned_val(0, 20);
-    for (size_t i=0; i < msg.id_or_mac.len; i++) {
-        msg.id_or_mac.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    msg.description_type = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.description.len = (uint8_t)random_range_unsigned_val(0, 23);
-    for (size_t i=0; i < msg.description.len; i++) {
-        msg.description.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    return msg;
-}
-#endif

+ 0 - 79
uav_can/user_src/dronecan.remoteid.System.c

@@ -1,79 +0,0 @@
-#define CANARD_DSDLC_INTERNAL
-#include <dronecan.remoteid.System.h>
-#include <string.h>
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-#include <test_helpers.h>
-#endif
-
-uint32_t dronecan_remoteid_System_encode(struct dronecan_remoteid_System* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-) {
-    uint32_t bit_ofs = 0;
-    memset(buffer, 0, DRONECAN_REMOTEID_SYSTEM_MAX_SIZE);
-    _dronecan_remoteid_System_encode(buffer, &bit_ofs, msg, 
-#if CANARD_ENABLE_TAO_OPTION
-    tao
-#else
-    true
-#endif
-    );
-    return ((bit_ofs+7)/8);
-}
-
-/*
-  return true if the decode is invalid
- */
-bool dronecan_remoteid_System_decode(const CanardRxTransfer* transfer, struct dronecan_remoteid_System* msg) {
-#if CANARD_ENABLE_TAO_OPTION
-    if (transfer->tao && (transfer->payload_len > DRONECAN_REMOTEID_SYSTEM_MAX_SIZE)) {
-        return true; /* invalid payload length */
-    }
-#endif
-    uint32_t bit_ofs = 0;
-    if (_dronecan_remoteid_System_decode(transfer, &bit_ofs, msg,
-#if CANARD_ENABLE_TAO_OPTION
-    transfer->tao
-#else
-    true
-#endif
-    )) {
-        return true; /* invalid payload */
-    }
-
-    const uint32_t byte_len = (bit_ofs+7U)/8U;
-#if CANARD_ENABLE_TAO_OPTION
-    // if this could be CANFD then the dlc could indicating more bytes than
-    // we actually have
-    if (!transfer->tao) {
-        return byte_len > transfer->payload_len;
-    }
-#endif
-    return byte_len != transfer->payload_len;
-}
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct dronecan_remoteid_System sample_dronecan_remoteid_System_msg(void) {
-    struct dronecan_remoteid_System msg;
-
-    msg.id_or_mac.len = (uint8_t)random_range_unsigned_val(0, 20);
-    for (size_t i=0; i < msg.id_or_mac.len; i++) {
-        msg.id_or_mac.data[i] = (uint8_t)random_bitlen_unsigned_val(8);
-    }
-    msg.operator_location_type = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.classification_type = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.operator_latitude = (int32_t)random_bitlen_signed_val(32);
-    msg.operator_longitude = (int32_t)random_bitlen_signed_val(32);
-    msg.area_count = (uint16_t)random_bitlen_unsigned_val(16);
-    msg.area_radius = (uint16_t)random_bitlen_unsigned_val(16);
-    msg.area_ceiling = random_float_val();
-    msg.area_floor = random_float_val();
-    msg.category_eu = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.class_eu = (uint8_t)random_bitlen_unsigned_val(8);
-    msg.operator_altitude_geo = random_float_val();
-    msg.timestamp = (uint32_t)random_bitlen_unsigned_val(32);
-    return msg;
-}
-#endif

+ 24 - 24
uav_can/user_src/drv_vkweigher_vls300.c

@@ -82,30 +82,30 @@ struct vk_weigher_vls300 _vk_vls300;
 //   return size;
 // }
 
-uint8_t vklift_weight_calibrate(uint32_t weight) 
-{
-  // static uint8_t transfer_id = 0;
-
-  // struct vkweigher_WeigherCalibRequest msg = {0};
-  // msg.weight = weight;
-
-  // uint8_t buffer[VKWEIGHER_WEIGHERCALIB_REQUEST_MAX_SIZE] = {0};
-  // memcpy(buffer,&msg.weight,sizeof(msg.weight));
-  // uint8_t len = vkweigher_WeigherCalibRequest_encode(&msg, buffer);
-  // CanardTxTransfer tranxfer = {
-  //     .inout_transfer_id = &transfer_id,
-  //     .transfer_type = CanardTransferTypeRequest,
-  //     .data_type_id = VKWEIGHER_WEIGHERCALIB_REQUEST_ID,
-  //     .data_type_signature = VKWEIGHER_WEIGHERCALIB_REQUEST_SIGNATURE,
-  //     .priority = CANARD_TRANSFER_PRIORITY_LOW,
-  //     .payload = buffer,
-  //     .payload_len = len,
-  // };
-
-   //dronecan_request_or_respond(DRONECAN_WEIGHER_NODE_ID, &tranxfer);
-
-  return 1;
-}
+// uint8_t vklift_weight_calibrate(uint32_t weight) 
+// {
+//   static uint8_t transfer_id = 0;
+
+//   struct vkweigher_WeigherCalibRequest msg = {0};
+//   msg.weight = weight;
+
+//   uint8_t buffer[VKWEIGHER_WEIGHERCALIB_REQUEST_MAX_SIZE] = {0};
+//   memcpy(buffer,&msg.weight,sizeof(msg.weight));
+//   uint8_t len = vkweigher_WeigherCalibRequest_encode(&msg, buffer);
+//   CanardTxTransfer tranxfer = {
+//       .inout_transfer_id = &transfer_id,
+//       .transfer_type = CanardTransferTypeRequest,
+//       .data_type_id = VKWEIGHER_WEIGHERCALIB_REQUEST_ID,
+//       .data_type_signature = VKWEIGHER_WEIGHERCALIB_REQUEST_SIGNATURE,
+//       .priority = CANARD_TRANSFER_PRIORITY_LOW,
+//       .payload = buffer,
+//       .payload_len = len,
+//   };
+
+//    dronecan_request_or_respond(DRONECAN_WEIGHER_NODE_ID, &tranxfer);
+
+//   return 1;
+// }
 
 // static rt_err_t fuse_prot(rt_device_t dev, void *args) {
 

+ 0 - 68
uav_can/user_src/uavcan.protocol.NodeStatus.c

@@ -1,68 +0,0 @@
-#define CANARD_DSDLC_INTERNAL
-#include <uavcan.protocol.NodeStatus.h>
-#include <string.h>
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-#include <test_helpers.h>
-#endif
-
-uint32_t uavcan_protocol_NodeStatus_encode(struct uavcan_protocol_NodeStatus* msg, uint8_t* buffer
-#if CANARD_ENABLE_TAO_OPTION
-    , bool tao
-#endif
-) {
-    uint32_t bit_ofs = 0;
-    memset(buffer, 0, UAVCAN_PROTOCOL_NODESTATUS_MAX_SIZE);
-    _uavcan_protocol_NodeStatus_encode(buffer, &bit_ofs, msg, 
-#if CANARD_ENABLE_TAO_OPTION
-    tao
-#else
-    true
-#endif
-    );
-    return ((bit_ofs+7)/8);
-}
-
-/*
-  return true if the decode is invalid
- */
-bool uavcan_protocol_NodeStatus_decode(const CanardRxTransfer* transfer, struct uavcan_protocol_NodeStatus* msg) {
-#if CANARD_ENABLE_TAO_OPTION
-    if (transfer->tao && (transfer->payload_len > UAVCAN_PROTOCOL_NODESTATUS_MAX_SIZE)) {
-        return true; /* invalid payload length */
-    }
-#endif
-    uint32_t bit_ofs = 0;
-    if (_uavcan_protocol_NodeStatus_decode(transfer, &bit_ofs, msg,
-#if CANARD_ENABLE_TAO_OPTION
-    transfer->tao
-#else
-    true
-#endif
-    )) {
-        return true; /* invalid payload */
-    }
-
-    const uint32_t byte_len = (bit_ofs+7U)/8U;
-#if CANARD_ENABLE_TAO_OPTION
-    // if this could be CANFD then the dlc could indicating more bytes than
-    // we actually have
-    if (!transfer->tao) {
-        return byte_len > transfer->payload_len;
-    }
-#endif
-    return byte_len != transfer->payload_len;
-}
-
-#ifdef CANARD_DSDLC_TEST_BUILD
-struct uavcan_protocol_NodeStatus sample_uavcan_protocol_NodeStatus_msg(void) {
-    struct uavcan_protocol_NodeStatus msg;
-
-    msg.uptime_sec = (uint32_t)random_bitlen_unsigned_val(32);
-    msg.health = (uint8_t)random_bitlen_unsigned_val(2);
-    msg.mode = (uint8_t)random_bitlen_unsigned_val(3);
-    msg.sub_mode = (uint8_t)random_bitlen_unsigned_val(3);
-    msg.vendor_specific_status_code = (uint16_t)random_bitlen_unsigned_val(16);
-    return msg;
-}
-#endif

+ 0 - 293
uav_can/user_src/user_rid.c

@@ -1,293 +0,0 @@
-#include "user_rid.h"
-#include "dronecan.h"
-#include <dronecan.remoteid.Location.h>
-#include <dronecan.remoteid.ArmStatus.h>
-#include <dronecan.remoteid.BasicID.h>
-#include <uavcan.protocol.NodeStatus.h>
-#include <dronecan.remoteid.OperatorID.h>
-#include <dronecan.remoteid.SelfID.h>
-#include <dronecan.remoteid.System.h>
-#include "string.h"
-
-Connect_check remoteid_link;
-_armStatusID_msg StatusId;
-_location_msg locationId;
-_operatorId_msg operatorId;
-_basicId_msg basicId;
-_selfId_msg selfId;
-_sys_operator_msg systemId;
-
-void send_location_msg( void )
-{
-    static uint8_t transfer_id = 0;
-
-    struct dronecan_remoteid_Location msg;
-
-    uint8_t buffer[DRONECAN_REMOTEID_LOCATION_MAX_SIZE] = {0};
-
-
-    msg.id_or_mac.len = 20;
-    memcpy(&msg.id_or_mac.data, &locationId.id_or_mac, msg.id_or_mac.len);
-    msg.status = locationId.status;
-    msg.direction = locationId.direction;
-    msg.speed_horizontal = locationId.speed_horizontal;
-    msg.speed_vertical = locationId.speed_vertical;
-    msg.latitude = locationId.latitude;
-    msg.longitude = locationId.longitude;
-    msg.altitude_barometric = locationId.altitude_barometric;
-    msg.altitude_geodetic = locationId.altitude_geodetic;
-    msg.height_reference = locationId.height_reference;
-    msg.height = locationId.height;
-    msg.horizontal_accuracy = locationId.horizontal_accuracy;
-    msg.vertical_accuracy = locationId.vertical_accuracy;
-    msg.barometer_accuracy = locationId.barometer_accuracy;
-    msg.speed_accuracy = locationId.speed_accuracy;
-    msg.timestamp = locationId.timestamp;
-    msg.timestamp_accuracy = locationId.timestamp_accuracy;
-
-    uint32_t len = dronecan_remoteid_Location_encode(&msg, buffer);
-
-    CanardTxTransfer tx_transfer = {
-        .data_type_signature = DRONECAN_REMOTEID_LOCATION_SIGNATURE,
-        .data_type_id = DRONECAN_REMOTEID_LOCATION_ID,
-        .inout_transfer_id = &transfer_id,
-        .priority = CANARD_TRANSFER_PRIORITY_MEDIUM,
-        .transfer_type = CanardTransferTypeBroadcast,
-        .payload = buffer,
-        .payload_len = len,
-    };
-
-    dronecan_broadcast(&tx_transfer);
-}
-
-void send_basicID(void) 
-{
-  static uint8_t transfer_id = 0;
-
-  struct dronecan_remoteid_BasicID msg;
-
-  uint8_t buffer[DRONECAN_REMOTEID_BASICID_MAX_SIZE] = {0};
-
-  msg.id_or_mac.len = 20;
-  memcpy(&msg.id_or_mac.data, &basicId.id_or_mac, msg.id_or_mac.len);
-  msg.id_type = basicId.id_type;
-  msg.ua_type = basicId.ua_type;
-  msg.uas_id.len = 20;
-  memcpy(&msg.uas_id.data, &basicId.uas_id, msg.uas_id.len);
-
-  uint32_t len = dronecan_remoteid_BasicID_encode(&msg, buffer);
-
-  CanardTxTransfer tx_transfer = {
-      .data_type_signature = DRONECAN_REMOTEID_BASICID_SIGNATURE,
-      .data_type_id = DRONECAN_REMOTEID_BASICID_ID,
-      .inout_transfer_id = &transfer_id,
-      .priority = CANARD_TRANSFER_PRIORITY_MEDIUM,
-      .transfer_type = CanardTransferTypeBroadcast,
-      .payload = buffer,
-      .payload_len = len,
-  };
-
-  dronecan_broadcast(&tx_transfer);
-}
-
-
-void send_operatorID(void) 
-{
-  static uint8_t transfer_id = 0;
-
-  struct dronecan_remoteid_OperatorID msg;
-
-  uint8_t buffer[DRONECAN_REMOTEID_OPERATORID_MAX_SIZE] = {0};
-
-  msg.id_or_mac.len = 20;
-  memcpy(&msg.id_or_mac.data, &operatorId.id_or_mac, msg.id_or_mac.len);
-  msg.operator_id_type = operatorId.operator_id_type;
-  msg.operator_id.len = 20;
-  memcpy(&msg.operator_id.data, &operatorId.operator_id, msg.operator_id.len);
-
-  uint32_t len = dronecan_remoteid_OperatorID_encode(&msg, buffer);
-
-  CanardTxTransfer tx_transfer = {
-      .data_type_signature = DRONECAN_REMOTEID_OPERATORID_SIGNATURE,
-      .data_type_id = DRONECAN_REMOTEID_OPERATORID_ID,
-      .inout_transfer_id = &transfer_id,
-      .priority = CANARD_TRANSFER_PRIORITY_MEDIUM,
-      .transfer_type = CanardTransferTypeBroadcast,
-      .payload = buffer,
-      .payload_len = len,
-  };
-
-  dronecan_broadcast(&tx_transfer);
-}
-
-
-
-void send_sysOperatorID(void) 
-{
-  static uint8_t transfer_id = 0;
-
-  struct dronecan_remoteid_System msg;
-
-  uint8_t buffer[DRONECAN_REMOTEID_SYSTEM_MAX_SIZE] = {0};
-
-  msg.id_or_mac.len = 20;
-  memcpy(&msg.id_or_mac.data, &systemId.id_or_mac, msg.id_or_mac.len);
-  msg.operator_location_type = systemId.operator_location_type;
-  msg.classification_type = systemId.classification_type;
-  msg.operator_latitude = systemId.operator_latitude;
-  msg.operator_longitude = systemId.operator_longitude;
-  msg.area_count = systemId.area_count;
-  msg.area_radius = systemId.area_radius;
-  msg.area_ceiling = systemId.area_ceiling;
-  msg.area_floor = systemId.area_floor;
-  msg.category_eu = systemId.category_eu;
-  msg.class_eu = systemId.class_eu;
-  msg.operator_altitude_geo = systemId.operator_altitude_geo;
-  msg.timestamp = systemId.timestamp;
-
-  uint32_t len = dronecan_remoteid_System_encode(&msg, buffer);
-
-  CanardTxTransfer tx_transfer = {
-      .data_type_signature = DRONECAN_REMOTEID_SYSTEM_SIGNATURE,
-      .data_type_id = DRONECAN_REMOTEID_SYSTEM_ID,
-      .inout_transfer_id = &transfer_id,
-      .priority = CANARD_TRANSFER_PRIORITY_MEDIUM,
-      .transfer_type = CanardTransferTypeBroadcast,
-      .payload = buffer,
-      .payload_len = len,
-  };
-
-  dronecan_broadcast(&tx_transfer);
-}
-
-
-void send_selfID(void) 
-{
-  static uint8_t transfer_id = 0;
-
-  struct dronecan_remoteid_SelfID msg;
-
-  uint8_t buffer[DRONECAN_REMOTEID_SELFID_MAX_SIZE] = {0};
-
-  msg.id_or_mac.len = 20;
-  memcpy(&msg.id_or_mac.data, &selfId.id_or_mac, msg.id_or_mac.len);
-  msg.description_type = selfId.description_type;
-  msg.description.len = 23;
-  memcpy(&msg.description.data, &selfId.description, msg.description.len);
-
-  uint32_t len = dronecan_remoteid_SelfID_encode(&msg, buffer);
-
-  CanardTxTransfer tx_transfer = {
-      .data_type_signature = DRONECAN_REMOTEID_SELFID_SIGNATURE,
-      .data_type_id = DRONECAN_REMOTEID_SELFID_ID,
-      .inout_transfer_id = &transfer_id,
-      .priority = CANARD_TRANSFER_PRIORITY_MEDIUM,
-      .transfer_type = CanardTransferTypeBroadcast,
-      .payload = buffer,
-      .payload_len = len,
-  };
-
-  dronecan_broadcast(&tx_transfer);
-}
-
-
-int remoteid_OnRecieved(CanardInstance *canardIns,
-                                CanardRxTransfer *transfer) 
-{
-  int ret = 0;
-  struct dronecan_remoteid_ArmStatus info;
-  static int TimeDelay = 0;
-  if (transfer->transfer_type == CanardTransferTypeBroadcast) 
-  {
-    if( transfer->data_type_id == DRONECAN_REMOTEID_ARMSTATUS_ID)
-    {
-        if (!dronecan_remoteid_ArmStatus_decode(transfer, &info)) {
-            StatusId.status = info.status;
-            if( StatusId.status != 0 && HAL_GetTick() - TimeDelay > 2500)
-            {
-              memcpy(&StatusId.status, &info.status, sizeof(struct dronecan_remoteid_ArmStatus));
-            }
-            else
-            {
-              StatusId.status = 0;
-              TimeDelay = HAL_GetTick();
-              memset(&StatusId.len,0,51);
-            }
-            StatusId.len = 50;
-            remoteid_link.connect_status = COMP_NORMAL;
-        }
-    }
-  }
-
-  return ret;
-}
-
-bool remoteid_shouldAcceptTransfer(const CanardInstance *ins,
-                                           uint64_t *out_data_type_signature,
-                                           uint16_t data_type_id,
-                                           CanardTransferType transfer_type,
-                                           uint8_t source_node_id) {
-
-  bool ret = false;
-    
-  if (data_type_id == DRONECAN_REMOTEID_ARMSTATUS_ID &&
-      transfer_type == CanardTransferTypeBroadcast) {
-    *out_data_type_signature =  DRONECAN_REMOTEID_ARMSTATUS_SIGNATURE;
-    ret = true;
-  } 
-  if (data_type_id == UAVCAN_PROTOCOL_NODESTATUS_ID &&
-        transfer_type == CanardTransferTypeBroadcast) {
-    *out_data_type_signature = UAVCAN_PROTOCOL_NODESTATUS_SIGNATURE;
-    ret = true;
-  } 
-
-  return ret;
-}
-
-
-
-void send_msg_to_remoteid(void)
-{
-    static uint32_t SendTime_N2HZ = 0;
-    static uint32_t SendTime_N3HZ = 0;
-    static uint32_t SendTime_N4HZ = 0;
-    static uint32_t SendTime_N5HZ = 0;
-    static uint32_t SendTime_N6HZ = 0;
-
-    if ( HAL_GetTick() - SendTime_N2HZ > 555 )
-    {
-        //send_node_status();
-        send_location_msg();
-        
-        SendTime_N2HZ = HAL_GetTick();
-    }
-    if ( HAL_GetTick() - SendTime_N3HZ > 666 )
-    {
-        send_sysOperatorID();
-        SendTime_N3HZ = HAL_GetTick();
-    }
-
-    if ( HAL_GetTick() - SendTime_N4HZ > 333 )
-    {
-        send_basicID();
-        SendTime_N4HZ = HAL_GetTick();
-    }
-
-    if ( HAL_GetTick() - SendTime_N6HZ > 1777 )
-    {
-        send_operatorID();
-        SendTime_N6HZ = HAL_GetTick();
-    }
-
-    if ( HAL_GetTick() - SendTime_N5HZ > 1888 )
-    {
-        send_selfID();
-        SendTime_N5HZ = HAL_GetTick();
-    }
-
-    
-
-    dronecan_tx_processing();
-}
-
-

+ 3 - 3
user_inc/soft_can.h

@@ -112,9 +112,9 @@ extern Radar Rupdate;
 #define EFT_FILTER_ID      0x00008851U
 #define EFT_MASK_ID        0xFFFFFF00U
 
-//EFT转接板 集成离心水泵称重断药播撒
-#define EFT_Z80_DEV (0x7010)
-#define EFT_Z80_DEV_ACK (0x7011)
+//绞龙
+#define CAN_JIEXING1_ID (0x7010)
+#define CAN_JIEXING2_ID (0x7011)
 
 // 第2~0位,发送端ID,默认3
 #define CAN_FULLY_SENDNODE_ID_MASK  0x00000007       // 0 0000 0000 0000 0000 0000 0000 0111(29位扩展ID)

+ 0 - 4
user_inc/soft_eft.h

@@ -121,10 +121,6 @@ typedef struct
 #pragma pack()
 extern water_dev Lpump1;
 extern water_dev Lpump2;
-extern water_dev nozzle1;
-extern water_dev nozzle2;
-extern water_dev nozzle3;
-extern water_dev nozzle4;
 extern water_dev churn;
 extern water_dev turntable;
 

+ 0 - 2
user_inc/soft_flash.h

@@ -36,7 +36,6 @@ typedef struct
     uint16_t _SN_H;
     short _hardVersion_L;
     short _hardVersion_H;
-    short mapping_type;
 }_F_PMU_PAR;
 extern _F_PMU_PAR flash_pmu_par;
 
@@ -48,7 +47,6 @@ typedef struct
     short reset_reason;         // 重启原因
     int SN;
     int hardVersion;
-    short mapping_type;         //遥控器映射类型
 }_C_PMU_PAR;
 extern _C_PMU_PAR current_pmu_par;
 extern bool write_flash_flag;

+ 1 - 4
user_inc/soft_flow.h

@@ -11,9 +11,6 @@
 #define EXTI_FALL 1
 #define EXTI_UP   2
 
-#define FUNC_INPUT 1
-#define FUNC_OUTPUT 2
-
 float flow_dete2(void);
 float flow_dete3(void);
 float flow_dete4(void);
@@ -24,7 +21,7 @@ void can_recv_mimor_flow_function(uint32_t CanID, uint8_t data[], uint8_t len);
 
 
 
-extern uint8_t L3L4_Reusetype;
+
 //extern bool L1_status;
 //extern bool L2_status;
 

+ 1 - 1
user_inc/soft_obstacle.h

@@ -80,7 +80,7 @@ typedef struct
 }_dev_par;
 #pragma pack()
 
-extern _dev_par Dev_parameter;
+extern _dev_par DM_4DRADARMAG;
 //避障雷达
 #pragma pack(1)
 typedef struct 

+ 0 - 2
user_inc/soft_p_2_c.h

@@ -46,7 +46,6 @@ enum vklink_msgid
 	_MSGID_B4DRADAR = 33,     //电目4d后避障雷达测试
 	_MSGID_FT4DRADAR = 34,     //电目4d前避障分段高度
 	_MSGID_BT4DRADAR = 35,     // 电目4d后避障分段高度
-	_MSG_REMOTE_ID = 45,    	//REMOTE_ID
 	_MSGID_UPDATA = 200,   // 升级信息
 	_MSGID_CANDEBUG = 213, // CAN调试
 };
@@ -202,7 +201,6 @@ typedef struct
 	float pos_y;
 	float pos_z;
 	float pos_flag;
-	uint16_t mapping_type;
 } plane_para;
 #pragma pack()
 extern plane_para planep;

+ 0 - 1
user_inc/soft_seed_device.h

@@ -121,7 +121,6 @@ enum FACID
     FAC_CHURN_SEED = 40,//绞龙播撒
     FAC_MOCIB_RL = 41,  //莫之比左避障
     FAC_MOCIB_RR = 42, //莫之比右避障
-    FAC_RT_4D = 43, //4D避障
 };
 typedef struct
 {

+ 1 - 1
user_inc/soft_terrain.h

@@ -58,7 +58,7 @@ typedef struct
 #pragma pack()
 extern uavr_terrain uavr56_info;
 extern uavr_terrain mimo_ter_info; 
-extern uavr_terrain DM_ter_info,FourD_ter_info; 
+extern uavr_terrain DM_ter_info; 
 extern int16_t F_4DRadar[3][3];
 extern int16_t B_4DRadar[3][3];
 // //木牛仿地

+ 1 - 2
user_inc/soft_timer.h

@@ -26,7 +26,6 @@ typedef struct
 extern Dev_timer devinfo_time;
 
 void timer_function(void);
-extern bool vol_flag,engine_flag,devtype_flag,can_debug_flag,dev_version_flag,mimo360_radar_flag,
-    DM_radar_flag,pmu_heart_flag,pmu_to_DM4Dmsg_flag,remoteid_flag;
+extern bool vol_flag,engine_flag,devtype_flag,can_debug_flag,dev_version_flag,mimo360_radar_flag,DM_radar_flag,pmu_heart_flag,pmu_to_DM4Dmsg_flag;
 uint32_t Get_Systimer_Us(void);
 #endif 

+ 2 - 30
user_inc/soft_water_device.h

@@ -2,6 +2,8 @@
 #define  _SOFT_WATER_DEVICE_H_
 #include "common.h"
 
+
+
 #pragma pack(1)
 typedef struct{ 
     short liquid_percent;
@@ -25,29 +27,6 @@ typedef struct
 }Z70_tranfer;
 #pragma pack()
 extern Z70_tranfer z70_info;
-typedef enum{ //eft
-    SPARY_DEFAULT = 0,
-    SPARY_GEMO = 1, //隔膜泵 需要带流量计
-    SPARY_ROUXING = 2, //柔性泵 
-    SPARY_TRANSFER = 3, //转接板集成喷洒 
-}SPARY;
-extern uint8_t spary_type;
-typedef enum{
-    NOZZLE_DEFAULT = 0,
-    NOZZLE_NORMAL = 1,
-    NOZZLE_TRANSFER = 2, //转接板集成喷
-}NOZZLE;
-extern uint8_t nozzle_type;
-
-typedef enum{
-    WEIGHT_DEFAULT = 0,
-    WEIGHT_NORMAL = 1, //普通称重
-    WEIGHT_LIFT = 2, //吊运称重
-    WEIGHT_FPLATE = 3, //前板
-    WEIGHT_TRANFER = 4, //转接板
-}WEIGHT;
-extern uint8_t weight_type;
-
 #pragma pack(1)
 typedef struct 
 {
@@ -237,13 +216,6 @@ Ready_Control
 #define HW_MAJORCONF_OPT0            0x00  //获取配置信息
 
 #define HW_GETESCID_OPT0             0x00  //获取ESCID及通道信息
-
-#define Z70_Pump1 (uint8_t)1
-#define Z70_Pump2 (uint8_t)2
-#define Z70_Nozzle1 (uint8_t)3
-#define Z70_Nozzle2 (uint8_t)4
-#define Z70_Nozzle3 (uint8_t)5
-#define Z70_Nozzle4 (uint8_t)6
 #define Z70_Public (uint8_t)0
 #define Z70_Churn     (uint8_t)7
 #define Z70_Turntable   (uint8_t)8

+ 2 - 6
user_src/soft_can.c

@@ -122,8 +122,8 @@ void Can_decode_data_function(CAN_RxHeaderTypeDef Rxhead)
       //   can_recv_muniu_terrain(RxData);
       //   break;
 
-      //EFT Z80 喷洒绞龙
-      case EFT_Z80_DEV ... EFT_Z80_DEV_ACK:
+      //格式电池
+      case CAN_JIEXING1_ID ... CAN_JIEXING2_ID:
         Get_auger_sowing_mag(RxHeader.ExtId, RxData, RxHeader.DLC);
         break;
       case CAN_NEWTATTU_MSG ... CAN_NEWTATTU_MSG2:
@@ -150,10 +150,6 @@ void Can_decode_data_function(CAN_RxHeaderTypeDef Rxhead)
       case CAN_MSGID_DM_LACKLOSS:
          DMlacklossCanRecvFunction(Rxhead.ExtId, RxData, RxHeader.DLC);
          break;
-      case 0x184E4364: //remoteid armStatus
-        dronecan_rx_callback(RxHeader,RxData);
-        // RIDCanRecvFunction(Rxhead.ExtId, RxData, RxHeader.DLC);
-        break;
       default:
         //好盈ID基本没有固定位,全检测
         HobbywingCanRecvHookFunction(Rxhead.ExtId, RxData, RxHeader.DLC);

+ 3 - 4
user_src/soft_eft.c

@@ -4,7 +4,6 @@
 #include "string.h"
 #include "soft_seed_device.h"
 #include "soft_version.h"
-#include "soft_water_device.h"
 
 
 uint8_t seed_output_mode = 1;
@@ -25,10 +24,10 @@ _mimo_lackloss mimo_lackloss;
 _mimo_lackloss DM_lackloss;
 water_dev Lpump1;
 water_dev Lpump2;
-water_dev nozzle1,nozzle2,nozzle3,nozzle4;
 weight70_dev z70weight;
 bool weight_runing_time = false;
 bool eft_sparyDev_priority = false;//EFT飞机存在两种水泵、称重ID一起发送
+bool eft_weightDev_priority = false;
 uint16_t LiftingWeight_warning = 0;
 void EftCanRecvHookFunction(uint32_t cellCanID, uint8_t data[], uint8_t len)
 {
@@ -48,7 +47,7 @@ void EftCanRecvHookFunction(uint32_t cellCanID, uint8_t data[], uint8_t len)
     case REVE_EFT_INFO:
         eft_info.enginearm_lock = data[0];
         
-        if(weight_type == WEIGHT_NORMAL)
+        if(eft_weightDev_priority != true)
         {
             eft_info.weight = data[1] * 256 + data[2];
             Dev.Weight_Link.connect_status = COMP_NORMAL;
@@ -158,7 +157,7 @@ void EftCanRecvHookFunction(uint32_t cellCanID, uint8_t data[], uint8_t len)
         Dev.Flow.facid = FAC_LPUMP;
         break;
     case CAN_EFT70_WEIGHT:
-        weight_type = WEIGHT_LIFT;
+        eft_weightDev_priority = true;
         eft_info.weight = (data[0] + data[1] * 256);
         LiftingWeight_warning = data[2];
 

+ 3 - 16
user_src/soft_flash.c

@@ -130,9 +130,6 @@ void flash_read_funcktion( void )
     
     parameter_copy();
 
-    
-
-
     if(current_pmu_par.uavtype == VK_ALL_IN_ONE)
     {
         init_pwmout(VK_ALL_IN_ONE); 
@@ -140,24 +137,16 @@ void flash_read_funcktion( void )
     }
     else
     {
-        if((current_pmu_par.mapping_type & 0x1) == 1)
-            L3L4_Reusetype = FUNC_OUTPUT;
-        
         //先执行上电离心喷头会转
+  
         GPIO_InitStruct.Pin = EXIT_1T_Pin|EXIT_2T_Pin;
         GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING;//GPIO_MODE_IT_RISING;
         GPIO_InitStruct.Pull = GPIO_PULLUP;
         HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
         
-        
-        GPIO_InitStruct.Pin = EXIT_3T_Pin|EXIT_4T_Pin; 
+        GPIO_InitStruct.Pin = EXIT_3T_Pin|EXIT_4T_Pin;
+        GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
         GPIO_InitStruct.Pull = GPIO_PULLUP;
-
-        if(L3L4_Reusetype == FUNC_INPUT)
-            GPIO_InitStruct.Mode = GPIO_MODE_INPUT;
-        else if(L3L4_Reusetype == FUNC_OUTPUT)
-            GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
-
         HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
 
 
@@ -187,7 +176,6 @@ void parameter_assignment_default(void)
     flash_pmu_par._SN_H = (PMU_SERIAL >> 16) & 0xffff;
     flash_pmu_par._hardVersion_L = PMU_HARDVERSION & 0xffff;
     flash_pmu_par._hardVersion_H = (PMU_HARDVERSION >> 16) & 0xffff;
-    flash_pmu_par.mapping_type = 0;
 
     WriteFlashNBtye(FLASH_PAR_INFO,(uint8_t *)&flash_pmu_par,sizeof(_F_PMU_PAR));
 }
@@ -207,7 +195,6 @@ void parameter_copy(void)
     current_pmu_par.reset_reason = flash_pmu_par._reset_reason;
     current_pmu_par.SN = flash_pmu_par._SN_L + (flash_pmu_par._SN_H << 16);
     current_pmu_par.hardVersion = flash_pmu_par._hardVersion_L + (flash_pmu_par._hardVersion_H << 16);
-    current_pmu_par.mapping_type = flash_pmu_par.mapping_type;
 }
 
 /**

+ 2 - 4
user_src/soft_flow.c

@@ -105,17 +105,15 @@ void flow_count_add(uint8_t flow_num,uint8_t exti_status)
   * @details 
   * @author  Zhang Sir 
  **/
-uint8_t L3L4_Reusetype = FUNC_INPUT;
 GPIO_PinState L3_status = GPIO_PIN_SET;
 GPIO_PinState L4_status = GPIO_PIN_SET;
 void L1L2_GPIO_check()
 {
     static int l1l2_time = 0;
     if ( HAL_GetTick() - l1l2_time < 100 )
+    {
         return;
-    if(L3L4_Reusetype != FUNC_INPUT)
-        return;
-
+    }
     l1l2_time = HAL_GetTick();
 
     // 抛球信号 接PMUA1

+ 8 - 8
user_src/soft_obstacle.c

@@ -1430,7 +1430,7 @@ void get_radar_blindAndPower_function( void )
         can_send_msg_normal(&can_buf[0], 8, can_id);
     }
     else if ((Dev.Part_Fradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarF.facid == FAC_DM_RF_4D) &&
-             (Dev_parameter.get_DM4DF_Blind_spot_distance == false && DM4Dmsg_send_fmu == false))
+             (DM_4DRADARMAG.get_DM4DF_Blind_spot_distance == false && DM4Dmsg_send_fmu == false))
     {
         can_id = 0xA81300;
         put_date_to_can(can_buf, 0x8, 0, 0, 0, 0, 0, 0, 0X7);
@@ -1449,7 +1449,7 @@ void get_radar_blindAndPower_function( void )
         can_send_msg_normal(&can_buf[0], 8, can_id);
     }
     else if((Dev.Part_Fradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarF.facid == FAC_DM_RF_4D) && 
-            (Dev_parameter.get_dotcloud_switch_4DF == false && DM4Dmsg_send_fmu == false))
+            (DM_4DRADARMAG.get_dotcloud_switch_4DF == false && DM4Dmsg_send_fmu == false))
     {
         can_id = 0xA81300;
         put_date_to_can(can_buf,0xB,0,0,0,0,0,0,0X7);
@@ -1474,42 +1474,42 @@ void get_radar_blindAndPower_function( void )
         can_send_msg_normal(&can_buf[0], 8, can_id);
     }
     else if((Dev.Part_Bradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarB.facid == FAC_DM_RB_4D) && 
-            (Dev_parameter.get_dotcloud_switch_4DB == false && DM4Dmsg_send_fmu == false))
+            (DM_4DRADARMAG.get_dotcloud_switch_4DB == false && DM4Dmsg_send_fmu == false))
     {
         can_id = 0xB81300;
         put_date_to_can(can_buf,0xB,0,0,0,0,0,0,0X7);
         can_send_msg_normal(&can_buf[0], 8, can_id);
     }
     if ((Dev.Part_Fradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarF.facid == FAC_DM_RF_4D) &&
-        (Dev_parameter.get_angel_4DF == false && DM4Dmsg_send_fmu == false))
+        (DM_4DRADARMAG.get_angel_4DF == false && DM4Dmsg_send_fmu == false))
     {
         can_id = 0xA81300;
         put_date_to_can(can_buf, 0xD, 0, 0, 0, 0, 0, 0, 0X7);
         can_send_msg_normal(&can_buf[0], 8, can_id);
     }
     else if ((Dev.Part_Fradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarF.facid == FAC_DM_RF_4D) &&
-             (Dev_parameter.get_ground_filter_4DF == false && DM4Dmsg_send_fmu == false))
+             (DM_4DRADARMAG.get_ground_filter_4DF == false && DM4Dmsg_send_fmu == false))
     {
         can_id = 0xA81300;
         put_date_to_can(can_buf, 0xF, 0, 0, 0, 0, 0, 0, 0X7);
         can_send_msg_normal(&can_buf[0], 8, can_id);
     }
     if ((Dev.Part_Bradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarB.facid == FAC_DM_RB_4D) &&
-        (Dev_parameter.get_angel_4DB == false && DM4Dmsg_send_fmu == false))
+        (DM_4DRADARMAG.get_angel_4DB == false && DM4Dmsg_send_fmu == false))
     {
         can_id = 0xB81300;
         put_date_to_can(can_buf, 0xD, 0, 0, 0, 0, 0, 0, 0X7);
         can_send_msg_normal(&can_buf[0], 8, can_id);
     }
     else if ((Dev.Part_Bradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarB.facid == FAC_DM_RB_4D) &&
-             (Dev_parameter.get_ground_filter_4DB == false && DM4Dmsg_send_fmu == false))
+             (DM_4DRADARMAG.get_ground_filter_4DB == false && DM4Dmsg_send_fmu == false))
     {
         can_id = 0xB81300;
         put_date_to_can(can_buf, 0xF, 0, 0, 0, 0, 0, 0, 0X7);
         can_send_msg_normal(&can_buf[0], 8, can_id);
     }
     else if ((Dev.Part_Bradar_Link.connect_status == COMP_NORMAL && Dev.Part_radarB.facid == FAC_DM_RB_4D) &&
-             (Dev_parameter.get_DM4DB_Blind_spot_distance == false && DM4Dmsg_send_fmu == false))
+             (DM_4DRADARMAG.get_DM4DB_Blind_spot_distance == false && DM4Dmsg_send_fmu == false))
     {
         can_id = 0xB81300;
         put_date_to_can(can_buf, 0x8, 0, 0, 0, 0, 0, 0, 0X7);

+ 1 - 91
user_src/soft_p_2_c.c

@@ -34,7 +34,6 @@
 #include "soft_update.h"
 #include "qingxie_bms.h"
 #include "soft_flash.h"
-#include "user_rid.h"
 
 
 uint8_t msg_buf[256] = {0};
@@ -159,8 +158,6 @@ short get_radar_info(uint8_t Radar_Type,uint8_t Info_Type)
             Ptr_T = &mimo_ter_info;
         else if(DM_ter_info.Link.connect_status != COMP_NOEXIST)
             Ptr_T = &DM_ter_info;
-        else if (FourD_ter_info.Link.connect_status != COMP_NOEXIST)
-            Ptr_T = &FourD_ter_info;
         else if(uavr56_info.Link.connect_status != COMP_NOEXIST)
             Ptr_T = &uavr56_info;
         
@@ -790,7 +787,7 @@ void pmu_to_con_DM4DBradar_msg(void)
     msg_buf[index++] = 'K';
     msg_buf[index++] = 'Z';
     msg_buf[index++] = '1';
-    memcpy(&msg_buf[index],&Dev_parameter.angel_4DF,18);
+    memcpy(&msg_buf[index],&DM_4DRADARMAG.angel_4DF,18);
     index += 18;
     msg_buf[1] = index - 6;
     crc = Get_Crc16(msg_buf, index);
@@ -1317,40 +1314,6 @@ void pmu_to_con_ack_data()
     uart2_send_msg(msg_buf, index);
 }
 
-/**
-  * @file    pmu_to_con_ridStatus_data
-  * @brief   PMU发送发动机信息
-  * @param   none
-  * @details 
-  * @author  Zhang Sir 
- **/
-void pmu_to_con_ridStatus_data(void)
-{
-    uint8_t index = 0;
-    if(remoteid_link.connect_status == COMP_NORMAL)
-    {
-        msg_buf[index++] = 0xFE;
-        msg_buf[index++] = 0;
-        msg_buf[index++] = 0; //组件计数
-        msg_buf[index++] = 0x00;
-        msg_buf[index++] = 0x00;
-        msg_buf[index++] = _MSG_REMOTE_ID;
-
-        msg_buf[index++] = ARMSTATUS_TYPE;
-        
-        memcpy(&msg_buf[index],&StatusId.status,sizeof(_armStatusID_msg));
-        index += (sizeof(_armStatusID_msg));
-
-        msg_buf[1] = index - 6;
-
-        uint16_t crc = Get_Crc16(msg_buf, index);
-        msg_buf[index++] = crc;
-        msg_buf[index++] = (crc >> 8) & 0xff;
-
-        uart2_send_msg(msg_buf, index);
-    }
-}
-
 
 /******************void pmu_to_fcu()******************************
  * ****************PMU发送信息给主控********************************
@@ -1415,11 +1378,6 @@ void pmu_to_fcu()
                 pmu_to_con_devtype_data();
                 devtype_flag = false;
             }
-            else if(remoteid_flag == true)
-            {
-                pmu_to_con_ridStatus_data();
-                remoteid_flag = false;
-            }
             break;
         case PMU_SEND_REQINFO:
             pmu_to_con_request_data();
@@ -1618,22 +1576,6 @@ void uart_recv_con_msg()
                 //摄像头舵机
                 __HAL_TIM_SET_COMPARE(&htim4, TIM_CHANNEL_1, pmu_pin.aux_steer);
             }
-            else
-            {
-                if( L3L4_Reusetype == FUNC_OUTPUT )
-                {
-                    //前后灯
-                    if((pmu_pin.aux_light & 0x1) > 0)
-                        HAL_GPIO_WritePin(GPIOB,EXIT_3T_Pin,GPIO_PIN_SET);
-                    else
-                        HAL_GPIO_WritePin(GPIOB,EXIT_3T_Pin,GPIO_PIN_RESET);
-
-                    if((pmu_pin.aux_light & 0x2) > 0)
-                        HAL_GPIO_WritePin(GPIOB,EXIT_4T_Pin,GPIO_PIN_SET);
-                    else
-                        HAL_GPIO_WritePin(GPIOB,EXIT_4T_Pin,GPIO_PIN_RESET); 
-                }
-            }
             
             break;
         case _MSGID_LED:
@@ -1654,11 +1596,6 @@ void uart_recv_con_msg()
                 flash_pmu_par._uavtype = planep.UAV_type;
                 write_flash_flag = true;
             }
-            if(current_pmu_par.mapping_type != planep.mapping_type)
-            {
-                flash_pmu_par.mapping_type = planep.mapping_type;
-                write_flash_flag = true;
-            }
             break;
         case _MSGID_TIME:
             //tem_32t = 1684136124;
@@ -2280,33 +2217,6 @@ void uart_recv_con_msg()
                 }
             }
             break;
-        case _MSG_REMOTE_ID:
-            {
-                uint8_t rid_type = 0;
-                rid_type = fcu_protocol.payload[6];
-                
-                switch (rid_type)
-                {
-                case LOCATION_TYPE:
-                    memcpy(&locationId.latitude, &fcu_protocol.payload[7], sizeof(_location_msg));
-                    break;
-                case SYS_OPERATOR_TYPE:
-                    memcpy(&systemId.operator_latitude, &fcu_protocol.payload[7], sizeof(_sys_operator_msg));
-                    break;
-                case BASICID_TYPE:
-                    memcpy(&basicId.target_system, &fcu_protocol.payload[7], sizeof(_basicId_msg));
-                    break;
-                case SELFID_TYPE:
-                    memcpy(&selfId.target_system, &fcu_protocol.payload[7], sizeof(_selfId_msg));
-                    break;
-                case OPERATOR_TYPE:
-                    memcpy(&operatorId.target_system, &fcu_protocol.payload[7], sizeof(_operatorId_msg));
-                    break;
-                default:
-                    break;
-                }
-            }
-            break;
         //升级固件标志
         case _MSGID_UPDATA:
         {

+ 44 - 71
user_src/soft_seed_device.c

@@ -283,28 +283,15 @@ void seed_init_send_info(uint8_t device_type,char *factory)
         switch (device_type)
         {
         case WEIGHT_DEVICE:
-            if(weight_init_eft.status != 0)
+            if(weight_init_eft.status != 0 && eft_weightDev_priority == false)
             {
                 if(weight_init_eft.step.read_k_flag != 0)
                 {
-                    if(weight_type == WEIGHT_FPLATE)
-                    {
-                        vk_can_id = 0x8877;
-                        vk_canbuf[0] = 0xFD;
-                        vk_canbuf[5] = 0xf1;
-                        vk_canbuf[6] = 0xf3;
-                        can_send_msg_normal((unsigned char *)&vk_canbuf, 8, vk_can_id); 
-                    }
-                    else if(weight_type == WEIGHT_TRANFER)
-                    {
-                        vk_can_id = 0x7011;
-                        vk_canbuf[0] = 0xE4;
-                        vk_canbuf[5] = 0xf1;
-                        vk_canbuf[6] = 0xf3;
-                        can_send_msg_normal((unsigned char *)&vk_canbuf, 8, vk_can_id);
-                    }
+                    vk_canbuf[0] = 0xFD;
+                    vk_canbuf[5] = 0xf1;
+                    vk_canbuf[6] = 0xf3;
                 }
-                
+                can_send_msg_normal((unsigned char *)&vk_canbuf, 8, vk_can_id);
             }
             break;
         case SEED_DEVICE:
@@ -340,7 +327,6 @@ void seed_init_send_info(uint8_t device_type,char *factory)
 void Set_Seed_Weight_Par(uint8_t device_type,char *factory)
 {   
     uint8_t can_buf[8] = {0};
-    uint32_t can_id = 0;
     if(strcmp(factory,"VK") == 0)
     {
         switch (device_type)
@@ -451,13 +437,8 @@ void Set_Seed_Weight_Par(uint8_t device_type,char *factory)
             }        
             break;
         case WEIGHT_DEVICE:
-            if((weight_type == WEIGHT_LIFT || weight_type == WEIGHT_TRANFER) && weight_order.type != 0 )
-            {            
-                if(weight_type == WEIGHT_LIFT)
-                    can_id = 0x88BB;
-                else
-                    can_id = 0x7011;
-
+            if(eft_weightDev_priority == true)
+            {                    
                 can_buf[1] = 0x00;  //D1 - D4
                 can_buf[2] = 0x00;
                 can_buf[3] = 0x00;
@@ -500,13 +481,14 @@ void Set_Seed_Weight_Par(uint8_t device_type,char *factory)
                 default:
                     break;
                 }
-                can_send_msg_normal((unsigned char *)&can_buf, 8, can_id);
+                can_send_msg_normal((unsigned char *)&can_buf, 8, 0x88BB);
                 weight_order.type = 0;
             }
             else
             {
                 if(weight_order.type != 0)   
                 {
+
                     can_buf[1] = 0x00;
                     can_buf[2] = 0x00;
                     can_buf[3] = 0x00;
@@ -803,7 +785,7 @@ void  update_device_type_data(void)
                 //Dev.Seed.warn = eft_info.warn_status >> 1;
                 Dev.Seed.speed = turntable.rpm;
                 Dev.Seed.churn_rpm = churn.rpm;
-                Dev.Seed.warn = churn.error_status;
+                Dev.Seed.warn = churn.error_status ;
                 Dev.Seed.churn_warn = churn.reserve;
                 break;
             default:
@@ -839,14 +821,6 @@ void  update_device_type_data(void)
                 Dev.Weight.k3 = eft_info.seed_k[2];
                 Dev.Weight.k4 = 0;
                 Dev.Weight.warn = eft_info.watering_warn_status >> 4 & 0xff;
-                if(weight_type == WEIGHT_TRANFER)
-                {
-                    Dev.Weight.kg = eft_info.weight;//20单位g  70单位10g
-                    Dev.Weight.k1 = z70weight.info.k1;
-                    Dev.Weight.k2 = z70weight.info.k2;
-                    Dev.Weight.k3 = z70weight.info.k3;
-                    Dev.Weight.k4 = z70weight.info.k4;
-                }
                 break;
             case FAC_LIFTWEIGHT:
                 Dev.Weight.mode = 0;
@@ -951,33 +925,20 @@ void  update_device_type_data(void)
                 
                 break;
             case FAC_EFT:
-                if(nozzle_type == NOZZLE_TRANSFER)
+                Dev.Nozzle.rpm1 = eft_info.cent1_rpm * 60;
+                Dev.Nozzle.rpm2 = eft_info.cent2_rpm * 60;
+                Dev.Nozzle.rpm3 = 0;
+                Dev.Nozzle.rpm4 = 0;
+
+                if( (eft_info.watering_warn_status & 0xc) != 0)
                 {
-                    Dev.Nozzle.rpm1 = nozzle1.rpm;
-                    Dev.Nozzle.rpm2 = nozzle2.rpm;
-                    Dev.Nozzle.rpm3 = nozzle3.rpm;
-                    Dev.Nozzle.rpm4 = nozzle4.rpm;
-                    Dev.Nozzle.warn = 0;
+                    Dev.Nozzle.warn = ((eft_info.watering_warn_status >> 2) & 0x3) + (eft_info.watering_warn_status & 0xf0);
                 }
-                else
+                else if((eft_info.watering_warn_status & 0xc) == 0)
                 {
-                    Dev.Nozzle.rpm1 = eft_info.cent1_rpm * 60;
-                    Dev.Nozzle.rpm2 = eft_info.cent2_rpm * 60;
-                    Dev.Nozzle.rpm3 = 0;
-                    Dev.Nozzle.rpm4 = 0;
-
-                    if( (eft_info.watering_warn_status & 0xc) != 0)
-                    {
-                        Dev.Nozzle.warn = ((eft_info.watering_warn_status >> 2) & 0x3) + (eft_info.watering_warn_status & 0xf0);
-                    }
-                    else if((eft_info.watering_warn_status & 0xc) == 0)
-                    {
-                        Dev.Nozzle.warn = 0;
-                    }
-                    Dev.Nozzle.warn = 0; //屏蔽报警
-                }    
-
-                
+                    Dev.Nozzle.warn = 0;
+                }
+                Dev.Nozzle.warn = 0; //屏蔽报警
                 break;
             case FAC_HD_NOZZLE:
                 // Dev.Nozzle.rpm1 = NozzleMsg[1].speed;
@@ -1050,6 +1011,24 @@ void  update_device_type_data(void)
             }    
         }
 
+        
+
+        // if(Dev.L_pump2_Link.connect_status == COMP_NORMAL)
+        // {
+        //     switch (Dev.L_pump2.facid)
+        //     {
+        //     case FAC_VK:
+        //         break;
+        //     case FAC_HW_ESC:
+        //         Dev.L_pump2.warn = EscMsg[1].warn_flag;
+        //         Dev.L_pump2.rpm =  EscMsg[1].motorRPM;        
+        //         break;
+        //     default:
+        //         break;
+        //     }    
+
+        // }
+
         //智能电池
         if(Dev.Bms_Link.connect_status == COMP_NORMAL)
         {
@@ -1324,19 +1303,13 @@ void can_sendmsg_eft_water(void)
 {
     uint8_t can_buf[8] = {0};
 
-    if(spary_type == SPARY_TRANSFER || Dev.Seed.facid == FAC_CHURN_SEED)
+    if(Dev.Seed_Link.connect_status != COMP_NOEXIST && Dev.Seed.facid == FAC_CHURN_SEED)
     {
         water70_info.dev_water70.flag = planep.lock_status == STA_LOCK ? 0x5 : 0xA;
-        if(Dev.Seed_Link.connect_status != COMP_NOEXIST)
-        {
-            water70_info.dev_water70.pump1 = math_cons_i16(tppwm_value,1000,2000) - 1000;
-            water70_info.dev_water70.pump2 = math_cons_i16(sow_rotate_value,1000,2000) - 1000;
-        }
-        else
-        {
-            water70_info.dev_water70.pump1 = math_cons_i16(pmu_pin.pump1,1000,2000) - 1000;
-            water70_info.dev_water70.pump2 = math_cons_i16(pmu_pin.pump2,1000,2000) - 1000;
-        }
+
+        water70_info.dev_water70.pump1 = math_cons_i16(tppwm_value,1000,2000) - 1000;
+        water70_info.dev_water70.pump2 = math_cons_i16(sow_rotate_value,1000,2000) - 1000;
+
         water70_info.dev_water70.nozzle1 = pmu_pin.nozz1_fm - 1000;
         water70_info.dev_water70.nozzle2 = pmu_pin.nozz2_zp - 1000;
         water70_info.dev_water70.nozzle3 = pmu_pin.nozz3 - 1000;

+ 19 - 57
user_src/soft_terrain.c

@@ -18,7 +18,7 @@ UAVH30 uavh30_dist;
 uavr_terrain uavr56_info = {.get_radar_sensi = 50};
 uavr_terrain mimo_ter_info;
 
-_dev_par Dev_parameter;
+_dev_par DM_4DRADARMAG;
 // muniu muniu_ter_info;
 
 bool terrain_is_link = false;
@@ -102,7 +102,7 @@ uint8_t DM_recv_flag = 0;
 uint8_t DM4d_recv_flag = 0;
 Connect_check DM_status;
 Connect_check DM_4dstatus;
-uavr_terrain DM_ter_info,FourD_ter_info;
+uavr_terrain DM_ter_info;
 uint8_t DM4dt_recv_flag = 0;
 uint8_t DM4dbt_recv_flag = 0;
 void DM_terrain_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t len)
@@ -160,14 +160,6 @@ void DM_terrain_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t
 
         DM_ter_info.height = data[3] + data[4] * 256;
     }
-    else if (cellCanID == 0x901302) // 单点协议
-    {
-        FourD_ter_info.Link.connect_status = COMP_NORMAL;
-        FourD_ter_info.Link.recv_time = HAL_GetTick();
-        Dev.Radar.facid_T = FAC_DM_RT_4D;
-
-        FourD_ter_info.height = data[3] + data[4] * 256;
-    }
 
     // 版本信息
     if (cellCanID == 0x981301 && data[0] == 0x1)
@@ -223,37 +215,6 @@ void DM_terrain_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t
     {
         pmu_set_ack(_MSGID_SET, MSGID_SET_R_FUNC, 0, data[1] + data[2] * 256);
     }
-
-    // 版本信息
-    if (cellCanID == 0x981302 && data[0] == 0x1)
-    {
-        uint32_t version_temp = 0;
-        DM_T_info.byte7.frame_flag = data[7];
-
-        if (DM_T_info.byte7.flag.head != 0) // 头
-        {
-            memcpy(&version_temp, &data[1], 4);
-            Int2String(version_temp, FourD_ter_info.sn, 9);
-
-            FourD_ter_info.version[3] = 'N';
-
-            regist_dev_info(&dev_ter, DEVICE_TERRA, false, FourD_ter_info.sn, 9, NULL, 0, NULL, 0, "dmter", 6);
-        }
-        else if (DM_T_info.byte7.flag.tail != 0) // 尾
-        {
-            memcpy(&version_temp, &data[1], 4);
-            Int2String(version_temp, &FourD_ter_info.version[4], 6);
-            FourD_ter_info.version[0] = 'D';
-            FourD_ter_info.version[1] = '4';
-            FourD_ter_info.version[2] = 'T';
-
-            regist_dev_info(&dev_ter, DEVICE_TERRA, false, NULL, 0, FourD_ter_info.version, 10, NULL, 0, "dmter", 6);
-
-            FourD_ter_info.get_radar_ver_flag = true;
-            pmu_send = PMU_SEND_VERSION; // 旧版APP
-        }
-    }
-
    
 }
 
@@ -508,6 +469,7 @@ void DM_Fobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t le
         {
             memcpy(&version_temp, &data[1], 4);
             Int2String(version_temp, DM_f_info.sn, 9);
+            // 通过SN序号判断新旧boot
             DM_f_info.version[3] = 'N';
             regist_dev_info(&dev_obsf, DEVICE_OBSF, false, DM_f_info.sn, 9, NULL, 0, NULL, 0, "dmter", 6);
         }
@@ -526,29 +488,29 @@ void DM_Fobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t le
     else if (cellCanID == 0xA81302 && (data[0] == 0xD || data[0] == 0xC))
     {
         if (data[0] == 0xD)
-            Dev_parameter.get_angel_4DF = true;
-        Dev_parameter.angel_4DF = data[1] + data[2] * 256;
+            DM_4DRADARMAG.get_angel_4DF = true;
+        DM_4DRADARMAG.angel_4DF = data[1] + data[2] * 256;
         DM4Dmsg_send_fmu = true;
     }
     else if (cellCanID == 0xA81302 && (data[0] == 0xF || data[0] == 0xE))
     {
         if (data[0] == 0xF)
-            Dev_parameter.get_ground_filter_4DF = true;
-        Dev_parameter.ground_filter_4DF = data[1] + data[2] * 256;
+            DM_4DRADARMAG.get_ground_filter_4DF = true;
+        DM_4DRADARMAG.ground_filter_4DF = data[1] + data[2] * 256;
         DM4Dmsg_send_fmu = true;
     }
     else if (cellCanID == 0xA81302 && (data[0] == 0xA || data[0] == 0xB))
     {
         if (data[0] == 0xB)
-            Dev_parameter.get_dotcloud_switch_4DF = true;
-        Dev_parameter.dotcloud_switch_4DF = data[1] + data[2] * 256;
+            DM_4DRADARMAG.get_dotcloud_switch_4DF = true;
+        DM_4DRADARMAG.dotcloud_switch_4DF = data[1] + data[2] * 256;
         DM4Dmsg_send_fmu = true;
     }
     else if (cellCanID == 0xA81302 && (data[0] == 0x8 || data[0] == 0x5))
     {
         if (data[0] == 0x8)
-            Dev_parameter.get_DM4DF_Blind_spot_distance = true;
-        Dev_parameter.DM4DF_Blind_spot_distance = data[1] + data[2] * 256;
+            DM_4DRADARMAG.get_DM4DF_Blind_spot_distance = true;
+        DM_4DRADARMAG.DM4DF_Blind_spot_distance = data[1] + data[2] * 256;
         DM4Dmsg_send_fmu = true;
     }
     /*else if(cellCanID == 0xA81302 && (data[0] == 0x1))
@@ -711,29 +673,29 @@ void DM_Bobs_recieved_hookfuction(uint32_t cellCanID, uint8_t data[], uint8_t le
     else if (cellCanID == 0xB81302 && (data[0] == 0xA || data[0] == 0xB))
     {
         if (data[0] == 0xB)
-            Dev_parameter.get_dotcloud_switch_4DB = true;
-        Dev_parameter.dotcloud_switch_4DB = data[1] + data[2] * 256;
+            DM_4DRADARMAG.get_dotcloud_switch_4DB = true;
+        DM_4DRADARMAG.dotcloud_switch_4DB = data[1] + data[2] * 256;
         DM4Dmsg_send_fmu = true;
     }
     else if (cellCanID == 0xB81302 && (data[0] == 0xD || data[0] == 0xC))
     {
         if (data[0] == 0xD)
-            Dev_parameter.get_angel_4DB = true;
-        Dev_parameter.angel_4DB = data[1] + data[2] * 256;
+            DM_4DRADARMAG.get_angel_4DB = true;
+        DM_4DRADARMAG.angel_4DB = data[1] + data[2] * 256;
         DM4Dmsg_send_fmu = true;
     }
     else if (cellCanID == 0xB81302 && (data[0] == 0xF || data[0] == 0xE))
     {
         if (data[0] == 0xF)
-            Dev_parameter.get_ground_filter_4DB = true;
-        Dev_parameter.ground_filter_4DB = data[1] + data[2] * 256;
+            DM_4DRADARMAG.get_ground_filter_4DB = true;
+        DM_4DRADARMAG.ground_filter_4DB = data[1] + data[2] * 256;
         DM4Dmsg_send_fmu = true;
     }
     else if (cellCanID == 0xB81302 && (data[0] == 0x8 || data[0] == 0x5))
     {
         if (data[0] == 0x8)
-            Dev_parameter.get_DM4DB_Blind_spot_distance = true;
-        Dev_parameter.DM4DB_Blind_spot_distance = data[1] + data[2] * 256;
+            DM_4DRADARMAG.get_DM4DB_Blind_spot_distance = true;
+        DM_4DRADARMAG.DM4DB_Blind_spot_distance = data[1] + data[2] * 256;
         DM4Dmsg_send_fmu = true;
     }
 }

+ 1 - 1
user_src/soft_test.c

@@ -197,7 +197,7 @@ void user_init(void)
 
   //PVD_Config();
 
-  dronecan_init();
+  //dronecan_init(); //test
 
   //上电读内存参数
   flash_read_funcktion();

+ 1 - 2
user_src/soft_timer.c

@@ -18,7 +18,7 @@ extern uint32_t user_timer_cnt;
  **/
 bool vol_flag = false, devtype_flag = false, engine_flag = false,
      can_debug_flag = false, dev_version_flag = false, mimo360_radar_flag = false,DM_radar_flag = false,
-     pmu_heart_flag = false,pmu_to_DM4Dmsg_flag = false,remoteid_flag = false;
+     pmu_heart_flag = false,pmu_to_DM4Dmsg_flag = false;
 
 Dev_timer devinfo_time;
 void timer_function()
@@ -37,7 +37,6 @@ void timer_function()
         devinfo_time.arm = true;
         devinfo_time.tempSensor = true;
         pmu_to_DM4Dmsg_flag = true;
-        remoteid_flag = true;
     }
     if (  Check_Timer_Ready(&time_2hz,_2_HZ_) )
     {

+ 1 - 0
user_src/soft_uart.c

@@ -335,6 +335,7 @@ void check_uart_data(rkfifo_t *fifo)
 				recv_step = RX_HEAD;
 			}
 			else
+
 			{
 				recv_step = RX_SEQ;
 			}

+ 3 - 35
user_src/soft_update.c

@@ -121,10 +121,6 @@ void Vk_Update_Device_Protocol(void)
                 else
                     memcpy(&can_buf[5],"DS1",3);
             }
-            else if ( Dev.Radar.facid_T == FAC_DM_RT_4D)
-            {
-                memcpy(&can_buf[5],"D4T",3);
-            }
             break;
         case UPDATE_OBS360:
             break;
@@ -246,16 +242,6 @@ void Update_Dev_Bootversion_Function(uint8_t data[])
                 Dev.Part_Fradar_Link.recv_time = HAL_GetTick();
                 Dev.Part_Fradar_Link.connect_status = COMP_NORMAL;
                 Dev.Part_radarF.facid = FAC_DM_RF_4D;
-
-                DM_f_info.version[0] = 'D';
-                DM_f_info.version[1] = '4';
-                DM_f_info.version[2] = 'F';
-                DM_f_info.version[3] = 'N';
-                for(uint8_t i = 4;i < 10; i++)
-                {
-                    DM_f_info.version[i] = '0';
-                }
-               regist_dev_info(&dev_obsf,DEVICE_OBSF,false,NULL,0,DM_f_info.version,10,NULL,0,"dmf",6);
             }
             else
             {
@@ -295,18 +281,10 @@ void Update_Dev_Bootversion_Function(uint8_t data[])
                 Dev.Part_Bradar_Link.recv_time = HAL_GetTick();
                 Dev.Part_Bradar_Link.connect_status = COMP_NORMAL;
                 Dev.Part_radarB.facid = FAC_DM_RB_4D;
-                
-                DM_4DB_info.version[0] = 'D';
-                DM_4DB_info.version[1] = '4';
-                DM_4DB_info.version[2] = 'B';
-                DM_4DB_info.version[3] = 'N';
-                for(uint8_t i = 4;i < 10; i++)
-                {
-                    DM_4DB_info.version[i] = '0';
-                }
-                regist_dev_info(&dev_obsb, DEVICE_OBSB, false, NULL, 0, DM_4DB_info.version, 10, NULL, 0, "dmter", 6);
+                // Dev.Part_Tradar_Link.recv_time = HAL_GetTick();
+                // Dev.Part_Tradar_Link.connect_status = COMP_NORMAL;
+                // Dev.Part_radarT.facid = FAC_DM_RF;
             }
-            
             break;
         case UPDATE_TERAIN:
             if(memcmp((char *)&data[1],"TR0",3) == 0)
@@ -337,16 +315,6 @@ void Update_Dev_Bootversion_Function(uint8_t data[])
                 Dev.Part_Tradar_Link.recv_time = HAL_GetTick();
                 Dev.Part_Tradar_Link.connect_status = COMP_NORMAL;
                 Dev.Part_radarT.facid = FAC_DM_RT_4D;
-
-                DM_ter_info.version[0] = 'D';
-                DM_ter_info.version[1] = '4';
-                DM_ter_info.version[2] = 'T';
-                DM_ter_info.version[3] = 'N';
-                for(uint8_t i = 4;i < 10; i++)
-                {
-                    DM_ter_info.version[i] = '0';
-                }
-                regist_dev_info(&dev_ter,DEVICE_TERRA,false,NULL,0,DM_ter_info.version,10,NULL,0,"dmter",6);
             }
             else
             {

+ 3 - 3
user_src/soft_version.c

@@ -192,8 +192,7 @@ void get_radar_version_and_sn(void)
         can_send_msg_normalstd(radar_can_buf, 7, 0xFA);
     }
 
-    if((DM_ter_info.Link.connect_status == COMP_NORMAL && DM_ter_info.get_radar_ver_flag == false) ||
-     (FourD_ter_info.Link.connect_status == COMP_NORMAL && FourD_ter_info.get_radar_ver_flag == false))
+    if(DM_ter_info.Link.connect_status == COMP_NORMAL && DM_ter_info.get_radar_ver_flag == false)
     {
         radar_can_buf[0] = 1;
         radar_can_buf[7] = 7;
@@ -205,7 +204,7 @@ void get_radar_version_and_sn(void)
         radar_can_buf[7] = 7;
         can_send_msg_normal(radar_can_buf, 8, 0XA81300);
     }
-    else if( Dev.Part_Bradar_Link.connect_status == COMP_NORMAL && DM_4DB_info.get_radar_ver_flag == false)
+    else if( Dev.Part_Bradar_Link.connect_status == COMP_NORMAL &&  DM_4DB_info.get_radar_ver_flag == false)
     {
         radar_can_buf[0] = 1;
         radar_can_buf[7] = 7;
@@ -520,6 +519,7 @@ void get_device_version_and_sn(void)
 
     if(Check_Timer_Ready(&circu_time,_2_HZ_))
     {  
+
         //获取雷达版本和SN号
         get_radar_version_and_sn();
 

+ 4 - 94
user_src/soft_water_device.c

@@ -11,7 +11,6 @@
 #include "soft_terrain.h"
 #include "soft_obstacle.h"
 #include "canard.h"
-#include "soft_eft.h"
 /**
   * @file    liquid_recieved_hookfuction
   * @brief   液位计解析
@@ -1025,94 +1024,13 @@ void Hobbywing_esc_func(void)
 }
 Z70_tranfer z70_info;
 water_dev churn,turntable;
-water_dev pump1,pump2;
-uint8_t spary_type = 0;
-uint8_t nozzle_type = 0;
-uint8_t weight_type = 0;
 void Get_auger_sowing_mag(uint32_t CanID, uint8_t data[], uint8_t len)
 {
-    if(CanID == EFT_Z80_DEV)
+    if(CanID == CAN_JIEXING1_ID)
     {
         memcpy(&z70_info, &data[0], len);
         switch (z70_info.dev_type)
         {
-        case Z70_Public:
-            if(weight_type == WEIGHT_DEFAULT)
-                weight_type = WEIGHT_TRANFER;
-            
-            mimo_lackloss.status = data[6];
-            memcpy(&eft_info.weight,&data[4],2);
-
-            Dev.Weight_Link.connect_status = COMP_NORMAL;
-            Dev.Weight.facid = FAC_EFT;
-            Dev.Weight_Link.recv_time = HAL_GetTick();
-            break;
-        case Z70_Pump1:
-            if( spary_type == SPARY_DEFAULT )
-                spary_type = SPARY_TRANSFER;
-            spary_type = SPARY_TRANSFER;
-            Lpump1.rpm = z70_info.rpm;
-            Lpump1.error_status = z70_info.warning;
-
-            Dev.L_pump1_Link.connect_status = COMP_NORMAL;
-            Dev.L_pump1.facid = FAC_EFT;
-            Dev.L_pump1_Link.recv_time = HAL_GetTick();
-            break;
-        case Z70_Pump2:
-            if( spary_type == SPARY_DEFAULT )
-                spary_type = SPARY_TRANSFER;
-            Lpump2.rpm = z70_info.rpm;
-            Lpump2.error_status = z70_info.warning;
-
-            Dev.L_pump2_Link.connect_status = COMP_NORMAL;
-            Dev.L_pump2.facid = FAC_EFT;
-            Dev.L_pump2_Link.recv_time = HAL_GetTick();
-
-            break;
-        case Z70_Nozzle1:
-            if(nozzle_type == NOZZLE_DEFAULT)
-                nozzle_type = NOZZLE_TRANSFER;
-
-            nozzle1.rpm = z70_info.rpm;
-            nozzle1.error_status = z70_info.warning;
-
-            Dev.Nozzle_Link.connect_status = COMP_NORMAL;
-            Dev.Nozzle.facid = FAC_EFT;
-            Dev.Nozzle_Link.recv_time = HAL_GetTick();
-            break;
-        case Z70_Nozzle2:
-            if(nozzle_type == NOZZLE_DEFAULT)
-                nozzle_type = NOZZLE_TRANSFER;
-
-            nozzle2.rpm = z70_info.rpm;
-            nozzle2.error_status = z70_info.warning;
-
-            Dev.Nozzle_Link.connect_status = COMP_NORMAL;
-            Dev.Nozzle.facid = FAC_EFT;
-            Dev.Nozzle_Link.recv_time = HAL_GetTick();
-            break;
-        case Z70_Nozzle3:
-            if(nozzle_type == NOZZLE_DEFAULT)
-                nozzle_type = NOZZLE_TRANSFER;
-
-            nozzle3.rpm = z70_info.rpm;
-            nozzle3.error_status = z70_info.warning;
-
-            Dev.Nozzle_Link.connect_status = COMP_NORMAL;
-            Dev.Nozzle.facid = FAC_EFT;
-            Dev.Nozzle_Link.recv_time = HAL_GetTick();
-            break;
-        case Z70_Nozzle4:
-            if(nozzle_type == NOZZLE_DEFAULT)
-                nozzle_type = NOZZLE_TRANSFER;
-
-            nozzle4.rpm = z70_info.rpm;
-            nozzle4.error_status = z70_info.warning;
-
-            Dev.Nozzle_Link.connect_status = COMP_NORMAL;
-            Dev.Nozzle.facid = FAC_EFT;
-            Dev.Nozzle_Link.recv_time = HAL_GetTick();
-            break;
          case Z70_Churn:
             churn.rpm = z70_info.rpm;
             churn.error_status = z70_info.warning;
@@ -1123,7 +1041,7 @@ void Get_auger_sowing_mag(uint32_t CanID, uint8_t data[], uint8_t len)
             if(churn_size != (z70_info.reserve3 & 0x07))
             {
                churn_size = z70_info.reserve3 & 0x07;
-               Dev_parameter.Packing_auger_size = churn_size;
+               DM_4DRADARMAG.Packing_auger_size = churn_size;
                DM4Dmsg_send_fmu = true;
             }
              
@@ -1143,7 +1061,7 @@ void Get_auger_sowing_mag(uint32_t CanID, uint8_t data[], uint8_t len)
             break;
         }
     }
-    else if(CanID == EFT_Z80_DEV_ACK)
+    else if(CanID == CAN_JIEXING2_ID)
     {
         if(data[0] == 0xe6)
         {
@@ -1151,17 +1069,9 @@ void Get_auger_sowing_mag(uint32_t CanID, uint8_t data[], uint8_t len)
         }
         else if(data[0] == 0xe7)
         {
-            Dev_parameter.Packing_auger_size = data[1];
+            DM_4DRADARMAG.Packing_auger_size = data[1];
             DM4Dmsg_send_fmu = true;
         }
-        else if(data[0] == 0xe4)
-        {
-            z70weight.info.k1 = data[1] + ((data[2] & 0x3f) << 8);
-            z70weight.info.k2 = (data[2] >> 6) + (data[3] << 2) + ((data[4] & 0xf) << 10);
-            z70weight.info.k3 = (data[4] >> 4) + (data[5] << 4)  + ((data[6] & 0x3) << 12);
-            z70weight.info.k4 = (data[6] >> 2) + (data[7] << 6);
-            weight_init_eft.step.read_k_flag = 0;
-        }
     }
 
 }