Skip to content

Commit

Permalink
Revert change to alter accessory name to make it unique
Browse files Browse the repository at this point in the history
  • Loading branch information
maximkulkin committed Nov 2, 2019
1 parent 41cb0f6 commit 0c5139f
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -3298,14 +3298,7 @@ void homekit_setup_mdns(homekit_server_t *server) {
return;
}

char unique_name[65]={0};
strncpy(unique_name, name->value.string_value, sizeof(unique_name)-6);
unique_name[strlen(unique_name)]='-';
unique_name[strlen(unique_name)]=server->accessory_id[0];
unique_name[strlen(unique_name)]=server->accessory_id[1];
unique_name[strlen(unique_name)]=server->accessory_id[3];
unique_name[strlen(unique_name)]=server->accessory_id[4];
homekit_mdns_configure_init(unique_name, PORT);
homekit_mdns_configure_init(name->value.string_value, PORT);

// accessory model name (required)
homekit_mdns_add_txt("md", "%s", model->value.string_value);
Expand Down

2 comments on commit 0c5139f

@peros550
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Maxim! I hope you are doing great!

May I ask what issues did you face with previous behavior?

@maximkulkin
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of examples already deal with it by appending part of MAC address (and it makes it too long and too ugly) and it feels you’re have more control that way (what if I don’t want extra stuff in my accessory name)

Please sign in to comment.