Ignore:
Timestamp:
Nov 30, 2012 8:57:18 AM (11 years ago)
Author:
riza
Message:

Re #1098: Modify input method for console, from character based to line based

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/branches/projects/cli/pjsip-apps/src/samples/clidemo.c

    r4302 r4303  
    190190    tcfg.port = 0; 
    191191#endif 
     192    tcfg.port = 2233; 
     193    tcfg.prompt_str = pj_str("CoolWater% "); 
    192194    status = pj_cli_telnet_create(cli, &tcfg, NULL); 
    193195    if (status != PJ_SUCCESS) 
     
    221223    pj_status_t status; 
    222224    pj_cli_sess *sess; 
    223  
     225    pj_cli_console_cfg console_cfg; 
     226 
     227    pj_cli_console_cfg_default(&console_cfg); 
     228    console_cfg.prompt_str = pj_str("HotWater> "); 
     229     
    224230    /* 
    225231     * Create the console front end 
    226232     */ 
    227     status = pj_cli_console_create(cli, NULL, &sess, NULL); 
     233    status = pj_cli_console_create(cli, &console_cfg, &sess, NULL); 
    228234    if (status != PJ_SUCCESS) 
    229235        return status; 
     
    235241     */ 
    236242    for (;;) { 
     243        char cmdline[PJ_CLI_MAX_CMDBUF]; 
    237244        pj_status_t status; 
    238245 
    239         status = pj_cli_console_process(sess); 
     246        status = pj_cli_console_process(sess, &cmdline[0], sizeof(cmdline)); 
    240247        if (status != PJ_SUCCESS) 
    241248            break; 
Note: See TracChangeset for help on using the changeset viewer.