resend_errordb and hcidbdump commands

The ability to resend with modified metadata also applies to error database resending. Error database resending is performed through hcicmd with the resend_errordb command:

  • resend_errordb mid
  • resend_errordb mid file name len10|nl|eof

If only the mid is supplied, then the message with that mid is resent directly from the error database with preserved metadata .

If three arguments are provided, then the message from the file is sent with metadata from the error db for the given mid. This mid argument supports a range of mids in the same format as hcidbdump, and supports resending multiple messages using this mid format:

x.y.z = only this message
x.y.z1:x.y.z2 = x.y messages z1 through z2

These options takes two arguments:

resend_errordb -m metafilename

This resends from the error database, but with modified metadata from a file. This file takes the same format as the SMAT metadata temp file.

The mids that are used in the resend come from the metadata file, meaning that when using metadata, resend_errordb also supports resending multiple messages.

Another option takes four arguments:

resend_errordb -m metafilename msgfilename len10|nl|eof

This performs an error database resend using both message data and metadata from files. As with resend, if the number of messages in both files do not match, the command returns an error without resending any messages.

If two or four arguments are used, but the first argument is not -m, then the command returns an error.

As resend_errordb takes from one to four arguments, the full form that is called from hcicmd is as follows:

hcicmd -p process_name -c ". resend_errordb mid"
hcicmd -p process_name -c ". resend_errordb -m metafilename"
hcicmd -p process_name -c ". resend_errordb mid msgfilename len10|nl|eof"
hcicmd -p process_name -c ". resend_errordb -m metafilename msgfilename len10|nl|eof"

-n metadata_filename option

To simplify these options, hcidbdump enables dumping metadata from the error database into a file of the necessary format. The option for this is -n metadata_filename.

hcidbdump -n metadata_filename -e -m mid output_filename

For example:

hcidbdump -n meta.txt -e -m 0.0.1:0.0.9999 out.txt

This generates the metadata file (meta.txt in the above example) which you can modify, use as the second argument to resend_errordb.