~ubuntu-branches/ubuntu/trusty/libticalcs/trusty-proposed

« back to all changes in this revision

Viewing changes to src/nsp_cmd.h

  • Committer: Package Import Robot
  • Author(s): Andreas B. Mundt
  • Date: 2013-08-27 19:58:21 UTC
  • mfrom: (2.1.2 sid)
  • Revision ID: package-import@ubuntu.com-20130827195821-biurlicyqb65gj3g
Tags: 1.1.8+dfsg2-2
* Provide original upstream source, but patch away pre-compiled
  binaries to be policy-compliant.
* Remove unnecessary dependency on 'autopoint', use autoreconf.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* Hey EMACS -*- linux-c -*- */
2
 
/* $Id: cmd84p.h 2074 2006-03-31 08:36:06Z roms $ */
3
 
 
4
 
/*  libticalcs - Ti Calculator library, a part of the TiLP project
5
 
 *  Copyright (C) 1999-2005  Romain Li�vin
6
 
 *
7
 
 *  This program is free software; you can redistribute it and/or modify
8
 
 *  it under the terms of the GNU General Public License as published by
9
 
 *  the Free Software Foundation; either version 2 of the License, or
10
 
 *  (at your option) any later version.
11
 
 *
12
 
 *  This program is distributed in the hope that it will be useful,
13
 
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
14
 
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
 
 *  GNU General Public License for more details.
16
 
 *
17
 
 *  You should have received a copy of the GNU General Public License
18
 
 *  along with this program; if not, write to the Free Software
19
 
 *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20
 
 */
21
 
 
22
 
#ifndef __NSP_CMDS__
23
 
#define __NSP_CMDS__
24
 
 
25
 
// Services IDs
26
 
#define SID_NULL                        0x4001
27
 
#define SID_ECHO                        0x4002
28
 
#define SID_DEV_INFOS           0x4020
29
 
#define SID_SCREENSHOT          0x4021
30
 
#define SID_SCREEN_RLE          0x4024
31
 
#define SID_LOGIN                       0x4050
32
 
#define SID_FILE_MGMT           0x4060
33
 
#define SID_OS_INSTALL          0x4080
34
 
 
35
 
// Errors
36
 
#define ERR_OK                                  0x00
37
 
#define ERR_DIR_UNKNOWN                 0x0a
38
 
#define ERR_DIRNAME_INVALID             0x0f
39
 
#define ERR_LIST_FAILED                 0x10
40
 
#define ERR_NO_MORE_TO_LIST             0x11
41
 
#define ERR_FILENAME_INVALID    0x14
42
 
#define ERR_NO_FILE_EXTENSION   0x15
43
 
 
44
 
// Status command
45
 
#define CMD_STATUS              0xff
46
 
 
47
 
// Device Information command
48
 
#define CMD_DI_VERSION  0x01
49
 
#define CMD_DI_MODEL    0x02
50
 
#define CMD_DI_FEXT             0x03
51
 
 
52
 
// File Management commands
53
 
#define CMD_FM_PUT_FILE         0x03
54
 
#define CMD_FM_OK                       0x04
55
 
#define CMD_FM_CONTENTS         0x05
56
 
#define CMD_FM_GET_FILE         0x07
57
 
#define CMD_FM_DIRLIST_INIT     0x0d
58
 
#define CMD_FM_DIRLIST_NEXT     0x0e
59
 
#define CMD_FM_DIRLIST_DONE     0x0f
60
 
#define CMD_FM_DIRLIST_ENT      0x10
61
 
#define CMD_FM_UNKWOWN          0x20
62
 
 
63
 
// OS Installation commands
64
 
#define CMD_OS_INSTALL          0x03
65
 
#define CMD_OS_OK                       0x04
66
 
#define CMD_OS_CONTENTS         0x05
67
 
#define CMD_OS_PROGRESS         0x06
68
 
 
69
 
// Structures
70
 
// ...
71
 
 
72
 
// Command wrappers
73
 
 
74
 
int cmd_r_login(CalcHandle *h);
75
 
 
76
 
int cmd_s_status(CalcHandle *h, uint8_t status);
77
 
int cmd_r_status(CalcHandle *h, uint8_t *status);
78
 
 
79
 
int cmd_s_dev_infos(CalcHandle *h, uint8_t cmd);
80
 
int cmd_r_dev_infos(CalcHandle *h, uint8_t *cmd, uint32_t *size, uint8_t **data);
81
 
 
82
 
int cmd_s_screen_rle(CalcHandle *h, uint8_t cmd);
83
 
int cmd_r_screen_rle(CalcHandle *h, uint8_t *cmd, uint32_t *size, uint8_t **data);
84
 
 
85
 
int cmd_s_dir_attributes(CalcHandle *h, const char *name);
86
 
int cmd_r_dir_attributes(CalcHandle *h, uint32_t *size, uint8_t *type, uint32_t *date);
87
 
 
88
 
int cmd_s_dir_enum_init(CalcHandle *h, const char *name);
89
 
int cmd_r_dir_enum_init(CalcHandle *h);
90
 
 
91
 
int cmd_s_dir_enum_next(CalcHandle *h);
92
 
int cmd_r_dir_enum_next(CalcHandle *h, char* name, uint32_t *size, uint8_t *type);
93
 
 
94
 
int cmd_s_dir_enum_done(CalcHandle *h);
95
 
int cmd_r_dir_enum_done(CalcHandle *h);
96
 
 
97
 
int cmd_s_put_file(CalcHandle *h, const char *name, uint32_t size);
98
 
int cmd_r_put_file(CalcHandle *h);
99
 
 
100
 
int cmd_s_get_file(CalcHandle *h, const char *name);
101
 
int cmd_r_get_file(CalcHandle *h, uint32_t *size);
102
 
 
103
 
int cmd_s_file_ok(CalcHandle *h);
104
 
int cmd_r_file_ok(CalcHandle *h);
105
 
 
106
 
int cmd_s_file_contents(CalcHandle *h, uint32_t  size, uint8_t  *data);
107
 
int cmd_r_file_contents(CalcHandle *h, uint32_t *size, uint8_t **data);
108
 
 
109
 
int cmd_s_os_install(CalcHandle *h, uint32_t size);
110
 
int cmd_r_os_install(CalcHandle *h);
111
 
 
112
 
int cmd_s_os_contents(CalcHandle *h, uint32_t size, uint8_t *data);
113
 
int cmd_r_progress(CalcHandle *h, uint8_t *value);
114
 
 
115
 
int cmd_s_echo(CalcHandle *h, uint32_t size, uint8_t *data);
116
 
int cmd_r_echo(CalcHandle *h, uint32_t *size, uint8_t **data);
117
 
 
118
 
#endif
 
1
/* Hey EMACS -*- linux-c -*- */
 
2
/* $Id: cmd84p.h 2074 2006-03-31 08:36:06Z roms $ */
 
3
 
 
4
/*  libticalcs - Ti Calculator library, a part of the TiLP project
 
5
 *  Copyright (C) 1999-2005  Romain Li�vin
 
6
 *
 
7
 *  This program is free software; you can redistribute it and/or modify
 
8
 *  it under the terms of the GNU General Public License as published by
 
9
 *  the Free Software Foundation; either version 2 of the License, or
 
10
 *  (at your option) any later version.
 
11
 *
 
12
 *  This program is distributed in the hope that it will be useful,
 
13
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
 *  GNU General Public License for more details.
 
16
 *
 
17
 *  You should have received a copy of the GNU General Public License
 
18
 *  along with this program; if not, write to the Free Software Foundation,
 
19
 *  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
20
 */
 
21
 
 
22
// /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h !
 
23
 
 
24
#ifndef __NSP_CMDS__
 
25
#define __NSP_CMDS__
 
26
 
 
27
// Services IDs
 
28
#define SID_NULL                0x4001
 
29
#define SID_ECHO                0x4002
 
30
 
 
31
#define SID_DEV_INFOS           0x4020
 
