Added /raw command to the IRC client input to allow sending raw data to the server
This commit is contained in:
parent
171f46d401
commit
6da5a97bb2
@ -29,6 +29,7 @@ This is being developed in my free time as a fun project. It is no where near be
|
|||||||
- [X] Wifi scanning & selection menu
|
- [X] Wifi scanning & selection menu
|
||||||
- [ ] Saved wifi profiles
|
- [ ] Saved wifi profiles
|
||||||
- [X] IRC Client
|
- [X] IRC Client
|
||||||
|
- [X] `/raw` command for IRC client to send raw data to the server
|
||||||
- [ ] ChatGPT
|
- [ ] ChatGPT
|
||||||
- [ ] SSH Client
|
- [ ] SSH Client
|
||||||
- [ ] Wardriving
|
- [ ] Wardriving
|
||||||
|
14
src/main.ino
14
src/main.ino
@ -236,8 +236,13 @@ void parseAndDisplay(String line) {
|
|||||||
|
|
||||||
void handleKeyboardInput(char key) {
|
void handleKeyboardInput(char key) {
|
||||||
if (key == '\n' || key == '\r') { // Enter
|
if (key == '\n' || key == '\r') { // Enter
|
||||||
|
if (inputBuffer.startsWith("/raw ")) {
|
||||||
|
String rawCommand = inputBuffer.substring(5); // Remove "/raw "
|
||||||
|
sendRawCommand(rawCommand);
|
||||||
|
} else {
|
||||||
sendIRC("PRIVMSG " + String(channel) + " :" + inputBuffer);
|
sendIRC("PRIVMSG " + String(channel) + " :" + inputBuffer);
|
||||||
addLine(nick, inputBuffer, "message");
|
addLine(nick, inputBuffer, "message");
|
||||||
|
}
|
||||||
inputBuffer = "";
|
inputBuffer = "";
|
||||||
displayInputLine();
|
displayInputLine();
|
||||||
} else if (key == '\b') { // Backspace
|
} else if (key == '\b') { // Backspace
|
||||||
@ -251,6 +256,15 @@ void handleKeyboardInput(char key) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void sendRawCommand(String command) {
|
||||||
|
if (client.connected()) {
|
||||||
|
sendIRC(command);
|
||||||
|
Serial.println("Sent raw command: " + command);
|
||||||
|
} else {
|
||||||
|
Serial.println("Failed to send raw command: Not connected to IRC");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char getKeyboardInput() {
|
char getKeyboardInput() {
|
||||||
char incoming = 0;
|
char incoming = 0;
|
||||||
Wire.requestFrom(LILYGO_KB_SLAVE_ADDRESS, 1);
|
Wire.requestFrom(LILYGO_KB_SLAVE_ADDRESS, 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user