#include <DaggyCore/Core.h>
\"exec\": \"ping 127.0.0.1\",\
\"exec\": \"ping 127.0.0.1\",\
void sleep_ms(int milliseconds)
#elif _POSIX_C_SOURCE >= 199309L
ts.tv_sec = milliseconds / 1000;
ts.tv_nsec = (milliseconds % 1000) * 1000000;
usleep(milliseconds * 1000);
int quit_after_time(void* msec)
void on_daggy_state_changed(DaggyCore core, DaggyStates state);
void on_provider_state_changed(DaggyCore core, const char* provider_id, DaggyProviderStates state);
void on_provider_error(DaggyCore core, const char* provider_id, DaggyError error);
void on_command_state_changed(DaggyCore core, const char* provider_id, const char* command_id, DaggyCommandStates state, int exit_code);
void on_command_stream(DaggyCore core, const char* provider_id, const char* command_id, DaggyStream stream);
void on_command_error(DaggyCore core, const char* provider_id, const char* command_id, DaggyError error);
int main(int argc, char** argv)
libdaggy_app_create(argc, argv);
libdaggy_core_create(json_data, Json, &core);
libdaggy_connect_aggregator(core,
on_provider_state_changed,
on_command_state_changed,
libdaggy_core_start(core);
libdaggy_run_in_thread(quit_after_time, &time);
return libdaggy_app_exec();
void on_daggy_state_changed(DaggyCore core, DaggyStates state)
printf("Daggy state changed: %d\n", state);
void on_provider_state_changed(DaggyCore core, const char* provider_id, DaggyProviderStates state)
printf("Provider %s state changed: %d\n", provider_id, state);
void on_provider_error(DaggyCore core, const char* provider_id, DaggyError error)
printf("Provider %s error. Code: %d, Category: %s\n", provider_id, error.error, error.category);
void on_command_state_changed(DaggyCore core, const char* provider_id, const char* command_id, DaggyCommandStates state, int exit_code)
printf("Command %s in provider %s state changed: %d\n", command_id, provider_id, state);
void on_command_stream(DaggyCore core, const char* provider_id, const char* command_id, DaggyStream stream)
printf("Command %s in provider %s has stream from session %s: %li\n", command_id, provider_id, stream.session, stream.seq_num);
void on_command_error(DaggyCore core, const char* provider_id, const char* command_id, DaggyError error)
printf("Command %s in provider %s has error. Code: %d, Category: %s\n", command_id, provider_id, error.error, error.category);