Skip to main content

Example plugin server

-> -> New release June 30th. See news
  Example plugin server for Ayyi system.
  When run, the app will create a new shm segment to share data, and start an
  associated dbus service to provide functions to modify the shm data.
  This simple example doesnt show how to install a dll for service discovery and
  client usage of our exported shm segment. See the Spectrogram plugin for a more 
  complete real-life example.
#include "ayyi.h"
#define SEG_SIZE 8
AyyiServer* ayyi_server = NULL;
main (int argc, char **argv)
   //initialise Ayyi, and export a single shm segment
   AyyiShmSeg* seg = shm_seg__new(AYYI_SEG_TYPE_PLUGIN, SEG_SIZE);
   GList* segs = g_list_append(NULL, seg);
   ayyi_server = ayyi_server__new(segs);
   //instantiate and start our dbus proxy GObject:
   ExampleDbus* bus = example_dbus_get_instance();
   if (!example_dbus_register_service (bus)) {
      printf("dbus registration failed!\n");
   g_main_loop_run (g_main_loop_new (NULL, 0));
   return EXIT_SUCCESS;

This code is in the ayyi/examples/plugin directory of the AyyiGtk package along with the associated service and data segment definitions.