|
1 /* |
|
2 * Copyright (c) 2009 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 * |
|
16 */ |
|
17 |
|
18 using System; |
|
19 using System.Collections.Generic; |
|
20 using System.Text; |
|
21 using SymbianUtils.BasicTypes; |
|
22 using SymbianETMLib.Common.Utilities; |
|
23 |
|
24 namespace SymbianETMLib.Common.Packets |
|
25 { |
|
26 public class ETMPcktBranch : ETMPcktFiveByteRunBase |
|
27 { |
|
28 #region Constructors |
|
29 public ETMPcktBranch() |
|
30 : base( "#######1" ) |
|
31 { |
|
32 // In the first packet, bits 6:1 contain the payload. |
|
33 // Bit 7 indicates whether another packet follows |
|
34 // Bit 0 is forms the "branch packet" signature. |
|
35 iExtractionMaskFirst = CreateMask( "01111110" ); |
|
36 } |
|
37 |
|
38 public ETMPcktBranch( byte aValue ) |
|
39 : this() |
|
40 { |
|
41 base.RawByte = aValue; |
|
42 } |
|
43 #endregion |
|
44 |
|
45 #region API |
|
46 #endregion |
|
47 |
|
48 #region From PcktBase |
|
49 public override int Priority |
|
50 { |
|
51 get { return int.MaxValue; } |
|
52 } |
|
53 #endregion |
|
54 |
|
55 #region Properties |
|
56 public string ExtractedBitsFirstByte |
|
57 { |
|
58 get |
|
59 { |
|
60 byte raw = (byte) ( base.RawByte & iExtractionMaskFirst ); |
|
61 raw >>= 1; |
|
62 string ret = SymBitUtils.GetBits( raw ); |
|
63 |
|
64 // Only the first 6 bits are valid |
|
65 return ret.Substring( 2, 6 ); |
|
66 } |
|
67 } |
|
68 #endregion |
|
69 |
|
70 #region Internal constants |
|
71 #endregion |
|
72 |
|
73 #region From System.Object |
|
74 #endregion |
|
75 |
|
76 #region Data members |
|
77 private readonly byte iExtractionMaskFirst; |
|
78 #endregion |
|
79 } |
|
80 } |