client: add socket_count reporting

This commit is contained in:
Thomas Schoebel-Theuer 2016-01-25 07:11:14 +01:00 committed by Thomas Schoebel-Theuer
parent e83aab57f7
commit 101a0d7b90
2 changed files with 9 additions and 0 deletions

View File

@ -971,6 +971,13 @@ static int client_switch(struct client_brick *brick)
int status = 0;
if (brick->power.button) {
int socket_count = 0;
int i;
for (i = 0; i < MAX_CLIENT_CHANNELS; i++)
if (output->bundle.channel[i].is_connected)
socket_count++;
brick->socket_count = socket_count;
if (brick->power.led_on)
goto done;
mars_power_led_off((void*)brick, false);
@ -985,6 +992,7 @@ static int client_switch(struct client_brick *brick)
}
mars_power_led_on((void*)brick, output->got_info);
} else {
brick->socket_count = 0;
if (brick->power.led_off)
goto done;
mars_power_led_on((void*)brick, false);

View File

@ -58,6 +58,7 @@ struct client_brick {
/* internal */
atomic_t sender_count;
atomic_t receiver_count;
int socket_count;
};
struct client_input {