Changes between Version 25 and Version 26 of GuiRpc
- Timestamp:
- Jun 29, 2010, 1:59:19 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GuiRpc
v25 v26 27 27 == Dealing with versions == 28 28 29 The GUI RPC protocol changes over time. If you're writing a GUI program that needs to communicate with older versions of the BOINC core client, here's what to do: 30 31 * Create a `GUI_RPC` object and connect. Call [#function-exchange_versions exchange_versions()] to get the client version. 32 * If [#function-exchange_versions exchange_versions()] fails (it's not supported in pre-5.6 clients) do a [#function-get_state get_state()] RPC, and get the client version from `CC_STATE::version_info`. 33 * Use the client version number to decide what subsequent RPCs to make (version info is included in the RPC list below). 29 The GUI RPC protocol changes over time. 30 If you're writing a GUI program that needs to communicate with older versions of the BOINC core client, 31 here's what to do: 32 33 * Create a `GUI_RPC` object and connect. 34 Call [#function-exchange_versions exchange_versions()] to get the client version. 35 * If [#function-exchange_versions exchange_versions()] fails (it's not supported in pre-5.6 clients) 36 do a [#function-get_state get_state()] RPC, and get the client version from `CC_STATE::version_info`. 37 * Use the client version number to decide what subsequent RPCs to make 38 (version info is included in the RPC list below). 34 39 35 40 {{{ … … 62 67 === `get_state(CC_STATE&)` === #function-get_state 63 68 64 Get the core client's 'static' state, i.e. its projects, apps, app_versions, workunits and results. This call is relatively slow and should only be done initially, and when needed later (see below). 69 Get the core client's 'static' state, i.e. its projects, apps, app_versions, workunits and results. 70 This call is relatively slow and should only be done initially, and when needed later (see below). 65 71 66 72 === `exchange_versions(VERSION_INFO&)` === #function-exchange_versions 67 73 68 Exchange version info with the core client. The core client's version info is returned. 74 Exchange version info with the core client. 75 The core client's version info is returned. 69 76 70 77 === `get_cc_status(CC_STATUS&)` === #function-get_cc_status … … 103 110 === `set_screensaver_mode``(bool enabled, ``double blank_time, ``DISPLAY_INFO&)` === #function-set_screensaver_mode 104 111 105 If `enabled` is `true`, the core client should try to get an application to provide screensaver graphics. Blank screen after `blank_time` seconds. 112 If `enabled` is `true`, the core client should try to get an application to provide screensaver graphics. 113 Blank screen after `blank_time` seconds. 106 114 107 115 === `get_file_transfers(FILE_TRANSFERS&)` === #function-get_file_transfers 108 116 109 Get a list of file transfers in progress. Each is linked by name to a project; use `CC_STATE::lookup_project()` to find this project in the current state; if it's not there, call [#function-get_state get_state()] again. 117 Get a list of file transfers in progress. 118 Each is linked by name to a project; use `CC_STATE::lookup_project()` 119 to find this project in the current state; 120 if it's not there, call [#function-get_state get_state()] again. 110 121 111 122 === `get_simple_gui_info(SIMPLE_GUI_INFO&)` === #function-get_simple_gui_info … … 127 138 === `get_activity_state(ACTIVITY_STATE&)` === #function-get_activity_state 128 139 129 Return bitmap of reasons why computation and network are suspended. '''Deprecated''' - for 5.5.13 and later, use [#function-cc_status cc_status()] instead. In 5.5.10 and earlier, it returns a `bool` (suspended) rather than bitmap. 140 Return bitmap of reasons why computation and network are suspended. 141 '''Deprecated''' - for 5.5.13 and later, use [#function-cc_status cc_status()] instead. 142 In 5.5.10 and earlier, it returns a `bool` (suspended) rather than bitmap. 130 143 131 144 === `get_messages(int seqno, MESSAGES&)` === #function-get_messages 132 145 133 Returns a list of messages to be displayed to the user. Each message has a sequence number (1, 2, ...), a priority (1=informational, 2=error) and a timestamp. The RPC requests the messages with sequence numbers greater than `seqno`, in order of increasing sequence number. 146 Returns a list of messages to be displayed to the user. 147 Each message has a sequence number (1, 2, ...), a priority (1=informational, 2=error) and a timestamp. 148 The RPC requests the messages with sequence numbers greater than `seqno`, 149 in order of increasing sequence number. 134 150 135 151 === `get_message_count(int& seqno)` === #function-get_message_seqno 136 152 137 Return the greatest message sequence number. Implemented in 6.10+ client version. 153 Return the greatest message sequence number. 154 Implemented in 6.10+ client version. 138 155 139 156 === `get_host_info(HOST_INFO&)` === #function-get_host_info … … 147 164 === `network_status(int&)` === #function-network_status 148 165 149 Find whether the core client has, needs, or is done with a physical network connection. Deprecated - for 5.5.13 and later, use [#function-cc_status cc_status()] instead. 166 Find whether the core client has, needs, or is done with a physical network connection. 167 Deprecated - for 5.5.13 and later, use [#function-cc_status cc_status()] instead. 150 168 151 169 === `get_newer_versions(std::string&)` === #function-get_newer_versions … … 163 181 === `project_op(PROJECT&, char* op)` === #function-project_op 164 182 165 Perform a control operation on the given project (only the `master_url` field needs to be set). `op` is one of "suspend", "resume", "reset", "detach", "update", "allowmorework", "nomorework". Since 5.10.14: "detach_when_done", "dont_detach_when_done". 183 Perform a control operation on the given project (only the `master_url` field needs to be set). 184 `op` is one of "suspend", "resume", "reset", "detach", "update", "allowmorework", "nomorework". 185 Since 5.10.14: "detach_when_done", "dont_detach_when_done". 166 186 167 187 === `project_attach(``char* url, ``char* account_key, ``char* project_name)` === #function-project_attach … … 171 191 === `set_run_mode(int mode, double duration)` === #function-set_run_mode 172 192 173 Set the run mode (never/auto/always). If duration is zero, mode is permanent. Otherwise revert to last permanent mode after duration seconds elapse. 193 Set the run mode (never/auto/always). 194 If duration is zero, mode is permanent. 195 Otherwise revert to last permanent mode after duration seconds elapse. 174 196 175 197 === `set_network_mode(int mode, double duration)` === #function-set_network_mode … … 187 209 === `network_available()` === #function-network_available 188 210 189 Tells the core client that a network connection is available, and that it should do as much network activity as it can. 211 Tells the core client that a network connection is available, 212 and that it should do as much network activity as it can. 190 213 191 214 === `file_transfer_op(FILE_TRANSFER&, const char* op)` === #function-file_transfer_op … … 203 226 === `acct_mgr_rpc(``const char* url, ``const char* name, ``const char* passwd, ``bool use_config_file)` === #function-acct_mgr_rpc 204 227 205 Do an Account Manager RPC to the given URL, passing the given name/password. If `use_config_file` is true, then the existing URL, username, and password are used and the core client updates the project information from the account manager. If the RPC is successful, save the account info on disk (it can be retrieved later using [#function-acct_mgr_info acct_mgr_info()]). If `url` is the empty string, remove account manager info from disk. 228 Do an Account Manager RPC to the given URL, passing the given name/password. 229 If `use_config_file` is true, then the existing URL, username, and password are used 230 and the core client updates the project information from the account manager. 231 If the RPC is successful, 232 save the account info on disk (it can be retrieved later using [#function-acct_mgr_info acct_mgr_info()]). 233 If `url` is the empty string, remove account manager info from disk. 206 234 207 235 === `acct_mgr_info(ACCT_MGR_INFO&)` === #function-acct_mgr_info … … 211 239 === `read_global_prefs_override()` === #function-read_global_prefs_override 212 240 213 Tells the core client to reread the [PrefsOverride global_prefs_override.xml] file, modifying the global preferences according to its contents. 241 Tells the core client to reread the [PrefsOverride global_prefs_override.xml] file, 242 modifying the global preferences according to its contents. 214 243 215 244 === `get_global_prefs_override(std::string&)` === #function-get_global_prefs_override 216 245 217 Reads the contents of the global [PrefsOverride preferences override] file into the given string. Return an error code if the file is not present. 246 Reads the contents of the global [PrefsOverride preferences override] file into the given string. 247 Return an error code if the file is not present. 218 248 219 249 === `set_global_prefs_override(std::string&)` === #function-set_global_prefs_override 220 250 221 Write the given contents to the global preferences override file. If the argument is an empty string, delete the file. Otherwise the argument must be a valid `<global_preferences>` element. 251 Write the given contents to the global preferences override file. 252 If the argument is an empty string, delete the file. 253 Otherwise the argument must be a valid `<global_preferences>` element. 222 254 223 255 === `get_global_prefs_override_struct(GLOBAL_PREFS&)` === #function-get_global_prefs_override_struct 224 256 225 Return the contents of the global preferences override file, parsed into a structure. Default values are zero. Returns an error code if the file is not present. 257 Return the contents of the global preferences override file, parsed into a structure. 258 Default values are zero. 259 Returns an error code if the file is not present. 226 260 227 261 === `set_global_prefs_override_struct(GLOBAL_PREFS&)` === #function-set_global_prefs_override_struct … … 249 283 === `set_debts(std::vector<PROJECT>)` === #function-set_debts 250 284 251 Set the short- and long-term debts of the given projects (only the `master_url`, `short_term_debt`, `long_term_debt`, `cuda_debt` and `ati_debt` fields are used in the `PROJECT` structs). [[T(VersionNew|5.10.11)]] 285 Set the short- and long-term debts of the given projects 286 (only the `master_url`, `short_term_debt`, `long_term_debt`, `cuda_debt` and `ati_debt` 287 fields are used in the `PROJECT` structs). 288 [[T(VersionNew|5.10.11)]] 289