mirror of
https://github.com/odriverobotics/ODrive.git
synced 2026-09-24 17:53:39 +08:00
Added 3 endpoints (UUID_0, UUID_1, UUID2) to expose the device UUID
This commit is contained in:
@@ -94,6 +94,9 @@ void motors_1_set_current_setpoint_func(void) {
|
||||
const Endpoint endpoints[] = {
|
||||
Endpoint::make_property("vbus_voltage", const_cast<const float*>(&vbus_voltage)),
|
||||
Endpoint::make_property("elec_rad_per_enc", const_cast<const float*>(&elec_rad_per_enc)),
|
||||
Endpoint::make_property("UUID_0", (const uint32_t*)(ID_UNIQUE_ADDRESS + 0*4)),
|
||||
Endpoint::make_property("UUID_1", (const uint32_t*)(ID_UNIQUE_ADDRESS + 1*4)),
|
||||
Endpoint::make_property("UUID_2", (const uint32_t*)(ID_UNIQUE_ADDRESS + 2*4)),
|
||||
Endpoint::make_object("motor0"),
|
||||
Endpoint::make_property("control_mode", reinterpret_cast<int32_t*>(&motors[0].control_mode)),
|
||||
Endpoint::make_property("error", reinterpret_cast<int32_t*>(&motors[0].error)),
|
||||
|
||||
@@ -335,6 +335,10 @@ inline const char* get_default_json_modifier<int32_t>() {
|
||||
return "\"type\":\"int32\",\"access\":\"rw\"";
|
||||
}
|
||||
template<>
|
||||
inline const char* get_default_json_modifier<const uint32_t>() {
|
||||
return "\"type\":\"uint32\",\"access\":\"r\"";
|
||||
}
|
||||
template<>
|
||||
inline const char* get_default_json_modifier<const uint16_t>() {
|
||||
return "\"type\":\"uint16\",\"access\":\"r\"";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user