static void
ble_gatts_read_test_misc_init(uint16_t *out_conn_handle)
{
    int rc;

    ble_hs_test_util_init();

    rc = ble_gatts_register_svcs(ble_gatts_read_test_svcs,
                                 ble_gatts_read_test_misc_reg_cb, NULL);
    TEST_ASSERT_FATAL(rc == 0);
    TEST_ASSERT_FATAL(ble_gatts_read_test_chr_1_def_handle != 0);
    TEST_ASSERT_FATAL(ble_gatts_read_test_chr_1_val_handle ==
                      ble_gatts_read_test_chr_1_def_handle + 1);
    TEST_ASSERT_FATAL(ble_gatts_read_test_chr_2_def_handle != 0);
    TEST_ASSERT_FATAL(ble_gatts_read_test_chr_2_val_handle ==
                      ble_gatts_read_test_chr_2_def_handle + 1);

    ble_gatts_start();

    ble_hs_test_util_create_conn(2, ble_gatts_read_test_peer_addr, NULL, NULL);

    if (out_conn_handle != NULL) {
        *out_conn_handle = 2;
    }
}
static void
ble_gatt_find_s_test_misc_init(void)
{
    ble_hs_test_util_init();
    ble_gatt_find_s_test_num_svcs = 0;
    ble_gatt_find_s_test_proc_complete = 0;
}
/**
 * @return                      The handle of the new test connection.
 */
static uint16_t
ble_att_clt_test_misc_init(void)
{
    ble_hs_test_util_init();
    ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}), NULL,
                                 NULL);
    return 2;
}
static void
ble_gatt_disc_c_test_init(void)
{
    ble_hs_test_util_init();

    ble_gatt_disc_c_test_num_chars = 0;
    ble_gatt_disc_c_test_rx_complete = 0;
}
static void
ble_att_clt_test_misc_init(struct ble_hs_conn **conn,
                           struct ble_l2cap_chan **att_chan)
{
    ble_hs_test_util_init();

    *conn = ble_hs_test_util_create_conn(2, ((uint8_t[]){2,3,4,5,6,7,8,9}));
    *att_chan = ble_hs_conn_chan_find(*conn, BLE_L2CAP_CID_ATT);
    TEST_ASSERT_FATAL(*att_chan != NULL);
}
static void
ble_gatt_write_test_init(void)
{
    int i;

    ble_hs_test_util_init();
    ble_gatt_write_test_cb_called = 0;
    ble_gatt_write_test_num_attrs = 0;

    for (i = 0; i < sizeof ble_gatt_write_test_attr_value; i++) {
        ble_gatt_write_test_attr_value[i] = i;
    }
}
static void
ble_gatts_reg_test_init(void)
{
    ble_hs_test_util_init();
    ble_gatts_reg_test_num_entries = 0;
}