author | Chad Peckham <chad.peckham@nokia.com> |
Mon, 01 Feb 2010 18:25:22 -0600 | |
changeset 870 | cdb6d745cb05 |
parent 868 | 089762ea5b6d |
child 942 | 2ed87b202d5c |
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 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
22 |
import org.eclipse.core.runtime.CoreException; |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
23 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
24 |
import com.sun.jna.Callback; |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
25 |
import com.sun.jna.Native; |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
26 |
import com.sun.jna.ptr.IntByReference; |
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 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
32 |
// DMAPI Device Management |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
33 |
// DMAPI Callbacks |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
34 |
public interface IConnAPIDeviceCallback extends StdCallCallback { |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
35 |
int invoke(int dwStatus, ShortByReference pstrSerialNumber); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
36 |
} |
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 |
// DMAPI APIs |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
39 |
int DMAPI_Initialize(int dwAPIVersion, IntByReference pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
40 |
int DMAPI_Terminate(IntByReference pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
41 |
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
|
42 |
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
|
43 |
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
|
44 |
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
|
45 |
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
|
46 |
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
|
47 |
int CONARegisterNotifyCallback(APIHANDLE hDMHandle, int dwState, IConnAPIDeviceCallback pfnNotify); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
48 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
49 |
// CFAPI Common APIs |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
50 |
int CFAPI_Initialize(int dwAPIVersion, IntByReference pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
51 |
int CFAPI_Terminate(IntByReference pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
52 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
53 |
// MCAPI Media Control |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
54 |
// MCAPI Callbacks |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
55 |
public interface IConnAPIMediaCallback extends StdCallCallback { |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
56 |
int invoke(int dwStatus, CONAPI_MEDIA[] pMedia); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
57 |
} |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
58 |
// MCAPI APIs |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
59 |
int MCAPI_Initialize(int dwAPIVersion, IntBuffer pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
60 |
int MCAPI_Terminate(IntBuffer pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
61 |
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
|
62 |
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
|
63 |
int CONACloseMM(APIHANDLE hMCHandle); |
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 CONAMMGetMedia(APIHANDLE hMCHandle, IntBuffer pdwCountOfMedia, CONAPI_MEDIA.ByReference[] ppMedia); //TODO: c++ - CONAPI_MEDIA** ppMedia |
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
|
65 |
int CONAMMSetMedia(APIHANDLE hMCHandle, CONAPI_MEDIA[] pMedia); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
66 |
int CONAMMFreeMediaStructures(int dwCountOfMedia, CONAPI_MEDIA[] 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
|
67 |
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
|
68 |
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
|
69 |
int CONARegisterMMNotifyCallback(APIHANDLE hMCHandle, int dwState, IConnAPIMediaCallback pfnNotify); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
70 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
71 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
72 |
// UPAPI USB Personality |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
73 |
// UPAPI APIs |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
74 |
int UPAPI_Initialize(int dwAPIVersion, IntBuffer pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
75 |
int UPAPI_Terminate(IntBuffer pdwParam); |
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
76 |
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
|
77 |
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
|
78 |
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
|
79 |
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
|
80 |
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
|
81 |
int UPAPI_FreeDeviceDescriptor(int dwDeviceCount, UP_DEVICE_DESCRIPTOR[] pDeviceDescriptor); |
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_GetConfigurationDescriptor(APIHANDLE hUPHandle, ShortBuffer pstrDeviceId, UP_CONFIGURATION_DESCRIPTOR[] pConfigurationDescriptor); |
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_GetStringDescriptor(APIHANDLE hUPHandle, ShortBuffer pstrDeviceId, int dwDescriptorIndex, int dwLanguageID, UP_STRING_DESCRIPTOR[] pStringDescriptor); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
84 |
int UPAPI_FreeStringDescriptor(UP_STRING_DESCRIPTOR[] pStringDescriptor); |
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
|
85 |
int UPAPI_GetPersonalityDescriptors(APIHANDLE hUPHandle, ShortBuffer pstrDeviceId, UP_PERSONALITY_DESCRIPTORS[] pPersonalityDescriptors); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
86 |
int UPAPI_FreePersonalityDescriptors(UP_PERSONALITY_DESCRIPTORS[] pPersonalityDescriptors); |
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
|
87 |
int UPAPI_SetPersonality(APIHANDLE hUPHandle, ShortBuffer pstrDeviceId, int dwPersonalityCode); |
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
|
88 |
int UPAPI_SendCommandToDevice(APIHANDLE hUPHandle, ShortBuffer pstrDeviceId, int dwDataDirection, UP_DATA_BUFFER[] pDataBuffer); |
868
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
89 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
90 |
|
089762ea5b6d
move com.nokia.carbide.remoteConnections.discovery.pccs to carbidecpp repository
cawthron
parents:
diff
changeset
|
91 |
} |