Database

A tiny btree key-value store (file mydb) behind a RAM dictionary. All keys and values are byte strings; read returns str and falls back to the default in database.params for keys never written. write only touches RAM and sets newdata; store flushes to flash and is called at the end of every cycle, after a server *SET and before deep sleep. If the file cannot be opened at boot it is deleted and the board resets.

The registry database.params doubles as the list of remotely writable parameters: handle_server_response() accepts a *SET only for keys whose access flag is "W". See System IDs for every key.

class gpspro.firmware_core.database[source]
params = {'200': ['R', 1, 0, 0, '0'], '211': ['W', 0, 0, 0, '0'], '212': ['W', 0, 0, 0, '60'], '214': ['W', 1, 0, 0, '120'], '230': ['R', 0, 0, 0, ''], '231': ['R', 0, 0, 0, ''], '232': ['R', 0, 0, 0, ''], '234': ['R', 0, 0, 0, ''], '235': ['R', 0, 0, 0, ''], '236': ['R', 0, 0, 0, ''], '237': ['R', 0, 0, 0, ''], '238': ['R', 0, 0, 0, ''], '254': ['W', 0, 0, 0, '0.0'], '255': ['W', 0, 0, 0, '0.0'], '256': ['R', 0, 0, 0, '0'], '257': ['R', 0, 0, 0, '0'], '258': ['R', 0, 0, 0, '0'], '262': ['R', 0, 0, 0, '0'], '421': ['W', 0, 0, 0, '900'], '422': ['W', 0, 0, 0, '43200'], '440': ['R', 0, 0, 0, '0'], '519': ['R', 0, 0, 0, '0'], '779': ['R', 0, 0, 0, ''], '780': ['R', 0, 0, 0, ''], '930': ['W', 0, 0, 0, '30'], '931': ['R', 0, 0, 0, '0'], '934': ['W', 0, 0, 0, '8'], 'buf_count': ['R', 0, 0, 0, '0'], 'buf_fmt': ['R', 0, 0, 0, '0'], 'buf_slot': ['R', 0, 0, 0, '0'], 'iccid': ['R', 0, 0, 0, ''], 'imsi': ['R', 0, 0, 0, ''], 'mot_ecnt': ['R', 0, 0, 0, '0'], 'mot_scnt': ['R', 0, 0, 0, '0'], 'mot_st': ['R', 0, 0, 0, '0'], 'rpt_ts': ['R', 0, 0, 0, ''], 'rsrp': ['R', 0, 0, 0, ''], 'rsrq': ['R', 0, 0, 0, '']}
read(prop)[source]
write(prop, value)[source]
store()[source]
init_defaults(imei)[source]