Skip to content

Fix fila10g_mode=? #168

@wehimwich

Description

@wehimwich

An obscure feature of this command, the ? monitor form is not quite right. For any command, the ? form returns what was commanded, as opposed to the actual settings of the device. For this command, if the sample rate was commanded, the ? monitor form shows decimation and implied sample rate. It should show just the sample rate commanded.

To fix this the fila10g_mode_cmd structure will need to be expanded. To make that change it will have to moved in shared memory (fscom.h) from its current location and placed at the end. A substitute of the same size as the old structure will need to be placed in the old location to protect users (notably telegraf) that have pinned a FS 10.1 shared memory lay-out.

These steps should do the trick:

  • In include/fila10g_mode_ds.h, rename the current fila10g_mode_cmd structure to fila10g_mode_cmd_old
  • In the same file, add a new structure fila10g_mode_cmd with the same contents as the old one, but with a new substructure samplerate, like what is in include/dbbc3_core3h_modex_ds.h.
  • In include/fscom.h, rename the existing fila10g_mode substructure to fila10g_mode_old, as an instance of fila10g_mode_cmd_old (i.e., add _old to both the type and instance names).
  • In the same file, add a new fila10g_mode substructure at the end of the main structure as an instance of fila10g_mode_cmd (i.e., the previous definition before it changed).
  • In clib/fila10g_mode_util.c, for functions fila10g_mode_dec(), fila10g_mode_enc(), vsi_samplerate_2_fila10g(), and fila10g_2_vsi_samplerate() make changes to parallel the use of samplerate in file clib/dbbc3_core3h_modex_util.c, for functions dbbc3_core3h_modex_dec(), dbbc3_core3h_modex_enc(), vsi_samplerate_2_dbbc3_core3h(), and dbbc3_core3h_2_vsi_samplerate().

If I didn't miss anything: Bob's your uncle.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions