Ignore:
Timestamp:
Nov 28, 2012 3:02:01 AM (12 years ago)
Author:
riza
Message:

Re #1098: Modify help screen, change backspace input character, fix static and dynamic choice type argument handling

File:
1 edited

Legend:

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

    r4299 r4302  
    9090} 
    9191 
     92static void get_codec_list(pj_cli_dyn_choice_param *param) 
     93{ 
     94    if (param->arg_id == 3) { 
     95        param->cnt = 2; 
     96        pj_strdup2(param->pool, &param->choice[0].value, "iLbc"); 
     97        pj_strdup2(param->pool, &param->choice[0].desc, "iLbc Codec"); 
     98        pj_strdup2(param->pool, &param->choice[1].value, "g729"); 
     99        pj_strdup2(param->pool, &param->choice[1].desc, "g729 Codec"); 
     100    } 
     101} 
     102 
    92103static struct cmd_xml_t cmd_xmls[] = { 
    93104    {"<CMD name='sayhello' id='1' sc='  ,h , ,, sh  ,' desc='Will say hello'>" 
     
    117128     "</CMD>", 
    118129     NULL}, 
     130    {"<CMD name='disable_codec' id='8' desc='Disable codec'>" 
     131     "  <ARG name='codec_list' type='choice' id='3' desc='Codec list'>" 
     132     "      <CHOICE value='g711' desc='G711 Codec'/>" 
     133     "      <CHOICE value='g722' desc='G722 Codec'/>" 
     134     "  </ARG>" 
     135     "</CMD>", 
     136     NULL}, 
    119137    {"<CMD name='quit_app' id='999' sc='qa' desc='Quit the application'>" 
    120138     "</CMD>", 
     
    159177        xml = pj_str(cmd_xmls[i].xml);   
    160178        status = pj_cli_add_cmd_from_xml(cli, NULL, &xml,  
    161                                          cmd_xmls[i].handler, NULL, NULL); 
     179            cmd_xmls[i].handler, NULL, get_codec_list); 
    162180        if (status != PJ_SUCCESS) 
    163181            goto on_return; 
Note: See TracChangeset for help on using the changeset viewer.