Skip to content
This repository was archived by the owner on Apr 29, 2021. It is now read-only.

API: ApiService send_command

Grimmer edited this page Jan 26, 2018 · 1 revision

Usually you will use ApiService.instance().send_command to send commands.

Its function definition:

    def send_command(self, cmd, parameter, built_callback= None, user_callback=""):

So we use this to make some commond functions. like def request_file_list(self, user_callback = None)

End User calls request_file_list

    request_file_list calles ApiService.instance().send_command

user_callback is for end user. there are 3 cases.

  1. Async-1: No specified user_callback parameter, then use default user_callback="" internal.
  2. Async-2: Sepcify user_callback=some_fun, so the user can pass his own callback function to handle the result.
  3. Sync (blocking): specify user_callback= None and pass it in send_command, so it will block user's (caller) thread and wait for the result as the return value.

Clone this wiki locally