Applied bjavaloader patch from Nicolas Vivien
[barry/progweb.git] / src / protocol.h
blobb3770ffbac534ec2a8d7dfaac972ed3ced801508
1 ///
2 /// \file protocol.h
3 /// USB Blackberry bulk protocol API constants
4 ///
6 /*
7 Copyright (C) 2005-2009, Net Direct Inc. (http://www.netdirect.ca/)
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 2 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
18 See the GNU General Public License in the COPYING file at the
19 root directory of this project for more details.
22 #ifndef __BARRY_PROTOCOL_H__
23 #define __BARRY_PROTOCOL_H__
25 // packet commands (Packet.command: has response codes too)
26 #define SB_COMMAND_FETCH_ATTRIBUTE 0x05
27 #define SB_COMMAND_FETCHED_ATTRIBUTE 0x06
28 #define SB_COMMAND_SELECT_MODE 0x07
29 #define SB_COMMAND_MODE_SELECTED 0x08
30 #define SB_COMMAND_OPEN_SOCKET 0x0a
31 #define SB_COMMAND_CLOSE_SOCKET 0x0b
32 #define SB_COMMAND_CLOSED_SOCKET 0x0c
33 #define SB_COMMAND_PASSWORD_CHALLENGE 0x0e
34 #define SB_COMMAND_PASSWORD 0x0f
35 #define SB_COMMAND_OPENED_SOCKET 0x10
36 #define SB_COMMAND_PASSWORD_FAILED 0x11
37 #define SB_COMMAND_SEQUENCE_HANDSHAKE 0x13
38 #define SB_COMMAND_DB_DATA 0x40
39 #define SB_COMMAND_DB_FRAGMENTED 0x60
40 #define SB_COMMAND_DB_DONE 0x41
41 #define SB_COMMAND_JL_UNKOWN1 0x64
42 #define SB_COMMAND_JL_UNKOWN2 0x70
43 #define SB_COMMAND_JL_UNKOWN3 0x63
44 #define SB_COMMAND_JL_UNKOWN4 0x00
45 #define SB_COMMAND_JL_UNKOWN5 0x67
46 #define SB_COMMAND_JL_UNKOWN6 0x68
47 #define SB_COMMAND_JL_UNKOWN7 0x8d
50 // mode constants
51 #define SB_MODE_REQUEST_SOCKET 0x00ff
54 // object and attribute ID codes (for ZeroPacket::GetAttribute())
55 // meanings for most of these are unknown
56 #define SB_OBJECT_INITIAL_UNKNOWN 0x14
57 #define SB_ATTR_INITIAL_UNKNOWN 0x01
58 #define SB_OBJECT_PROFILE 0x08
59 #define SB_ATTR_PROFILE_DESC 0x02
60 #define SB_ATTR_PROFILE_PIN 0x04
61 #define SB_OBJECT_SOCKET_UNKNOWN 0x04
64 // param command parameters
65 //#define SB_PARAM_DEFAULT 0xff
68 // DB Operation Command
69 #define SB_DBOP_SET_RECORD 0x41
70 #define SB_DBOP_CLEAR_DATABASE 0x43
71 #define SB_DBOP_GET_DBDB 0x4a
72 #define SB_DBOP_OLD_GET_DBDB 0x4c
73 #define SB_DBOP_GET_COUNT 0x4e
74 #define SB_DBOP_GET_RECORDS 0x4f
75 #define SB_DBOP_OLD_GET_RECORDS 0x42
76 #define SB_DBOP_OLD_GET_RECORDS_REPLY 0x44
78 #define SB_DBOP_GET_RECORD_STATE_TABLE 0x53 // replies with 0x60, 0x41
79 #define SB_DBOP_SET_RECORD_FLAGS 0x54 // replies with 0x41
80 // used to clear dirty flag
81 #define SB_DBOP_GET_RECORD_BY_INDEX 0x46 // replies with 0x44
82 // John's device uses 0x50, with a reply of 0x4f (!)
83 // Then uses 0x55 as usual
84 // Delete uses 0x50/0x4f to check as well, then uses 0x52 as
85 // usual to do the actual delete.
86 #define SB_DBOP_SET_RECORD_BY_INDEX 0x55 // replies with 0x41
87 #define SB_DBOP_DELETE_RECORD_BY_INDEX 0x52 // intellisync does a GET(0x46)
88 // first, probably to make sure
89 // it has the right data and
90 // record
92 #endif