0

On Tizen (wearable), I have to create a service application which 99% inactive. However it must get a callback when network of the device changes (i.e. from no connection to LTE).

How can I get this kind of events?

Daniel
  • 2,318
  • 2
  • 22
  • 53

1 Answers1

1

I think the guide below seems to be helpful. https://docs.tizen.org/application/native/guides/connectivity/connection/

To monitor changes in the connection type, register and define a callback:

connection_set_type_changed_cb(connection, __connection_changed_cb, NULL);

static void
__connection_changed_cb(connection_type_e type, void* user_data)
{
    dlog_print(DLOG_INFO, LOG_TAG, "Type changed callback, connection type: %d", type);
}
Jeik
  • 26
  • 2
  • For this, I'll have to keep the `connection` variable? I.e. I shall NOT call `connection_destroy` on it to make this work? – Daniel Nov 05 '22 at 18:30
  • 1
    You're right. If you call connection_destroy, callback is no longer called because all resources for receiving connection signals are released internally. – Jeik Nov 07 '22 at 10:26