CETerm: How can I get my VT host application to sound a tone on my terminal?

Version 2

    Verified Product Versions

    Wavelink Naurtech CETerm 5.7

    Environment:

    CETerm 5.7

     

    How can I get my VT host application to sound a tone on my terminal?

    For VT emulation you can have the host application send a string of bytes to the handheld to sound a tone. Here is the syntax for the VT Tone command:

     

    APC #TWFilename ST

     

    where:

     

    APC character starts the command and is hex 0x9F or the two characters ESC _

    #T are literal characters to specify the tone command

    WFilename is a 9 character wav filename without the ".wav" type

    ST character ends the command and is hex 0x9C or the two characters ESC ->ESC is the character with hex value 0x1B

     

    You should probably use the "two character" sequences for the start and stop. The "WFilename" must be padded with spaces if the file name is not 9 characters long.

     

    Try sending these characters to play the system "default" sound

     

    ESC_#T defaultESC\

     

    Where the only spaces should be the two before "default" and the ESC should be a single byte with the value 0x1B. You can play any .wav file in the \Windows directory.

     

    Your host application must be ready for a command status reply which can usually be discarded. The reply will be in the form \\X<CR> where X will be 0 for success and non-zero if the command failed. Here's a sample:

    char apc_7[] = { 0x1B, '_', 0 }; 
    char st_7[] = { 0x1B, '\\', 0 };  
    fputs( apc_7, stdout ); 
    fputs( "#T   exclam", stdout );  // Exclamation sound 
    fputs( st_7, stdout );  
    // Read result 
    rspstr = get_reply(); 

     

    Some tips:

    1. Note that none of these writes sends any carriage returns or line feeds.
    2. The file \windows\exclam.wav must exist on the device.
    3. The reply is read by "get_reply" to consume the returned status.

     

    You can also sound a tone using the following syntax

     

    #TxxxYYYzzz

     

    where

     

    xxx is the volume between 0 and 10. Always three digits. Pad with leading zeros if necessary. Volume ranges from 0 (silent) to 10 (loudest).

    YYY is the frequency between 0 and 3000 Hz(in 100 Hz multiples). It should be a value between 0 and 30. Always three digits. Pad with leading zeros if necessary.

    zzz is the length of time for which the tone is played. Its value should be between 0 and 10 which corresponds to a range between 0.5 and 5 seconds in 0.5 second increments. Always three digits. Pad with leading zeros if necessary.

     

    For example, #T007020005 generates a tone at volume level 7, 2000 Hz, for 2.5 seconds.