summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/device/bluetoth/blue_w32.h
authorzautrix <zautrix>2004-08-07 17:24:40 (UTC)
committer zautrix <zautrix>2004-08-07 17:24:40 (UTC)
commit88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22 (patch) (unidiff)
tree6331418973714243beb674abc87692277b83869d /gammu/emb/common/device/bluetoth/blue_w32.h
parentef8a09ce74ad3f0a51484d03fdf009bd5b3677bf (diff)
downloadkdepimpi-88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22.zip
kdepimpi-88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22.tar.gz
kdepimpi-88b0d33b8b0b1f6ae320cfc863ca6a47fa8fec22.tar.bz2
Initial revision
Diffstat (limited to 'gammu/emb/common/device/bluetoth/blue_w32.h') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/device/bluetoth/blue_w32.h188
1 files changed, 188 insertions, 0 deletions
diff --git a/gammu/emb/common/device/bluetoth/blue_w32.h b/gammu/emb/common/device/bluetoth/blue_w32.h
new file mode 100644
index 0000000..e457c92
--- a/dev/null
+++ b/gammu/emb/common/device/bluetoth/blue_w32.h
@@ -0,0 +1,188 @@
1
2GSM_Error bluetooth_connect(GSM_StateMachine *s, int port, char *device);
3GSM_Error bluetooth_findchannel(GSM_StateMachine *s);
4
5/* MS Platform SDK */
6
7#ifndef __blue_w32_h
8#define __blue_w32_h
9
10 #include <pshpack1.h> // Without it compiled code hangs up BT stack
11
12 typedef ULONGLONG BTH_ADDR, *PBTH_ADDR;
13
14#define NAP_MASK ((ULONGLONG) 0xFFFF00000000)
15#define SAP_MASK ((ULONGLONG) 0x0000FFFFFFFF)
16
17#define NAP_BIT_OFFSET (8 * 4)
18#define SAP_BIT_OFFSET (0)
19
20 #define GET_NAP(_bth_addr) ((USHORT) (((_bth_addr) & NAP_MASK) >> NAP_BIT_OFFSET))
21 #define GET_SAP(_bth_addr) ((ULONG) (((_bth_addr) & SAP_MASK) >> SAP_BIT_OFFSET))
22
23#ifndef AF_BTH
24 #define AF_BTH 32
25#endif
26
27typedef struct _SOCKADDR_BTH {
28 USHORT addressFamily; // Always AF_BTH
29 BTH_ADDR btAddr; // Bluetooth device address
30 GUID serviceClassId; // [OPTIONAL] system will query SDP for port
31 ULONG port; // RFCOMM channel or L2CAP PSM
32} SOCKADDR_BTH, *PSOCKADDR_BTH;
33
34 #define BTHPROTO_RFCOMM 0x0003
35
36#ifdef BLUETOOTH_RF_SEARCHING
37
38typedef struct _SOCKET_ADDRESS {
39 LPSOCKADDR lpSockaddr ;
40 INT iSockaddrLength ;
41} SOCKET_ADDRESS, *PSOCKET_ADDRESS, FAR * LPSOCKET_ADDRESS ;
42
43typedef struct _CSADDR_INFO {
44 SOCKET_ADDRESS LocalAddr ;
45 SOCKET_ADDRESS RemoteAddr ;
46 INT iSocketType ;
47 INT iProtocol ;
48} CSADDR_INFO, *PCSADDR_INFO, FAR * LPCSADDR_INFO ;
49
50typedef struct _AFPROTOCOLS {
51 INT iAddressFamily;
52 INT iProtocol;
53} AFPROTOCOLS, *PAFPROTOCOLS, *LPAFPROTOCOLS;
54
55typedef enum _WSAEcomparator
56{
57 COMP_EQUAL = 0,
58 COMP_NOTLESS
59} WSAECOMPARATOR, *PWSAECOMPARATOR, *LPWSAECOMPARATOR;
60
61typedef struct _WSAVersion
62{
63 DWORD dwVersion;
64 WSAECOMPARATOR ecHow;
65}WSAVERSION, *PWSAVERSION, *LPWSAVERSION;
66
67typedef struct _WSAQuerySetA
68{
69 DWORD dwSize;
70 LPSTR lpszServiceInstanceName;
71 LPGUID lpServiceClassId;
72 LPWSAVERSION lpVersion;
73 LPSTR lpszComment;
74 DWORD dwNameSpace;
75 LPGUID lpNSProviderId;
76 LPSTR lpszContext;
77 DWORD dwNumberOfProtocols;
78 LPAFPROTOCOLS lpafpProtocols;
79 LPSTR lpszQueryString;
80 DWORD dwNumberOfCsAddrs;
81 LPCSADDR_INFO lpcsaBuffer;
82 DWORD dwOutputFlags;
83 LPBLOB lpBlob;
84} WSAQUERYSET, WSAQUERYSETA, *PWSAQUERYSETA, *LPWSAQUERYSETA;
85
86DEFINE_GUID(L2CAP_PROTOCOL_UUID, 0x00000100, 0x0000, 0x1000, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB);
87
88#ifndef NS_BTH
89# define NS_BTH 16
90#endif
91
92#define LUP_CONTAINERS 0x0002
93#define LUP_RETURN_NAME 0x0010
94#define LUP_RETURN_TYPE 0x0020
95#define LUP_RETURN_COMMENT 0x0080
96#define LUP_RETURN_ADDR 0x0100
97#define LUP_RETURN_BLOB 0x0200
98 #define LUP_FLUSHCACHE 0x1000
99#define LUP_RES_SERVICE 0x8000
100
101#define WSAAPI FAR PASCAL
102
103#ifndef WINSOCK_API_LINKAGE
104#ifdef DECLSPEC_IMPORT
105#define WINSOCK_API_LINKAGE DECLSPEC_IMPORT
106#else
107#define WINSOCK_API_LINKAGE
108#endif
109#endif
110
111WINSOCK_API_LINKAGE INT WSAAPI
112WSALookupServiceBeginA(
113 IN LPWSAQUERYSETA lpqsRestrictions,
114 IN DWORD dwControlFlags,
115 OUT LPHANDLE lphLookup
116 );
117
118#define WSALookupServiceBegin WSALookupServiceBeginA
119
120WINSOCK_API_LINKAGE INT WSAAPI
121WSALookupServiceNextA(
122 IN HANDLE hLookup,
123 IN DWORD dwControlFlags,
124 IN OUT LPDWORD lpdwBufferLength,
125 OUT LPWSAQUERYSETA lpqsResults
126 );
127
128#define WSALookupServiceNext WSALookupServiceNextA
129
130WINSOCK_API_LINKAGE INT WSAAPI WSALookupServiceEnd(IN HANDLE hLookup);
131
132#define MAX_PROTOCOL_CHAIN 7
133
134typedef struct _WSAPROTOCOLCHAIN {
135 int ChainLen; /* the length of the chain, */
136 /* length = 0 means layered protocol, */
137 /* length = 1 means base protocol, */
138 /* length > 1 means protocol chain */
139 DWORD ChainEntries[MAX_PROTOCOL_CHAIN]; /* a list of dwCatalogEntryIds */
140} WSAPROTOCOLCHAIN, FAR * LPWSAPROTOCOLCHAIN;
141
142#define WSAPROTOCOL_LEN 255
143
144typedef struct _WSAPROTOCOL_INFOA {
145 DWORD dwServiceFlags1;
146 DWORD dwServiceFlags2;
147 DWORD dwServiceFlags3;
148 DWORD dwServiceFlags4;
149 DWORD dwProviderFlags;
150 GUID ProviderId;
151 DWORD dwCatalogEntryId;
152 WSAPROTOCOLCHAIN ProtocolChain;
153 int iVersion;
154 int iAddressFamily;
155 int iMaxSockAddr;
156 int iMinSockAddr;
157 int iSocketType;
158 int iProtocol;
159 int iProtocolMaxOffset;
160 int iNetworkByteOrder;
161 int iSecurityScheme;
162 DWORD dwMessageSize;
163 DWORD dwProviderReserved;
164 CHAR szProtocol[WSAPROTOCOL_LEN+1];
165} WSAPROTOCOL_INFOA, FAR * LPWSAPROTOCOL_INFOA;
166
167typedef WSAPROTOCOL_INFOA WSAPROTOCOL_INFO;
168
169#define SO_PROTOCOL_INFOA 0x2004 /* WSAPROTOCOL_INFOA structure */
170#define SO_PROTOCOL_INFO SO_PROTOCOL_INFOA
171
172WINSOCK_API_LINKAGE INT WSAAPI
173WSAAddressToStringA(
174 IN LPSOCKADDR lpsaAddress,
175 IN DWORD dwAddressLength,
176 IN LPWSAPROTOCOL_INFOA lpProtocolInfo,
177 IN OUT LPSTR lpszAddressString,
178 IN OUT LPDWORD lpdwAddressStringLength
179 );
180
181#define WSAAddressToString WSAAddressToStringA
182
183#endif
184#endif
185
186/* How should editor hadle tabs in this file? Add editor commands here.
187 * vim: noexpandtab sw=8 ts=8 sts=8:
188 */