mirror of
https://github.com/schoebel/mars
synced 2025-01-12 01:29:50 +00:00
client: add socket_count reporting
This commit is contained in:
parent
e83aab57f7
commit
101a0d7b90
@ -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);
|
||||
|
@ -58,6 +58,7 @@ struct client_brick {
|
||||
/* internal */
|
||||
atomic_t sender_count;
|
||||
atomic_t receiver_count;
|
||||
int socket_count;
|
||||
};
|
||||
|
||||
struct client_input {
|
||||
|
Loading…
Reference in New Issue
Block a user