writeUnitName() will save up to 6 characters from the start of the array that you pass to it as a pointer. The array is treated as a null (0x00) terminated string. Only the number of characters found before the first null will be saved if less than 6 characters. If the string is longer than 6 characters, only the first 6 characters will be saved.
readUnitName() will fill the provided array with a null terminated string containing up to 6 characters. In addition, the return value will be the length of the string. The array that you provide as a pointer must be at least 7 bytes long to allow up to 6 characters plus the null terminator. What a sketch does with the returned string is up to it.
The Arduboy2 library's Arduboy2 class begin() function will display the unit name at the bottom of the screen, for a short time, under the ARDUBOY logo, after the logo finishes scrolling down. The Arduboy2Base class begin() function won't display the name because there is no text capability in this class.
If you write your own sketch that allows you to set the unit name:
- Allow 0 to 6 characters to be set.
- Don't allow value 0xFF or line feed (0x0A) or carriage return (0x0D). The name also can't include 0x00 because that's the string terminator.