|
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 the License "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 // OSTProtocol.h: interface for the COSTProtocol class. |
|
18 // |
|
19 ////////////////////////////////////////////////////////////////////// |
|
20 |
|
21 #if !defined(AFX_OSTPROTOCOL_H__6A8FE0C0_A365_4649_8665_EFCCA002A707__INCLUDED_) |
|
22 #define AFX_OSTPROTOCOL_H__6A8FE0C0_A365_4649_8665_EFCCA002A707__INCLUDED_ |
|
23 |
|
24 #if _MSC_VER > 1000 |
|
25 #pragma once |
|
26 #endif // _MSC_VER > 1000 |
|
27 |
|
28 #include "BaseProtocol.h" |
|
29 // Version 1 offsets |
|
30 #define OST_HDR_LEN_1 4 // header length |
|
31 #define OST_VER_BYTE_1 0 // byte that contains the version |
|
32 #define OST_PROT_BYTE_1 1 // protocol byte |
|
33 #define OST_LEN_BYTE_1 2 // first byte of length (bytes 2-3) |
|
34 #define OST_MSG_BYTE_1 4 // start of message bytes |
|
35 |
|
36 // Protocol constants |
|
37 #define OST_PROT_OST_SYSTEM (0x00) // OST System messages |
|
38 #define OST_PROT_OST_ACTIVATION (0x01) // OST Activation messages |
|
39 #define OST_PROT_OST_ASCII (0x02) // OST ASCII messages |
|
40 #define OST_PROT_OST_SIMPLE (0x03) // OST Simple messages |
|
41 #define OST_PROT_OST_EXTENSIBLE (0x04) // OST Extensible messages |
|
42 #define OST_PROT_OST_SYMBIAN (0x05) // OST Symbian messages |
|
43 #define OST_PROT_TRK (0x90) // OST TRK messages |
|
44 #define OST_PROT_TC (0x91) // OST TraceCore messages |
|
45 |
|
46 class COSTProtocol : public CBaseProtocol |
|
47 { |
|
48 public: |
|
49 COSTProtocol(); |
|
50 virtual ~COSTProtocol(); |
|
51 |
|
52 BOOL DecodeMessage(BYTE* fullMessage, DWORD& fullLength, BYTE& msgId, BYTE*& rawMessage, DWORD& rawLength); |
|
53 DWORD EncodeMessage(BYTE* rawMessage, DWORD rawLength, BYTE protocolVersion, BYTE msgId, BYTE* fullMessage, DWORD maxFullLength); |
|
54 DWORD GetHeaderLength() { return OST_HDR_LEN_1; } |
|
55 }; |
|
56 |
|
57 #endif // !defined(AFX_OSTPROTOCOL_H__6A8FE0C0_A365_4649_8665_EFCCA002A707__INCLUDED_) |