ImagePrint/ImagePrintEngine/DeviceProtocols/btprotocol/inc/btprotocolconsts.h
branchRCL_3
changeset 21 d59c248c9d36
parent 0 d11fb78c4374
equal deleted inserted replaced
20:159fc2f68139 21:d59c248c9d36
       
     1 /*
       
     2 * Copyright (c) 2004-2007 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 
       
    19 
       
    20 #ifndef BTPROTOCOLCONSTS_H
       
    21 #define BTPROTOCOLCONSTS_H
       
    22 
       
    23 #include <btsdp.h>
       
    24 
       
    25 ////////////////////////////////////////////////////////////////////////////////////////
       
    26 //
       
    27 // Obex header HI values from http://www.it.lut.fi/~doc/bluetooth/OBEX12.pdf
       
    28 //
       
    29 ////////////////////////////////////////////////////////////////////////////////////////
       
    30 const TUint KBtObexHeaderHiCount			=	0xC0;	//Number of objects (used by Connect)
       
    31 const TUint KBtObexHeaderHiName				=	0x01;	//name of the object (often a file name)
       
    32 const TUint KBtObexHeaderHiType				=	0x42;	//type of object - e.g. text, html, binary, manufacturer specific
       
    33 const TUint KBtObexHeaderHiLength			=	0xC3;	//the length of the object in bytes
       
    34 const TUint KBtObexHeaderHiTimeIso			=	0x44;	//date/time stamp – ISO 8601 version - preferred
       
    35 const TUint KBtObexHeaderHiTime4B			=	0xC4;	//date/time stamp – 4 byte version (for compatibility only)
       
    36 const TUint KBtObexHeaderHiDescription		=	0x05;	//text description of the object
       
    37 const TUint KBtObexHeaderHiTarget			=	0x46;	//name of service that operation is targeted to
       
    38 const TUint KBtObexHeaderHiHTTP				=	0x47;	//an HTTP 1.x header
       
    39 const TUint KBtObexHeaderHiBody				=	0x48;	//a chunk of the object body.
       
    40 const TUint KBtObexHeaderHiEnd				=	0x49;	//of Body
       
    41 const TUint KBtObexHeaderHiWho				=	0x4A;	//identifies the OBEX application, used to tell if talking to a peer
       
    42 const TUint KBtObexHeaderHiConnectionId		=	0xCB;	//an identifier used for OBEX connection multiplexing
       
    43 const TUint KBtObexHeaderHiAppParameters	=	0x4C;	//extended application request & response information
       
    44 const TUint KBtObexHeaderHiAuthChallenge	=	0x4D;	//authentication digest-challenge
       
    45 const TUint KBtObexHeaderHiAuthResponse		=	0x4E;	//authentication digest-response
       
    46 const TUint KBtObexHeaderHiObjectClass		=	0x4F;	//OBEX Object class of object
       
    47 // Reserved			=	0x10 to 0x2F	//this range includes all combinations of the upper 2 bits
       
    48 // User Defined		=	0x30 to 0x3F	//this range includes all combinations of the upper 2 bits
       
    49 
       
    50 // Obex tag values
       
    51 const TUint KBtObexTagOffset	=	0x01;
       
    52 const TUint KBtObexTagCount		=	0x02;
       
    53 const TUint KBtObexTagJobId		=	0x03;
       
    54 const TUint KBtObexTagSize		=	0x04;
       
    55 
       
    56 // Obex tag lengths in bytes
       
    57 const TUint KBtDataLength4		=	0x04;	//Length of I4 = 4 bytes integer
       
    58 const TUint KBtTripletLength	=	6;	//Length of tag + length + data = 1 + 1 + 4
       
    59 
       
    60 
       
    61 ////////////////////////////////////////////////////////////////////////////////////////
       
    62 //
       
    63 // Mime types
       
    64 //
       
    65 ////////////////////////////////////////////////////////////////////////////////////////
       
    66 _LIT8(KBtMimeTypeSoap, 			"x-obex/bt-SOAP");
       
    67 _LIT8(KBtMimeTypeXhtml, 		"application/vnd.pwg-xhtml-print+xml\0"); //"application/xhtml+xml");
       
    68 _LIT8(KBtMimeTypeReferenced, 	"x-obex/referencedobject");
       
    69 _LIT8(KBtMimeTypeJpeg, 			"image/jpeg");
       
    70 _LIT8(KBtMimeAnyImg, 			"image/*" );
       
    71 
       
    72 ////////////////////////////////////////////////////////////////////////////////////////
       
    73 //
       
    74 // Obex constants
       
    75 //
       
    76 // According to http://www.bluetooth.org/assigned-numbers/baseband.htm
       
    77 // these should be the correct numbers, however the Series 60
       
    78 // implementation of Bluetooth uses the numbers as below
       
    79 //
       
    80 ////////////////////////////////////////////////////////////////////////////////////////
       
    81 //#define KBTMjrDevClassImaging			0x6
       
    82 //#define KBTMinDevClassPrinter			0x80
       
    83 //#define KBTMjrSvcClassRendering		0x20
       
    84 //#define KBTMjrSvcClassObjectTransfer	0x80
       
    85 
       
    86 /** If the Major Device Class includes Imaging, the discovered Bluetooth device MAY be a BPP printer. */
       
    87 #define KBTMjrDevClassImaging			0x600
       
    88 /** If the Minor Device Class includes Printing, the discovered Bluetooth device is LIKELY a BPP printer. */
       
    89 #define KBTMinDevClassPrinter			0x20
       
    90 /** If the Major Service Class does not include Rendering, the discovered Bluetooth device is NOT a BPP printer. */
       
    91 #define KBTMjrSvcClassRendering			0x200000
       
    92 /** If the Major Service Class includes ObjectTransfer, the discovered Bluetooth device is NOT a BPP printer. */
       
    93 #define KBTMjrSvcClassObjectTransfer	0x800000
       
    94 
       
    95 /** Nokia 6600: If the Major Device Class includes Imaging, the discovered Bluetooth device MAY be a BPP printer. */
       
    96 #define KBTMjrDevClassImaging_V2			0x600
       
    97 /** Nokia 6600: If the Minor Device Class includes Printing, the discovered Bluetooth device is LIKELY a BPP printer. */
       
    98 #define KBTMinDevClassPrinter_V2			0x80
       
    99 /** Nokia 6600: If the Major Service Class does not include Rendering, the discovered Bluetooth device is NOT a BPP printer. */
       
   100 #define KBTMjrSvcClassRendering_V2			0x40000
       
   101 /** Nokia 6600: If the Major Service Class does not includes ObjectTransfer, the discovered Bluetooth device is NOT a BPP printer. */
       
   102 #define KBTMjrSvcClassObjectTransfer_V2		0x100000
       
   103 
       
   104 /** If the Major Device Class includes Computer, the discovered Bluetooth device MAY support Object Transfer. */
       
   105 #define KBTMjrDevClassComputer 0x100
       
   106 /** The device is a Desktop Computer. */
       
   107 #define KBTMinDevClassDesktop  0x4
       
   108 /** The device is a Server Computer. */
       
   109 #define KBTMinDevClassServer   0x8
       
   110 /** The device is a Laptop Computer. */
       
   111 #define KBTMinDevClassLaptop   0xC
       
   112 
       
   113 
       
   114 // According to https://www.bluetooth.org/foundry/assignnumb/document/service_discovery
       
   115 /** UID for OBEX Object Push service in a Bluetooth device SDP query. Required for OPP. */
       
   116 #define KBTSDPOBEXObjectPush    0x1105
       
   117 /** UID for the BPP Direct Printing service in a Bluetooth device SDP query. Required for BPP. */
       
   118 #define KBTSDPDirectPrinting	0x1118
       
   119 /** UID for the BPP Reference Printing service in a Bluetooth device SDP query. Required for BPP. */
       
   120 #define KBTSDPReferencePrinting	0x1119
       
   121 /** UID for the BPP Direct Printing Reference Objects service in a Bluetooth device SDP advertise. Required for BPP. */
       
   122 #define KBTSDPDPROService 		0x1120
       
   123 /** UID for the BPP Printing Status service in a Bluetooth device SDP advertise. Required for BPP. */
       
   124 #define KBTSDPPrintingStatus 	0x1123
       
   125 /** UID for L2CAP in a Bluetooth device SDP query. Required for BPP. */
       
   126 #define KBTSDPL2CAP				0x0100
       
   127 /** UID for RFCOMM in a Bluetooth device SDP query. Required for BPP. */
       
   128 #define KBTSDPRFCOMM			0x0003
       
   129 /** UID for Object Exchange in a Bluetooth device SDP query. Required for BPP. */
       
   130 #define KBTSDPObex				0x0008
       
   131 
       
   132 // Additions to universal attributes in btsdp.h
       
   133 static const TSdpAttributeID KSdpAttrIdAdditionalProtocolDescriptorLists 	= 0x000D;
       
   134 static const TSdpAttributeID KSdpAttrIdDocFormatsSupported 					= 0x0350;
       
   135 static const TSdpAttributeID KSdpAttrIdModelID 								= 0x0358;
       
   136 static const TSdpAttributeID KSdpAttrIdMaxWidth								= 0x0362;
       
   137 static const TSdpAttributeID KSdpAttrIdMaxLen 								= 0x0364;
       
   138 static const TSdpAttributeID KSdpAttrIdAllDone 								= 0xFFFFFF;
       
   139 // own constants for UID bitmask
       
   140 static const TUint KBtMaskRFCOMM 			= 0;
       
   141 static const TUint KBtMaskL2CAP 			= 1;
       
   142 static const TUint KBtMaskObex		 		= 2;
       
   143 static const TUint KBtMaskObjectPush	 	= 4;
       
   144 static const TUint KBtMaskDirectPrinting 	= 8;
       
   145 static const TUint KBtMaskPrintingStatus 	= 16;
       
   146 static const TUint KBtMaskROService			= 32;
       
   147 
       
   148 static const TUint KBtMaskObexLevel		= KBtMaskRFCOMM | KBtMaskL2CAP | KBtMaskObex;
       
   149 
       
   150 
       
   151 ////////////////////////////////////////////////////////////////////////////////////////
       
   152 //
       
   153 // Obex server constants
       
   154 //
       
   155 ////////////////////////////////////////////////////////////////////////////////////////
       
   156 const TUint KRfcommChannel = 1;
       
   157 const TUint KServiceClass = 0x01007779; // Own UID
       
   158 
       
   159 _LIT( KServiceName,"DirectPrintingReferenceObjectsService" );
       
   160 _LIT( KServiceDescription,"Direct Printing Reference Objects Service" );
       
   161 
       
   162 // Used by ObexFileServerImpl.h
       
   163 const TInt KSimultainousSocketsOpen = 8;
       
   164 
       
   165 ////////////////////////////////////////////////////////////////////////////////////////
       
   166 //
       
   167 // Misc
       
   168 //
       
   169 ////////////////////////////////////////////////////////////////////////////////////////
       
   170 const TInt KPendingLimit = 6; // 6 x 5 sec = 30 sec total to wait answer to request from printer
       
   171 const TInt KOppPendingLimit = 24; // 24 X 5 sec = 120 sec total to wait opp printing. 
       
   172 // to get local BT name from central repository
       
   173 const TUid KCRUidBluetoothLocalNameSettings = {0x10204DAC};
       
   174 const TUint32 KBTLocalName = 0x00000001;
       
   175 
       
   176 /** XHTML file name*/
       
   177 _LIT(KXHTMLFileName, 	"c:\\system\\data\\xhtml\\Bt_Print_%d.xhtml");
       
   178 _LIT8(KXHTMLFileName8, 	"c:\\system\\data\\xhtml\\Bt_Print_%d.xhtml");
       
   179 
       
   180 /* Time out value for OBEX commands = 20 second */
       
   181 const TInt KObexCmdTimeOut = 20000000;
       
   182 
       
   183 #endif // BTPROTOCOLCONSTS_H
       
   184 
       
   185 //  End of File
       
   186