Problem with HC-12 and Arduino nano

for an example of transmitting a structure using a HC-12 see how-to-convert-hex-character-from-softwareserial-string-to-int
the code is running on an ESP32 but should by OK on a nano