| Hand-held management layer

### ticalcs_calc_features

CalcFeatures TICALL ticalcs_calc_features(CalcHandle* handle)

Returns the features and operations supported by the hand-held.

handle : | a previously allocated handle
Return value : | a mask of features (CalcFeatures).

### ticalcs_calc_isready

int TICALL ticalcs_calc_isready(CalcHandle* handle)

Check whether calc is ready.

handle : | a previously allocated handle
Return value : | after connecting to the calculator, you usually want to use this command once, before attempting to use any other commands. This is required on some models (protocols). There are exceptions to this general rule, especially when a DUSB calculator (84+ family, 89T) is in the OS receive mode, where the Ready check cannot be performed. Return value: 0 if ready else ERR_NOT_READY.

### ticalcs_calc_send_key

int TICALL ticalcs_calc_send_key(CalcHandle* handle, uint32_t key)

Check whether calc is ready.

handle : | a previously allocated handle
key : | a TI scancode
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_execute

int TICALL ticalcs_calc_execute(CalcHandle* handle, VarEntry* ve, const char* args)

Remotely execute a program or a FLASH application. Restrictions: execution of FLASH applications is supported thru D-USB only.

handle : | a previously allocated handle
ve : | folder and variable name with type
args : | argument to pass to program (in TI-charset, aka native)
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_screen

int TICALL ticalcs_calc_recv_screen(CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap)

Request a screenshot and receive a raw bitmap in the calculator's native format (depending on the model, 1 bit B/W, 4-bit grayscale, 16-bit color).

handle : | a previously allocated handle
sc : | a structure which contains required screen format and returns screen sizes
bitmap : | adress of pointer for allocated bitmap. Must be freed when no longer needed.
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_screen_rgb888

int TICALL ticalcs_calc_recv_screen_rgb888(CalcHandle* handle, CalcScreenCoord* sc, uint8_t** bitmap)

Request a screenshot and receive a RGB888 bitmap (convenience function).

handle : | a previously allocated handle
sc : | a structure which contains required screen format and returns screen sizes
bitmap : | adress of pointer for allocated bitmap. Must be freed when no longer needed.
Return value : | 0 if successful, an error code otherwise.

### ticalcs_free_screen

g_free((void *)bitmap);

Frees a bitmap previously allocated by ticalcs_calc_recv_screen() or ticalcs_calc_recv_screen_rgb888().

bitmap : | a previously allocated bitmap
Return value : |

### ticalcs_calc_get_dirlist

int TICALL ticalcs_calc_get_dirlist(CalcHandle* handle, GNode** vars, GNode **apps)

Request a directory listing.

handle : | a previously allocated handle
vars : | a tree of folder & variables
apps : | a tree of FLASH apps
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_get_memfree

int TICALL ticalcs_calc_get_memfree(CalcHandle* handle, uint32_t* ram, uint32_t *flash)

Request free memory. Do a dirlist to update value.

handle : | a previously allocated handle
ram : | RAM memory available
flash : | Flash memory available
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_backup

int TICALL ticalcs_calc_send_backup(CalcHandle* handle, BackupContent* content)

Send a backup.

handle : | a previously allocated handle
content : | backup content
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_backup

int TICALL ticalcs_calc_recv_backup(CalcHandle* handle, BackupContent* content)

Request a backup and receive it.

handle : | a previously allocated handle
content : | backup content
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_var

int TICALL ticalcs_calc_send_var(CalcHandle* handle, CalcMode mode, FileContent* content)

Send one or more variables (silent mode).

handle : | a previously allocated handle
mode : | to document
content : | file content to send
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_var

int TICALL ticalcs_calc_recv_var(CalcHandle* handle, CalcMode mode, FileContent* content, VarRequest* vr)

Request receiving of _one_ variable (silent mode).

handle : | a previously allocated handle
mode: : | (null)
content : | where to store variable content
var : | a #VarRequest structure got with dirlist
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_var_ns

int TICALL ticalcs_calc_send_var_ns(CalcHandle* handle, CalcMode mode, FileContent* content)

Send one or more variable (non-silent mode).

handle : | a previously allocated handle
mode: : | (null)
content : | file content to send
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_var_ns

int TICALL ticalcs_calc_recv_var_ns(CalcHandle* handle, CalcMode mode, FileContent* content, VarEntry** var)

Receive one or more variable (non-silent mode).

handle : | a previously allocated handle
mode: : | (null)
content : | where to store variables
var : | information on the received variable (if single) or NULL (if group)
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_app

int TICALL ticalcs_calc_send_app(CalcHandle* handle, FlashContent* content)

Send a FLASH app.

handle : | a previously allocated handle
content : | content to send
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_app

int TICALL ticalcs_calc_recv_app(CalcHandle* handle, FlashContent* content, VarRequest* vr)

Request receiving of a FLASH app.

handle : | a previously allocated handle
content : | where to store content
var : | FLASH app to request
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_os

int TICALL ticalcs_calc_send_os(CalcHandle* handle, FlashContent* content)

Send a FLASH os.

handle : | a previously allocated handle
content : | content to send
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_idlist

int TICALL ticalcs_calc_recv_idlist(CalcHandle* handle, uint8_t* idlist)

Request ID-LIST of hand-held.

handle : | a previously allocated handle
idlist : | static buffer (32 chars) where to store ID-LIST
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_dump_rom_1

int TICALL ticalcs_calc_dump_rom_1(CalcHandle* handle)

Send a ROM dumping program to hand-held.

handle : | a previously allocated handle
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_dump_rom_2

int TICALL ticalcs_calc_dump_rom_2(CalcHandle* handle, CalcDumpSize size, const char *filename)

Start dumping (if possible).

handle : | a previously allocated handle
size : | optional size of dump
filename : | where to store the dump
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_set_clock

