public class BlinkupController extends Object
Modifier and Type | Field and Description |
---|---|
static double |
BLINKUP_VERSION_NUMBER |
static String |
BLINKUP_VERSION_STRING |
int |
countdownSeconds
Number of seconds to count down before BlinkUp.
|
int |
drawableIdInterstitial
Resource Id for the image to activate the interstitial page.
|
boolean |
enablePowerSaveMessage
Show warning message before BlinkUp on detecting a low frame rate.
|
static String |
FIELD_DNS_1 |
static String |
FIELD_DNS_2 |
static String |
FIELD_ERROR |
static String |
FIELD_GATEWAY |
static String |
FIELD_IP_ADDRESS |
static String |
FIELD_MODE |
static String |
FIELD_NETMASK |
static String |
FIELD_PASSWORD |
static String |
FIELD_PIN |
static String |
FIELD_PORT |
static String |
FIELD_PROXY_PASSWORD |
static String |
FIELD_PROXY_USERNAME |
static String |
FIELD_SERVER |
static String |
FIELD_SSID |
static String |
FIELD_TOKEN |
Intent |
intentBlinkupComplete
Intent to launch your activity after flashing the wifi settings via
BlinkUp.
|
Intent |
intentClearComplete
Intent to launch your activity after clearing the wifi settings via
BlinkUp.
|
protected String |
lastMode |
static String |
MODE_CLEAR |
static String |
MODE_ETHERNET |
static String |
MODE_WIFI |
static String |
MODE_WPS |
boolean |
setFullScreenBrightness
Set screen brightness to 100%.
|
int |
setScreenBrightnessPercent
Set screen brightness to this percentage.
|
boolean |
showClearConfig
Show clear device settings in the wifi select interface.
|
boolean |
showLegacyMode
Show checkbox to enable legacy mode.
|
boolean |
showPassword
Show checkbox to show password.
|
String |
stringIdBlinkUpDesc
Resource Id for the custom string for the BlinkUp description.
|
String |
stringIdChangeNetwork
Resource Id for the custom string for change network.
|
String |
stringIdChooseWiFiNetwork
Resource Id for the custom string to choose wifi network.
|
String |
stringIdClearDeviceSettings
Resource Id for the custom string to clear device settings.
|
String |
stringIdClearWireless
Resource Id for the custom string for clear device button.
|
String |
stringIdConnectUsingWps
Resource Id for the custom string for connect using WPS.
|
String |
stringIdCountdownDesc
Resource Id for the custom string for countdown description.
|
String |
stringIdLegacyMode
Resource Id for the custom string for legacy mode.
|
String |
stringIdLegacyModeDesc
Resource Id for the custom string for legacy mode description.
|
String |
stringIdLowFrameRateDesc
Resource Id for the custom string for description in low frame rate dialog.
|
String |
stringIdLowFrameRateGoToSettings
Resource Id for the custom string for go to settings in low frame rate dialog.
|
String |
stringIdLowFrameRateProceedAnyway
Resource Id for the custom string for proceed anyway in low frame rate dialog.
|
String |
stringIdLowFrameRateTitle
Resource Id for the custom string for title in low frame rate dialog.
|
String |
stringIdNext
Resource Id for the custom string for next when using interstitial page.
|
String |
stringIdOk
Resource Id for the custom string for OK.
|
String |
stringIdPasswordHint
Resource Id for the custom string for password hint.
|
String |
stringIdRememberPassword
Resource Id for the custom string for remember password.
|
String |
stringIdSendBlinkUp
Resource Id for the custom string for the Send BlinkUp button.
|
String |
stringIdShowPassword
Resource Id for the custom string for show password.
|
String |
stringIdSsidHint
Resource Id for the custom string for SSID hint.
|
String |
stringIdWpsInfo
Resource Id for the custom string for wps info.
|
String |
stringIdWpsPinHint
Resource Id for the custom string for WPS pin hint.
|
Modifier and Type | Method and Description |
---|---|
void |
acquireSetupToken(Activity activity,
String apiKey,
TokenAcquireCallback tokenAcquireCallback)
Acquire a setup token.
|
void |
cancelTokenStatusPolling()
Stop the current token status fetching.
|
void |
clearDevice(Activity activity)
Show BlinkUp directly to clear device settings on the Imp.
|
void |
clearDevice(Activity activity,
boolean legacyMode)
Show BlinkUp directly to clear device settings on the Imp.
|
void |
clearSavedData(Context context)
Clear cached and persistent data (saved passwords, most recent blinkup,
etc)
|
static String |
getCurrentWifiSSID(Context context)
Get the SSID of the connected wifi network
|
static BlinkupController |
getInstance()
Get a BlinkupController instance.
|
void |
getTokenStatus(String token,
TokenStatusCallback callback)
Fetch the agent url, impee ID and verified date after BlinkUp.
|
void |
getTokenStatus(String token,
TokenStatusCallback callback,
long timeoutMs)
Fetch the agent url, impee ID and verified date after BlinkUp.
|
void |
getTokenStatus(TokenStatusCallback callback)
Fetch the agent url, impee ID and verified date after BlinkUp.
|
void |
getTokenStatus(TokenStatusCallback callback,
long timeoutMs)
Fetch the agent url, impee ID and verified date after BlinkUp.
|
void |
handleActivityResult(Activity activity,
int requestCode,
int resultCode,
Intent data)
Call this from
onActivityResult
of your activity if you have specified a custom complete activity via
intentBlinkupComplete or
intentClearComplete |
void |
selectWifi(Activity activity,
String apiKey,
int requestCode,
ServerErrorHandler errorHandler)
Bring up the wifi select interface and return the collected parameters
in onActivityResult
|
void |
selectWifiAndSetupDevice(Activity activity,
String apiKey,
ServerErrorHandler errorHandler)
Bring up the wifi select interface to configure an Imp.
|
void |
setBaseUrl(String baseUrl)
Set the base url of the BlinkupController.
|
void |
setPlanID(String planID)
Set planID for all requests.
|
void |
setupDevice(Activity activity,
String apiKey,
Proxy proxy,
StaticIp staticIp,
boolean legacyMode,
ServerErrorHandler errorHandler)
Show BlinkUp with Ethernet.
|
void |
setupDevice(Activity activity,
String apiKey,
Proxy proxy,
StaticIp staticIp,
ServerErrorHandler errorHandler)
Show BlinkUp with Ethernet.
|
void |
setupDevice(Activity activity,
String wpsPin,
String apiKey,
boolean legacyMode,
ServerErrorHandler errorHandler)
Show BlinkUp directly without going through the wifi select interface.
|
void |
setupDevice(Activity activity,
String wpsPin,
String apiKey,
Proxy proxy,
StaticIp staticIp,
boolean legacyMode,
ServerErrorHandler errorHandler)
Show BlinkUp directly without going through the wifi select interface.
|
void |
setupDevice(Activity activity,
String wpsPin,
String apiKey,
Proxy proxy,
StaticIp staticIp,
ServerErrorHandler errorHandler)
Show BlinkUp directly without going through the wifi select interface.
|
void |
setupDevice(Activity activity,
String wpsPin,
String apiKey,
ServerErrorHandler errorHandler)
Show BlinkUp directly without going through the wifi select interface.
|
void |
setupDevice(Activity activity,
String ssid,
String password,
String apiKey,
boolean legacyMode,
ServerErrorHandler errorHandler)
Show BlinkUp directly without going through the wifi select interface.
|
void |
setupDevice(Activity activity,
String ssid,
String password,
String apiKey,
Proxy proxy,
StaticIp staticIp,
ServerErrorHandler errorHandler)
Show BlinkUp directly without going through the wifi select interface.
|
void |
setupDevice(Activity activity,
String ssid,
String password,
String apiKey,
ServerErrorHandler errorHandler)
Show BlinkUp directly without going through the wifi select interface.
|
public static final String BLINKUP_VERSION_STRING
public static final double BLINKUP_VERSION_NUMBER
public static final String FIELD_MODE
public static final String MODE_WIFI
public static final String MODE_WPS
public static final String MODE_ETHERNET
public static final String MODE_CLEAR
public static final String FIELD_SSID
public static final String FIELD_PASSWORD
public static final String FIELD_PIN
public static final String FIELD_TOKEN
public static final String FIELD_ERROR
public static final String FIELD_PORT
public static final String FIELD_SERVER
public static final String FIELD_PROXY_USERNAME
public static final String FIELD_PROXY_PASSWORD
public static final String FIELD_IP_ADDRESS
public static final String FIELD_NETMASK
public static final String FIELD_GATEWAY
public static final String FIELD_DNS_1
public static final String FIELD_DNS_2
public boolean showLegacyMode
public boolean showPassword
public String stringIdChooseWiFiNetwork
public String stringIdWpsInfo
public String stringIdClearDeviceSettings
public String stringIdClearWireless
public String stringIdSendBlinkUp
public String stringIdBlinkUpDesc
public String stringIdLegacyMode
public String stringIdLegacyModeDesc
public String stringIdOk
public String stringIdNext
public String stringIdSsidHint
public String stringIdPasswordHint
public String stringIdRememberPassword
public String stringIdShowPassword
public String stringIdWpsPinHint
public String stringIdChangeNetwork
public String stringIdConnectUsingWps
public String stringIdCountdownDesc
public String stringIdLowFrameRateTitle
public String stringIdLowFrameRateDesc
public String stringIdLowFrameRateGoToSettings
public String stringIdLowFrameRateProceedAnyway
public int drawableIdInterstitial
public int countdownSeconds
public boolean enablePowerSaveMessage
public boolean setFullScreenBrightness
public int setScreenBrightnessPercent
setFullScreenBrightness
i.e. if this is set to anything other than 100, the screen
brightness will be set to this percentage whether setFullScreenBrightness
is set to
true or false.public boolean showClearConfig
public Intent intentBlinkupComplete
handleActivityResult
from the onActivityResult
of your activity.public Intent intentClearComplete
handleActivityResult
from the onActivityResult
of your activity.protected String lastMode
public static BlinkupController getInstance()
public void handleActivityResult(Activity activity, int requestCode, int resultCode, Intent data)
onActivityResult
of your activity if you have specified a custom complete activity via
intentBlinkupComplete
or
intentClearComplete
activity
- Your activityrequestCode
- Request code from onActivityResult
resultCode
- Result code from onActivityResult
data
- Intent from onActivityResult
public void setBaseUrl(String baseUrl)
public void setPlanID(String planID)
public void clearSavedData(Context context)
context
- Context to clear datapublic void selectWifiAndSetupDevice(Activity activity, String apiKey, ServerErrorHandler errorHandler)
activity
- Originating activityapiKey
- Your api keyerrorHandler
- Error handlerpublic void selectWifi(Activity activity, String apiKey, int requestCode, ServerErrorHandler errorHandler)
activity
- Originating activityapiKey
- Your api keyrequestCode
- Request code for onActivityResulterrorHandler
- Error handlerpublic void setupDevice(Activity activity, String ssid, String password, String apiKey, ServerErrorHandler errorHandler)
activity
- Originating activityssid
- SSID for flashingpassword
- Password for flashingapiKey
- Your api keyerrorHandler
- Error handlerpublic void setupDevice(Activity activity, String ssid, String password, String apiKey, Proxy proxy, StaticIp staticIp, ServerErrorHandler errorHandler)
activity
- Originating activityssid
- SSID for flashingpassword
- Password for flashingapiKey
- Your api keyproxy
- Proxy info. null if not neededstaticIp
- Static IP info. null if not needederrorHandler
- Error handlerpublic void setupDevice(Activity activity, String ssid, String password, String apiKey, boolean legacyMode, ServerErrorHandler errorHandler)
activity
- Originating activityssid
- SSID for flashingpassword
- Password for flashingapiKey
- Your api keylegacyMode
- Legacy modeerrorHandler
- Error handlerpublic void setupDevice(Activity activity, String wpsPin, String apiKey, ServerErrorHandler errorHandler)
activity
- Originating activitywpsPin
- WPS pin for flashingapiKey
- Your api keyerrorHandler
- Error handlerpublic void setupDevice(Activity activity, String wpsPin, String apiKey, boolean legacyMode, ServerErrorHandler errorHandler)
activity
- Originating activitywpsPin
- WPS pin for flashingapiKey
- Your api keylegacyMode
- Legacy modeerrorHandler
- Error handlerpublic void setupDevice(Activity activity, String wpsPin, String apiKey, Proxy proxy, StaticIp staticIp, ServerErrorHandler errorHandler)
activity
- Originating activitywpsPin
- WPS pin for flashingapiKey
- Your api keyproxy
- Proxy info. null if not neededstaticIp
- Static IP info. null if not needederrorHandler
- Error handlerpublic void setupDevice(Activity activity, String wpsPin, String apiKey, Proxy proxy, StaticIp staticIp, boolean legacyMode, ServerErrorHandler errorHandler)
activity
- Originating activitywpsPin
- WPS pin for flashingapiKey
- Your api keyproxy
- Proxy info. null if not neededstaticIp
- Static IP info. null if not neededlegacyMode
- Legacy modeerrorHandler
- Error handlerpublic void setupDevice(Activity activity, String apiKey, Proxy proxy, StaticIp staticIp, ServerErrorHandler errorHandler)
activity
- Originating activityapiKey
- Your api keyproxy
- Proxy info. null if not neededstaticIp
- Static IP info. null if not needederrorHandler
- Error handlerpublic void setupDevice(Activity activity, String apiKey, Proxy proxy, StaticIp staticIp, boolean legacyMode, ServerErrorHandler errorHandler)
activity
- Originating activityapiKey
- Your api keyproxy
- Proxy info. null if not neededstaticIp
- Static IP info. null if not neededlegacyMode
- Legacy modeerrorHandler
- Error handlerpublic void clearDevice(Activity activity)
activity
- Originating activitypublic void clearDevice(Activity activity, boolean legacyMode)
activity
- Originating activitylegacyMode
- Legacy modepublic static String getCurrentWifiSSID(Context context)
context
- Originating contextpublic void acquireSetupToken(Activity activity, String apiKey, TokenAcquireCallback tokenAcquireCallback)
activity
- Originating activityapiKey
- Your api keytokenAcquireCallback
- Callback for success and errorpublic void getTokenStatus(TokenStatusCallback callback)
callback
- Callback to handle success, error and timeout.public void getTokenStatus(String token, TokenStatusCallback callback)
token
- The setup tokencallback
- Callback to handle success, error and timeout.public void getTokenStatus(TokenStatusCallback callback, long timeoutMs)
callback
- Callback to handle success, error and timeout.timeoutMs
- timeout in milliseconds.public void getTokenStatus(String token, TokenStatusCallback callback, long timeoutMs)
token
- The setup tokencallback
- Callback to handle success, error and timeout.timeoutMs
- timeout in milliseconds.public void cancelTokenStatusPolling()