1 /* |
|
2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * implementation for NCM notification message class |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 /** |
|
21 @file |
|
22 @internalComponent |
|
23 */ |
|
24 |
|
25 |
|
26 #include <es_sock.h> |
|
27 #include "ncmnotificationdescriptor.h" |
|
28 |
|
29 |
|
30 // ======== MEMBER FUNCTIONS ======== |
|
31 // |
|
32 |
|
33 |
|
34 // |
|
35 // This function packs the TUSBNotificationNetworkConnection class into a descriptor with |
|
36 // the correct byte alignment for transmission on the USB bus. |
|
37 |
|
38 |
|
39 TDes8& TUSBNotificationNetworkConnection::Des() |
|
40 { |
|
41 TUint index = 0; |
|
42 |
|
43 iBuffer.SetLength(KUSBNotificationNetworkConnection); |
|
44 iBuffer[index++] = iRequestType; |
|
45 iBuffer[index++] = iNotification; |
|
46 LittleEndian::Put16(&iBuffer[index], iValue); |
|
47 index += 2; |
|
48 LittleEndian::Put16(&iBuffer[index], iIndex); |
|
49 index += 2; |
|
50 LittleEndian::Put16(&iBuffer[index], iLength); |
|
51 return iBuffer; |
|
52 } |
|
53 |
|
54 // |
|
55 //This function packs the TUSBNotificationConnectionSpeedChange class into a descriptor with |
|
56 //the correct byte alignment for transmission on the USB bus. |
|
57 |
|
58 TDes8& TUSBNotificationConnectionSpeedChange::Des() |
|
59 { |
|
60 TUint index = 0; |
|
61 |
|
62 iBuffer.SetLength(KUSBNotificationConnectionSpeedChange); |
|
63 iBuffer[index++] = iRequestType; |
|
64 iBuffer[index++] = iNotification; |
|
65 LittleEndian::Put16(&iBuffer[index], iValue); |
|
66 index += 2; |
|
67 LittleEndian::Put16(&iBuffer[index], iIndex); |
|
68 index += 2; |
|
69 LittleEndian::Put16(&iBuffer[index], iLength); |
|
70 index += 2; |
|
71 LittleEndian::Put32(&iBuffer[index], iUSBitRate); |
|
72 index += 4; |
|
73 LittleEndian::Put32(&iBuffer[index], iDSBitRate); |
|
74 return iBuffer; |
|
75 } |
|
76 |
|
77 |
|