Hubiquitus Android  0.3
Android client for hubiquitus protocol
codes.js
Go to the documentation of this file.
00001 /*
00002  * Copyright (c) Novedia Group 2012.
00003  *
00004  *     This file is part of Hubiquitus.
00005  *
00006  *     Hubiquitus is free software: you can redistribute it and/or modify
00007  *     it under the terms of the GNU General Public License as published by
00008  *     the Free Software Foundation, either version 3 of the License, or
00009  *     (at your option) any later version.
00010  *
00011  *     Hubiquitus is distributed in the hope that it will be useful,
00012  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *     GNU General Public License for more details.
00015  *
00016  *     You should have received a copy of the GNU General Public License
00017  *     along with Hubiquitus.  If not, see <http://www.gnu.org/licenses/>.
00018  */
00019 
00020 //Make it compatible with node and web browser
00021 if (typeof define !== 'function') { var define = require('amdefine')(module) }
00022 
00023 define(
00024     [],
00025     function(){
00026 
00027         var types = {
00028             hStatus: 'hStatus',
00029             hResult: 'hResult',
00030             hMessage: 'hMessage'
00031         };
00032 
00033         var errors = {
00034             NO_ERROR: 0,
00035             JID_MALFORMAT: 1,
00036             CONN_TIMEOUT: 2,
00037             AUTH_FAILED: 3,
00038             ATTACH_FAILED: 4,
00039             ALREADY_CONNECTED: 5,
00040             TECH_ERROR : 6,
00041             NOT_CONNECTED : 7,
00042             CONN_PROGRESS : 8,
00043             ALREADY_SUBSCRIBED: 1,
00044             GET_SUBS_FAILED: 2
00045         };
00046 
00047         var statuses = {
00048             CONNECTING : 1,
00049             CONNECTED : 2,
00050             REATTACHING: 3,
00051             REATTACHED: 4,
00052             DISCONNECTING: 5,
00053             DISCONNECTED: 6
00054         };
00055 
00056         var hResultStatus = {
00057             OK : 0,
00058             TECH_ERROR : 1,
00059             NOT_CONNECTED : 3,
00060             NOT_AUTHORIZED : 5,
00061             MISSING_ATTR : 6,
00062             INVALID_ATTR : 7,
00063             NOT_AVAILABLE : 9,
00064             EXEC_TIMEOUT : 10
00065         };
00066 
00067         //requireJS way to export
00068         return{
00069             errors : errors,
00070             statuses: statuses,
00071             hResultStatus : hResultStatus,
00072             types: types
00073         }
00074     }
00075 );
 All Classes Namespaces Files Functions Variables