Minor fixes to get Thomas' DT reception and intent broadcasting working.

This commit is contained in:
gardners 2011-05-23 17:36:51 +09:30 committed by Jeremy Lakeman
parent 83f88a6d08
commit 23b791bd0a

View File

@ -197,6 +197,7 @@ int processRequest(unsigned char *packet,int len,
break; break;
case ACTION_DIGITALTELEGRAM: case ACTION_DIGITALTELEGRAM:
// Unpack SMS message. // Unpack SMS message.
if (debug>1) fprintf(stderr,"In ACTION_DIGITALTELEGRAM\n");
{ {
char emitterPhoneNumber[256]; char emitterPhoneNumber[256];
char message[256]; char message[256];
@ -217,8 +218,8 @@ int processRequest(unsigned char *packet,int len,
// Send SMS to android // Send SMS to android
char amCommand[576]; // 64 char + 2*256(max) char = 576 char amCommand[576]; // 64 char + 2*256(max) char = 576
sprintf(amCommand, "am broadcast -a org.servalproject.DT -e number \"%s\" -e content \"%s\"", emitterPhoneNumber, message); sprintf(amCommand, "am broadcast -a org.servalproject.DT -e number \"%s\" -e content \"%s\"", emitterPhoneNumber, message);
int exitcode = printf(amCommand); if (debug>1) fprintf(stderr,"Delivering DT message via intent: %s\n",amCommand);
//int exitcode = system(amCommand); int exitcode = runCommand(amCommand);
} }
break; break;
case ACTION_SET: case ACTION_SET: