public abstract class EnelXBLEManager
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
EnelXBLEManager.IdentifyChargingPointCallback |
static interface |
EnelXBLEManager.ScanCallback
Interface for implementing a callback for scanning features.
|
static interface |
EnelXBLEManager.StartChargeCallback |
static interface |
EnelXBLEManager.StopChargeCallback |
| Constructor and Description |
|---|
EnelXBLEManager() |
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String[] |
getMissingPermissions(android.content.Context context)
Returns an array with all those permissions that are required by the EnelX BLE SDK but not
yet granted by the user.
|
static void |
identifyChargingPoint(android.content.Context context,
BLEChargingPoint chargingPoint,
java.lang.String chargeCardUid,
EnelXBLEManager.IdentifyChargingPointCallback callback)
Makes blink or buzz the given charging point, thus the user can identify it.
|
static boolean |
isBluetoothEnabled(android.content.Context context)
Checks whether bluetooth on device is currently enabled.
|
static boolean |
isSupported(android.content.Context context)
Checks whether the EnelX BLE SDK is supported by the current device.
|
static void |
startCharge(android.content.Context context,
BLEChargingPoint chargingPoint,
java.lang.String chargeCardUid,
EnelXBLEManager.StartChargeCallback callback)
Connects the given charging point and ask it to start charging.
|
static void |
startScan(android.content.Context context,
BLEChargingPoint.Status[] statusFilter,
EnelXBLEManager.ScanCallback callback)
Starts scanning for charging points in one of the given statuses (or in any status if no
filter is given).
|
static void |
stopCharge(android.content.Context context,
BLEChargingPoint chargingPoint,
java.lang.String chargeCardUid,
EnelXBLEManager.StopChargeCallback callback)
Connects the given charging point and ask it to stop charging.
|
static void |
stopScan(android.content.Context context,
EnelXBLEManager.ScanCallback callback)
Stops a previously started scanning operation.
|
public static boolean isSupported(android.content.Context context)
context - The application context.public static java.lang.String[] getMissingPermissions(android.content.Context context)
context - The application context.public static boolean isBluetoothEnabled(android.content.Context context)
context - The application context.public static void startScan(android.content.Context context,
BLEChargingPoint.Status[] statusFilter,
EnelXBLEManager.ScanCallback callback)
If all requirements are met, the scanning operation is started and the caller is notified
through the EnelXBLEManager.ScanCallback.onScanStarted() method. Since now on, the scan is
running until it is stopped by calling
stopScan(Context, ScanCallback) or until an error causes the
scanning operation to be automatically stopped. In both cases, the caller is notified through
the EnelXBLEManager.ScanCallback.onScanStopped() method.
Charging points detected during the scan are notified to the caller through the
EnelXBLEManager.ScanCallback.onChargingPoint(BLEChargingPoint, EnelXBLEManager.ScanCallback.Event) method.
If an error occurs, before or after the scan has been started, it is notified to the caller
through the EnelXBLEManager.ScanCallback.onScanError(EnelXBLEManager.ScanCallback.Error, Exception) method.
context - The application context.statusFilter - The charging point status filters. If null or empty, no filter
is applied and charging points in any status are returned.callback - A callback object for receiving scan related events.public static void stopScan(android.content.Context context,
EnelXBLEManager.ScanCallback callback)
context - The application context.callback - The same callback object passed previously to the
startScan(Context, BLEChargingPoint.Status[], ScanCallback)
method for starting the scan.public static void startCharge(android.content.Context context,
BLEChargingPoint chargingPoint,
java.lang.String chargeCardUid,
EnelXBLEManager.StartChargeCallback callback)
context - The application context.chargingPoint - The target charging point.chargeCardUid - The Charge Card UID needed to authorize the charge.callback - A callback object for notifying results.public static void stopCharge(android.content.Context context,
BLEChargingPoint chargingPoint,
java.lang.String chargeCardUid,
EnelXBLEManager.StopChargeCallback callback)
context - The application context.chargingPoint - The target charging point.chargeCardUid - The Charge Card UID needed to authorize the stop charge command.callback - A callback object for notifying results.public static void identifyChargingPoint(android.content.Context context,
BLEChargingPoint chargingPoint,
java.lang.String chargeCardUid,
EnelXBLEManager.IdentifyChargingPointCallback callback)
context - The application context.chargingPoint - The target charging point.chargeCardUid - The Charge Card UID for identifying the charging point.callback - A callback object for being notified about the operation results.