add: controller/..../relays endpoints
add: relay functions remove: drivers
This commit is contained in:
parent
f040cd8b21
commit
0edb16a2d5
15 changed files with 587 additions and 44 deletions
endpoints
|
@ -214,7 +214,7 @@ api_v1_controllers_discover_POST(struct mg_connection *c, endpoint_args_t *args,
|
|||
{
|
||||
known_controllers[i]->active = 1;
|
||||
strncpy(known_controllers[i]->name, discovered_name, discovered_name_len);
|
||||
known_controllers[i]->name[MAX_NAME_LENGTH] = '\0';
|
||||
known_controllers[i]->name[discovered_name_len] = '\0';
|
||||
known_controllers[i]->port = discovered_command_port;
|
||||
known_controllers[i]->relay_count = discovered_relay_count;
|
||||
|
||||
|
@ -237,8 +237,8 @@ api_v1_controllers_discover_POST(struct mg_connection *c, endpoint_args_t *args,
|
|||
discovered_controller->id = 0;
|
||||
strcpy(discovered_controller->ip, inet_ntoa(addr.sin_addr));
|
||||
memcpy(discovered_controller->uid, discovered_id, sizeof(uuid_t));
|
||||
strncpy(discovered_controller->name, discovered_name, MAX_NAME_LENGTH);
|
||||
discovered_controller->name[MAX_NAME_LENGTH] = '\0';
|
||||
strncpy(discovered_controller->name, discovered_name, discovered_name_len);
|
||||
discovered_controller->name[discovered_name_len] = '\0';
|
||||
discovered_controller->relay_count = discovered_relay_count;
|
||||
discovered_controller->port = discovered_command_port;
|
||||
discovered_controller->active = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue