[luci] using bitlib

Ashok Rao greatarbor at gmail.com
Sun Jul 3 22:50:56 CEST 2011


I am trying to enhance  model/cbi/admin_system/admin.lua  with some
bitwise operations
Having a problem accessing the bitwise operations library.  Test
programs using that work fine but not within a luci  page
Here is what I've done ....
Have added   the following line to the top of admin.lua
local bit = require "bit"
Here is the statement that I am trying to execute
      test_key = bit.bxor(0x1234,0x1962)
Have made sure that bit.lua exists in /usr/lib/lua
However I get an error when I refresh the page

/usr/lib/lua/luci/model/cbi/admin_system/admin.lua:71: attempt to
index upvalue 'bit' (a boolean value)
stack traceback:
	/usr/lib/lua/luci/model/cbi/admin_system/admin.lua:71: in function 'write'
	?: in function 'parse'
	?: in function 'parse'
	?: in function 'parse'
	?: in function 'parse'
	?: in function 'parse'
	/usr/lib/lua/luci/dispatcher.lua:691: in function 'target'
	/usr/lib/lua/luci/dispatcher.lua:385: in function 'dispatch'
	/usr/lib/lua/luci/dispatcher.lua:147: in function
</usr/lib/lua/luci/dispatcher.lua:146>

Any suggestions ?

Ashok


More information about the luci mailing list