Skip to content

Commit

Permalink
Expose ucad's port as read-only
Browse files Browse the repository at this point in the history
  • Loading branch information
tfarago committed Mar 17, 2022
1 parent 52c5aea commit d3c01a0
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions uca-net-camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ GQuark uca_net_camera_error_quark ()

enum {
PROP_HOST = N_BASE_PROPERTIES,
PROP_PORT,
IS_RECORDING,
IS_READOUT,
N_PROPERTIES
Expand Down Expand Up @@ -411,9 +412,13 @@ uca_net_camera_get_property (GObject *object,
priv = UCA_NET_CAMERA_GET_PRIVATE (object);

/* handle net camera props */
if (property_id == PROP_HOST) {
g_value_set_string (value, priv->host);
return;
switch (property_id) {
case PROP_HOST:
g_value_set_string (value, priv->host);
return;
case PROP_PORT:
g_value_set_uint (value, UCA_NET_DEFAULT_PORT);
return;
}

/* handle remote props */
Expand Down Expand Up @@ -619,6 +624,13 @@ uca_net_camera_class_init (UcaNetCameraClass *klass)
"localhost",
G_PARAM_READWRITE | G_PARAM_CONSTRUCT);

net_properties[PROP_PORT] =
g_param_spec_uint("port",
"Port of ucad",
"Port of ucad",
1, G_MAXUINT, UCA_NET_DEFAULT_PORT,
G_PARAM_READABLE);

for (guint i = PROP_0 + 1; i < N_BASE_PROPERTIES; i++)
g_object_class_override_property (oclass, i, uca_camera_props[i]);

Expand Down

0 comments on commit d3c01a0

Please sign in to comment.