connectivity/com.nokia.tcf/native/TCFNative/TCFProtOST/OSTProtocol.h
author bkirk
Sat, 18 Sep 2010 16:18:58 -0700
changeset 2054 deb27f632e39
parent 458 70467d598794
permissions -rw-r--r--
should be using JavaSE-1.6 VM, and .classpath, codegen.targetPlatform, compliance and source should also all be 1.6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
60
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     1
/*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     3
* All rights reserved.
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     4
* This component and the accompanying materials are made available
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     5
* under the terms of the License "Eclipse Public License v1.0"
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     6
* which accompanies this distribution, and is available
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     8
*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
     9
* Initial Contributors:
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    11
*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    12
* Contributors:
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    13
*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    14
* Description: 
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    15
*
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    16
*/
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    17
// OSTProtocol.h: interface for the COSTProtocol class.
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    18
//
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    19
//////////////////////////////////////////////////////////////////////
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    20
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    21
#if !defined(AFX_OSTPROTOCOL_H__6A8FE0C0_A365_4649_8665_EFCCA002A707__INCLUDED_)
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    22
#define AFX_OSTPROTOCOL_H__6A8FE0C0_A365_4649_8665_EFCCA002A707__INCLUDED_
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    23
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    24
#if _MSC_VER > 1000
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    25
#pragma once
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    26
#endif // _MSC_VER > 1000
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    27
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    28
#include "BaseProtocol.h"
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    29
// Version 1 offsets
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    30
#define OST_HDR_LEN_1	4	// header length
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    31
#define OST_VER_BYTE_1	0	// byte that contains the version
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    32
#define OST_PROT_BYTE_1	1	// protocol byte
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    33
#define OST_LEN_BYTE_1	2	// first byte of length (bytes 2-3)
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    34
#define OST_MSG_BYTE_1	4	// start of message bytes
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    35
	
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    36
// Protocol constants
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    37
#define OST_PROT_OST_SYSTEM			(0x00)	// OST System messages
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    38
#define OST_PROT_OST_ACTIVATION		(0x01)	// OST Activation messages
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    39
#define OST_PROT_OST_ASCII			(0x02)	// OST ASCII messages
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    40
#define OST_PROT_OST_SIMPLE			(0x03)	// OST Simple messages
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    41
#define OST_PROT_OST_EXTENSIBLE		(0x04)	// OST Extensible messages 
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    42
#define OST_PROT_OST_SYMBIAN		(0x05)	// OST Symbian messages
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    43
#define OST_PROT_TRK				(0x90)	// OST TRK messages
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    44
#define OST_PROT_TC					(0x91)	// OST TraceCore messages
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    45
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    46
class COSTProtocol : public CBaseProtocol  
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    47
{
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    48
public:
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    49
	COSTProtocol();
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    50
	virtual ~COSTProtocol();
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    51
458
70467d598794 Fix for bug 9652
Chad Peckham <chad.peckham@nokia.com>
parents: 60
diff changeset
    52
	int DecodeMessage(BYTE* fullMessage, DWORD& fullLength, BYTE& msgId, BYTE*& rawMessage, DWORD& rawLength);
60
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    53
	DWORD EncodeMessage(BYTE* rawMessage, DWORD rawLength, BYTE protocolVersion, BYTE msgId, BYTE* fullMessage, DWORD maxFullLength);
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    54
	DWORD GetHeaderLength() { return OST_HDR_LEN_1; }
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    55
};
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    56
9d2210c8eed2 Commit changes for 2.1.0
chpeckha
parents:
diff changeset
    57
#endif // !defined(AFX_OSTPROTOCOL_H__6A8FE0C0_A365_4649_8665_EFCCA002A707__INCLUDED_)