I am using nRF9160: LTE Sensor Gateway to connect wiht nRF52832. My problem is I cannot re establish connection between the nRF9160 and the nRF52832. I have tried to create a function which is called whenever disconnection occours below
static void disconnected(struct bt_conn *conn, u8_t conn_err)
{
int err;
err = bt_scan_start(BT_SCAN_TYPE_SCAN_ACTIVE);
if (err) {
printk("Scanning failed to start, err %d\n", err);
}
printk("Scanning...\n");
}
However when the devices reconnect I encounter this error when calling bt_gatt_dm_start(conn, BT_UUID_TMS, &discovery_cb, NULL);
does anyone know how to solve this issue? or work around on getting bluetooth devices reconnected when their is a disconnection?
please assist