Client interface

The mm-sync service provides a client interface that allows your applications to access the service, start and monitor synchronizations, and set debugging levels.

Before you can synchronize any content, you must connect to mm-sync by calling mm_sync_connect(). This function returns a connection handle that must be used in subsequent API calls to refer to the same connection. For example, you can start synchronizations by calling mm_sync_start(), passing in that connection handle along with the mountpoint of the device and the path containing the content that you want to synchronize. In this same function, you can provide flags that request specific synchronization passes and other options such as recursive synchronization.

After an operation has started, you can suspend it with mm_sync_suspend() or cancel it with mm_sync_cancel(). To resume a suspended operation, call mm_sync_resume(). To monitor progress, you can get the status of one or all synchronizations using the mm_sync_status_get*() functions.

When you're finished synchronizing media content, you can disconnect from mm-sync by calling mm_sync_disconnect().

There's also a function for setting the debugging and verbosity levels (mm_sync_debug_set()) so you can see useful troubleshooting information in the stderr file stream and slog2info logging utility.