Merge pull request #246 from DavidLin1577/patch-21

Improved the readablity of  the code
This commit is contained in:
Supowang
2020-11-23 10:56:43 +08:00
committed by GitHub

View File

@@ -10,8 +10,8 @@
#define BLE_RAW_ADV_DATA_LEN (31U) #define BLE_RAW_ADV_DATA_LEN (31U)
typedef enum nimble_scan_status_en { typedef enum nimble_scan_status_en {
NIMBLE_SCAN_STATUS_STOPPED, NIMBLE_SCAN_STATUS_STOPPED = 0,
NIMBLE_SCAN_STATUS_SCANNING, NIMBLE_SCAN_STATUS_SCANNING = 1,
} nimble_scan_status_t; } nimble_scan_status_t;
typedef struct nimble_scan_item_st { typedef struct nimble_scan_item_st {
@@ -198,7 +198,7 @@ int nimble_scan_start(void)
{ {
int rc; int rc;
if (ble_gap_disc_active() != 0) { if (ble_gap_disc_active() != NIMBLE_SCAN_STATUS_STOPPED) {
return 0; return 0;
} }
@@ -216,7 +216,7 @@ void nimble_scan_stop(void)
{ {
int rc; int rc;
if (ble_gap_disc_active() != 1) { if (ble_gap_disc_active() != NIMBLE_SCAN_STATUS_SCANNING) {
return; return;
} }