Skip to content

Commit ebc8738

Browse files
committed
tweaks for when we include phy code
1 parent 9fccf60 commit ebc8738

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

libs/bluetooth/bluetooth.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,9 +166,11 @@ typedef enum {
166166
BLEP_RESTART_SOFTDEVICE, //< Perform a softdevice restart (again, we don't want to do this in an IRQ!)
167167
BLEP_RSSI_PERIPH, //< RSSI data from peripheral connection (rssi as data)
168168
BLEP_ADV_REPORT, //< Advertising received (as buffer)
169-
#ifndef SAVE_ON_FLASH
169+
#if (NRF_SD_BLE_API_VERSION >= 5)
170170
BLEP_PHY_UPDATE_REQUEST, //< PHY update request (connection handle as data, [tx_phy,rx_phy] as buffer)
171171
BLEP_PHY_UPDATE, //< PHY update finished (connection handle as data, [tx_phy,rx_phy,status] as buffer)
172+
#endif
173+
#ifndef SAVE_ON_FLASH
172174
BLEP_MTU_UPDATE, //< MTU update finished (connection handle as data, [mtu_16bit] as buffer)
173175
#endif
174176
#if CENTRAL_LINK_COUNT>0

libs/bluetooth/jswrap_bluetooth.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -509,7 +509,7 @@ Called with discovered characteristics when discovery is finished
509509
],
510510
"#if" : "defined(NRF52_SERIES)"
511511
}
512-
(2v28+) This event is fired when the phy (radio) is changed for the active Bluetooth connection. The parameter is the data `[tx_phy, rx_phy, status]`
512+
(2v28+, nRF52840 only) This event is fired when the phy (radio) is changed for the active Bluetooth connection. The parameter is the data `[tx_phy, rx_phy, status]`
513513
514514
`tx_phy`/`rx_phy` are integers where each bit corresponds to:
515515
@@ -528,7 +528,7 @@ Called with discovered characteristics when discovery is finished
528528
],
529529
"#if" : "defined(NRF52_SERIES)"
530530
}
531-
(2v28+) This event is fired when the phy (radio) is requested to change for the active Bluetooth connection. The parameter is the data `[tx_phy, rx_phy]`
531+
(2v28+, nRF52840 only) This event is fired when the phy (radio) is requested to change for the active Bluetooth connection. The parameter is the data `[tx_phy, rx_phy]`
532532
533533
`tx_phy`/`rx_phy` are integers where each bit corresponds to:
534534
@@ -547,7 +547,7 @@ eg. `7` means all phys (eg any) have been requested
547547
],
548548
"#if" : "defined(NRF52_SERIES)"
549549
}
550-
(2v28+) This event is fired when the MTU changes for the active Bluetooth connection. Yhis is the amount of
550+
(2v28+) This event is fired when the MTU changes for the active Bluetooth connection. This is the amount of
551551
data that can be transferred in one packet.
552552
*/
553553

@@ -589,7 +589,7 @@ received. It doesn't get called if NFC is started with `NRF.nfcURL` or
589589
],
590590
"#if" : "defined(NRF52_SERIES)"
591591
}
592-
(2v28+) This event is fired when the phy (radio) is changed for this Bluetooth connection. The parameter is the data `[tx_phy, rx_phy, status]`
592+
(2v28+, nRF52840 only) This event is fired when the phy (radio) is changed for this Bluetooth connection. The parameter is the data `[tx_phy, rx_phy, status]`
593593
594594
`tx_phy`/`rx_phy` are integers where each bit corresponds to:
595595
@@ -608,7 +608,7 @@ received. It doesn't get called if NFC is started with `NRF.nfcURL` or
608608
],
609609
"#if" : "defined(NRF52_SERIES)"
610610
}
611-
(2v28+) This event is fired when the phy (radio) is requested to change for this Bluetooth connection. The parameter is the data `[tx_phy, rx_phy]`
611+
(2v28+, nRF52840 only) This event is fired when the phy (radio) is requested to change for this Bluetooth connection. The parameter is the data `[tx_phy, rx_phy]`
612612
613613
`tx_phy`/`rx_phy` are integers where each bit corresponds to:
614614
@@ -627,7 +627,7 @@ eg. `7` means all phys (eg any) have been requested
627627
],
628628
"#if" : "defined(NRF52_SERIES)"
629629
}
630-
(2v28+) This event is fired when the MTU changes for the active Bluetooth connection. Yhis is the amount of
630+
(2v28+) This event is fired when the MTU changes for the active Bluetooth connection. This is the amount of
631631
data that can be transferred in one packet.
632632
*/
633633
/*JSON{

targets/nrf5x/bluetooth.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ int jsble_exec_pending(uint8_t *buffer, int bufferLen) {
350350
jsble_restart_softdevice(NULL);
351351
break;
352352
}
353-
#ifndef SAVE_ON_FLASH
353+
#if (NRF_SD_BLE_API_VERSION >= 5)
354354
case BLEP_PHY_UPDATE_REQUEST:
355355
case BLEP_PHY_UPDATE: {
356356
uint16_t conn_handle = data;
@@ -363,6 +363,8 @@ int jsble_exec_pending(uint8_t *buffer, int bufferLen) {
363363
}
364364
break;
365365
}
366+
#endif
367+
#ifndef SAVE_ON_FLASH
366368
case BLEP_MTU_UPDATE: {
367369
uint16_t conn_handle = data;
368370
JsVar *eventTarget = jsble_device_from_handle(conn_handle);
@@ -1508,7 +1510,7 @@ static void ble_evt_handler(ble_evt_t const * p_ble_evt, void * p_context) {
15081510
#endif
15091511
break;
15101512
}
1511-
#endif
1513+
#endif // NRF_SD_BLE_API_VERSION >= 5
15121514

15131515
#if NRF_SD_BLE_API_VERSION<5
15141516
case BLE_EVT_TX_COMPLETE:

0 commit comments

Comments
 (0)