-
Notifications
You must be signed in to change notification settings - Fork 17
Description
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_cmdstructure tofila10g_mode_cmd_old - In the same file, add a new structure
fila10g_mode_cmdwith the same contents as the old one, but with a new substructuresamplerate, like what is in include/dbbc3_core3h_modex_ds.h. - In include/fscom.h, rename the existing
fila10g_modesubstructure tofila10g_mode_old, as an instance offila10g_mode_cmd_old(i.e., add_oldto both the type and instance names). - In the same file, add a new
fila10g_modesubstructure at the end of the main structure as an instance offila10g_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(), andfila10g_2_vsi_samplerate()make changes to parallel the use ofsampleratein file clib/dbbc3_core3h_modex_util.c, for functionsdbbc3_core3h_modex_dec(),dbbc3_core3h_modex_enc(),vsi_samplerate_2_dbbc3_core3h(), anddbbc3_core3h_2_vsi_samplerate().
If I didn't miss anything: Bob's your uncle.