Lines Matching refs:len
49 size_t len = 3; in bt_settings_encode_key() local
52 if (len < path_size) { in bt_settings_encode_key()
57 strncpy(&path[len], subsys, path_size - len); in bt_settings_encode_key()
58 len = strlen(path); in bt_settings_encode_key()
59 if (len < path_size) { in bt_settings_encode_key()
60 path[len] = '/'; in bt_settings_encode_key()
61 len++; in bt_settings_encode_key()
64 for (int8_t i = 5; i >= 0 && len < path_size; i--) { in bt_settings_encode_key()
65 len += bin2hex(&addr->a.val[i], 1, &path[len], in bt_settings_encode_key()
66 path_size - len); in bt_settings_encode_key()
69 if (len < path_size) { in bt_settings_encode_key()
73 path[len] = '0' + addr->type; in bt_settings_encode_key()
74 len++; in bt_settings_encode_key()
77 if (key && len < path_size) { in bt_settings_encode_key()
78 path[len] = '/'; in bt_settings_encode_key()
79 len++; in bt_settings_encode_key()
80 strncpy(&path[len], key, path_size - len); in bt_settings_encode_key()
81 len += strlen(&path[len]); in bt_settings_encode_key()
84 if (len >= path_size) { in bt_settings_encode_key()
122 ssize_t len; in set_setting() local
140 len = settings_name_next(name, &next); in set_setting()
142 if (!strncmp(name, "id", len)) { in set_setting()
149 len = read_cb(cb_arg, &bt_dev.id_addr, sizeof(bt_dev.id_addr)); in set_setting()
150 if (len < sizeof(bt_dev.id_addr[0])) { in set_setting()
151 if (len < 0) { in set_setting()
153 " (err %zd)", len); in set_setting()
156 LOG_HEXDUMP_DBG(&bt_dev.id_addr, len, "data read"); in set_setting()
164 bt_dev.id_count = len / sizeof(bt_dev.id_addr[0]); in set_setting()
174 if (!strncmp(name, "name", len)) { in set_setting()
175 len = read_cb(cb_arg, &bt_dev.name, sizeof(bt_dev.name) - 1); in set_setting()
176 if (len < 0) { in set_setting()
178 " (err %zd)", len); in set_setting()
180 bt_dev.name[len] = '\0'; in set_setting()
189 if (!strncmp(name, "appearance", len)) { in set_setting()
195 len = read_cb(cb_arg, &bt_dev.appearance, sizeof(bt_dev.appearance)); in set_setting()
196 if (len < 0) { in set_setting()
197 return len; in set_setting()
205 if (!strncmp(name, "irk", len)) { in set_setting()
206 len = read_cb(cb_arg, bt_dev.irk, sizeof(bt_dev.irk)); in set_setting()
207 if (len < sizeof(bt_dev.irk[0])) { in set_setting()
208 if (len < 0) { in set_setting()
210 " (err %zd)", len); in set_setting()
218 count = len / sizeof(bt_dev.irk[0]); in set_setting()