@@ -84,7 +84,7 @@ void GAPClass::stopAdvertise()
84
84
85
85
int GAPClass::scan (bool withDuplicates)
86
86
{
87
- HCI.leSetScanEnable (false , true );
87
+ HCI.leSetScanEnable (0x00 , 0x01 );
88
88
89
89
// active scan, 20 ms scan interval (N * 0.625), 20 ms scan window (N * 0.625), public own address type, no filter
90
90
/*
@@ -94,19 +94,19 @@ int GAPClass::scan(bool withDuplicates)
94
94
- The scan window can only be less than or equal to the scan interval
95
95
*/
96
96
if (HCI.leSetScanParameters (0x01 , 0x0020 , 0x0020 , 0x00 , 0x00 ) != 0 ) {
97
- return false ;
97
+ return 0 ;
98
98
}
99
99
100
100
_scanning = true ;
101
101
102
- if (HCI.leSetScanEnable (true , ! withDuplicates) != 0 ) {
102
+ if (HCI.leSetScanEnable (0x01 , withDuplicates ? 0x00 : 0x01 ) != 0 ) {
103
103
return 0 ;
104
104
}
105
105
106
106
return 1 ;
107
107
}
108
108
109
- int GAPClass::scanForName (String name, bool withDuplicates)
109
+ int GAPClass::scanForName (const String& name, bool withDuplicates)
110
110
{
111
111
_scanNameFilter = name;
112
112
_scanUuidFilter = " " ;
@@ -115,7 +115,7 @@ int GAPClass::scanForName(String name, bool withDuplicates)
115
115
return scan (withDuplicates);
116
116
}
117
117
118
- int GAPClass::scanForUuid (String uuid, bool withDuplicates)
118
+ int GAPClass::scanForUuid (const String& uuid, bool withDuplicates)
119
119
{
120
120
_scanNameFilter = " " ;
121
121
_scanUuidFilter = uuid;
@@ -124,7 +124,7 @@ int GAPClass::scanForUuid(String uuid, bool withDuplicates)
124
124
return scan (withDuplicates);
125
125
}
126
126
127
- int GAPClass::scanForAddress (String address, bool withDuplicates)
127
+ int GAPClass::scanForAddress (const String& address, bool withDuplicates)
128
128
{
129
129
_scanNameFilter = " " ;
130
130
_scanUuidFilter = " " ;
@@ -135,7 +135,7 @@ int GAPClass::scanForAddress(String address, bool withDuplicates)
135
135
136
136
void GAPClass::stopScan ()
137
137
{
138
- HCI.leSetScanEnable (false , false );
138
+ HCI.leSetScanEnable (0x00 , 0x00 );
139
139
140
140
_scanning = false ;
141
141
0 commit comments