int TICALL ticalcs_calc_set_clock(CalcHandle* handle, CalcClock* _clock)

Set date & time of hand-held (if AMS >= 2.09).

handle : | a previously allocated handle
clock : | a #CalcClock structure
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_get_clock

int TICALL ticalcs_calc_get_clock(CalcHandle* handle, CalcClock* _clock)

Get date & time of hand-held (if AMS >= 2.09).

handle : | a previously allocated handle
clock : | a #CalcClock structure
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_del_var

int TICALL ticalcs_calc_del_var(CalcHandle* handle, VarRequest* vr)

Request deleting of a variable (if possible).

handle : | a previously allocated handle
var : | var to delete
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_new_fld

int TICALL ticalcs_calc_new_fld(CalcHandle* handle, VarRequest* vr)

Request creation of a folder. Beware: %vr.name may be modified !

handle : | a previously allocated handle
vr : | name of folder to create (vr->folder)
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_get_version

int TICALL ticalcs_calc_get_version(CalcHandle* handle, CalcInfos* infos)

Request version info.

handle : | a previously allocated handle
infos : | where to store version information
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_cert

int TICALL ticalcs_calc_send_cert(CalcHandle* handle, FlashContent* content)

Send a certificate.

handle : | a previously allocated handle
content : | content to send
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_cert

int TICALL ticalcs_calc_recv_cert(CalcHandle* handle, FlashContent* content)

Request receiving of a certificate.

handle : | a previously allocated handle
content : | where to store content
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_rename_var

int TICALL ticalcs_calc_rename_var(CalcHandle* handle, VarRequest* oldname, VarRequest *newname)

Remotely rename a variable, and/or move it to a different folder.

handle : | a previously allocated handle
oldname : | existing name and folder
newname : | new name and folder
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_change_attr

int TICALL ticalcs_calc_change_attr(CalcHandle* handle, VarRequest* vr, FileAttr attr)

Remotely change a variable's archive/lock state.

handle : | a previously allocated handle
vr : | variable to modify
attr : | new attributes for variable
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_all_vars_backup

int TICALL ticalcs_calc_send_all_vars_backup(CalcHandle* handle, FileContent* content)

Send a fake backup, for the models which support it.

handle : | a previously allocated handle
content : | backup content
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_all_vars_backup

int TICALL ticalcs_calc_recv_all_vars_backup(CalcHandle* handle, FileContent* content)

Request a fake backup (list of vars and apps) and receive it.

handle : | a previously allocated handle
content : | backup content
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_backup2

int TICALL ticalcs_calc_send_backup2(CalcHandle* handle, const char* filename)

Send a backup from file.

handle : | a previously allocated handle
filename : | name of file which contains backup to send
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_backup2

int TICALL ticalcs_calc_recv_backup2(CalcHandle* handle, const char *filename)

Request a backup and receive it to file.

handle : | a previously allocated handle
filename : | name of file where to store backup
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_var2

int TICALL ticalcs_calc_send_var2(CalcHandle* handle, CalcMode mode, const char* filename)

Send one or more variables (silent mode) from file.

handle : | a previously allocated handle
mode : | to document
filename : | name of file
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_var2

int TICALL ticalcs_calc_recv_var2(CalcHandle* handle, CalcMode mode, const char* filename, VarRequest* vr)

Request receiving of _one_ variable (silent mode).

handle : | a previously allocated handle
mode: : | (null)
content : | where to store variable content
var : | a #VarRequest structure got with dirlist
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_var_ns2

int TICALL ticalcs_calc_send_var_ns2(CalcHandle* handle, CalcMode mode, const char* filename)

Send one or more variable (non-silent mode).

handle : | a previously allocated handle
mode: : | (null)
filename : | name of file
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_var_ns2

int TICALL ticalcs_calc_recv_var_ns2(CalcHandle* handle, CalcMode mode, const char* filename, VarEntry** vr)

Receive one or more variable (non-silent mode).

handle : | a previously allocated handle
mode: : | (null)
filename : | where to store variables
var : | information on the received variable (if single) or NULL (if group)
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_app2

int TICALL ticalcs_calc_send_app2(CalcHandle* handle, const char* filename)

Send a FLASH app or os.

handle : | a previously allocated handle
filename : | name of file
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_app2

int TICALL ticalcs_calc_recv_app2(CalcHandle* handle, const char* filename, VarRequest* vr)

Request receiving of a FLASH app.

handle : | a previously allocated handle
content : | where to store content
var : | FLASH app to request
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_cert2

int TICALL ticalcs_calc_send_cert2(CalcHandle* handle, const char* filename)

Send a certificate.

handle : | a previously allocated handle
filename : | name of file
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_os2

int TICALL ticalcs_calc_send_os2(CalcHandle* handle, const char* filename)

Send a FLASH app.

handle : | a previously allocated handle
filename : | name of file
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_cert2

int TICALL ticalcs_calc_recv_cert2(CalcHandle* handle, const char* filename)

Request certificate. Depending on extension, saves it as *.9Xq or *.cer.

handle : | a previously allocated handle
filename : | name of file
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_send_tigroup2

int TICALL ticalcs_calc_send_tigroup2(CalcHandle* handle, const char* filename, TigMode mode)

Send a TiGroup file.

handle : | a previously allocated handle
filename : | name of file
mode : | which vars/apps to send
Return value : | 0 if successful, an error code otherwise.

### ticalcs_calc_recv_tigroup2

int TICALL ticalcs_calc_recv_tigroup2(CalcHandle* handle, const char* filename, TigMode mode)

Receive a TiGroup file.

handle : | a previously allocated handle
filename : | name of file
mode : | which vars/apps to receive
Return value : | 0 if successful, an error code otherwise.

### Return to the main index