void sendPong() {
  LoRa.beginPacket();
  LoRa.print("Pong");
  LoRa.endPacket();
}

void sendTime() {
  unsigned long time = 0;

  if(time_running) {
    time = set_time - (millis() - timer);
  }
  else {
    time = set_time;
  }
  time = time / 1000;
  time_h = time / (long)3600;
  time = time - (time_h * (long)3600);
  time_m = time / 60;
  time_s = time - (time_m * 60);
  LoRa.beginPacket();
  LoRa.print(unit);
  LoRa.print("-");
  LoRa.print(time_h);
  LoRa.print(":");
  LoRa.print(time_m);
  LoRa.print(":");
  LoRa.print(time_s);
  LoRa.endPacket();
}

void sendDelay() {
  unsigned long edit_time = set_hold_up_timer[one_by_one - one_by_one_from] / 100;
  time_m = edit_time / 600;
  edit_time = edit_time - (time_m * 600);
  time_s = edit_time / 10;
  edit_time = edit_time - time_s * 10;
  LoRa.beginPacket();
  LoRa.print(one_by_one);
  LoRa.print("-");
  LoRa.print(time_m);
  LoRa.print(":");
  LoRa.print(time_s);
  LoRa.print(".");
  LoRa.print(edit_time);
  LoRa.endPacket();
}

void sendLoRaSetting() {
  LoRa.beginPacket();
  LoRa.print(unit);
  LoRa.print("-");
  LoRa.print(LoRa_power);
  LoRa.print("/");
  LoRa.print(LoRa_SF);
  LoRa.endPacket();
}

void sendAlias() {
  LoRa.beginPacket();
  LoRa.print(one_by_one);
  LoRa.print("-");
  LoRa.print(alias[one_by_one - one_by_one_from]);
  LoRa.endPacket();
}

void sendTemp() {
  LoRa.beginPacket();
  LoRa.print(unit);
  LoRa.print(". ");
  LoRa.print(readTemp());
  LoRa.print(" C");
  LoRa.endPacket();
}

void sendBatLvl() {
  LoRa.beginPacket();
  LoRa.print(unit);
  LoRa.print(". ");
  LoRa.print(bat_lvl);
  LoRa.print(" %");
  LoRa.endPacket();
}

void sendUnitInfo() {
  LoRa.beginPacket();
  LoRa.print("UI(");
  LoRa.print(unit);
  LoRa.print(")[");
  LoRa.print(readTemp());
  LoRa.print(", ");
  LoRa.print(bat_lvl);
  if(armed) {
    LoRa.print(", True");
  }
  else {
    LoRa.print(", False");
  }
  LoRa.print("]");
  LoRa.endPacket();
}

void resendAlias(int re_one_by_one, int re_alias) {
  LoRa.beginPacket();
  LoRa.print("ReAlias(");
  LoRa.print(re_one_by_one);
  LoRa.print(")[");
  LoRa.print(re_alias);
  LoRa.print("]");
  LoRa.endPacket();
}

void resendDelay(int re_one_by_one, unsigned long re_delay) {
  LoRa.beginPacket();
  LoRa.print("ReDelay(");
  LoRa.print(re_one_by_one);
  LoRa.print(")[");
  LoRa.print(re_delay);
  LoRa.print("]");
  LoRa.endPacket();
}

int getFirstNumber(String msg_edit) {
  msg_edit.remove(0, (msg_edit.indexOf('(') + 1));
  msg_edit.remove(msg_edit.indexOf(')'), (msg_edit.length() - msg_edit.indexOf(')')));
  int number = msg_edit.toInt();
  return number;
}

long getSecondNumber(String msg_edit) {
  msg_edit.remove(0, (msg_edit.indexOf('[') + 1));
  msg_edit.remove(msg_edit.indexOf(']'), (msg_edit.length() - msg_edit.indexOf(']')));
  unsigned long number = msg_edit.toInt();
  return number;
}
