/* * Upload operator logo to a GSM phone using connected * Nokia Communicator. Copyright b@bbbs.net, 1999. * * Usage: Start BTERM on your home computer and activate Fax Modem on * your Nokia Communicator. Press Alt-E to execute a script in * BTERM. * * This script requires a file called "9110logo.txt" in current directory. * It's format is: * * 1st line: SMSC number * 2nd line: Receiver number * 3rd line: GSMnet number (Sonera, Finland = 24491) * 4th line: ignored * the rest: logo bitmap, 72 * 14 pixels * * Example: ---cut--- +358405202000 +358405480800 24491 ************************************************************************* xx xx xxxx xx xx xx xx xxxxxx xxxx xx xx xxxx * xx xx xx xxx xxx xx xx xx xx xxx xx xx xx * xx xx xx xxxxxxx xx xx xx xx xxxx xx xx xx * xxxx xx xx x xx xxxxxx xxxx xx xxxxxxx xx xx * xx xx xx xx xx xx xx xx xx xx xxxx xx xx * xx xx xx xx xx xx xx xx xx xx xxx xx xx * xx xx xxxx xx xx xx xx xxxxxx xxxx xx xx xxxx * * xxxxxx xxxx xxxx xxxxx xxxx xxxxx xxxx xx xx * xx xx xx xx xx xx xx xx xx xx xx xx xx xx xx * xxxxx xx xx xx xx xxxxx xxxxxx xxxxx xx xx xxxx * xx xx xx xx xx xx xx xx xx xxxx xx xx xx * xx xx xx xx xx xx xx xx xx xx xx xx xx xx * xx xxxx xxxx xxxxx xx xx xx xx xxxx xx * ************************************************************************* ---cut--- */ #include void talk(char sends, char recvs) { printf("%s",sends); delay(50); // yeah, ignore recvs in this version... } void main() { int f; char s, s2; int x, y, c; if ((f=fopen("9110logo.txt","rt"))!=-1) { s=fgets(f); talk(sprintf("AT+CSCA=\"%s\"\r",s),"OK"); talk("AT+CSMP=81,,0,245\r","OK"); s=fgets(f); talk(sprintf("AT+CMGS=\"%s\"\r",s),">"); s2="06050415820000"; s=fgets(f); s2=sprintf("%s%u%uF%u%u%u",s2,copy(s,2,1),copy(s,1,1),copy(s,3,1),copy(s,5,1),copy(s,4,1)); s2=sprintf("%s00480E01",s2); fgets(f); for (y=0; y<14; y++) { s=fgets(f); c=0; for (x=0; x<72; x++) { c<<=1; if (copy(s,x+1,1)=="x") c|=1; if ((x & 3)==3) { s2=sprintf("%s%1X",s2,c); c=0; } } } talk(sprintf("%s\032",s2),"+CMGS:"); talk("AT+CSMP=17,,0,0\r","OK"); fclose(f); } }