Add files via upload

master
EA5SW 8 years ago committed by GitHub
parent 19ef8eee0a
commit b6f7971ba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -123,7 +123,7 @@ void CDisplay::writeDMR(unsigned int slotNo, const std::string& src, bool group,
LogMessage ("Voice TG:%s",dst.c_str()); LogMessage ("Voice TG:%s",dst.c_str());
LogMessage ("Voice Callsign:%s",src.c_str()); LogMessage ("Voice Callsign:%s",src.c_str());
//TTS Voice //TTS
char voice[80]; char voice[80];
strcpy (voice,"echo \""); strcpy (voice,"echo \"");
if (strcmp ("",src.c_str()) !=0){ if (strcmp ("",src.c_str()) !=0){
@ -199,7 +199,7 @@ for (char & c : s)
strcat(voice," Victor "); strcat(voice," Victor ");
} }
else if (c == 'W'){ else if (c == 'W'){
strcat(voice," Güisky "); strcat(voice," Güisski ");
} }
else if (c == 'X'){ else if (c == 'X'){
strcat(voice," Exray "); strcat(voice," Exray ");
@ -258,19 +258,36 @@ for (char & c : s)
system ("/ram/mm_voice.sh &"); system ("/ram/mm_voice.sh &");
} }
if ((strcmp ("99990",dst.c_str()) ==0)) //REMOTE Commands
{
printf ("Wifi Off\n");
system("sudo rfkill block 0");
}
else if ((strcmp ("99991",dst.c_str()) ==0))
{
printf ("Wifi On\n");
system("sudo rfkill unblock 0");
}
if ((strcmp ("99999",dst.c_str()) ==0)){
LogMessage ("Remote Command Reboot");
system("sudo shutdown -r now");
}
else if ((strcmp ("99998",dst.c_str()) ==0)){
LogMessage ("Remote Command Shutdown");
system("sudo shutdown -h now");
}
else if ((strcmp ("99997",dst.c_str()) ==0)){
LogMessage ("Remote Command DmrPlus");
system("mm_plus");
}
else if ((strcmp ("99996",dst.c_str()) ==0)){
LogMessage ("Remote Command DMRGateway");
system("mm_gate");
}
else if ((strcmp ("99995",dst.c_str()) ==0)){
LogMessage ("Remote Command BrandMeister");
system("mm_BM");
}
else if ((strcmp ("99991",dst.c_str()) ==0)){
LogMessage ("Remote Command Wifi On");
system("sudo rfkill unblock 0");
}
else if ((strcmp ("99990",dst.c_str()) ==0)){
LogMessage ("Remote Command Wifi Off");
system("sudo rfkill block 0");
}
} }
void CDisplay::writeDMRRSSI(unsigned int slotNo, unsigned char rssi) void CDisplay::writeDMRRSSI(unsigned int slotNo, unsigned char rssi)

