Revision: 4470
          http://playerstage.svn.sourceforge.net/playerstage/?rev=4470&view=rev
Author:   thjc
Date:     2008-04-02 21:02:15 -0700 (Wed, 02 Apr 2008)

Log Message:
-----------
added new for of AddInterface that fetches details from teh config file

Modified Paths:
--------------
    code/player/trunk/libplayercore/driver.cc
    code/player/trunk/libplayercore/driver.h

Modified: code/player/trunk/libplayercore/driver.cc
===================================================================
--- code/player/trunk/libplayercore/driver.cc   2008-04-02 12:07:33 UTC (rev 
4469)
+++ code/player/trunk/libplayercore/driver.cc   2008-04-03 04:02:15 UTC (rev 
4470)
@@ -132,6 +132,22 @@
   return 0;
 }
 
+int
+Driver::AddInterface(player_devaddr_t *addr, ConfigFile * cf, int section, int 
code, char * key)
+{
+  assert(addr);
+  // Create position interface
+  if (cf->ReadDeviceAddr(addr, section,"provides", code, -1, key) != 0)
+  {
+    if (key)
+      PLAYER_ERROR2("Could not load interface address. 
%s:*:*:%s:*",key,interf_to_str(code));
+    else
+      PLAYER_ERROR1("Could not load interface address. 
%s:*",interf_to_str(code));
+    return -1;
+  }
+  return this->AddInterface(*addr);
+}
+
 void
 Driver::Publish(QueuePointer &queue,
                 player_msghdr_t* hdr,

Modified: code/player/trunk/libplayercore/driver.h
===================================================================
--- code/player/trunk/libplayercore/driver.h    2008-04-02 12:07:33 UTC (rev 
4469)
+++ code/player/trunk/libplayercore/driver.h    2008-04-03 04:02:15 UTC (rev 
4470)
@@ -137,6 +137,16 @@
     @returns 0 on success, non-zero otherwise. */
     int AddInterface(player_devaddr_t addr);
 
+    /** @brief Add an interface.
+
+    This form loads the address details from the config file and then adds the 
interface.
+
+    @param addr Pointer to Player device address, this is filled in with the 
address details.
+
+    @returns 0 on success, non-zero otherwise. */
+    int AddInterface(player_devaddr_t *addr, ConfigFile * cf, int section, int 
code, char * key = NULL);
+
+    
     /** @brief Set/reset error code */
     void SetError(int code) {this->error = code;}
 


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to