globalize0815:
Yeah, I know how to assign addresses using the lines you quoted from the library.
That´s not the problem...
I´m receiving the TX address via serial from a computer and
want to change the TX address before transmitting data also received from the computer via serial.
The address is not hard coded in the arduino, but can change depending on what remote device the computer wants to send data to. As several remote devices shall be used, including all addresses in the arduino code is not feasible.The data received via serial is the TX address and the payload to transmit both in string format. The payload can easily be converted from string to byte (actually int but in a byte array). The address however is a problem as it has to be converted from string to uint64.
Would it make sense to slice the string and convert it piece by piece to an int and assemble the data to the desired format?
I wouldn't convert piece by piece as an int, but as a byte... (Remember on Arduinos an int is two bytes.) Though I suppose you may want to read from the source string as an int to get both ASCII values into one variable to then convert down to an byte (high byte converts to high nybble, low byte converts to low nybble)...
Another method might be to have your address variable as a union of the uint64_t and a byte[] array. This would eliminate the tedium of shifting a 64 bit value on an 8 bit processor... Convert each byte from the two received ASCII characters to a byte hex value and then put it in the appropriate byte[] array index. Then read the completed uint64_t value. Just be careful to watch your byte order (both in order of conversion and in location of storage). You need to think about whether you want to store the value in byte[] indexes 0-4, 4-0, 7-3, or 3-7.