author | stechong |
Wed, 20 Oct 2010 11:19:31 -0500 | |
changeset 2165 | 2a7b5eccb0bc |
parent 1083 | 846b99bbf2a1 |
permissions | -rw-r--r-- |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
1 |
/* |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
2 |
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
3 |
* All rights reserved. |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
4 |
* This component and the accompanying materials are made available |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
5 |
* under the terms of the License "Eclipse Public License v1.0" |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
6 |
* which accompanies this distribution, and is available |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html". |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
8 |
* |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
9 |
* Initial Contributors: |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
10 |
* Nokia Corporation - initial contribution. |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
11 |
* |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
12 |
* Contributors: |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
13 |
* |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
14 |
* Description: |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
15 |
* |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
16 |
*/ |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
17 |
package com.nokia.carbide.remoteconnections.discovery.pccs.pccsnative; |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
18 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
19 |
import java.nio.IntBuffer; |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
20 |
import java.nio.ShortBuffer; |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
21 |
|
1021
6594b07c89c8
Changes to fix bugs 10618 10714 10731 10759 10580 merged from 2.5 branch
chpeckha
parents:
942
diff
changeset
|
22 |
import com.sun.jna.Native; |
6594b07c89c8
Changes to fix bugs 10618 10714 10731 10759 10580 merged from 2.5 branch
chpeckha
parents:
942
diff
changeset
|
23 |
import com.sun.jna.Pointer; |
942
2ed87b202d5c
PnP for switching USB personalities. Bug 10604.
Chad Peckham <chad.peckham@nokia.com>
parents:
870
diff
changeset
|
24 |
import com.sun.jna.WString; |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
25 |
import com.sun.jna.ptr.IntByReference; |
1021
6594b07c89c8
Changes to fix bugs 10618 10714 10731 10759 10580 merged from 2.5 branch
chpeckha
parents:
942
diff
changeset
|
26 |
import com.sun.jna.ptr.PointerByReference; |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
27 |
import com.sun.jna.ptr.ShortByReference; |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
28 |
import com.sun.jna.win32.StdCallLibrary; |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
29 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
30 |
public interface IConnAPILibrary extends StdCallLibrary { |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
31 |
|
1021
6594b07c89c8
Changes to fix bugs 10618 10714 10731 10759 10580 merged from 2.5 branch
chpeckha
parents:
942
diff
changeset
|
32 |
public static IConnAPILibrary INSTANCE = (IConnAPILibrary) Native.loadLibrary("ConnAPI", IConnAPILibrary.class); //$NON-NLS-1$ |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
33 |
// DMAPI Device Management |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
34 |
// DMAPI Callbacks |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
35 |
public interface IConnAPIDeviceCallback extends StdCallCallback { |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
36 |
int invoke(int dwStatus, ShortByReference pstrSerialNumber); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
37 |
} |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
38 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
39 |
// DMAPI APIs |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
40 |
int DMAPI_Initialize(int dwAPIVersion, IntByReference pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
41 |
int DMAPI_Terminate(IntByReference pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
42 |
int DMAPI_GetAPIVersion(); |
870
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
43 |
int CONAOpenDM(LPAPIHANDLE mHDMHandle); |
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
44 |
int CONACloseDM(APIHANDLE mHDMHandle); |
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
45 |
int CONAGetDeviceCount(APIHANDLE hDMHandle, IntByReference pdwCount); |
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
46 |
int CONAGetDevices(APIHANDLE hDMHandle, IntByReference pdwCount, CONAPI_DEVICE[] pDevices ); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
47 |
int CONAFreeDeviceStructure( int dwCount, CONAPI_DEVICE[] pDevices ); |
870
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
48 |
int CONARegisterNotifyCallback(APIHANDLE hDMHandle, int dwState, IConnAPIDeviceCallback pfnNotify); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
49 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
50 |
// CFAPI Common APIs |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
51 |
int CFAPI_Initialize(int dwAPIVersion, IntByReference pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
52 |
int CFAPI_Terminate(IntByReference pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
53 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
54 |
// MCAPI Media Control |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
55 |
// MCAPI Callbacks |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
56 |
public interface IConnAPIMediaCallback extends StdCallCallback { |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
57 |
int invoke(int dwStatus, CONAPI_MEDIA[] pMedia); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
58 |
} |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
59 |
// MCAPI APIs |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
60 |
int MCAPI_Initialize(int dwAPIVersion, IntBuffer pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
61 |
int MCAPI_Terminate(IntBuffer pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
62 |
int MCAPI_GetAPIVersion(); |
870
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
63 |
int CONAOpenMM(LPAPIHANDLE phMCHandle, int dwValue); |
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
64 |
int CONACloseMM(APIHANDLE hMCHandle); |
1083
846b99bbf2a1
clean up of some warning and todos
Chad Peckham <chad.peckham@nokia.com>
parents:
1021
diff
changeset
|
65 |
int CONAMMGetMedia(APIHANDLE hMCHandle, IntBuffer pdwCountOfMedia, CONAPI_MEDIA.ByReference[] ppMedia); |
846b99bbf2a1
clean up of some warning and todos
Chad Peckham <chad.peckham@nokia.com>
parents:
1021
diff
changeset
|
66 |
int CONAMMGetMedia(APIHANDLE hMCHandle, IntBuffer pdwCountOfMedia, CONAPI_MEDIA.ByReference ppMedia); |
846b99bbf2a1
clean up of some warning and todos
Chad Peckham <chad.peckham@nokia.com>
parents:
1021
diff
changeset
|
67 |
int CONAMMGetMedia(APIHANDLE hMCHandle, IntBuffer pdwCountOfMedia, PointerByReference ppMedia); |
870
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
68 |
int CONAMMSetMedia(APIHANDLE hMCHandle, CONAPI_MEDIA[] pMedia); |
1021
6594b07c89c8
Changes to fix bugs 10618 10714 10731 10759 10580 merged from 2.5 branch
chpeckha
parents:
942
diff
changeset
|
69 |
int CONAMMSetMedia(APIHANDLE hMCHandle, Pointer pMedia); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
70 |
int CONAMMFreeMediaStructures(int dwCountOfMedia, CONAPI_MEDIA[] pMedia); |
1021
6594b07c89c8
Changes to fix bugs 10618 10714 10731 10759 10580 merged from 2.5 branch
chpeckha
parents:
942
diff
changeset
|
71 |
int CONAMMFreeMediaStructures(int dwCountOfMedia, Pointer pMedia); |
870
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
72 |
int MCAPI_GetMediaInfo(APIHANDLE hMCHandle, ShortBuffer pstrMediaID, CONAPI_MEDIA_INFO[] pMediaInfo); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
73 |
int MCAPI_FreeMediaInfo(CONAPI_MEDIA_INFO[] pMediaInfo); |
870
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
74 |
int CONARegisterMMNotifyCallback(APIHANDLE hMCHandle, int dwState, IConnAPIMediaCallback pfnNotify); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
75 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
76 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
77 |
// UPAPI USB Personality |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
78 |
// UPAPI APIs |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
79 |
int UPAPI_Initialize(int dwAPIVersion, IntBuffer pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
80 |
int UPAPI_Terminate(IntBuffer pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
81 |
int UPAPI_GetAPIVersion(); |
870
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
82 |
int UPAPI_OpenUSBPersonality(int dwVendorId, LPAPIHANDLE phUPHandle); |
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
83 |
int UPAPI_CloseUSBPersonality(APIHANDLE hUPHandle); |
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
84 |
int UPAPI_QueryDeviceCount(APIHANDLE hUPHandle, IntBuffer pdwDeviceCount); |
cdb6d745cb05
Made HANDLEs more generic. They all are derived from one type in APIs. Added opening/closing of UPAPI.
Chad Peckham <chad.peckham@nokia.com>
parents:
868
diff
changeset
|
85 |
int UPAPI_QueryDevices(APIHANDLE hUPHandle, IntBuffer pdwDeviceCount, UP_DEVICE_DESCRIPTOR[] pDeviceDescriptor); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
86 |
int UPAPI_FreeDeviceDescriptor(int dwDeviceCount, UP_DEVICE_DESCRIPTOR[] pDeviceDescriptor); |
942
2ed87b202d5c
PnP for switching USB personalities. Bug 10604.
Chad Peckham <chad.peckham@nokia.com>
parents:
870
diff
changeset
|
87 |
int UPAPI_GetConfigurationDescriptor(APIHANDLE hUPHandle, WString pstrDeviceId, UP_CONFIGURATION_DESCRIPTOR[] pConfigurationDescriptor); |
2ed87b202d5c
PnP for switching USB personalities. Bug 10604.
Chad Peckham <chad.peckham@nokia.com>
parents:
870
diff
changeset
|
88 |
int UPAPI_GetStringDescriptor(APIHANDLE hUPHandle, WString pstrDeviceId, int dwDescriptorIndex, int dwLanguageID, UP_STRING_DESCRIPTOR pStringDescriptor); |
2ed87b202d5c
PnP for switching USB personalities. Bug 10604.
Chad Peckham <chad.peckham@nokia.com>
parents:
870
diff
changeset
|
89 |
int UPAPI_FreeStringDescriptor(UP_STRING_DESCRIPTOR pStringDescriptor); |
2ed87b202d5c
PnP for switching USB personalities. Bug 10604.
Chad Peckham <chad.peckham@nokia.com>
parents:
870
diff
changeset
|
90 |
int UPAPI_GetPersonalityDescriptors(APIHANDLE hUPHandle, WString pstrDeviceId, UP_PERSONALITY_DESCRIPTORS[] pPersonalityDescriptors); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
91 |
int UPAPI_FreePersonalityDescriptors(UP_PERSONALITY_DESCRIPTORS[] pPersonalityDescriptors); |
942
2ed87b202d5c
PnP for switching USB personalities. Bug 10604.
Chad Peckham <chad.peckham@nokia.com>
parents:
870
diff
changeset
|
92 |
int UPAPI_SetPersonality(APIHANDLE hUPHandle, WString pstrDeviceId, int dwPersonalityCode); |
2ed87b202d5c
PnP for switching USB personalities. Bug 10604.
Chad Peckham <chad.peckham@nokia.com>
parents:
870
diff
changeset
|
93 |
int UPAPI_SendCommandToDevice(APIHANDLE hUPHandle, WString pstrDeviceId, int dwDataDirection, UP_DATA_BUFFER[] pDataBuffer); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
94 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
95 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
96 |
} |