32
#define SID_SCREENSHOT          0x4021
 
33
#define SID_SCREEN_RLE          0x4024
 
34
 
 
35
#define SID_KEYPRESSES          0x4042
 
36
 
 
37
#define SID_LOGIN               0x4050
 
38
#define SID_MESSAGES            0x4051
 
39
 
 
40
#define SID_FILE_MGMT           0x4060
 
41
 
 
42
#define SID_OS_INSTALL          0x4080
 
43
 
 
44
// Errors
 
45
#define ERR_OK                                  0x00
 
46
#define ERR_DIR_UNKNOWN                 0x0a
 
47
#define ERR_DIRNAME_INVALID             0x0f
 
48
#define ERR_LIST_FAILED                 0x10
 
49
#define ERR_NO_MORE_TO_LIST             0x11
 
50
#define ERR_FILENAME_INVALID    0x14
 
51
#define ERR_NO_FILE_EXTENSION   0x15
 
52
 
 
53
// Status command
 
54
#define CMD_STATUS              0xff
 
55
 
 
56
// Device Information command
 
57
#define CMD_DI_VERSION  0x01
 
58
#define CMD_DI_MODEL    0x02
 
59
#define CMD_DI_FEXT             0x03
 
60
 
 
61
// File Management commands
 
62
#define CMD_FM_PUT_FILE         0x03
 
63
#define CMD_FM_OK                       0x04
 
64
#define CMD_FM_CONTENTS         0x05
 
65
#define CMD_FM_PUT_FILE_EOT     0x06
 
66
#define CMD_FM_GET_FILE         0x07
 
67
#define CMD_FM_DEL_FILE         0x09
 
68
#define CMD_FM_NEW_FOLDER       0x0a
 
69
#define CMD_FM_DEL_FOLDER       0x0b
 
70
#define CMD_FM_COPY_FILE        0x0c
 
71
#define CMD_FM_DIRLIST_INIT     0x0d
 
72
#define CMD_FM_DIRLIST_NEXT     0x0e
 
73
#define CMD_FM_DIRLIST_DONE     0x0f
 
74
#define CMD_FM_DIRLIST_ENT      0x10
 
75
#define CMD_FM_ATTRIBUTES       0x20
 
76
#define CMD_FM_RENAME_FILE      0x21
 
77
 
 
78
// OS Installation commands
 
79
#define CMD_OS_INSTALL          0x03
 
80
#define CMD_OS_OK                       0x04
 
81
#define CMD_OS_CONTENTS         0x05
 
82
#define CMD_OS_PROGRESS         0x06
 
83
 
 
84
// Structures
 
85
// ...
 
86
 
 
87
// Command wrappers
 
88
 
 
89
TIEXPORT3 int TICALL nsp_cmd_r_login(CalcHandle *h);
 
90
 
 
91
TIEXPORT3 int TICALL nsp_cmd_s_status(CalcHandle *h, uint8_t status);
 
92
TIEXPORT3 int TICALL nsp_cmd_r_status(CalcHandle *h, uint8_t *status);
 
93
 
 
94
TIEXPORT3 int TICALL nsp_cmd_s_dev_infos(CalcHandle *h, uint8_t cmd);
 
95
TIEXPORT3 int TICALL nsp_cmd_r_dev_infos(CalcHandle *h, uint8_t *cmd, uint32_t *size, uint8_t **data);
 
96
 
 
97
TIEXPORT3 int TICALL nsp_cmd_s_screen_rle(CalcHandle *h, uint8_t cmd);
 
98
TIEXPORT3 int TICALL nsp_cmd_r_screen_rle(CalcHandle *h, uint8_t *cmd, uint32_t *size, uint8_t **data);
 
99
 
 
100
TIEXPORT3 int TICALL nsp_cmd_s_dir_attributes(CalcHandle *h, const char *name);
 
101
TIEXPORT3 int TICALL nsp_cmd_r_dir_attributes(CalcHandle *h, uint32_t *size, uint8_t *type, uint32_t *date);
 
102
 
 
103
TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_init(CalcHandle *h, const char *name);
 
104
TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_init(CalcHandle *h);
 
105
 
 
106
TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_next(CalcHandle *h);
 
107
TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_next(CalcHandle *h, char* name, uint32_t *size, uint8_t *type);
 
108
 
 
109
TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_done(CalcHandle *h);
 
110
TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_done(CalcHandle *h);
 
111
 
 
112
TIEXPORT3 int TICALL nsp_cmd_s_put_file(CalcHandle *h, const char *name, uint32_t size);
 
113
TIEXPORT3 int TICALL nsp_cmd_r_put_file(CalcHandle *h);
 
114
 
 
115
TIEXPORT3 int TICALL nsp_cmd_s_put_file_eot(CalcHandle *h);
 
116
// No nsp_cmd_r_put_file_eot because the calculator doesn't seem to reply to CMD_FM_PUT_FILE_EOT.
 
117
 
 
118
TIEXPORT3 int TICALL nsp_cmd_s_get_file(CalcHandle *h, const char *name);
 
119
TIEXPORT3 int TICALL nsp_cmd_r_get_file(CalcHandle *h, uint32_t *size);
 
120
 
 
121
TIEXPORT3 int TICALL nsp_cmd_s_del_file(CalcHandle *h, const char *name);
 
122
TIEXPORT3 int TICALL nsp_cmd_r_del_file(CalcHandle *h);
 
123
 
 
124
TIEXPORT3 int TICALL nsp_cmd_s_new_folder(CalcHandle *h, const char *name);
 
125
TIEXPORT3 int TICALL nsp_cmd_r_new_folder(CalcHandle *h);
 
126
 
 
127
TIEXPORT3 int TICALL nsp_cmd_s_del_folder(CalcHandle *h, const char *name);
 
128
TIEXPORT3 int TICALL nsp_cmd_r_del_folder(CalcHandle *h);
 
129
 
 
130
TIEXPORT3 int TICALL nsp_cmd_s_copy_file(CalcHandle *h, const char *name, const char *name2);
 
131
TIEXPORT3 int TICALL nsp_cmd_r_copy_file(CalcHandle *h);
 
132
 
 
133
TIEXPORT3 int TICALL nsp_cmd_s_rename_file(CalcHandle *h, const char *name, const char *name2);
 
134
TIEXPORT3 int TICALL nsp_cmd_r_rename_file(CalcHandle *h);
 
135
 
 
136
TIEXPORT3 int TICALL nsp_cmd_s_file_ok(CalcHandle *h);
 
137
TIEXPORT3 int TICALL nsp_cmd_r_file_ok(CalcHandle *h);
 
138
 
 
139
TIEXPORT3 int TICALL nsp_cmd_s_file_contents(CalcHandle *h, uint32_t  size, uint8_t  *data);
 
140
TIEXPORT3 int TICALL nsp_cmd_r_file_contents(CalcHandle *h, uint32_t *size, uint8_t **data);
 
141
 
 
142
TIEXPORT3 int TICALL nsp_cmd_s_os_install(CalcHandle *h, uint32_t size);
 
143
TIEXPORT3 int TICALL nsp_cmd_r_os_install(CalcHandle *h);
 
144
 
 
145
TIEXPORT3 int TICALL nsp_cmd_s_os_contents(CalcHandle *h, uint32_t size, uint8_t *data);
 
146
TIEXPORT3 int TICALL nsp_cmd_r_progress(CalcHandle *h, uint8_t *value);
 
147
 
 
148
TIEXPORT3 int TICALL nsp_cmd_s_echo(CalcHandle *h, uint32_t size, uint8_t *data);
 
149
TIEXPORT3 int TICALL nsp_cmd_r_echo(CalcHandle *h, uint32_t *size, uint8_t **data);
 
150
 
 
151
TIEXPORT3 int TICALL nsp_cmd_s_keypress_event(CalcHandle *h, const uint8_t keycode[3]);
 
152
// There doesn't seem to be a need for nsp_cmd_r_keypress_event.
 
153
 
 
154
#endif