14 lines
335 B
Go
14 lines
335 B
Go
package deviceconfig
|
|||
|
|
|
||
|
|
import (
|
||
|
|
"strings"
|
||
|
|
"unicode"
|
||
|
|
"unicode/utf8"
|
||
|
|
)
|
||
|
|
|
||
|
|
// Empty restores the default label. The byte limit fits the firmware NVS buffer.
|
||
|
|
func ValidDisplayName(name string) bool {
|
||
|
|
return len(name) <= 96 && utf8.ValidString(name) && strings.TrimSpace(name) == name &&
|
||
|
|
strings.IndexFunc(name, unicode.IsControl) < 0
|
||
|
|
}
|