wish_app/wish_app.c
void wish_app_on_ready(wish_app_t *app) {
    WISHDEBUG(LOG_DEBUG, "Ready signal to app");
    size_t buf_len = 100;
    uint8_t buf[buf_len];
    memset(buf, 0, buf_len);
    
    bson bs;
    bson_init_buffer(&bs, buf, buf_len);
    bson_append_bool(&bs, "ready", true);
    bson_finish(&bs);
    
    send_app_to_core(app->wsid, bson_data(&bs), bson_size(&bs));
    if (app->ready != NULL) {
        app->ready_state = true;
        app->ready(app, true);
    }
    
    /* fetch local core's host id */
    bson host_config_bs;
    bson_init_buffer(&host_config_bs, buf, buf_len);
    bson_append_string(&host_config_bs, "op", "host.config");
    bson_append_start_array(&host_config_bs, "args");
    bson_append_finish_array(&host_config_bs);
    bson_append_int(&host_config_bs, "id", 0);
    bson_finish(&host_config_bs);

    wish_app_request(app, &host_config_bs, host_config_cb, app);
}
/** Callback invoked when service is connected to core */
Callback invoked when service is connected to core
Callback invoked when service is connected to core
void wish_app_on_ready(wish_app_t *app) {
    WISHDEBUG(LOG_DEBUG, "Ready signal to app");
    size_t buf_len = 100;
    uint8_t buf[buf_len];
    memset(buf, 0, buf_len);
    bson bs;
    bson_init_buffer(&bs, buf, buf_len);
    bson_append_bool(&bs, "ready", true);
    bson_finish(&bs);
    send_app_to_core(app->wsid, bson_data(&bs), bson_size(&bs));
    if (app->ready != NULL) {
        app->ready_state = true;
        app->ready(app, true);
    }
    bson host_config_bs;
    bson_init_buffer(&host_config_bs, buf, buf_len);
    bson_append_string(&host_config_bs, "op", "host.config");
    bson_append_start_array(&host_config_bs, "args");
    bson_append_finish_array(&host_config_bs);
    bson_append_int(&host_config_bs, "id", 0);
    bson_finish(&host_config_bs);
    wish_app_request(app, &host_config_bs, host_config_cb, app);
}
void wish_app_on_ready ( wish_app_t * app ) { WISHDEBUG ( LOG_DEBUG , " " ) ; size_t buf_len = 100 ; uint8_t buf [ buf_len ] ; memset ( buf , 0 , buf_len ) ; bson bs ; bson_init_buffer ( & bs , buf , buf_len ) ; bson_append_bool ( & bs , " " , true ) ; bson_finish ( & bs ) ; send_app_to_core ( app -> wsid , bson_data ( & bs ) , bson_size ( & bs ) ) ; if ( app -> ready != NULL ) { app -> ready_state = true ; app -> ready ( app , true ) ; } bson host_config_bs ; bson_init_buffer ( & host_config_bs , buf , buf_len ) ; bson_append_string ( & host_config_bs , " " , " " ) ; bson_append_start_array ( & host_config_bs , " " ) ; bson_append_finish_array ( & host_config_bs ) ; bson_append_int ( & host_config_bs , " " , 0 ) ; bson_finish ( & host_config_bs ) ; wish_app_request ( app , & host_config_bs , host_config_cb , app ) ; }
Callback invoked when service is connected to core
Callback invoked when service is connected to core
/* fetch local core's host id */