@ -366,7 +366,8 @@ void CNextion::writeDMRInt(unsigned int slotNo, const std::string& src, bool gro
if (strcmp(type,"R") == 0) { if (strcmp(type,"R") == 0) {
sendCommand("t2.pco=2016"); sendCommand("t2.pco=2016");
sendCommand("t36.pco=2016"); sendCommand("j0.pco=1024");
sendCommand("t36.pco=2016");
sendCommand("t36.txt=\"Busy\""); sendCommand("t36.txt=\"Busy\"");
sendCommand(text); sendCommand(text);
@ -405,28 +406,6 @@ FILE *cfgfileTG;
fclose(cfgfileTG); fclose(cfgfileTG);
// READ INI SYSOP & CONTROL
FILE *cfgfileCT;
int maxlineCT = 256;
int iCT=0;
char ctrl[7][256];
std::string tct ("ctrl.ini");
std::string pathct ("");
pathct = m_filesConfig + tct;
const char* filect = pathct.c_str();
cfgfileCT = fopen (filect, "r");
if (cfgfileCT==NULL) printf("can't open file\n");
while (fgets(ctrl[iCT], maxlineCT, cfgfileCT)) {
ctrl[iCT][strlen(ctrl[iCT])-1] = '\0';
iCT++;
}
fclose(cfgfileCT);
/* READ INI PREFIXES /* READ INI PREFIXES
* *
* A prefixes * A prefixes
@ -534,39 +513,6 @@ else {
sendCommand("t2.font=11"); sendCommand("t2.font=11");
sendCommand(text); sendCommand(text);
// Compare ShutDown Routines
if ((strcmp (ctrl[3],dst.c_str()) ==0) && (strncmp (src.c_str(),ctrl[0],6) == 0) && (strcmp ("1",ctrl[1]) == 0))
{
printf ("Reboot NOW\n");
system("sudo shutdown -r now");
}
else if ((strcmp (ctrl[2],dst.c_str()) ==0) && (strncmp (src.c_str(),ctrl[0],6) == 0) && (strcmp ("1",ctrl[1]) == 0))
{
printf ("Shutdown NOW\n");
system("sudo shutdown -h now");
close();
}
else if ((strcmp (ctrl[4],dst.c_str()) ==0) && (strncmp (src.c_str(),ctrl[0],6) == 0) && (strcmp ("1",ctrl[1]) == 0))
{
printf ("DmrPlusmode\n");
system("mm_plus");
}
else if ((strcmp (ctrl[5],dst.c_str()) ==0) && (strncmp (src.c_str(),ctrl[0],6) == 0) && (strcmp ("1",ctrl[1]) == 0))
{
printf ("DMRGateway mode\n");
system("mm_gate");
}
else if ((strcmp (ctrl[6],dst.c_str()) ==0) && (strncmp (src.c_str(),ctrl[0],6) == 0) && (strcmp ("1",ctrl[1]) == 0))
{
printf ("BrandMeister mode\n");
system("mm_BM");
}
::sprintf(text, "t3.txt=\"%s%s\"", group ? "TG: " : "", dst.c_str()); ::sprintf(text, "t3.txt=\"%s%s\"", group ? "TG: " : "", dst.c_str());
@ -603,11 +549,6 @@ else if (strcmp ("4000",dst.c_str()) ==0) {
::sprintf(text, "p5.pic=11"); ::sprintf(text, "p5.pic=11");
sendCommand(text); sendCommand(text);
} }
else if (strcmp (ctrl[0],dst.c_str()) ==0) {
char text[130U];
::sprintf(text, "p5.pic=9");
sendCommand(text);
}
else if (strcmp ("9990",dst.c_str()) ==0) { else if (strcmp ("9990",dst.c_str()) ==0) {
char text[130U]; char text[130U];
::sprintf(text, "p5.pic=7"); ::sprintf(text, "p5.pic=7");
@ -618,6 +559,23 @@ else if (strcmp ("6",dst.c_str()) ==0) {
::sprintf(text, "p5.pic=13"); ::sprintf(text, "p5.pic=13");
sendCommand(text); sendCommand(text);
} }
else if ((strcmp ("99991",dst.c_str()) ==0)){
char text[130U];
::sprintf(text, "p5.pic=14");
sendCommand(text);
}
else if ((strcmp ("99990",dst.c_str()) ==0)){
char text[130U];
::sprintf(text, "p5.pic=15");
sendCommand(text);
}
/*
else if (strcmp (callsign,dst.c_str()) ==0) {
char text[130U];
::sprintf(text, "p5.pic=9");
sendCommand(text);
}
*/
else else
{ {
@ -627,12 +585,10 @@ else
sendCommand(text); sendCommand(text);
}} }}
sendCommand ("t5.txt=\"RSSI: -10udBm\""); sendCommand ("t5.txt=\"RSSI: -10udBm\"");
sendCommand ("t7.txt=\"Ber: 0.0%\""); sendCommand ("t7.txt=\"Ber: 0.0%\"");
sendCommand(text); sendCommand(text);
} }
m_clockDisplayTimer.stop(); m_clockDisplayTimer.stop();

