ActiveScanning Property
Whether to use active scanning.
Syntax
ANSI (Cross Platform) int GetActiveScanning();
int SetActiveScanning(int bActiveScanning); Unicode (Windows) BOOL GetActiveScanning();
INT SetActiveScanning(BOOL bActiveScanning);
#define PID_BLECLIENT_ACTIVESCANNING 1 IPWORKSBLE_EXTERNAL void* IPWORKSBLE_CALL IPWorksBLE_BLEClient_Get(void *lpObj, int propid, int arridx, int *lpcbVal, int64 *lpllVal); IPWORKSBLE_EXTERNAL int IPWORKSBLE_CALL IPWorksBLE_BLEClient_Set(void *lpObj, int propid, int arridx, const void *val, int cbVal);
Default Value
FALSE
Remarks
When enabled, the class will instruct the system to use active scanning rather than passive scanning, at the cost of higher power consumption.
Active scanning causes the system's BLE API to request a scan response packet for each advertisement received, which in turn means that you will be able to get more information from devices without connecting to them.
The tradeoff is that enabling this feature increases power consumption for both the client and server, but if your use-case doesn't call for ever actually connecting to the devices (which itself can be a power-intensive operation), then that tradeoff might be mitigated.
Note that you cannot change the value of the ActiveScanning property if the class is already scanning.
Active Scanning
// Enable active scanning.
bleclient1.ActiveScanning = true;
bleclient1.StartScanning("");
// ...
bleclient1.StopScanning();
This property is not available at design time.
Data Type
Boolean