Connect to Generic Access Service with SDK 17.1.0

From the examples of SDK 17.1.0 (I'm Not using Zephyr), I'm trying to connect to a beacon's Generic Access Service, so I can read the characteristic 0x2A00 and then read it's name. But I'm not able to even connect to it yet.

I scanned the beacon and the service of this access service is: 00001800-0000-1000-8000-00805f9b34fb.

How can I achieve that?

Below is my code. 

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
static ble_uuid_t const m_nus_uuid =
{
.uuid = 0x2A00,
.type = BLE_UUID_TYPE_BLE
};
static ble_gap_scan_params_t const m_scan_param =
{
.active = 0x01,
.interval = NRF_BLE_SCAN_SCAN_INTERVAL,
.window = NRF_BLE_SCAN_SCAN_WINDOW,
.filter_policy = BLE_GAP_SCAN_FP_ACCEPT_ALL,
.timeout = SCAN_DURATION,
.scan_phys = BLE_GAP_PHY_1MBPS,
};
static void db_discovery_init(void)
{
ble_db_discovery_init_t db_init;
memset(&db_init, 0, sizeof(ble_db_discovery_init_t));
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX