Lines Matching refs:client
103 static int filter_set(struct bt_mesh_proxy_client *client, in filter_set() argument
118 (void)memset(client->filter, 0, sizeof(client->filter)); in filter_set()
119 client->filter_type = ACCEPT; in filter_set()
122 (void)memset(client->filter, 0, sizeof(client->filter)); in filter_set()
123 client->filter_type = REJECT; in filter_set()
133 static void filter_add(struct bt_mesh_proxy_client *client, uint16_t addr) in filter_add() argument
143 for (i = 0; i < ARRAY_SIZE(client->filter); i++) { in filter_add()
144 if (client->filter[i] == addr) { in filter_add()
149 for (i = 0; i < ARRAY_SIZE(client->filter); i++) { in filter_add()
150 if (client->filter[i] == BT_MESH_ADDR_UNASSIGNED) { in filter_add()
151 client->filter[i] = addr; in filter_add()
157 static void filter_remove(struct bt_mesh_proxy_client *client, uint16_t addr) in filter_remove() argument
167 for (i = 0; i < ARRAY_SIZE(client->filter); i++) { in filter_remove()
168 if (client->filter[i] == addr) { in filter_remove()
169 client->filter[i] = BT_MESH_ADDR_UNASSIGNED; in filter_remove()
175 static void send_filter_status(struct bt_mesh_proxy_client *client, in send_filter_status() argument
195 if (client->filter_type == ACCEPT) { in send_filter_status()
201 for (filter_size = 0U, i = 0; i < ARRAY_SIZE(client->filter); i++) { in send_filter_status()
202 if (client->filter[i] != BT_MESH_ADDR_UNASSIGNED) { in send_filter_status()
217 err = bt_mesh_proxy_msg_send(client->cli->conn, BT_MESH_PROXY_CONFIG, in send_filter_status()
227 struct bt_mesh_proxy_client *client; in proxy_filter_recv() local
230 client = find_client(conn); in proxy_filter_recv()
235 filter_set(client, buf); in proxy_filter_recv()
236 send_filter_status(client, rx, buf); in proxy_filter_recv()
243 filter_add(client, addr); in proxy_filter_recv()
245 send_filter_status(client, rx, buf); in proxy_filter_recv()
252 filter_remove(client, addr); in proxy_filter_recv()
254 send_filter_status(client, rx, buf); in proxy_filter_recv()
317 static int beacon_send(struct bt_mesh_proxy_client *client, in beacon_send() argument
327 err = bt_mesh_beacon_create(sub, &buf, client->privacy); in beacon_send()
335 return bt_mesh_proxy_msg_send(client->cli->conn, BT_MESH_PROXY_BEACON, in beacon_send()
341 struct bt_mesh_proxy_client *client = cb_data; in send_beacon_cb() local
343 return beacon_send(client, sub) != 0; in send_beacon_cb()
348 struct bt_mesh_proxy_client *client; in proxy_send_beacons() local
350 client = CONTAINER_OF(work, struct bt_mesh_proxy_client, send_beacons); in proxy_send_beacons()
352 (void)bt_mesh_subnet_find(send_beacon_cb, client); in proxy_send_beacons()
918 struct bt_mesh_proxy_client *client; in proxy_ccc_write() local
927 client = find_client(conn); in proxy_ccc_write()
928 if (client->filter_type == NONE) { in proxy_ccc_write()
929 client->filter_type = ACCEPT; in proxy_ccc_write()
930 bt_mesh_wq_submit(&client->send_beacons); in proxy_ccc_write()
996 struct bt_mesh_proxy_client *client = &clients[i]; in bt_mesh_proxy_gatt_disconnect() local
998 if (client->cli && (client->filter_type == ACCEPT || in bt_mesh_proxy_gatt_disconnect()
999 client->filter_type == REJECT)) { in bt_mesh_proxy_gatt_disconnect()
1000 client->filter_type = NONE; in bt_mesh_proxy_gatt_disconnect()
1001 bt_conn_disconnect(client->cli->conn, in bt_mesh_proxy_gatt_disconnect()
1025 struct bt_mesh_proxy_client *client; in bt_mesh_proxy_addr_add() local
1029 client = find_client(cli->conn); in bt_mesh_proxy_addr_add()
1031 LOG_DBG("filter_type %u addr 0x%04x", client->filter_type, addr); in bt_mesh_proxy_addr_add()
1033 if (client->filter_type == ACCEPT) { in bt_mesh_proxy_addr_add()
1034 filter_add(client, addr); in bt_mesh_proxy_addr_add()
1035 } else if (client->filter_type == REJECT) { in bt_mesh_proxy_addr_add()
1036 filter_remove(client, addr); in bt_mesh_proxy_addr_add()
1040 static bool client_filter_match(struct bt_mesh_proxy_client *client, in client_filter_match() argument
1045 LOG_DBG("filter_type %u addr 0x%04x", client->filter_type, addr); in client_filter_match()
1047 if (client->filter_type == REJECT) { in client_filter_match()
1048 for (i = 0; i < ARRAY_SIZE(client->filter); i++) { in client_filter_match()
1049 if (client->filter[i] == addr) { in client_filter_match()
1061 if (client->filter_type == ACCEPT) { in client_filter_match()
1062 for (i = 0; i < ARRAY_SIZE(client->filter); i++) { in client_filter_match()
1063 if (client->filter[i] == addr) { in client_filter_match()
1080 struct bt_mesh_proxy_client *client = &clients[i]; in bt_mesh_proxy_relay() local
1082 if (!client->cli) { in bt_mesh_proxy_relay()
1086 if (!client_filter_match(client, dst)) { in bt_mesh_proxy_relay()
1090 if (bt_mesh_proxy_relay_send(client->cli->conn, adv)) { in bt_mesh_proxy_relay()
1110 struct bt_mesh_proxy_client *client; in gatt_connected() local
1122 client = find_client(conn); in gatt_connected()
1124 client->filter_type = NONE; in gatt_connected()
1125 (void)memset(client->filter, 0, sizeof(client->filter)); in gatt_connected()
1126 client->cli = bt_mesh_proxy_role_setup(conn, proxy_send, in gatt_connected()
1135 client->privacy = false; in gatt_connected()
1137 client->privacy = (bt_mesh_priv_gatt_proxy_get() == BT_MESH_FEATURE_ENABLED) || in gatt_connected()
1141 LOG_DBG("privacy: %d", client->privacy); in gatt_connected()
1158 struct bt_mesh_proxy_client *client; in gatt_disconnected() local
1171 client = find_client(conn); in gatt_disconnected()
1172 if (client->cli) { in gatt_disconnected()
1173 bt_mesh_proxy_role_cleanup(client->cli); in gatt_disconnected()
1174 client->cli = NULL; in gatt_disconnected()