BLE examples throwing deprecated warnings with 5.7.0 on P2

Appreciate these are only warnings...

VSC_Projects/P2-BLE-Test-Central/target/5.7.0/p2/memory_platform_user.ld ...
In file included from ../../../hal/inc/interrupts_hal.h:39,
                 from ../../../hal/inc/core_hal.h:91,
                 from ../../../modules/shared/rtl872x/inc/user_part_export.c:7,
                 from src/user_export.c:1:
../../../hal/inc/pinmap_hal.h:92:1: warning: 'Hal_Pin_Info' is deprecated: Use hal_pin_info_t instead [-Wdeprecated-declarations]
   92 | Hal_Pin_Map(void) {
      | ^~~~~~~~~~~
In file included from ../../../hal/inc/pinmap_hal.h:77,
                 from ../../../hal/inc/interrupts_hal.h:39,
                 from ../../../hal/inc/core_hal.h:91,
                 from ../../../modules/shared/rtl872x/inc/user_part_export.c:7,
                 from src/user_export.c:1:
../../../hal/src/rtl872x/pinmap_impl.h:26:16: note: declared here
   26 | typedef struct hal_pin_info_t {
      |                ^~~~~~~~~~~~~~
In file included from ../../../hal/inc/interrupts_hal.h:234,
                 from ../../../hal/inc/core_hal.h:91,
                 from ../../../modules/shared/rtl872x/inc/user_part_export.c:7,
                 from src/user_export.c:1:
../../../hal/inc/interrupts_hal_compat.h:37:1: warning: 'HAL_InterruptHandler' is deprecated: Use hal_interrupt_handler_t [-Wdeprecated-declarations]
   37 | HAL_Interrupts_Attach(uint16_t pin, HAL_InterruptHandler handler, void* data, InterruptMode mode, HAL_InterruptExtraConfiguration* config) {
      | ^~~~~~~~~~~~~~~~~~~~~
../../../hal/inc/interrupts_hal_compat.h:37:1: warning: 'HAL_InterruptExtraConfiguration' is deprecated: Use hal_interrupt_extra_configuration_t [-Wdeprecated-declarations]
In file included from ../../../hal/inc/core_hal.h:91,
                 from ../../../modules/shared/rtl872x/inc/user_part_export.c:7,
                 from src/user_export.c:1:
../../../hal/inc/interrupts_hal.h:76:16: note: declared here
   76 | typedef struct hal_interrupt_extra_configuration_t {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../hal/inc/interrupts_hal.h:234,
                 from ../../../hal/inc/core_hal.h:91,
                 from ../../../modules/shared/rtl872x/inc/user_part_export.c:7,
                 from src/user_export.c:1:
../../../hal/inc/interrupts_hal_compat.h:77:1: warning: 'HAL_InterruptCallback' is deprecated: Use hal_interrupt_callback_t [-Wdeprecated-declarations]
   77 | HAL_Set_System_Interrupt_Handler(hal_irq_t irq, const HAL_InterruptCallback* callback, HAL_InterruptCallback* previous, void* reserved) {
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../hal/inc/core_hal.h:91,
                 from ../../../modules/shared/rtl872x/inc/user_part_export.c:7,
                 from src/user_export.c:1:
../../../hal/inc/interrupts_hal.h:66:16: note: declared here
   66 | typedef struct hal_interrupt_callback_t {
      |                ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from ../../../hal/inc/interrupts_hal.h:234,
                 from ../../../hal/inc/core_hal.h:91,
                 from ../../../modules/shared/rtl872x/inc/user_part_export.c:7,
                 from src/user_export.c:1:

[Additional point]
When the peripheral device code is run then this comes out of the log

0000009642 [hal] INFO: WiFi on
0000010307 [net.lwip_rltk] INFO: promisc_deinit TODO
0000010313 [hal] INFO: WiFi off

and the LESC pairing does not correctly work - related to the TODO?

I am getting a bit worried about BLE on P2 since we have plans for headless devices that can be controlled via BLE from a mobile app however this doesn't appear to be working!

The warnings for Hal_Pin_Info and HAL_Interrupt are internal to Device OS and will be fixed in a future version. It won't affect your firmware.

There is no plan to support LESC pairing on the P2/Photon 2 at this time. I believe it's not supported in the RTL872x SDK.

Not sure about the log warning. I've seen it, but it doesn't seem to cause any problems. And in any case, it's in Wi-Fi, not BLE.

@rickkas7 There being no plan to support LESC pairing on P2/Photon2 is at odds with the reference documents and examples which just requires OS >5.1.0. So does the [net.lwip_rltk] TODO explains why the pairing doesn't progress or is that WiFi?

LESC pairing - simple

This example shows how to do encrypted BLE communication using LESC Pairing in "just works" mode. This encrypts the data between the two devices, but does not authenticate, which requires some combination of displays and keypads or buttons. This requires Device OS 3.1 or later. The P2 and Photon 2 require Device OS 5.1 or later for LESC pairing.

I am working through the BLE API and finding things we need to be working on P2 aren't - rather disappointing.

You're right, LESC is in Device OS 5.1 and later on RTL872x.

That error message is from Wi-Fi, and doesn't have anything to do with BLE. LESC pairing should work.

1 Like

I have implemented the code in the examples, below is the log output for the central device - it might have paired for all I know but then is no log message to that effect and there is a state in the code.

0000013363 [app] INFO: ignoring 20:92:8C:AA:9E:XX, not our service
0000013366 [app] INFO: ignoring 54:AD:26:93:81:XX, not our service
0000013370 [app] INFO: found our Device DD:AB:CD:AA:94:EE
0000013374 [app] INFO: about to connect
0000015816 [app] INFO: Connected, starting pairing...
0000016536 [app] INFO: onPairingEvent STATUS_UPDATED status=0 lesc=1 bonded=0
0000017886 [app] INFO: sent counter=0
0000019911 [app] INFO: sent counter=1
0000021891 [app] INFO: sent counter=2
0000023871 [app] INFO: sent counter=3
0000025896 [app] INFO: sent counter=4

There are no explanations of the magic values in the onPairingEvent!