Back Midas Rome Roody Rootana
  Midas DAQ System  Not logged in ELOG logo
Entry  23 Aug 2005, Konstantin Olchanski, Info, new mvmestd api 
    Reply  01 Sep 2005, Stefan Ritt, Info, new mvmestd api 
       Reply  01 Sep 2005, Stefan Ritt, Suggestion, new mvmestd api 
       Reply  10 Sep 2005, Konstantin Olchanski, Info, new mvmestd api 
          Reply  11 Sep 2005, Stefan Ritt, Info, new mvmestd api 
             Reply  02 Nov 2005, I. K. arapkorir, Info, new mvmestd api 
                Reply  02 Nov 2005, Pierre-Andre Amaudruz, Info, new mvmestd api 
Message ID: 221     Entry time: 01 Sep 2005     In reply to: 220
Author: Stefan Ritt 
Topic: Suggestion 
Subject: new mvmestd api 
Anothe idea which comes to my mind, we could make it kind of object oriented, like

typedef struct {
  int handle;
  int crate;
  int amod;
  int fifo_mode;
  ...
} MVME_INTERFACE;

main()
{
  MVME_INERFACE *vme;

  vme = mvme_init(); // allocated and fills MVME_INTERFACE structure

  mvme_set_crate(vme, crate_no);
  mvme_set_address_mode(vme, A24);
  ...

  mvme_read(vme, vme_address, dest_addr, num_bytes);
  mvme_exit(vme);    // frees memory allocated in mvme_init()
}

------------------------------------------

This way we would only have one structure containing all required parameters, and get/set
functions for it, like the OO textbooks propose it. This would actually make it thread
save. The "vme" pointer from above still has to be passed around to subroutines, but a
single pointer is better than lots of handles.
ELOG V3.1.4-2e1708b5