GCLIB_DLL_EXPORTED GReturn GCALL GSetupDownloadFile | ( | GCon | g, |
GCStringIn | file_path, | ||
GOption | options, | ||
GCStringOut | info, | ||
GSize | info_len | ||
) |
Download a saved controller configuration from a file.
g | Connection's handle. |
file_path | Null-terminated string containing the path to the gcb file. |
options | Bit mask to determine what configuration data to download. See below for all options. |
info | Optional pointer to a buffer to store the controller info. If no info is needed, specify as NULL. |
info_len | Length of optional info buffer. If no info is needed, specify as NULL. |
If both info and info_len are not NULL, the controller information will be provided regardless of the options parameter.
The options parameter is a bit mask. If options is set to 0, GSetupDownloadFile() will return a bit mask indicating which sectors in the specified GCB are not empty. The following contains a list of all currently available options:
Bit | Value | Function | Description |
---|---|---|---|
1 | 0x0002 | Restore parameters | KPA, KIA, KDA, etc... |
3 | 0x0008 | Restore variables | Variables are listed by the LV command |
4 | 0x0010 | Restore arrays | Arrays are listed by the LA command |
5 | 0x0020 | Restore program | The program is listed by the LS command |
31 | 0x8000 | Ignore errors | Ignore invalid parameter errors and continue restoring data. GSetupDownloadFile() will still stop immediately if a connection issue or other fatal error is encountered |
Usage example:
Definition at line 476 of file arrays.c.
References G_BAD_FILE, G_NO_ERROR, GProgramDownload(), H_ArrayDownloadFromMemory(), H_DownloadData(), H_FindSector(), and vector().