35 * @param aOwner Observer (the port factory). |
35 * @param aOwner Observer (the port factory). |
36 * @param aUnit The port number. |
36 * @param aUnit The port number. |
37 * @return Ownership of a newly created CRegistrationPort object |
37 * @return Ownership of a newly created CRegistrationPort object |
38 */ |
38 */ |
39 { |
39 { |
40 OstTraceFunctionEntry0( CREGISTRATIONPORT_NEWL_ENTRY ); |
40 LOG_STATIC_FUNC_ENTRY |
|
41 |
41 CRegistrationPort* self = new(ELeave) CRegistrationPort(aAcmController); |
42 CRegistrationPort* self = new(ELeave) CRegistrationPort(aAcmController); |
42 CleanupClosePushL(*self); |
43 CleanupClosePushL(*self); |
43 self->ConstructL(aUnit); |
44 self->ConstructL(aUnit); |
44 CleanupStack::Pop(); |
45 CleanupStack::Pop(); |
45 OstTraceFunctionExit0( CREGISTRATIONPORT_NEWL_EXIT ); |
|
46 return self; |
46 return self; |
47 } |
47 } |
48 |
48 |
49 void CRegistrationPort::ConstructL(TUint aUnit) |
49 void CRegistrationPort::ConstructL(TUint aUnit) |
50 /** |
50 /** |
51 * 2nd-phase constructor. |
51 * 2nd-phase constructor. |
52 * |
52 * |
53 * @param aUnit The port number. |
53 * @param aUnit The port number. |
54 */ |
54 */ |
55 { |
55 { |
56 OstTraceFunctionEntry0( CREGISTRATIONPORT_CONSTRUCTL_ENTRY ); |
56 LOG_FUNC |
|
57 |
57 TName name; |
58 TName name; |
58 name.Num(aUnit); |
59 name.Num(aUnit); |
59 TInt err = SetName(&name); |
60 LEAVEIFERRORL(SetName(&name)); |
60 if (err < 0) |
|
61 { |
|
62 OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_CONSTRUCTL, "CRegistrationPort::ConstructL;err=%d", err ); |
|
63 User::Leave(err); |
|
64 } |
|
65 OstTraceFunctionExit0( CREGISTRATIONPORT_CONSTRUCTL_EXIT ); |
|
66 } |
61 } |
67 |
62 |
68 CRegistrationPort::CRegistrationPort(MAcmController& aAcmController) |
63 CRegistrationPort::CRegistrationPort(MAcmController& aAcmController) |
69 /** |
64 /** |
70 * Constructor. |
65 * Constructor. |
71 * |
66 * |
72 * @param aAcmController To use when creating and destroying ACM functions. |
67 * @param aAcmController To use when creating and destroying ACM functions. |
73 */ |
68 */ |
74 : iAcmController(aAcmController) |
69 : iAcmController(aAcmController) |
75 { |
70 { |
76 OstTraceFunctionEntry0( CREGISTRATIONPORT_CREGISTRATIONPORT_CONS_ENTRY ); |
|
77 OstTraceFunctionExit0( CREGISTRATIONPORT_CREGISTRATIONPORT_CONS_EXIT ); |
|
78 } |
71 } |
79 |
72 |
80 void CRegistrationPort::StartRead(const TAny* /*aClientBuffer*/, |
73 void CRegistrationPort::StartRead(const TAny* /*aClientBuffer*/, |
81 TInt /*aLength*/) |
74 TInt /*aLength*/) |
82 /** |
75 /** |
132 * |
124 * |
133 * @param aClientBuffer pointer to the Client's buffer |
125 * @param aClientBuffer pointer to the Client's buffer |
134 * @param aLength number of bytes to write |
126 * @param aLength number of bytes to write |
135 */ |
127 */ |
136 { |
128 { |
137 OstTraceFunctionEntry0( CREGISTRATIONPORT_STARTWRITE_ENTRY ); |
129 LOG_FUNC |
|
130 |
138 WriteCompleted(KErrNotSupported); |
131 WriteCompleted(KErrNotSupported); |
139 OstTraceFunctionExit0( CREGISTRATIONPORT_STARTWRITE_EXIT ); |
|
140 } |
132 } |
141 |
133 |
142 void CRegistrationPort::WriteCancel() |
134 void CRegistrationPort::WriteCancel() |
143 /** |
135 /** |
144 * Cancel a pending write |
136 * Cancel a pending write |
145 */ |
137 */ |
146 { |
138 { |
147 OstTraceFunctionEntry0( CREGISTRATIONPORT_WRITECANCEL_ENTRY ); |
139 LOG_FUNC |
|
140 |
148 WriteCompleted(KErrNotSupported); |
141 WriteCompleted(KErrNotSupported); |
149 OstTraceFunctionExit0( CREGISTRATIONPORT_WRITECANCEL_EXIT ); |
|
150 } |
142 } |
151 |
143 |
152 void CRegistrationPort::Break(TInt /*aTime*/) |
144 void CRegistrationPort::Break(TInt /*aTime*/) |
153 /** |
145 /** |
154 * Send a break signal to the host. |
146 * Send a break signal to the host. |
155 * |
147 * |
156 * @param aTime Length of break in microseconds |
148 * @param aTime Length of break in microseconds |
157 */ |
149 */ |
158 { |
150 { |
159 OstTraceFunctionEntry0( CREGISTRATIONPORT_BREAK_ENTRY ); |
151 LOG_FUNC |
|
152 |
160 BreakCompleted(KErrNotSupported); |
153 BreakCompleted(KErrNotSupported); |
161 OstTraceFunctionExit0( CREGISTRATIONPORT_BREAK_EXIT ); |
|
162 } |
154 } |
163 |
155 |
164 void CRegistrationPort::BreakCancel() |
156 void CRegistrationPort::BreakCancel() |
165 /** |
157 /** |
166 * Cancel a pending break. |
158 * Cancel a pending break. |
167 */ |
159 */ |
168 { |
160 { |
169 OstTraceFunctionEntry0( CREGISTRATIONPORT_BREAKCANCEL_ENTRY ); |
161 LOG_FUNC |
170 OstTraceFunctionExit0( CREGISTRATIONPORT_BREAKCANCEL_EXIT ); |
|
171 } |
162 } |
172 |
163 |
173 TInt CRegistrationPort::GetConfig(TDes8& /*aDes*/) const |
164 TInt CRegistrationPort::GetConfig(TDes8& /*aDes*/) const |
174 /** |
165 /** |
175 * Pass a config request |
166 * Pass a config request |
176 * |
167 * |
177 * @param aDes config will be written to this descriptor |
168 * @param aDes config will be written to this descriptor |
178 * @return Error |
169 * @return Error |
179 */ |
170 */ |
180 { |
171 { |
181 OstTraceFunctionEntry0( CREGISTRATIONPORT_GETCONFIG_ENTRY ); |
172 LOG_FUNC |
182 OstTraceFunctionExit0( CREGISTRATIONPORT_GETCONFIG_EXIT ); |
173 |
183 return KErrNotSupported; |
174 return KErrNotSupported; |
184 } |
175 } |
185 |
176 |
186 TInt CRegistrationPort::SetConfig(const TDesC8& /*aDes*/) |
177 TInt CRegistrationPort::SetConfig(const TDesC8& /*aDes*/) |
187 /** |
178 /** |
318 * |
308 * |
319 * @param aLength new length of Tx and Rx buffer |
309 * @param aLength new length of Tx and Rx buffer |
320 * @return Error |
310 * @return Error |
321 */ |
311 */ |
322 { |
312 { |
323 OstTraceFunctionEntry0( CREGISTRATIONPORT_SETRECEIVEBUFFERLENGTH_ENTRY ); |
313 LOG_FUNC |
324 OstTraceFunctionExit0( CREGISTRATIONPORT_SETRECEIVEBUFFERLENGTH_EXIT ); |
314 |
325 return KErrNotSupported; |
315 return KErrNotSupported; |
326 } |
316 } |
327 |
317 |
328 void CRegistrationPort::Destruct() |
318 void CRegistrationPort::Destruct() |
329 /** |
319 /** |
330 * Destruct - we must (eventually) call delete this |
320 * Destruct - we must (eventually) call delete this |
331 */ |
321 */ |
332 { |
322 { |
333 OstTraceFunctionEntry0( CREGISTRATIONPORT_DESTRUCT_ENTRY ); |
323 LOG_FUNC |
|
324 |
334 delete this; |
325 delete this; |
335 OstTraceFunctionExit0( CREGISTRATIONPORT_DESTRUCT_EXIT ); |
|
336 } |
326 } |
337 |
327 |
338 void CRegistrationPort::FreeMemory() |
328 void CRegistrationPort::FreeMemory() |
339 /** |
329 /** |
340 * Attempt to reduce our memory foot print. |
330 * Attempt to reduce our memory foot print. |
341 */ |
331 */ |
342 { |
332 { |
343 OstTraceFunctionEntry0( CREGISTRATIONPORT_FREEMEMORY_ENTRY ); |
333 LOG_FUNC |
344 OstTraceFunctionExit0( CREGISTRATIONPORT_FREEMEMORY_EXIT ); |
|
345 } |
334 } |
346 |
335 |
347 void CRegistrationPort::NotifyDataAvailable() |
336 void CRegistrationPort::NotifyDataAvailable() |
348 /** |
337 /** |
349 * Notify client when data is available |
338 * Notify client when data is available |
350 */ |
339 */ |
351 { |
340 { |
352 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYDATAAVAILABLE_ENTRY ); |
341 LOG_FUNC |
|
342 |
353 NotifyDataAvailableCompleted(KErrNotSupported); |
343 NotifyDataAvailableCompleted(KErrNotSupported); |
354 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYDATAAVAILABLE_EXIT ); |
|
355 } |
344 } |
356 |
345 |
357 void CRegistrationPort::NotifyDataAvailableCancel() |
346 void CRegistrationPort::NotifyDataAvailableCancel() |
358 /** |
347 /** |
359 * Cancel an outstanding data availalbe notification |
348 * Cancel an outstanding data availalbe notification |
360 */ |
349 */ |
361 { |
350 { |
362 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYDATAAVAILABLECANCEL_ENTRY ); |
351 LOG_FUNC |
|
352 |
363 NotifyDataAvailableCompleted(KErrNotSupported); |
353 NotifyDataAvailableCompleted(KErrNotSupported); |
364 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYDATAAVAILABLECANCEL_EXIT ); |
|
365 } |
354 } |
366 |
355 |
367 TInt CRegistrationPort::GetFlowControlStatus(TFlowControl& /*aFlowControl*/) |
356 TInt CRegistrationPort::GetFlowControlStatus(TFlowControl& /*aFlowControl*/) |
368 /** |
357 /** |
369 * Get the flow control status |
358 * Get the flow control status |
370 * |
359 * |
371 * @param aFlowControl flow control status will be written to this descriptor |
360 * @param aFlowControl flow control status will be written to this descriptor |
372 * @return Error |
361 * @return Error |
373 */ |
362 */ |
374 { |
363 { |
375 OstTraceFunctionEntry0( CREGISTRATIONPORT_GETFLOWCONTROLSTATUS_ENTRY ); |
364 LOG_FUNC |
376 OstTraceFunctionExit0( CREGISTRATIONPORT_GETFLOWCONTROLSTATUS_EXIT ); |
365 |
377 return KErrNotSupported; |
366 return KErrNotSupported; |
378 } |
367 } |
379 |
368 |
380 void CRegistrationPort::NotifyOutputEmpty() |
369 void CRegistrationPort::NotifyOutputEmpty() |
381 /** |
370 /** |
382 * Notify the client when the output buffer is empty. |
371 * Notify the client when the output buffer is empty. |
383 */ |
372 */ |
384 { |
373 { |
385 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYOUTPUTEMPTY_ENTRY ); |
374 LOG_FUNC |
|
375 |
386 NotifyOutputEmptyCompleted(KErrNotSupported); |
376 NotifyOutputEmptyCompleted(KErrNotSupported); |
387 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYOUTPUTEMPTY_EXIT ); |
|
388 } |
377 } |
389 |
378 |
390 void CRegistrationPort::NotifyOutputEmptyCancel() |
379 void CRegistrationPort::NotifyOutputEmptyCancel() |
391 /** |
380 /** |
392 * Cancel a pending request to be notified when the output buffer is empty. |
381 * Cancel a pending request to be notified when the output buffer is empty. |
393 */ |
382 */ |
394 { |
383 { |
395 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYOUTPUTEMPTYCANCEL_ENTRY ); |
384 LOG_FUNC |
|
385 |
396 NotifyOutputEmptyCompleted(KErrNotSupported); |
386 NotifyOutputEmptyCompleted(KErrNotSupported); |
397 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYOUTPUTEMPTYCANCEL_EXIT ); |
|
398 } |
387 } |
399 |
388 |
400 void CRegistrationPort::NotifyBreak() |
389 void CRegistrationPort::NotifyBreak() |
401 /** |
390 /** |
402 * Notify a client of a break on the serial line. |
391 * Notify a client of a break on the serial line. |
403 */ |
392 */ |
404 { |
393 { |
405 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYBREAK_ENTRY ); |
394 LOG_FUNC |
|
395 |
406 BreakNotifyCompleted(KErrNotSupported); |
396 BreakNotifyCompleted(KErrNotSupported); |
407 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYBREAK_EXIT ); |
|
408 } |
397 } |
409 |
398 |
410 void CRegistrationPort::NotifyBreakCancel() |
399 void CRegistrationPort::NotifyBreakCancel() |
411 /** |
400 /** |
412 * Cancel a pending notification of a serial line break. |
401 * Cancel a pending notification of a serial line break. |
413 */ |
402 */ |
414 { |
403 { |
415 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYBREAKCANCEL_ENTRY ); |
404 LOG_FUNC |
|
405 |
416 BreakNotifyCompleted(KErrNotSupported); |
406 BreakNotifyCompleted(KErrNotSupported); |
417 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYBREAKCANCEL_EXIT ); |
|
418 } |
407 } |
419 |
408 |
420 void CRegistrationPort::NotifyFlowControlChange() |
409 void CRegistrationPort::NotifyFlowControlChange() |
421 /** |
410 /** |
422 * Notify a client of a change in the flow control state. |
411 * Notify a client of a change in the flow control state. |
423 */ |
412 */ |
424 { |
413 { |
425 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYFLOWCONTROLCHANGE_ENTRY ); |
414 LOG_FUNC |
|
415 |
426 FlowControlChangeCompleted(EFlowControlOn,KErrNotSupported); |
416 FlowControlChangeCompleted(EFlowControlOn,KErrNotSupported); |
427 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYFLOWCONTROLCHANGE_EXIT ); |
|
428 } |
417 } |
429 |
418 |
430 void CRegistrationPort::NotifyFlowControlChangeCancel() |
419 void CRegistrationPort::NotifyFlowControlChangeCancel() |
431 /** |
420 /** |
432 * Cancel a pending request to be notified when the flow control state changes. |
421 * Cancel a pending request to be notified when the flow control state changes. |
433 */ |
422 */ |
434 { |
423 { |
435 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYFLOWCONTROLCHANGECANCEL_ENTRY ); |
424 LOG_FUNC |
|
425 |
436 FlowControlChangeCompleted(EFlowControlOn,KErrNotSupported); |
426 FlowControlChangeCompleted(EFlowControlOn,KErrNotSupported); |
437 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYFLOWCONTROLCHANGECANCEL_EXIT ); |
|
438 } |
427 } |
439 |
428 |
440 void CRegistrationPort::NotifyConfigChange() |
429 void CRegistrationPort::NotifyConfigChange() |
441 /** |
430 /** |
442 * Notify a client of a change to the serial port configuration. |
431 * Notify a client of a change to the serial port configuration. |
443 */ |
432 */ |
444 { |
433 { |
445 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYCONFIGCHANGE_ENTRY ); |
434 LOG_FUNC |
|
435 |
446 ConfigChangeCompleted(KNullDesC8, KErrNotSupported); |
436 ConfigChangeCompleted(KNullDesC8, KErrNotSupported); |
447 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYCONFIGCHANGE_EXIT ); |
|
448 } |
437 } |
449 |
438 |
450 void CRegistrationPort::NotifyConfigChangeCancel() |
439 void CRegistrationPort::NotifyConfigChangeCancel() |
451 /** |
440 /** |
452 * Cancel a pending request to be notified of a change to the serial port |
441 * Cancel a pending request to be notified of a change to the serial port |
453 * configuration. |
442 * configuration. |
454 */ |
443 */ |
455 { |
444 { |
456 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYCONFIGCHANGECANCEL_ENTRY ); |
445 LOG_FUNC |
|
446 |
457 ConfigChangeCompleted(KNullDesC8, KErrNotSupported); |
447 ConfigChangeCompleted(KNullDesC8, KErrNotSupported); |
458 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYCONFIGCHANGECANCEL_EXIT ); |
|
459 } |
448 } |
460 |
449 |
461 void CRegistrationPort::NotifySignalChange(TUint /*aSignalMask*/) |
450 void CRegistrationPort::NotifySignalChange(TUint /*aSignalMask*/) |
462 /** |
451 /** |
463 * Notify a client of a change to the signal lines. |
452 * Notify a client of a change to the signal lines. |
464 */ |
453 */ |
465 { |
454 { |
466 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYSIGNALCHANGE_ENTRY ); |
455 LOG_FUNC |
|
456 |
467 SignalChangeCompleted(0, KErrNotSupported); |
457 SignalChangeCompleted(0, KErrNotSupported); |
468 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYSIGNALCHANGE_EXIT ); |
|
469 } |
458 } |
470 |
459 |
471 void CRegistrationPort::NotifySignalChangeCancel() |
460 void CRegistrationPort::NotifySignalChangeCancel() |
472 /** |
461 /** |
473 * Cancel a pending client request to be notified about a change to the signal |
462 * Cancel a pending client request to be notified about a change to the signal |
474 * lines. |
463 * lines. |
475 */ |
464 */ |
476 { |
465 { |
477 OstTraceFunctionEntry0( CREGISTRATIONPORT_NOTIFYSIGNALCHANGECANCEL_ENTRY ); |
466 LOG_FUNC |
|
467 |
478 SignalChangeCompleted(0, KErrNotSupported); |
468 SignalChangeCompleted(0, KErrNotSupported); |
479 OstTraceFunctionExit0( CREGISTRATIONPORT_NOTIFYSIGNALCHANGECANCEL_EXIT ); |
|
480 } |
469 } |
481 |
470 |
482 TInt CRegistrationPort::GetRole(TCommRole& aRole) |
471 TInt CRegistrationPort::GetRole(TCommRole& aRole) |
483 /** |
472 /** |
484 * Get the role of this port unit |
473 * Get the role of this port unit |
485 * |
474 * |
486 * @param aRole reference to where the role will be written to |
475 * @param aRole reference to where the role will be written to |
487 * @return Error |
476 * @return Error |
488 */ |
477 */ |
489 { |
478 { |
490 OstTraceFunctionEntry0( CREGISTRATIONPORT_GETROLE_ENTRY ); |
479 LOG_FUNC |
491 aRole = iRole; |
480 aRole = iRole; |
492 OstTrace1( TRACE_NORMAL, CREGISTRATIONPORT_GETROLE, "CRegistrationPort::GetRole;aRole=%d", (TInt)aRole ); |
481 LOGTEXT2(_L8("\trole=%d"), aRole); |
493 OstTraceFunctionExit0( CREGISTRATIONPORT_GETROLE_EXIT ); |
|
494 return KErrNone; |
482 return KErrNone; |
495 } |
483 } |
496 |
484 |
497 TInt CRegistrationPort::SetRole(TCommRole aRole) |
485 TInt CRegistrationPort::SetRole(TCommRole aRole) |
498 /** |
486 /** |