@ -619,100 +619,75 @@ if (strcmp ("9",dst.c_str()) ==0) {
display.printf("%s%s", group ? "TG:" : "", dst.c_str()); display.printf("%s%s", group ? "TG:" : "", dst.c_str());
// ShutDown & Reboot compares // ShutDown & Reboot compares & print screen
if ((strcmp ("99999",dst.c_str()) ==0)) if ((strcmp ("99999",dst.c_str()) ==0)){
{
display.clearDisplay(); display.clearDisplay();
OLED_statusbar(); OLED_statusbar();
display.setCursor(20,OLED_LINE3); display.setCursor(20,OLED_LINE3);
display.setTextSize(2); display.setTextSize(2);
display.printf("Reboot"); display.printf("Reboot");
display.display(); display.display();
printf ("Reboot\n");
system("sudo shutdown -r now");
delay (1000); delay (1000);
} }
else if ((strcmp ("99998",dst.c_str()) ==0)) else if ((strcmp ("99998",dst.c_str()) ==0)) {
{
display.clearDisplay(); display.clearDisplay();
OLED_statusbar(); OLED_statusbar();
display.setCursor(20,OLED_LINE3); display.setCursor(20,OLED_LINE3);
display.setTextSize(2); display.setTextSize(2);
display.printf("STOP"); display.printf("STOP");
display.display(); display.display();
printf ("Shutdown\n");
system("sudo shutdown -h now");
delay (1000); delay (1000);
} }
else if ((strcmp ("99997",dst.c_str()) ==0)) else if ((strcmp ("99997",dst.c_str()) ==0)){
{
display.clearDisplay(); display.clearDisplay();
OLED_statusbar(); OLED_statusbar();
display.setCursor(20,OLED_LINE3); display.setCursor(20,OLED_LINE3);
display.setTextSize(2); display.setTextSize(2);
display.printf("Load +"); display.printf("Load +");
display.display(); display.display();
printf ("DmrPlus\n");
system("mm_plus");
delay (100); delay (100);
} }
else if ((strcmp ("99996",dst.c_str()) ==0)) else if ((strcmp ("99996",dst.c_str()) ==0)){
{
display.clearDisplay(); display.clearDisplay();
OLED_statusbar(); OLED_statusbar();
display.setCursor(20,OLED_LINE3); display.setCursor(20,OLED_LINE3);
display.setTextSize(2); display.setTextSize(2);
display.printf("Load Gate"); display.printf("Load Gate");
display.display(); display.display();
printf ("DMRGateway\n");
system("mm_gate");
delay (100); delay (100);
} }
else if ((strcmp ("99995",dst.c_str()) ==0)) else if ((strcmp ("99995",dst.c_str()) ==0)){
{
display.clearDisplay(); display.clearDisplay();
OLED_statusbar(); OLED_statusbar();
display.setCursor(20,OLED_LINE3); display.setCursor(20,OLED_LINE3);
display.setTextSize(2); display.setTextSize(2);
display.printf("Load BM"); display.printf("Load BM");
display.display(); display.display();
printf ("BrandMeister\n");
system("mm_BM");
delay (100); delay (100);
} }
else if ((strcmp ("99990",dst.c_str()) ==0)) else if ((strcmp ("99990",dst.c_str()) ==0)){
{
display.clearDisplay(); display.clearDisplay();
OLED_statusbar(); OLED_statusbar();
display.setCursor(20,OLED_LINE3); display.setCursor(20,OLED_LINE3);
display.setTextSize(2); display.setTextSize(2);
display.printf("Wifi Off"); display.printf("Wifi Off");
display.display(); display.display();
printf ("Wifi Off\n");
system("sudo rfkill block 0");
} }
else if ((strcmp ("99991",dst.c_str()) ==0)) else if ((strcmp ("99991",dst.c_str()) ==0)){
{
display.clearDisplay(); display.clearDisplay();
OLED_statusbar(); OLED_statusbar();
display.setCursor(20,OLED_LINE3); display.setCursor(20,OLED_LINE3);
display.setTextSize(2); display.setTextSize(2);
display.printf("Wifi On"); display.printf("Wifi On");
display.display(); display.display();
printf ("Wifi On\n");
system("sudo rfkill unblock 0");
} }

Loading…
Cancel
Save

Powered by TurnKey Linux.