int cursorIndex = 0;                                                            // index to handle cursor display while transmitting in broadcast mode

        /// <summary>
        /// Setup ANT-FS client to process messages from connected device
        /// </summary>
        public void Start(ANT_Device antDevice)
        {
            PrintMenu();
            try
            {
                // Create the ANT-FS client and attach it to a channel (in this case, 0)
                channel0    = antDevice.getChannel(0);
                antfsClient = new ANTFS_ClientChannel(channel0);

                // Setup callback to handle ANT-FS response events
                antfsClient.OnResponse += new Action <ANTFS_ClientChannel.Response>(HandleClientResponses);

                // Configure the client, and begin beaconing
                ConfigureClient(antDevice);

                while (!demoDone)
                {
                    string command = Console.ReadLine();
                    HandleUserInput(command);
                    Thread.Sleep(0);
                }
            }
            catch (ANTFS_Exception antEx)  // Handle exceptions thrown by ANT Managed library
            {
                Console.WriteLine("ANT-FS Exception: " + antEx.Message);
            }
            catch (Exception ex)  // Handle other exceptions
            {
                Console.WriteLine("Demo failed: " + ex.Message);
                Console.ReadLine();
            }
            finally
            {
                Console.WriteLine("Disconnecting module...");
                antDevice.Dispose();    // Close down the device completely and completely shut down all communication
                antfsClient.Dispose();  // Release all native resources used by the client
                Console.WriteLine("Demo has completed successfully!");
            }
        }
        /// <summary>
        /// Process user input and execute requested commands
        /// </summary>
        /// <param name="command">User command</param>
        public void HandleUserInput(string command)
        {
            try
            {
                switch (command)
                {
                case "M":
                case "m":
                    PrintMenu();
                    break;

                case "V":
                case "v":
                    Console.WriteLine("ANT-FS Library Version " + ANTFS_ClientChannel.GetLibraryVersion());
                    break;

                case "S":
                case "s":
                    Console.WriteLine("Status: " + Print.AsString(antfsClient.GetStatus()));
                    break;

                case "Q":
                case "q":
                    demoDone = true;
                    break;

                default:
                    break;
                }
            }
            catch (ANTFS_RequestFailed_Exception antEx)
            {
                // Inform the user that the operation requested failed, and resume operation
                Console.WriteLine(antEx.Message);
            }
        }