protocol.h

Go to the documentation of this file.
00001 ///
00002 /// \file       protocol.h
00003 ///             USB Blackberry bulk protocol API constants
00004 ///
00005 
00006 /*
00007     Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
00008 
00009     This program is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00017 
00018     See the GNU General Public License in the COPYING file at the
00019     root directory of this project for more details.
00020 */
00021 
00022 #ifndef __BARRY_PROTOCOL_H__
00023 #define __BARRY_PROTOCOL_H__
00024 
00025 // packet commands (Packet.command: has response codes too)
00026 #define SB_COMMAND_FETCH_ATTRIBUTE      0x05
00027 #define SB_COMMAND_FETCHED_ATTRIBUTE    0x06
00028 #define SB_COMMAND_SELECT_MODE          0x07
00029 #define SB_COMMAND_MODE_SELECTED        0x08
00030 #define SB_COMMAND_OPEN_SOCKET          0x0a
00031 #define SB_COMMAND_CLOSE_SOCKET         0x0b
00032 #define SB_COMMAND_CLOSED_SOCKET        0x0c
00033 #define SB_COMMAND_PASSWORD_CHALLENGE   0x0e
00034 #define SB_COMMAND_PASSWORD             0x0f
00035 #define SB_COMMAND_OPENED_SOCKET        0x10
00036 #define SB_COMMAND_PASSWORD_FAILED      0x11
00037 #define SB_COMMAND_SEQUENCE_HANDSHAKE   0x13
00038 #define SB_COMMAND_DB_DATA              0x40
00039 #define SB_COMMAND_DB_FRAGMENTED        0x60
00040 #define SB_COMMAND_DB_DONE              0x41
00041 
00042 
00043 // mode constants
00044 #define SB_MODE_REQUEST_SOCKET          0x00ff
00045 
00046 
00047 // object and attribute ID codes (for ZeroPacket::GetAttribute())
00048 // meanings for most of these are unknown
00049 #define SB_OBJECT_INITIAL_UNKNOWN               0x14
00050 #define         SB_ATTR_INITIAL_UNKNOWN         0x01
00051 #define SB_OBJECT_PROFILE                       0x08
00052 #define         SB_ATTR_PROFILE_DESC            0x02
00053 #define         SB_ATTR_PROFILE_PIN             0x04
00054 #define SB_OBJECT_SOCKET_UNKNOWN                0x04
00055 
00056 
00057 // param command parameters
00058 //#define SB_PARAM_DEFAULT              0xff
00059 
00060 
00061 // DB Operation Command
00062 #define SB_DBOP_SET_RECORD              0x41
00063 #define SB_DBOP_CLEAR_DATABASE          0x43
00064 #define SB_DBOP_GET_DBDB                0x4a
00065 #define SB_DBOP_OLD_GET_DBDB            0x4c
00066 #define SB_DBOP_GET_COUNT               0x4e
00067 #define SB_DBOP_GET_RECORDS             0x4f
00068 #define SB_DBOP_OLD_GET_RECORDS         0x42
00069 #define SB_DBOP_OLD_GET_RECORDS_REPLY   0x44
00070 
00071 #define SB_DBOP_GET_RECORD_STATE_TABLE  0x53    // replies with 0x60, 0x41
00072 #define SB_DBOP_SET_RECORD_FLAGS        0x54    // replies with 0x41
00073                                                 // used to clear dirty flag
00074 #define SB_DBOP_GET_RECORD_BY_INDEX     0x46    // replies with 0x44
00075         // John's device uses 0x50, with a reply of 0x4f (!)
00076         // Then uses 0x55 as usual
00077         // Delete uses 0x50/0x4f to check as well, then uses 0x52 as
00078         // usual to do the actual delete.
00079 #define SB_DBOP_SET_RECORD_BY_INDEX     0x55    // replies with 0x41
00080 #define SB_DBOP_DELETE_RECORD_BY_INDEX  0x52    // intellisync does a GET(0x46)
00081                                                 // first, probably to make sure
00082                                                 // it has the right data and
00083                                                 // record
00084 
00085 #endif
00086 

Generated on Mon Jan 12 10:51:13 2009 for Barry by  doxygen 1.5.7.1