37 const TUid KBTBBEventChannel = {0x00000604}; // Channel for baseband event notifier |
37 const TUid KBTBBEventChannel = {0x00000604}; // Channel for baseband event notifier |
38 const TUid KBTObexPINChannel = {0x00000605}; // Channel for OBEX PIN notifier |
38 const TUid KBTObexPINChannel = {0x00000605}; // Channel for OBEX PIN notifier |
39 const TUid KBTPowerModeChannel = {0x00000606}; // Channel for power mode notifier |
39 const TUid KBTPowerModeChannel = {0x00000606}; // Channel for power mode notifier |
40 const TUid KBTAudioAccessoryChannel = {0x00000607}; // Channel for audio accessory notifier |
40 const TUid KBTAudioAccessoryChannel = {0x00000607}; // Channel for audio accessory notifier |
41 const TUid KBTLowMemoryChannel = {0x00000608}; // Channel for low memory notifier |
41 const TUid KBTLowMemoryChannel = {0x00000608}; // Channel for low memory notifier |
42 const TUid KBTPairedDeviceSettingChannel = {0x00000610}; |
42 const TUid KBTPairedDeviceSettingChannel = {0x00000610}; |
43 |
43 |
44 // FORWARD DECLARATIONS |
44 // FORWARD DECLARATIONS |
45 class CBTEngSettings; |
45 class CBTEngSettings; |
46 |
46 |
47 enum TBTRegistryQueryState |
47 enum TBTRegistryQueryState |
71 * A utility function for checking whether autolock is on. |
71 * A utility function for checking whether autolock is on. |
72 * @param None. |
72 * @param None. |
73 * @return A boolean according to autolock state. |
73 * @return A boolean according to autolock state. |
74 */ |
74 */ |
75 TBool AutoLockOnL(); |
75 TBool AutoLockOnL(); |
76 |
76 |
77 protected: // Constructors and destructor |
77 protected: // Constructors and destructor |
78 |
78 |
79 /** |
79 /** |
80 * C++ default constructor. |
80 * C++ default constructor. |
81 */ |
81 */ |
82 CBTNotifierBase(); |
82 CBTNotifierBase(); |
83 |
83 |
|
84 protected: // New functions |
|
85 |
84 /** |
86 /** |
85 * Symbian 2nd phase constructor. |
87 * Symbian 2nd phase constructor. |
86 */ |
88 */ |
87 virtual void ConstructL(); |
89 virtual void ConstructL(); |
88 |
90 |
89 |
91 /** |
90 |
92 * Used in asynchronous notifier launch to store received parameters |
91 protected: // New functions |
93 * into members variables and make needed initializations. |
92 |
|
93 /** |
|
94 * Used in asynchronous notifier launch to store received parameters |
|
95 * into members variables and make needed initializations. |
|
96 * @param aBuffer A buffer containing received parameters |
94 * @param aBuffer A buffer containing received parameters |
97 * @param aReturnVal The return value to be passed back. |
95 * @param aReturnVal The return value to be passed back. |
98 * @param aMessage Should be completed when the notifier is deactivated. |
96 * @param aMessage Should be completed when the notifier is deactivated. |
99 * @return None. |
97 * @return None. |
100 */ |
98 */ |
101 virtual void GetParamsL(const TDesC8& aBuffer, |
99 virtual void GetParamsL(const TDesC8& aBuffer, |
102 TInt aReplySlot, |
100 TInt aReplySlot, |
103 const RMessagePtr2& aMessage)=0; |
101 const RMessagePtr2& aMessage)=0; |
104 |
102 |
105 /** |
103 /** |
106 * A utility function for setting the power status of Bluetooth. |
104 * A utility function for setting the power status of Bluetooth. |
107 * If the power is not on the user will be presented a query. |
105 * If the power is not on the user will be presented a query. |
108 * @return ETrue if BT is turned on successfully; EFalse otherwise |
106 * @return ETrue if BT is turned on successfully; EFalse otherwise |
109 */ |
107 */ |
110 TBool CheckAndSetPowerOnL(); |
108 TBool CheckAndSetPowerOnL(); |
111 |
109 |
112 /** |
110 /** |
113 * A function for setting BT name |
111 * A function for setting BT name |
114 * @return ETrue if BT name is set successfully; EFalse otherwise |
112 * @return ETrue if BT name is set successfully; EFalse otherwise |
115 */ |
113 */ |
116 TBool AskLocalBTNameQueryL(); |
114 TBool AskLocalBTNameQueryL(); |
117 |
115 |
118 /** |
116 /** |
119 * Check if there is any existing connection to audio profiles from |
117 * Check if there is any existing connection to audio profiles from |
120 * the same device |
118 * the same device |
121 * @return ETrue if the device is connected. |
119 * @return ETrue if the device is connected. |
122 */ |
120 */ |
123 TBool IsExistingConnectionToAudioL(const TBTDevAddr& aDevAddr); |
121 TBool IsExistingConnectionToAudioL(const TBTDevAddr& aDevAddr); |
124 |
122 |
133 * Complete Client/Server message and Nulled the reply slot. |
131 * Complete Client/Server message and Nulled the reply slot. |
134 * @param aErr Error code for client notification. |
132 * @param aErr Error code for client notification. |
135 * @return None |
133 * @return None |
136 */ |
134 */ |
137 void CompleteMessage(TInt aValueToReplySlot, TInt aErr); |
135 void CompleteMessage(TInt aValueToReplySlot, TInt aErr); |
138 |
136 |
139 /** |
137 /** |
140 * Complete Client/Server message and Nulled the reply slot. |
138 * Complete Client/Server message and Nulled the reply slot. |
141 * @param aErr Error code for client notification. |
139 * @param aErr Error code for client notification. |
142 * @return None |
140 * @return None |
143 */ |
141 */ |
144 void CompleteMessage(const TDesC8& aDesToReplySlot, TInt aErr); |
142 void CompleteMessage(const TDesC8& aDesToReplySlot, TInt aErr); |
145 |
143 |
146 /** |
144 /** |
147 * Checks from central repository whether the Bluetooth friendly name |
145 * Checks from central repository whether the Bluetooth friendly name |
148 * has been modified . |
146 * has been modified . |
149 * @return ETure if the name has been modified. |
147 * @return ETure if the name has been modified. |
150 */ |
148 */ |
151 TBool IsLocalNameModifiedL(); |
149 TBool IsLocalNameModifiedL(); |
152 |
150 |
153 /** |
151 /** |
154 * Get the device information from BT Registry by the given address. |
152 * Get the device information from BT Registry by the given address. |
155 */ |
153 */ |
156 void GetDeviceFromRegL(const TBTDevAddr& aAddr); |
154 void GetDeviceFromRegL(const TBTDevAddr& aAddr); |
157 |
155 |
158 /** |
156 /** |
159 * virtual function to be ovewritten by sub-classes. |
157 * virtual function to be ovewritten by sub-classes. |
160 * Will be called when Getting Device by BTEng DevMan is completed. |
158 * Will be called when Getting Device by BTEng DevMan is completed. |
161 * @param aDev the device from registry if it is not null. indicates either a failure |
159 * @param aDev the device from registry if it is not null. indicates either a failure |
162 * or the device is not available in registry. |
160 * or the device is not available in registry. |
163 */ |
161 */ |
164 virtual void HandleGetDeviceCompletedL(const CBTDevice* aDev); |
162 virtual void HandleGetDeviceCompletedL(const CBTDevice* aDev); |
165 |
163 |
166 /** |
164 /** |
167 * Asks the user if s/he want's to block the device in question |
165 * Asks the user if s/he want's to block the device in question |
189 * @return None |
187 * @return None |
190 */ |
188 */ |
191 void CheckAndHandleQueryIntervalL(); |
189 void CheckAndHandleQueryIntervalL(); |
192 |
190 |
193 private: |
191 private: |
194 |
192 |
195 void DoHandleGetDevicesCompleteL(TInt aErr, CBTDeviceArray* aDeviceArray ); |
193 void DoHandleGetDevicesCompleteL(TInt aErr, CBTDeviceArray* aDeviceArray ); |
196 |
194 |
197 protected: // Functions from base classes |
195 protected: // Functions from base classes |
198 |
196 |
199 /** |
197 /** |
200 * From MEikSrvNotifierBase2 Called when a notifier is first loaded |
198 * From MEikSrvNotifierBase2 Called when a notifier is first loaded |
201 * to allow any initial construction that is required. |
199 * to allow any initial construction that is required. |
202 * @param None. |
200 * @param None. |
203 * @return A structure containing priority and channel info. |
201 * @return A structure containing priority and channel info. |
204 */ |
202 */ |
205 virtual TNotifierInfo RegisterL()=0; |
203 virtual TNotifierInfo RegisterL()=0; |
206 |
204 |
207 /** |
205 /** |
208 * From MEikSrvNotifierBase2 The notifier has been deactivated |
206 * From MEikSrvNotifierBase2 The notifier has been deactivated |
209 * so resources can be freed and outstanding messages completed. |
207 * so resources can be freed and outstanding messages completed. |
210 * @param None. |
208 * @param None. |
211 * @return None. |
209 * @return None. |
212 */ |
210 */ |
213 virtual void Cancel(); |
211 virtual void Cancel(); |
217 * @param TCoeHelpContext. Must be instance TCoeHelpContext, or NULL. |
215 * @param TCoeHelpContext. Must be instance TCoeHelpContext, or NULL. |
218 * If null this will open help about blocked devices., |
216 * If null this will open help about blocked devices., |
219 * @return KErrNone |
217 * @return KErrNone |
220 */ |
218 */ |
221 static TInt LaunchHelp(TAny *TCoeHelpContext=NULL); |
219 static TInt LaunchHelp(TAny *TCoeHelpContext=NULL); |
222 #endif |
220 #endif |
223 |
221 |
224 private: // Functions from base classes |
222 private: // Functions from base classes |
225 |
223 |
226 /** |
224 /** |
227 * From MEikSrvNotifierBase2 Called when all resources allocated |
225 * From MEikSrvNotifierBase2 Called when all resources allocated |
228 * by notifiers should be freed. |
226 * by notifiers should be freed. |
229 * @param None. |
227 * @param None. |
230 * @return None. |
228 * @return None. |
231 */ |
229 */ |
232 virtual void Release(); |
230 virtual void Release(); |
233 |
231 |
234 /** |
232 /** |
235 * From MEikSrvNotifierBase2 Return the priority a notifier takes |
233 * From MEikSrvNotifierBase2 Return the priority a notifier takes |
236 * and the channels it acts on. |
234 * and the channels it acts on. |
237 * @param None. |
235 * @param None. |
238 * @return A structure containing priority and channel info. |
236 * @return A structure containing priority and channel info. |
239 */ |
237 */ |
240 virtual TNotifierInfo Info() const; |
238 virtual TNotifierInfo Info() const; |
241 |
239 |
242 /** |
240 /** |
243 * From MEikSrvNotifierBase2 Synchronic notifier launch. |
241 * From MEikSrvNotifierBase2 Synchronic notifier launch. |
244 * @param aBuffer Received parameter data. |
242 * @param aBuffer Received parameter data. |
245 * @return A pointer to return value. |
243 * @return A pointer to return value. |
246 */ |
244 */ |
247 virtual TPtrC8 StartL(const TDesC8& aBuffer); |
245 virtual TPtrC8 StartL(const TDesC8& aBuffer); |
248 |
246 |
249 /** |
247 /** |
250 * From MEikSrvNotifierBase2 Asynchronic notifier launch. |
248 * From MEikSrvNotifierBase2 Asynchronic notifier launch. |
251 * @param aBuffer A buffer containing received parameters |
249 * @param aBuffer A buffer containing received parameters |
252 * @param aReturnVal The return value to be passed back. |
250 * @param aReturnVal The return value to be passed back. |
253 * @param aMessage Should be completed when the notifier is deactivated. |
251 * @param aMessage Should be completed when the notifier is deactivated. |
254 * @return A pointer to return value. |
252 * @return A pointer to return value. |
255 */ |
253 */ |
256 virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); |
254 virtual void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); |
257 |
255 |
258 /** |
256 /** |
259 * From MEikSrvNotifierBase2 Updates a currently active notifier. |
257 * From MEikSrvNotifierBase2 Updates a currently active notifier. |
260 * @param aBuffer The updated data. |
258 * @param aBuffer The updated data. |
261 * @return A pointer to return value. |
259 * @return A pointer to return value. |
262 */ |
260 */ |
263 virtual TPtrC8 UpdateL(const TDesC8& aBuffer); |
261 virtual TPtrC8 UpdateL(const TDesC8& aBuffer); |
264 |
262 |
265 /** |
263 /** |
266 * From MBTEngDevManObserver |
264 * From MBTEngDevManObserver |
267 * Indicates to the caller that adding, deleting or modifying a device |
265 * Indicates to the caller that adding, deleting or modifying a device |
268 * has completed. |
266 * has completed. |
269 */ |
267 */ |
270 virtual void HandleDevManComplete(TInt aErr); |
268 virtual void HandleDevManComplete(TInt aErr); |
271 |
269 |
272 /** |
270 /** |
273 * From MBTEngDevManObserver |
271 * From MBTEngDevManObserver |
274 * Call back function when GetDevices() request is completed. |
272 * Call back function when GetDevices() request is completed. |
275 * @param aErr Status information, if there is an error. |
273 * @param aErr Status information, if there is an error. |
276 * @param aDeviceArray Array of devices that match the given criteria |
274 * @param aDeviceArray Array of devices that match the given criteria |
277 * (the array provided by the calller). |
275 * (the array provided by the calller). |
278 */ |
276 */ |
279 void HandleGetDevicesComplete( TInt aErr, CBTDeviceArray* aDeviceArray ); |
277 void HandleGetDevicesComplete( TInt aErr, CBTDeviceArray* aDeviceArray ); |
280 |
278 |
281 /** |
279 /** |