connectivity/com.nokia.carbide.remoteConnections.discovery.pccs/src/com/nokia/carbide/remoteconnections/discovery/pccs/pccsnative/DMAPIDefinitions.java
changeset 868 089762ea5b6d
child 1118 572705e37c33
equal deleted inserted replaced
867:14f10a1d075c 868:089762ea5b6d
       
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the License "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 package com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative;
       
    18 
       
    19 public class DMAPIDefinitions {
       
    20 	//=========================================================
       
    21 	// CFAPI version
       
    22 	//
       
    23 	public static final int CFAPI_VERSION_10 = 10;
       
    24 	//=========================================================
       
    25 	//=========================================================
       
    26 	// Device Management API versions 
       
    27 	//
       
    28 	public static final int DMAPI_VERSION_30		=30;
       
    29 	public static final int DMAPI_VERSION_31		=31;
       
    30 	public static final int DMAPI_VERSION_32		=32;
       
    31 	public static final int DMAPI_VERSION_33		=33;
       
    32 	public static final int DMAPI_VERSION_34		=34;
       
    33 	public static final int DMAPI_VERSION_35		=35;
       
    34 	public static final int DMAPI_VERSION_36		=36;
       
    35 	public static final int DMAPI_VERSION_37		=37;
       
    36 	//=========================================================
       
    37 	// Device callback status values
       
    38 	public static final int CONAPI_DEVICE_LIST_UPDATED		=0x00;	// List is updated. No any specific information.
       
    39 	public static final int CONAPI_DEVICE_ADDED				=0x01;	// A new device is added to the list.
       
    40 	public static final int CONAPI_DEVICE_REMOVED			=0x02;	// Device is removed from the list.
       
    41 	public static final int CONAPI_DEVICE_UPDATED			=0x04;	// Device is updated. A connection is added or removed
       
    42 													// or device is renamed. Device still exist in the list.
       
    43 	// Device callback info values
       
    44 	public static final int CONAPI_CONNECTION_ADDED			=0x01;	// Note! HIBYTE == media, LOBYTE == CONAPI_CONNECTION_ADDED
       
    45 	public static final int CONAPI_CONNECTION_REMOVED		=0x02;	// Note! HIBYTE == media, LOBYTE == CONAPI_CONNECTION_REMOVED
       
    46 	public static final int CONAPI_DEVICE_RENAMED			=0x04;	// Friendly name of the device is changed
       
    47 
       
    48 	// Device callback macros
       
    49 //	#define	GET_CONAPI_CB_STATUS(Status)	(0x0000FFFF & Status)
       
    50 //	#define	GET_CONAPI_CB_INFO(Status)		((0x00FF0000 & Status)>>16)
       
    51 //	#define	GET_CONAPI_CB_INFO_DATA(Status)	((0xFF000000 & Status)>>24)
       
    52 	public static final int GET_CONAPI_CB_STATUS(int status) {
       
    53 		return (0x0000FFFF & status);
       
    54 	}
       
    55 	public static final int GET_CONAPI_CB_INFO(int status) {
       
    56 		return ((0x00FF0000 & status) >>16);
       
    57 	}
       
    58 	public static final int GET_CONAPI_CB_INFO_DATA(int status) {
       
    59 		return ((0xFF000000 & status)>>24);
       
    60 	}
       
    61 	// Definitions used with dwState value in CONAPI_CONNECTION_INFO stucture:
       
    62 //	#define	CONAPI_DEVICE_NOT_FUNCTIONAL		0x00000000	// Device is not working or unsupported device.
       
    63 //	#define	CONAPI_DEVICE_UNPAIRED				0x00000001	// Device is not paired
       
    64 //	#define	CONAPI_DEVICE_PAIRED				0x00000002	// Device is paired
       
    65 //	#define	CONAPI_DEVICE_PCSUITE_TRUSTED		0x00000004	// Device is PC Suite trusted
       
    66 //	#define	CONAPI_DEVICE_WRONG_MODE			0x00000008	// Device is connected in wrong mode.
       
    67 	public static final int CONAPI_DEVICE_NOT_FUNCTIONAL = 0x00000000;
       
    68 	public static final int CONAPI_DEVICE_UNPAIRED = 0x00000001;
       
    69 	public static final int CONAPI_DEVICE_PAIRED = 0x00000002;
       
    70 	public static final int CONAPI_DEVICE_PCSUITE_TRUSTED = 0x00000004;
       
    71 	public static final int CONAPI_DEVICE_WRONG_MODE = 0x00000008;
       
    72 
       
    73 	// Definitions used also with dwState value in CONAPI_CONNECTION_INFO stucture if 
       
    74 	// CONASetDeviceListOption function is called with DMAPI_OPTION_INCLUDE_USB_MODE_IN_LIST parameter:
       
    75 //	#define CONAPI_DEVICE_IN_PCSUITE_MODE		0x01000000	// PC Suite mode
       
    76 //	#define CONAPI_DEVICE_IN_MASSSTORAGE_MODE	0x02000000  // Mass storage mode
       
    77 //	#define CONAPI_DEVICE_IN_MTP_MODE			0x03000000	// Media Transfer mode
       
    78 //	#define CONAPI_DEVICE_IN_RNDIS_MODE			0x04000000  // RNDIS mode
       
    79 //	#define CONAPI_DEVICE_IN_PICTBRIDGE_MODE	0x05000000  // Picture bridge mode
       
    80 //	#define CONAPI_DEVICE_IN_UNKNOWN_MODE		0x0E000000  // Unknown mode
       
    81 	public static final int CONAPI_DEVICE_IN_PCSUITE_MODE = 0x01000000;
       
    82 	public static final int CONAPI_DEVICE_IN_MASSSTORAGE_MODE = 0x02000000;
       
    83 	public static final int CONAPI_DEVICE_IN_MTP_MODE = 0x03000000;
       
    84 	public static final int CONAPI_DEVICE_IN_RNDIS_MODE = 0x04000000;
       
    85 	public static final int CONAPI_DEVICE_IN_PICTBRIDGE_MODE = 0x05000000;
       
    86 	public static final int CONAPI_DEVICE_IN_UNKNOWN_MODE = 0x0E000000;
       
    87 	
       
    88 
       
    89 	// Macros used to check device's swState value: 
       
    90 //	#define	CONAPI_IS_DEVICE_UNPAIRED(dwState)	(dwState & 0x01)		// Returns 1 if true
       
    91 //	#define	CONAPI_IS_DEVICE_PAIRED(dwState)	((dwState >> 1) & 0x01) // Returns 1 if true
       
    92 //	#define	CONAPI_IS_PCSUITE_TRUSTED(dwState)	((dwState >> 2) & 0x01) // Returns 1 if true
       
    93 //	#define	CONAPI_IS_DEVICE_WRONG_MODE(dwState)((dwState >> 3) & 0x01)	// Returns 1 if true
       
    94 //	#define	CONAPI_GET_DEVICE_MODE(dwState)     (dwState & 0x0F000000)	// Returns CONAPI_DEVICE_IN_xxxx_MODE value
       
    95 
       
    96 	public static final boolean CONAPI_IS_DEVICE_UNPAIRED(int state) {
       
    97 		return (state & 0x01) != 0;
       
    98 	}
       
    99 	public static final boolean CONAPI_IS_DEVICE_PAIRED(int state) {
       
   100 		return ((state >> 1) & 0x01) != 0;
       
   101 	}
       
   102 	public static final boolean CONAPI_IS_PCSUITE_TRUSTED(int state) {
       
   103 		return ((state >> 2) & 0x01) != 0;
       
   104 	}
       
   105 	public static final boolean CONAPI_IS_DEVICE_WRONG_MODE(int state) {
       
   106 		return ((state >> 3) & 0x01) != 0;
       
   107 	}
       
   108 	public static final int CONAPI_GET_DEVICE_MODE(int state) {
       
   109 		return (state & 0x0F000000);
       
   110 	}
       
   111 	public static final boolean CONAPI_IS_IN_PCSUITE_MODE(int state) {
       
   112 		return CONAPI_GET_DEVICE_MODE(state) == CONAPI_DEVICE_IN_PCSUITE_MODE;
       
   113 	}
       
   114 	public static final boolean CONAPI_IS_IN_MASSSTORAGE_MODE(int state) {
       
   115 		return CONAPI_GET_DEVICE_MODE(state) == CONAPI_DEVICE_IN_MASSSTORAGE_MODE;
       
   116 	}
       
   117 	public static final boolean CONAPI_IS_IN_RNDIS_MODE(int state) {
       
   118 		return CONAPI_GET_DEVICE_MODE(state) == CONAPI_DEVICE_IN_RNDIS_MODE;
       
   119 	}
       
   120 
       
   121 	
       
   122 	public static final int CONAPI_SERIES60_2ED_DEVICE = 33554448;
       
   123 	public static final int CONAPI_FS_FILE_CONVERSION = 256;
       
   124 	public static final int CONAPI_DEVICE_PRODUCT_INFO = 1048576;
       
   125 	public static final int CONAPI_DEVICE_IS_APP_SUPPORTED = 2;
       
   126 	public static final int CONAPI_ALLOW_TO_USE_CACHE = 4096;
       
   127 	public static final int DMAPI_OPTION_SET_MANUFACTURER = 1;
       
   128 	public static final int CONAPI_UNKNOWN_DEVICE = 0;
       
   129 	public static final int CONAPI_SET_PCSUITE_UNTRUSTED = 2048;
       
   130 	public static final int CONAPI_SET_PCSUITE_TRUSTED = 1024;
       
   131 	public static final int CONAPI_DEVICE_GET_VERSION = 1048580;
       
   132 	public static final int CONAPI_DS_MMS_SERVICE = 20480;
       
   133 	public static final int CONAPI_SYNC_SA_DM = 2;
       
   134 	public static final int CONAPI_GET_PAIRED_PHONES = 16384;
       
   135 	public static final int CONAPI_DEVICE_GET_FOLDEREXCLUDE = 7340036;
       
   136 	public static final int CONAPI_NEF_SERVICE = 12288;
       
   137 	public static final int CONAPI_DEVICE_GENERAL_INFO = 65536;
       
   138 	public static final int CONAPI_SERIES80_DEVICE = 33554688;
       
   139 	public static final int CONAPI_FOLDER_BROWSING_SERVICE = 28672;
       
   140 	public static final int CONAPI_DS_SERVICE = 4096;
       
   141 	public static final int CONAPI_DEVICE_GET_PROPERTY = 1;
       
   142 	public static final int CONAPI_FS_INSTALL_JAVA_APPLICATIONS = 16;
       
   143 	public static final int CONAPI_GET_ALL_PHONES = 8192;
       
   144 	public static final int CONAPI_SYNC_CI_DS = 16;
       
   145 	public static final int CONAPI_DEVICE_GET_OBJTYPE = 3145732;
       
   146 	public static final int CONAPI_FS_LIST_APPLICATIONS = 512;
       
   147 	public static final int CONAPI_FS_INSTALL_SIS_APPLICATIONS = 32;
       
   148 	public static final int CONAPI_DEVICE_GET_NETWORK_ID = 50331652;
       
   149 	public static final int CONAPI_DS_BOOKMARKS_SERVICE = 24576;
       
   150 	public static final int CONAPI_DM_SERVICE = 8192;
       
   151 	public static final int CONAPI_DEVICE_GET_FOLDERMEMTYPE = 6291460;
       
   152 	public static final int CONAPI_FS_NOT_SUPPORTED = 0;
       
   153 	public static final int CONAPI_FS_SUPPORTED = 1;
       
   154 	public static final int CONAPI_NOKIA7710_DEVICE = 33558528;
       
   155 	public static final int CONAPI_USER_DEFINED_SERVICE = 32768;
       
   156 	public static final int CONAPI_GET_TRUSTED_PHONES = 32768;
       
   157 	public static final int CONAPI_DS_SMS_SERVICE = 16384;
       
   158 	public static final int CONAPI_SYNC_NOT_SUPPORTED = 0;
       
   159 	public static final int CONAPI_FS_INSTALL_SISX_APPLICATIONS = 64;
       
   160 	public static final int CONAPI_SERIES60_3ED_DEVICE = 33554464;
       
   161 	public static final int CONAPI_DEVICE_GET_FOLDERPATH = 5242884;
       
   162 	public static final int CONAPI_SYNC_SA_DS = 1;
       
   163 	public static final int CONAPI_DEVICE_GET_COUNTRY_CODE = 33554436;
       
   164 	public static final int CONAPI_FS_UNINSTALL_APPLICATIONS = 1024;
       
   165 	public static final int CONAPI_FS_EXTENDED_OPERATIONS = 2048;
       
   166 	public static final int CONAPI_UNPAIR_DEVICE = 512;
       
   167 	public static final int CONAPI_DEVICE_PROPERTIES_INFO = 16777216;
       
   168 	public static final int CONAPI_DEVICE_GET_CURRENT_NETWORK = 16777220;
       
   169 	public static final int CONAPI_DEVICE_GET_ALL_VALUES = 8388612;
       
   170 	public static final int CONAPI_SERIES40_DEVICE = 16777217;
       
   171 	public static final int CONAPI_DEVICE_GET_FILEPATH = 4194308;
       
   172 	public static final int CONAPI_DEVICE_GET_UUID = 2097156;
       
   173 	public static final int CONAPI_PAIR_DEVICE = 256;
       
   174 	public static final int CONAPI_DEVICE_ICON_INFO = 268435456;
       
   175 
       
   176 }