ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
BLE

Files

file  ruuvi_interface_communication_ble_advertising_test.h
 
file  ruuvi_interface_communication_ble_gatt_test.h
 

Macros

#define RI_TEST_ADV_FAST   (100U)
 Fastest allowed interval for connectable advertising. More...
 
#define RI_TEST_ADV_TOO_FAST   (99U)
 Interval shorter than allowed for non-connectable advertising. More...
 
#define RI_TEST_ADV_TOO_SLOW   (10001U)
 Interval longer than allowed for non-connectable advertising. More...
 
#define RI_ADV_RND_DELAY   (10U)
 Maximum random delay in adv interval. More...
 
#define RI_TEST_ADV_SCAN_INTERVAL   (200U)
 Scan interval for test. More...
 
#define RI_TEST_ADV_SCAN_WINDOW   (100U)
 Scan window for test. More...
 
#define RI_TEST_ADV_SCAN_CH_NUM   (3U)
 Number of channels to scan. More...
 
#define TEST_GATT_PACKET_LEN   (20U)
 Bytes of GATT test packet. More...
 
#define TEST_GATT_PACKET_NUM   (10000U)
 Number of packets to send in throughput test. More...
 

Functions

bool ri_communication_ble_advertising_run_integration_test (const rd_test_print_fp printfp, const ri_radio_modulation_t modulation)
 Run advertising test. More...
 
bool ri_communication_ble_gatt_run_integration_test (const rd_test_print_fp printfp, const ri_radio_modulation_t modulation)
 

Detailed Description

Macro Definition Documentation

◆ RI_ADV_RND_DELAY

#define RI_ADV_RND_DELAY   (10U)

Maximum random delay in adv interval.

Definition at line 21 of file ruuvi_interface_communication_ble_advertising_test.h.

◆ RI_TEST_ADV_FAST

#define RI_TEST_ADV_FAST   (100U)

Fastest allowed interval for connectable advertising.

Definition at line 18 of file ruuvi_interface_communication_ble_advertising_test.h.

◆ RI_TEST_ADV_SCAN_CH_NUM

#define RI_TEST_ADV_SCAN_CH_NUM   (3U)

Number of channels to scan.

Definition at line 24 of file ruuvi_interface_communication_ble_advertising_test.h.

◆ RI_TEST_ADV_SCAN_INTERVAL

#define RI_TEST_ADV_SCAN_INTERVAL   (200U)

Scan interval for test.

Definition at line 22 of file ruuvi_interface_communication_ble_advertising_test.h.

◆ RI_TEST_ADV_SCAN_WINDOW

#define RI_TEST_ADV_SCAN_WINDOW   (100U)

Scan window for test.

Definition at line 23 of file ruuvi_interface_communication_ble_advertising_test.h.

◆ RI_TEST_ADV_TOO_FAST

#define RI_TEST_ADV_TOO_FAST   (99U)

Interval shorter than allowed for non-connectable advertising.

Definition at line 19 of file ruuvi_interface_communication_ble_advertising_test.h.

◆ RI_TEST_ADV_TOO_SLOW

#define RI_TEST_ADV_TOO_SLOW   (10001U)

Interval longer than allowed for non-connectable advertising.

Definition at line 20 of file ruuvi_interface_communication_ble_advertising_test.h.

◆ TEST_GATT_PACKET_LEN

#define TEST_GATT_PACKET_LEN   (20U)

Bytes of GATT test packet.

Definition at line 21 of file ruuvi_interface_communication_ble_gatt_test.h.

◆ TEST_GATT_PACKET_NUM

#define TEST_GATT_PACKET_NUM   (10000U)

Number of packets to send in throughput test.

Definition at line 22 of file ruuvi_interface_communication_ble_gatt_test.h.

Function Documentation

◆ ri_communication_ble_advertising_run_integration_test()

bool ri_communication_ble_advertising_run_integration_test ( const rd_test_print_fp  printfp,
const ri_radio_modulation_t  modulation 
)

Run advertising test.

Tests transmitting data at given modulation. If selected modulation can be used as a primary PHY, it is used. If selected modulation can be used only as a secondary PHY, primary advertisement is sent at 1 MBit / s and secondary extended advertisement is sent on selected PHY.

Also checks that data is received while scanning, and that scanning times out after scanning on all selected channels.

Currently does not verify the actual PHY data was received / sent on.

◆ ri_communication_ble_gatt_run_integration_test()

bool ri_communication_ble_gatt_run_integration_test ( const rd_test_print_fp  printfp,
const ri_radio_modulation_t  modulation 
)