Status Codes
Error codes should be used as CONSTANTS and the programmer need not worry about the value they hold. To to validate that a connection was connected, you will implement something like
connection_status = ipg::get
if (ipg::CONNECTED != connection_status) {
print("The connection is not connected")
}
Get the last error
If an error status code is returned, a user friendly error description should have been set in the code. To access this error description, you can call ipg::get_last_error().
General
| Error Code |
Description |
| OK |
Everything is OK, no errors |
| INVALID_UUID |
A UUID was provided that doesn't match any current connection |
| INVALID_ARGUMENT |
A general error was detected because a provided argument was not correct |
| CHANNEL_OUT_OF_RANGE |
This is returned when a provided channel is not within the range of channels present on the device |
| SEND_FAILED |
Returned when the send fails |
| INVALID_COMMAND |
Returned if the given command is not valid |
Connection
| Error Code |
Description |
| NOT_CONNECTED |
The specified connection is currently Not Connected |
| INVALID_IP_ADDRESS |
An incorrectly formatted IP Address |
| INVALID_PORT |
A port number that is out of range. JMP is 9220 by default, but can be changed. Valid port numbers are 1025 - 65535. |
| CONNECTING |
Returned while the socket connection is in progress |
| CONNECTED |
Returned when the socket is connected |
| CONNECTION_FAILED |
Returned when the connection attempt was unsuccessful |
| CONNECTION_LOST |
Returned when the client gracefully closes the connection or the client is no longer available |
| DISCONNECTING |
Returned when the connection is being disconnected |
| DISCONNECTED |
Returned after the connection has been disconnected. As of now there is nothing more that can be done with a disconnected connection |
Authentication
| Error Code |
Description |
| NOT_AUTHENTICATED |
This connection has not yet attempted to authenicate |
| AUTHENTICATING |
This connection is currently in the process of authenticating |
| AUTHENTICATION_FAILED |
Authentication has been attempted and has failed. The JMP connection closes after 3 failures |
| ADMINISTRATOR |
The connection has been authenticated with administrator privileges |
| USER |
The connection has been authenticated with user privileges |
| GUEST |
The connection has been authenticated with guest privileges |
| NO_ADMINISTRATOR_PRIVILEGES |
A function was called that requires the connection to have administrator privileges |
| NO_CONTROL_PRIVILEGES |
A function was called that requires the connection to have control privileges. Control priviles are granted to users or administrators |
External Modules