bluetooth state

Former Member
Former Member
  • I use this :

    var settings = Toybox.System.getDeviceSettings();
    if (settings has : phoneConnected)
    {
    // Check the connection state v3.0.0
    var state = settings.connectionInfo[:bluetooth].state;

    the state value will be : CONNECTION_STATE_NOT_INITIALIZED, CONNECTION_STATE_NOT_CONNECTED or
    CONNECTION_STATE_CONNECTED



    This part of code works fine with the simulator but on my vivoactive 3 the 0 state is never set. Is it really a bug ?
    • I believe you will only see 0 (CONNECTION_STATE_NOT_INITIALIZED) if the watch hasn't been paired with a phone yet. After that it's just connected/not connected.
      By the way, the "has" for phoneConnected really isn't needed (it's on everything), but you probably want to use one for connectionInfo as that's only on CIQ3 (or greater) devices.