constructor help

So i have this structure,

struct TimerInfos3 : public Hdr {
    aTimer Timers3[4];
    byte sendTo;
    TimerInfos3 (byte from) : Hdr('U', 'Y', from), Timers3{  aTimer(0,0), aTimer(0,0), aTimer(0,0), aTimer(0,0)  } {}
    void disp() {
      Hdr::disp();
    }
    bool copyFlags(byte timerNumber, byte flags) {
      byte previous = Timers3[timerNumber].status & tiSetable;
      flags &= tiSetable;
      if (previous != flags) {
        Timers3[timerNumber].status = flags | tiUpdated;
        return true;
      }
      return false;
    }
    bool setOnTime(byte timerNumber, uint16_t value) {
      Timers3[timerNumber].onTime = value;
    }
    bool setOffTime(byte timerNumber, uint16_t value) {
      Timers3[timerNumber].offTime = value;
    }
    bool setFrom(TimerInfos3* in) {
      bool changes = false;
      for (byte i = 0; i < sizeof(Timers3) / sizeof(Timers3[0]); i++) {
        changes |= copyFlags(i, in->Timers3[i].status);
        changes |= setOnTime(i, in->Timers3[i].onTime);
        changes |= setOffTime(i, in->Timers3[i].offTime);
      }
      return changes;
       
    }
    void process2(){
      if (millis() - sometime>= 3000){
         writeTo('*', this, sizeof(TimerInfos3), true);
         sometime= millis();
      }
        
    }
};

i send the structure like this,

writeTo(‘Y’, &t, sizeof(TimerInfos3), false);

im trying to send this with a nrf card and that works , Because of th ‘Y’ in the constructor below. to send to ‘Z’ i need to change the ‘Y’ to a ‘Z’ while the program is running???
TimerInfos3 (byte from) : Hdr(‘U’, ‘Y’, from), Timers3{ aTimer(0,0), aTimer(0,0), aTimer(0,0), aTimer(0,0) } {}

and this works perfect sending to ‘Y’

however i want to send to ‘Z’ like this,

writeTo(‘Z’, &t, sizeof(TimerInfos3), false);

the node gets the message but the Hdr is not right the constructor it needs to be,

TimerInfos3 (byte from) : Hdr(‘U’, ‘Z’, from), Timers3{ aTimer(0,0), aTimer(0,0), aTimer(0,0), aTimer(0,0) } {}

i tried to change it like this while the program is running,

Hdr(‘U’, ‘Z’, ‘X’);

but i dont think it worked. if i manually put ‘Z’ in the hdr constructor it works but then i cant send it to why. How can do this?

Assuming 't' is an object of TimerInfos3, you cannot send the contents of 't' because there's a pointer. It doesn't make sense to send the pointers anywhere. Try to just send the data and reconstruct the object on the other side.

arduino_new:
Assuming 't' is an object of TimerInfos3, you cannot send the contents of 't' because there's a pointer. It doesn't make sense to send the pointers anywhere. Try to just send the data and reconstruct the object on the other side.

Im trying to find a way to explain this, i dont want to create another structure just to have the constructor like this,

TimerInfos3 (byte from) : Hdr('U', 'Z', from), Timers3{ aTimer(0,0), aTimer(0,0), aTimer(0,0), aTimer(0,0) } {}

If i leave the constructor above the way it is then the 'Z' node gets the right message,
if its like this then 'Y' gets the right message,

TimerInfos3 (byte from) : Hdr('U', 'Y', from), Timers3{ aTimer(0,0), aTimer(0,0), aTimer(0,0), aTimer(0,0) } {}

I have to send messages to both but dont want to create another structure just for that. hopefully this shed a little more light on what im trying to achieve

notsolowki:
hopefully this shed a little more light on what im trying to achieve

Clear as mud.

notsolowki:
Im trying to find a way to explain this, i dont want to create another structure just to have the constructor like this,

TimerInfos3 (byte from) : Hdr('U', 'Z', from), Timers3{ aTimer(0,0), aTimer(0,0), aTimer(0,0), aTimer(0,0) } {}

If i leave the constructor above the way it is then the 'Z' node gets the right message,
if its like this then 'Y' gets the right message,

TimerInfos3 (byte from) : Hdr('U', 'Y', from), Timers3{ aTimer(0,0), aTimer(0,0), aTimer(0,0), aTimer(0,0) } {}

I have to send messages to both but dont want to create another structure just for that. hopefully this shed a little more light on what im trying to achieve

Why not? you still need an object on the receiving side to work with right? Anyway, you can't send away pointers. Pointers only make sense in its own environment where it is declared.