Add field to mac_commands

I have a problem when I add a field to MacCommands, i explain exactly what i did:
Server :
-I added “NbSpec” in the function " func (p LinkADRReqPayload) MarshalBinary() ([]byte, error);" by
adding the following line : b = append(b, p.NbSpec)
-I added NbSpec in the struct LinkADRReqPayload.
-I assigned the value 14 to NbSpec in Data.go when setting macCommands
Application:
first I succeeded in recovering the value of NbSpec at the chirpstack application server
-I added p.NbSpec = data[4] in the function “func (p *LinkADRReqPayload) UnmarshalBinary(data
[]byte) error”
-I Modified the first field of " LinkADRReq: {4, func() MACCommandPayload { return
&LinkADRReqPayload{} }}, by replacing the 4 by 5

I note that the value can be received at the device level
but the operation of ADR is no longer correct.

I tried to compare the normal behavior without adding a new field I see that uplinkhistory contains the values ​​of TxPowerIndex whereas after the change this value always remains at zero.
I would love to have your help. thank you

I’m not a Golang developer, so I cannot really help you with the logic.
By adding another field to LinkADRReq, will you be adding another byte to this MAC command? If so, then Chirpstack also needs to know that it is now one byte longer than normal.

Making such a modification to a standard MAC command makes your device non-standard. If you can avoid doing that, wouldn’t that be best?