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