|
本帖最后由 aidou101 于 2023-5-5 09:48 编辑
- --初始化函数
- function on_control_notify(screen,control,value)
- if screen == 0 and control == 9 and value == 0
- then
- w_json["ip"] = get_text(0, 1)
- w_json["DNS"] = get_text(0, 2)
- json_data = cjson.encode(w_json)
- write_flash_string(0, json_data)
- print(json_data)
- w_json["ip"] = get_text(0, 1)
- w_json["DNS"] = get_text(0, 2)
- json_data = cjson.encode(w_json)
- write_flash_string(16, json_data)
- print(json_data)
- end
-
- if screen == 0 and control == 10 and value == 0
- then
- r_json = read_flash_string(0)
- read_Jsonstr_flash = cjson.decode(r_json)
- print(read_Jsonstr_flash)
- set_text(0, 5, read_Jsonstr_flash['ip'])
- set_text(0, 6, read_Jsonstr_flash['DNS'])
- end
- if screen == 0 and control == 3 and value == 0
- then
- send_json = cjson.encode(send_tb)
- set_text(0, 4, send_json)
- end
- end
复制代码 见上代码,只有在读的时候改为最后一些写进去的地址,即上面的16 才可以;请教,是只允许有一个json的读写吗?
如果不是,上面的代码要如何修开,可以进行多个json的读写?
|
|