Skip to main content

Device and Internet Status

Device and Internet Connection related commands.

Get Device ID​

Returns a unique device ID.

Login required: No

CmdProc Code: OVS_CMD_GET_DEVICEID

Command number: 7

Input: Not required

Response: OVS_NOTIFY_GET_DEVICEID

OVS_NOTIFY_GET_DEVICEID Successful response
OVS_ERR_OK

data will contain
{
"device_id" : "unique_device_id"
}

Code sample:

VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_GET_DEVICEID, callback);

Check AES Support​

Checks whether the device's CPU natively supports AES encryption

Login required: No

CmdProc Code: OVS_CMD_CHECK_AES

Command number: 12

Input: Not required

Response: OVS_NOTIFY_CHECK_AES

OVS_NOTIFY_GET_DEVICEID Successful response
OVS_ERR_OK

data will contain
{
"AES_Support" : true|false
}

Code sample:

VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_AES, callback);

Check Internet Connection​

Attempts to establish a connection to the back-end server. If connection fails, returns OVS_ERR_INTERNET_DISCONNECTED error.

Login required: No

CmdProc Code: OVS_CMD_CHECK_INTERNET

Command number: 6

Input: Not required

Response: OVS_NOTIFY_CHECK_INTERNET

OVS_NOTIFY_CHECK_INTERNET Successful response
OVS_ERR_OK

data is null

Code sample:

VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_INTERNET, callback);

Check Open Port​

Attempts to establish a connection to a specified host and port. Returns OVS_ERR_PORT_CLOSED error if connection fails.

Login required: No

CmdProc Code: OVS_CMD_CHECK_PORT

Command number: 8

Input:

{
"ip_addr": "167.71.173.88",
"proto": "tcp",
"port": 1194
}

Response: OVS_NOTIFY_CHECK_PORT

OVS_NOTIFY_CHECK_PORT Successful response
OVS_ERR_OK

data is null

Code sample:

VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_CHECK_PORT, callback, "178.79.183.206", "tcp", "1194");

Get Ping​

Attempts to establish a connection to a given VPN server and, if connection could be established, measures ping time.

Login required: No

CmdProc Code: OVS_CMD_GET_PING_RESULT

Command number: 11

Input:

{
"ip_addr": "104.192.3.90"
}

Response: OVS_NOTIFY_GET_PING_RESULT

OVS_NOTIFY_GET_PING_RESULT Successful response
OVS_ERR_OK

data will contain the IP address and the response time in ms

{
"ip_addr": "104.192.3.90",
"time": 30
}

Code sample:

VPNSDK.CommandNotifyCB callback = new VPNSDK.CommandNotifyCB() {
@Override
public void onNotify(int notification, int error, Object data) {
if (error == VPNSDK.OVS_ERROR_CODES.OVS_ERR_OK) {
// Do something when command is successful
} else {
// Process error
}
}
};
VPNSDK.CmdProc(VPNSDK.OVS_CMD_CODES.OVS_CMD_GET_PING_RESULT, callback, "104.192.3.90");