get_config_value/set_config_value Script commands - General Discussion and Assistance - CHDK Forum  

get_config_value/set_config_value Script commands

  • 2 Replies
  • 3855 Views
get_config_value/set_config_value Script commands
« on: 27 / October / 2017, 05:54:14 »
Advertisements
I am trying, in Lua, to use the get_config_value() and set_config_value() to get and set menu settings.

As an example, enabling and disabling the usb remote switch.
 
A page from the WIKI is http://chdk.wikia.com/wiki/Script_commands which states
 
Quote
Use the index number found in CHDK source file conf.c in the structure conf_info[].

The value for conf.remote_enable is 200.
 
Using 4755 on SX150IS and chdkptp GUI, it does not work - this does not cause disconnect:
Code: [Select]
> =set_config_value(200,1)
do something else is ok

In conf_map_1_2[] , 200 is mapped to 2203.
It does not work.
 
In conf_map_1_2[],  121 is mapped to 1200.
That works:
Code: [Select]
>=set_config_value(1200,1)
-> do something
ERROR: not connected

So, where is the correct,ordered list of values to be remapped and where would new id's be added ?

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: get_config_value/set_config_value Script commands
« Reply #1 on: 27 / October / 2017, 06:04:31 »
ISo, where is the correct,ordered list of values to be remapped and where would new id's be added ?


/CHDK/LUALIB/GEN/cnf_?.lua


e.g.
Code: [Select]
cfg = require("gen/cnf_core")
set_config_value(cfg.remote_enable, 1);


Phil.
CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

Re: get_config_value/set_config_value Script commands
« Reply #2 on: 28 / October / 2017, 05:16:54 »
Thanks Phil.

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal