Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fila10g_mode=? #168

Open
5 tasks
wehimwich opened this issue Mar 4, 2022 · 0 comments
Open
5 tasks

Fix fila10g_mode=? #168

wehimwich opened this issue Mar 4, 2022 · 0 comments

Comments

@wehimwich
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant