1
/* Hey EMACS -*- linux-c -*- */
2
/* $Id: cmd84p.h 2074 2006-03-31 08:36:06Z roms $ */
4
/* libticalcs - Ti Calculator library, a part of the TiLP project
5
* Copyright (C) 1999-2005 Romain Li�vin
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.
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.
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.
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
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
45
#define CMD_STATUS 0xff
47
// Device Information command
48
#define CMD_DI_VERSION 0x01
49
#define CMD_DI_MODEL 0x02
50
#define CMD_DI_FEXT 0x03
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
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
74
int cmd_r_login(CalcHandle *h);
76
int cmd_s_status(CalcHandle *h, uint8_t status);
77
int cmd_r_status(CalcHandle *h, uint8_t *status);
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);
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);
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);
88
int cmd_s_dir_enum_init(CalcHandle *h, const char *name);
89
int cmd_r_dir_enum_init(CalcHandle *h);
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);
94
int cmd_s_dir_enum_done(CalcHandle *h);
95
int cmd_r_dir_enum_done(CalcHandle *h);
97
int cmd_s_put_file(CalcHandle *h, const char *name, uint32_t size);
98
int cmd_r_put_file(CalcHandle *h);
100
int cmd_s_get_file(CalcHandle *h, const char *name);
101
int cmd_r_get_file(CalcHandle *h, uint32_t *size);
103
int cmd_s_file_ok(CalcHandle *h);
104
int cmd_r_file_ok(CalcHandle *h);
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);
109
int cmd_s_os_install(CalcHandle *h, uint32_t size);
110
int cmd_r_os_install(CalcHandle *h);
112
int cmd_s_os_contents(CalcHandle *h, uint32_t size, uint8_t *data);
113
int cmd_r_progress(CalcHandle *h, uint8_t *value);
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);
1
/* Hey EMACS -*- linux-c -*- */
2
/* $Id: cmd84p.h 2074 2006-03-31 08:36:06Z roms $ */
4
/* libticalcs - Ti Calculator library, a part of the TiLP project
5
* Copyright (C) 1999-2005 Romain Li�vin
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.
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.
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
22
// /!\ NOTE: for this file, backwards compatibility will not necessarily be maintained as strongly as it is for ticalcs.h !
28
#define SID_NULL 0x4001
29
#define SID_ECHO 0x4002
31
#define SID_DEV_INFOS 0x4020
32
#define SID_SCREENSHOT 0x4021
33
#define SID_SCREEN_RLE 0x4024
35
#define SID_KEYPRESSES 0x4042
37
#define SID_LOGIN 0x4050
38
#define SID_MESSAGES 0x4051
40
#define SID_FILE_MGMT 0x4060
42
#define SID_OS_INSTALL 0x4080
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
54
#define CMD_STATUS 0xff
56
// Device Information command
57
#define CMD_DI_VERSION 0x01
58
#define CMD_DI_MODEL 0x02
59
#define CMD_DI_FEXT 0x03
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
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
89
TIEXPORT3 int TICALL nsp_cmd_r_login(CalcHandle *h);
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);
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);
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);
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);
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);
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);
109
TIEXPORT3 int TICALL nsp_cmd_s_dir_enum_done(CalcHandle *h);
110
TIEXPORT3 int TICALL nsp_cmd_r_dir_enum_done(CalcHandle *h);
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);
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.
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);
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);
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);
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);
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);
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);
136
TIEXPORT3 int TICALL nsp_cmd_s_file_ok(CalcHandle *h);
137
TIEXPORT3 int TICALL nsp_cmd_r_file_ok(CalcHandle *h);
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);
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);
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);
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);
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.