35 #include "btconnectionobserver.h" |
35 #include "btconnectionobserver.h" |
36 #include "listenerobserver.h" |
36 #include "listenerobserver.h" |
37 #include "genericserver.h" |
37 #include "genericserver.h" |
38 #include "hidlayoutids.h" |
38 #include "hidlayoutids.h" |
39 #include "genericactive.h" |
39 #include "genericactive.h" |
|
40 #include "hidsdpobserver.h" |
|
41 #include "bthidconnection.h" |
40 |
42 |
41 class CBTConnection; |
43 class CBTConnection; |
42 class CSocketListener; |
44 class CSocketListener; |
43 class CBTHidConnection; |
45 class CBTHidConnection; |
44 class CBTHidDevice; |
46 class CBTHidDevice; |
45 class CGenericHid; |
47 class CGenericHid; |
|
48 class CHidSdpClient; |
46 class CBTHidNotifierHelper; |
49 class CBTHidNotifierHelper; |
47 |
50 |
48 /** |
51 /** |
49 * An instance of class CBTHidServer is the main server class. |
52 * An instance of class CBTHidServer is the main server class. |
50 * |
53 * |
51 * @since Series 60 2.6 |
54 * @since Series 60 2.6 |
52 */ |
55 */ |
53 class CBTHidServer : public CGenericServer, |
56 class CBTHidServer : public CGenericServer, |
54 public MBTConnectionObserver, |
57 public MBTConnectionObserver, |
55 public MListenerObserver, |
58 public MListenerObserver, |
56 public MTransportLayer |
59 public MTransportLayer, |
|
60 public MHidSdpObserver |
57 { |
61 { |
58 public: |
62 public: |
59 |
63 |
60 /*! |
64 /*! |
61 Create a CBTHidServer object using two phase construction, |
65 Create a CBTHidServer object using two phase construction, |
115 void CleanOldConnection(TInt aConnID); |
119 void CleanOldConnection(TInt aConnID); |
116 /*! |
120 /*! |
117 Asks the server to create a new connection object. |
121 Asks the server to create a new connection object. |
118 @result ID for the connection |
122 @result ID for the connection |
119 */ |
123 */ |
120 TInt NewConnectionL(); |
124 TInt NewConnectionL(TBTConnectionState aConnectionState); |
121 |
125 |
122 /*! |
126 /*! |
123 Asks the server to do a first-time connection to a device. |
127 Asks the server to do a first-time connection to a device. |
124 @param aConnID ID of the connection returned from NewConnectionL |
128 @param aConnID ID of the connection returned from NewConnectionL |
125 */ |
129 */ |
149 Finds out the connection status for a given Bluetooth address connected with HID profile |
153 Finds out the connection status for a given Bluetooth address connected with HID profile |
150 @param aBDAddr reference to TBTAddr that is checked from Bluetooth registry |
154 @param aBDAddr reference to TBTAddr that is checked from Bluetooth registry |
151 @result TBTEngConnectionStatus |
155 @result TBTEngConnectionStatus |
152 */ |
156 */ |
153 TBTEngConnectionStatus ConnectStatus(const TBTDevAddr& aAddress); |
157 TBTEngConnectionStatus ConnectStatus(const TBTDevAddr& aAddress); |
154 |
158 |
|
159 /*! |
|
160 Finds out the connection status for a given Bluetooth address connected with HID profile |
|
161 @param aBDAddr reference to TBTAddr that is checked from Bluetooth registry |
|
162 @result ETrue device is found from Container |
|
163 EFalse device is not found from Container |
|
164 */ |
|
165 TBool DeviceExistInContainer(const TBTDevAddr& aAddress); |
|
166 |
155 /*! |
167 /*! |
156 Panic the server. |
168 Panic the server. |
157 @param aPanic panic code |
169 @param aPanic panic code |
158 */ |
170 */ |
159 static void PanicServer(TInt aPanic); |
171 static void PanicServer(TInt aPanic); |
175 void HandleCommandAck(TInt aConnID, TInt aStatus); |
187 void HandleCommandAck(TInt aConnID, TInt aStatus); |
176 |
188 |
177 void HandleInterruptData(TInt aConnID, const TDesC8& aBuffer); |
189 void HandleInterruptData(TInt aConnID, const TDesC8& aBuffer); |
178 |
190 |
179 void FirstTimeConnectionComplete(TInt aConnID, TInt aStatus); |
191 void FirstTimeConnectionComplete(TInt aConnID, TInt aStatus); |
|
192 |
|
193 void FirstTimeConnectionCompleteFromRemote(TInt aConnID, TInt aStatus); |
180 |
194 |
181 void LinkLost(TInt aConnID); |
195 void LinkLost(TInt aConnID); |
182 |
196 |
183 void LinkRestored(TInt aConnID); |
197 void LinkRestored(TInt aConnID); |
184 |
198 |
185 void Disconnected(TInt aConnID); |
199 void Disconnected(TInt aConnID); |
186 |
200 |
187 void Unplugged(TInt aConnID); |
201 void Unplugged(TInt aConnID); |
|
202 |
|
203 void StartSDPSearch(TInt aConnID); |
188 |
204 |
189 public: |
205 public: |
190 //from MListenerObserver |
206 //from MListenerObserver |
191 void SocketAccepted(TUint aPort, TInt aErrorCode); |
207 void SocketAccepted(TUint aPort, TInt aErrorCode); |
|
208 |
|
209 public: |
|
210 // from MHidSdpObserver |
|
211 |
|
212 void HidSdpSearchComplete(TInt aResult); |
192 |
213 |
193 public: |
214 public: |
194 //from MTransportLayer |
215 //from MTransportLayer |
195 TUint CountryCodeL(TInt aConnID); |
216 TUint CountryCodeL(TInt aConnID); |
196 |
217 |