Added 3 endpoints (UUID_0, UUID_1, UUID2) to expose the device UUID

This commit is contained in:
Cristian Fluture
2018-01-14 23:38:21 -08:00
parent e2a8dce355
commit 6cefbf6e62
2 changed files with 7 additions and 0 deletions
+3
View File
@@ -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)),
+4
View File
@@ -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\"";
}