1    /* --COPYRIGHT--,EPL
     2     *  Copyright (c) 2016-2020 Texas Instruments Incorporated - http://www.ti.com
     3     * All rights reserved.
     4     *
     5     * Redistribution and use in source and binary forms, with or without
     6     * modification, are permitted provided that the following conditions are met:
     7     *
     8     * *  Redistributions of source code must retain the above copyright
     9     *    notice, this list of conditions and the following disclaimer.
    10     *
    11     * *  Redistributions in binary form must reproduce the above copyright
    12     *    notice, this list of conditions and the following disclaimer in the
    13     *    documentation and/or other materials provided with the distribution.
    14     *
    15     * *  Neither the name of Texas Instruments Incorporated nor the names of
    16     *    its contributors may be used to endorse or promote products derived
    17     *    from this software without specific prior written permission.
    18     *
    19     * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    20     * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
    21     * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    22     * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
    23     * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
    24     * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    25     * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
    26     * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
    27     * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
    28     * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
    29     * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    30     *
    31     * --/COPYRIGHT--*/
    32    
    33    /*!
    34     *  ======== Main.xdc ========
    35     *  The xdc.rov.testserver displays ROV views to clients on the command line.
    36     *  The server expects that a CCS debugger is already started and an application
    37     *  is loaded.
    38     *
    39     *  The DSlite port must be known at the time the server is started. Therefore,
    40     *  when starting CCS, the environment variable TI_DS_WEBSOCKET_PORT must be set
    41     *  and that same port number must be supplied to xdc.rov.testserver.
    42     *
    43     *  Commands:
    44     *
    45     *  Start the server -
    46     *      xs xdc.rov.testserver --exec <full path> --port <port_number>
    47     *
    48     *  Get a list of Modules and Tabs
    49     *      l
    50     *
    51     *  Get a Module's View
    52     *      v Module View
    53     *
    54     *  Issue the command "Run" to the debugger
    55     *      r
    56     *
    57     *  Issue the command "Pause" to the debugger
    58     *      p
    59     *
    60     *  Evaluate an XDCScript or a JavaScript expression
    61     *      > expression
    62     *
    63     *  Exit xdc.rov.testserver
    64     *      e
    65     *
    66     */
    67    metaonly module Main inherits xdc.tools.ICmd {
    68    
    69        override config String usage[] = [
    70            ' ',
    71            'Usage',
    72            '[--exec <executable>]',
    73            '[--port <DSLite Websocket port>]',
    74            '[-v <debug level>]',
    75            '[--help]',
    76            ' ',
    77        ];
    78    
    79    instance:
    80    
    81        /*!
    82         *  ======== exec ========
    83         *
    84         *  Executable to run ROV on
    85         *
    86         */
    87        @CommandOption('exec')
    88        config String executable = "";
    89    
    90        /*!
    91         *  ======== port ========
    92         *
    93         *  DSLite port
    94         *
    95         *  Corresponds to the value in the environment variable
    96         *  TI_DS_WEBSOCKET_PORT. The variable must be set at the time CCS is
    97         *  started.
    98         */
    99        @CommandOption('port')
   100        config UInt port;
   101    
   102        /*!
   103         *  ======== verbose ========
   104         *
   105         *  Defines the amount of debug info
   106         *
   107         */
   108        @CommandOption('v')
   109        config UInt verbose = 0;
   110    }