root/platform/USRP/trunk/USRP/src/main.cpp @ 4522

Revision 4522, 2.0 KB (checked in by jgaeddert, 6 years ago)

setting svn properties on USRP files

  • Property svn:eol-style set to native
Line 
1/****************************************************************************
2
3Copyright 2005,2006 Virginia Polytechnic Institute and State University
4
5This file is part of the OSSIE USRP Device.
6
7OSSIE USRP Device is free software; you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation; either version 2 of the License, or
10(at your option) any later version.
11
12OSSIE USRP Device is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OSSIE USRP Device; if not, write to the Free Software
19Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20
21
22****************************************************************************/
23
24#include <iostream>
25
26#include <sched.h>
27
28#include "ossie/ossieSupport.h"
29#include "ossie/debug.h"
30
31#include "USRP.h"
32
33
34int main(int argc, char* argv[])
35
36{
37
38    if (argc != 4) {
39        std::cerr << argv[0] << " <identifier> <usage name> <software profile>" << std::endl;
40        exit (-1);
41    }
42
43    ossieDebugLevel = 3;
44
45    struct sched_param prio;
46
47    prio.sched_priority = 5;
48
49    int rc = sched_setscheduler(0, SCHED_RR, &prio);
50
51    if (rc < 0)
52        std::cerr << "Failed to set RR scheduler for USRP device." << std::endl;
53
54    ossieSupport::ORB *orb = new ossieSupport::ORB;
55
56    char *id = argv[1];
57    char *label = argv[2];
58    char *profile = argv[3];
59
60
61    USRP_i* usrp_servant;
62    CF::Device_var usrp_var;
63
64    // Create the USRP device servant and object reference
65
66    usrp_servant = new USRP_i(id, label, profile);
67    usrp_var = usrp_servant->_this();
68
69    std::string objName = "DomainName1/";
70    objName += label;
71    orb->bind_object_to_name((CORBA::Object_ptr) usrp_var, objName.c_str());
72
73
74    // Start the orb
75    orb->orb->run();
76
77}
Note: See TracBrowser for help on using the browser.