/* Indicates whether the set of registered services can be modified. The service set is mutable if: o No peers are connected, and o No GAP operations are active (advertise, discover, or connect). */
static bool ble_gatts_mutable(void)
/* Indicates whether the set of registered services can be modified. The service set is mutable if: o No peers are connected, and o No GAP operations are active (advertise, discover, or connect). */
static bool ble_gatts_mutable(void)
{
    if (ble_gap_adv_active() ||
        ble_gap_disc_active() ||
        ble_gap_conn_active()) {
        return false;
    }
    if (ble_hs_conn_first() != NULL) {
        return false;
    }
    return true;
}