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_ECHO                 0x01
00027 #define SB_COMMAND_ECHO_REPLY           0x02
00028 #define SB_COMMAND_RESET                0x03
00029 #define SB_COMMAND_RESET_REPLY          0x04
00030 #define SB_COMMAND_FETCH_ATTRIBUTE      0x05
00031 #define SB_COMMAND_FETCHED_ATTRIBUTE    0x06
00032 #define SB_COMMAND_SELECT_MODE          0x07
00033 #define SB_COMMAND_MODE_SELECTED        0x08
00034 #define SB_COMMAND_OPEN_SOCKET          0x0a
00035 #define SB_COMMAND_CLOSE_SOCKET         0x0b
00036 #define SB_COMMAND_CLOSED_SOCKET        0x0c
00037 #define SB_COMMAND_PASSWORD_CHALLENGE   0x0e
00038 #define SB_COMMAND_PASSWORD             0x0f
00039 #define SB_COMMAND_OPENED_SOCKET        0x10
00040 #define SB_COMMAND_PASSWORD_FAILED      0x11
00041 #define SB_COMMAND_SEQUENCE_HANDSHAKE   0x13
00042 #define SB_COMMAND_DB_DATA              0x40
00043 #define SB_COMMAND_DB_FRAGMENTED        0x60
00044 #define SB_COMMAND_DB_DONE              0x41
00045 
00046 // JavaLoader commands
00047 #define SB_COMMAND_JL_HELLO             0x64    // This could be a general ACK in both directions
00048 #define SB_COMMAND_JL_HELLO_ACK         0x65    // From device after host HELLO
00049 #define SB_COMMAND_JL_GOODBYE           0x8d
00050 #define SB_COMMAND_JL_SET_UNKNOWN1      0x70    // Initial sequence, 0
00051 #define SB_COMMAND_JL_SET_COD_FILENAME  0x80
00052 #define SB_COMMAND_JL_SET_COD_SIZE      0x67    // Always big endian
00053 #define SB_COMMAND_JL_SEND_DATA         0x68
00054 #define SB_COMMAND_JL_SET_TIME          0x7c
00055 #define SB_COMMAND_JL_GET_SCREENSHOT    0x87
00056 #define SB_COMMAND_JL_DEVICE_INFO       0x71
00057 #define SB_COMMAND_JL_OS_METRICS        0x78
00058 #define SB_COMMAND_JL_BOOTROM_METRICS   0x79
00059 #define SB_COMMAND_JL_GET_DIRECTORY     0x6d
00060 #define SB_COMMAND_JL_GET_DATA_ENTRY    0x6e    // Used for both DIR and SCREENSHOT
00061 #define SB_COMMAND_JL_GET_SUBDIR        0x7f
00062 #define SB_COMMAND_JL_GET_SUBDIR_ENTRY  0x7d
00063 #define SB_COMMAND_JL_ERASE             0x69
00064 #define SB_COMMAND_JL_FORCE_ERASE       0x7b
00065 #define SB_COMMAND_JL_UNKNOWN3          0x63
00066 #define SB_COMMAND_JL_GET_LOG           0x73
00067 #define SB_COMMAND_JL_GET_LOG_ENTRY     0x74
00068 #define SB_COMMAND_JL_CLEAR_LOG         0x88
00069 #define SB_COMMAND_JL_SAVE_MODULE       0x7e
00070 #define SB_COMMAND_JL_WIPE_APPS         0x6a
00071 #define SB_COMMAND_JL_WIPE_FS           0x6b
00072 #define SB_COMMAND_JL_LOG_STRACES       0x8e
00073 #define SB_COMMAND_JL_RESET_FACTORY     0x91
00074 
00075 // JavaLoader response
00076 #define SB_COMMAND_JL_ACK               0x64
00077 #define SB_COMMAND_JL_READY             0x01
00078 #define SB_COMMAND_JL_RESET_REQUIRED    0x78    // Occurs after GOODBYE when handheld reset is required
00079 #define SB_COMMAND_JL_COD_IN_USE        0x6c    // Perhaps "BUSY" is also a good name?
00080 #define SB_COMMAND_JL_COD_NOT_FOUND     0x69
00081 #define SB_COMMAND_JL_NOT_SUPPORTED     0x71    // Occurs when device does not support a command
00082 
00083 // JavaLoader data
00084 #define SB_DATA_JL_SUCCESS              0x64    // Device has accepted the data packet
00085 #define SB_DATA_JL_INVALID              0x68    // Device returns this code if the application isn't valid.
00086 
00087 
00088 // mode constants
00089 #define SB_MODE_REQUEST_SOCKET          0x00ff
00090 
00091 
00092 // object and attribute ID codes (for ZeroPacket::GetAttribute())
00093 // meanings for most of these are unknown
00094 #define SB_OBJECT_INITIAL_UNKNOWN               0x14
00095 #define         SB_ATTR_INITIAL_UNKNOWN         0x01
00096 #define SB_OBJECT_PROFILE                       0x08
00097 #define         SB_ATTR_PROFILE_DESC            0x02
00098 #define         SB_ATTR_PROFILE_PIN             0x04
00099 #define SB_OBJECT_SOCKET_UNKNOWN                0x04
00100 
00101 
00102 // param command parameters
00103 //#define SB_PARAM_DEFAULT              0xff
00104 
00105 
00106 // DB Operation Command
00107 #define SB_DBOP_SET_RECORD              0x41
00108 #define SB_DBOP_CLEAR_DATABASE          0x43
00109 #define SB_DBOP_GET_DBDB                0x4a
00110 #define SB_DBOP_OLD_GET_DBDB            0x4c
00111 #define SB_DBOP_GET_COUNT               0x4e
00112 #define SB_DBOP_GET_RECORDS             0x4f
00113 #define SB_DBOP_OLD_GET_RECORDS         0x42
00114 #define SB_DBOP_OLD_GET_RECORDS_REPLY   0x44
00115 
00116 #define SB_DBOP_GET_RECORD_STATE_TABLE  0x53    // replies with 0x60, 0x41
00117 #define SB_DBOP_SET_RECORD_FLAGS        0x54    // replies with 0x41
00118                                                 // used to clear dirty flag
00119 #define SB_DBOP_GET_RECORD_BY_INDEX     0x46    // replies with 0x44
00120         // John's device uses 0x50, with a reply of 0x4f (!)
00121         // Then uses 0x55 as usual
00122         // Delete uses 0x50/0x4f to check as well, then uses 0x52 as
00123         // usual to do the actual delete.
00124 #define SB_DBOP_SET_RECORD_BY_INDEX     0x55    // replies with 0x41
00125 #define SB_DBOP_DELETE_RECORD_BY_INDEX  0x52    // intellisync does a GET(0x46)
00126                                                 // first, probably to make sure
00127                                                 // it has the right data and
00128                                                 // record
00129 
00130 #endif
00131 

Generated on Tue Jun 30 16:08:14 2009 for Barry by  doxygen 1.5.8