Skip to content

Commit 7cdebab

Browse files
committed
Fix SDK12 regression
1 parent 13e4ef0 commit 7cdebab

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

targets/nrf5x/bluetooth.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3472,7 +3472,11 @@ void jsble_central_connect(ble_gap_addr_t peer_addr, JsVar *options) {
34723472
ble_gap_scan_params_t m_scan_param;
34733473
memset(&m_scan_param, 0, sizeof(m_scan_param));
34743474
m_scan_param.active = 1; // Active scanning set.
3475+
#if NRF_SD_BLE_API_VERSION>5 // the resolution depends on which API version!
34753476
m_scan_param.timeout = MSEC_TO_UNITS(4000, UNIT_10_MS); // 4 second timeout (in 10ms units)
3477+
#else
3478+
m_scan_param.timeout = 4; // 4 second timeout
3479+
#endif
34763480
jsble_set_scan_params(&m_scan_param, options);
34773481

34783482
ble_gap_conn_params_t gap_conn_params;

0 commit comments

Comments
 (0)