From: short <> Date: Wed, 3 Apr 2002 01:44:15 +0000 (+0000) Subject: This commit was generated by cvs2svn to compensate for changes in r164, X-Git-Url: https://git.jankratochvil.net/?p=gnokii.git;a=commitdiff_plain;h=HEAD;hp=56289d787a96f7d74273e0d1d1875b487f6cfe39 This commit was generated by cvs2svn to compensate for changes in r164, which included commits to RCS files with non-trunk default branches. --- diff --git a/COPYRIGHT b/COPYRIGHT new file mode 100644 index 0000000..8565fdb --- /dev/null +++ b/COPYRIGHT @@ -0,0 +1,30 @@ +GNOKII - A Linux/Unix toolset and driver for the GSM phones + Copyright (C) 1999 Hugh Blemings & Pavel Janík ml. + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free Software +Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT +ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +FOR A PARTICULAR PURPOSE. See the GNU General Public License for more +details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free Software Foundation, Inc., 59 Temple +Place - Suite 330, Boston, MA 02111-1307, USA. + +You can contact authors by mail at + +hugh@blemings.org Pavel.Janik@suse.cz +Hugh Blemings Mgr. Pavel Janík, SuSE CR, s.r.o. +PO Box 234 Pod Pekárnami 338/12 +Belconnen ACT 2616 190 00 Praha 9 +Australia Czech Republic + +We would be delighted to receive a postcard from you if you use gnokii but +this is not a requirement of these licence terms! :) + +Any trademarks in this or other gnokii documents/files are the property of +their respective owners. diff --git a/Docs/default/3210/nse8/pictures/picture1.nlm b/Docs/default/3210/nse8/pictures/picture1.nlm new file mode 100644 index 0000000..85aee07 Binary files /dev/null and b/Docs/default/3210/nse8/pictures/picture1.nlm differ diff --git a/Docs/default/3210/nse8/pictures/picture2.nlm b/Docs/default/3210/nse8/pictures/picture2.nlm new file mode 100644 index 0000000..95192e6 Binary files /dev/null and b/Docs/default/3210/nse8/pictures/picture2.nlm differ diff --git a/Docs/default/3210/nse8/pictures/picture3.nlm b/Docs/default/3210/nse8/pictures/picture3.nlm new file mode 100644 index 0000000..4db41a3 Binary files /dev/null and b/Docs/default/3210/nse8/pictures/picture3.nlm differ diff --git a/Docs/default/3210/nse8/startup.nlm b/Docs/default/3210/nse8/startup.nlm new file mode 100644 index 0000000..a339ef6 Binary files /dev/null and b/Docs/default/3210/nse8/startup.nlm differ diff --git a/Docs/default/3210/nse9/pictures/picture1.nlm b/Docs/default/3210/nse9/pictures/picture1.nlm new file mode 100644 index 0000000..95192e6 Binary files /dev/null and b/Docs/default/3210/nse9/pictures/picture1.nlm differ diff --git a/Docs/default/3210/nse9/pictures/picture2.nlm b/Docs/default/3210/nse9/pictures/picture2.nlm new file mode 100644 index 0000000..64f67a8 Binary files /dev/null and b/Docs/default/3210/nse9/pictures/picture2.nlm differ diff --git a/Docs/default/3210/nse9/pictures/picture3.nlm b/Docs/default/3210/nse9/pictures/picture3.nlm new file mode 100644 index 0000000..85aee07 Binary files /dev/null and b/Docs/default/3210/nse9/pictures/picture3.nlm differ diff --git a/Docs/default/3210/nse9/pictures/picture4.nlm b/Docs/default/3210/nse9/pictures/picture4.nlm new file mode 100644 index 0000000..93aee77 Binary files /dev/null and b/Docs/default/3210/nse9/pictures/picture4.nlm differ diff --git a/Docs/default/3210/nse9/startup.nlm b/Docs/default/3210/nse9/startup.nlm new file mode 100644 index 0000000..25bf8d4 Binary files /dev/null and b/Docs/default/3210/nse9/startup.nlm differ diff --git a/Docs/default/3310/TwojaEra b/Docs/default/3310/TwojaEra new file mode 100644 index 0000000..81b0548 --- /dev/null +++ b/Docs/default/3310/TwojaEra @@ -0,0 +1 @@ +Twoja Era:d=8,o=6,s=N,b=160,l=0:g5,c,g,2f,2e,2p,p,g5,c,g,2f,2e,2p,4p,h5,g5,2d.5,4p,2p,p,g5,c,g,2f,2e,2p,p,g5,c,g,2f,2e,2p,4p,h5,g5,2d.5,4p \ No newline at end of file diff --git a/Docs/default/3310/pictures/picture1.nlm b/Docs/default/3310/pictures/picture1.nlm new file mode 100644 index 0000000..c1a4ec2 Binary files /dev/null and b/Docs/default/3310/pictures/picture1.nlm differ diff --git a/Docs/default/3310/pictures/picture10.nlm b/Docs/default/3310/pictures/picture10.nlm new file mode 100644 index 0000000..d277ec9 Binary files /dev/null and b/Docs/default/3310/pictures/picture10.nlm differ diff --git a/Docs/default/3310/pictures/picture11.nlm b/Docs/default/3310/pictures/picture11.nlm new file mode 100644 index 0000000..01f76e0 Binary files /dev/null and b/Docs/default/3310/pictures/picture11.nlm differ diff --git a/Docs/default/3310/pictures/picture12.nlm b/Docs/default/3310/pictures/picture12.nlm new file mode 100644 index 0000000..d7cc9a4 Binary files /dev/null and b/Docs/default/3310/pictures/picture12.nlm differ diff --git a/Docs/default/3310/pictures/picture13.nlm b/Docs/default/3310/pictures/picture13.nlm new file mode 100644 index 0000000..6fc50c6 Binary files /dev/null and b/Docs/default/3310/pictures/picture13.nlm differ diff --git a/Docs/default/3310/pictures/picture14.nlm b/Docs/default/3310/pictures/picture14.nlm new file mode 100644 index 0000000..698ec61 Binary files /dev/null and b/Docs/default/3310/pictures/picture14.nlm differ diff --git a/Docs/default/3310/pictures/picture2.nlm b/Docs/default/3310/pictures/picture2.nlm new file mode 100644 index 0000000..1cb9c6d Binary files /dev/null and b/Docs/default/3310/pictures/picture2.nlm differ diff --git a/Docs/default/3310/pictures/picture3.nlm b/Docs/default/3310/pictures/picture3.nlm new file mode 100644 index 0000000..d72fdaf Binary files /dev/null and b/Docs/default/3310/pictures/picture3.nlm differ diff --git a/Docs/default/3310/pictures/picture4.nlm b/Docs/default/3310/pictures/picture4.nlm new file mode 100644 index 0000000..7dca99b Binary files /dev/null and b/Docs/default/3310/pictures/picture4.nlm differ diff --git a/Docs/default/3310/pictures/picture5.nlm b/Docs/default/3310/pictures/picture5.nlm new file mode 100644 index 0000000..ecb1c3b Binary files /dev/null and b/Docs/default/3310/pictures/picture5.nlm differ diff --git a/Docs/default/3310/pictures/picture6.nlm b/Docs/default/3310/pictures/picture6.nlm new file mode 100644 index 0000000..4db41a3 Binary files /dev/null and b/Docs/default/3310/pictures/picture6.nlm differ diff --git a/Docs/default/3310/pictures/picture7.nlm b/Docs/default/3310/pictures/picture7.nlm new file mode 100644 index 0000000..85aee07 Binary files /dev/null and b/Docs/default/3310/pictures/picture7.nlm differ diff --git a/Docs/default/3310/pictures/picture8.nlm b/Docs/default/3310/pictures/picture8.nlm new file mode 100644 index 0000000..90f9469 Binary files /dev/null and b/Docs/default/3310/pictures/picture8.nlm differ diff --git a/Docs/default/3310/pictures/picture9.nlm b/Docs/default/3310/pictures/picture9.nlm new file mode 100644 index 0000000..692a4d6 Binary files /dev/null and b/Docs/default/3310/pictures/picture9.nlm differ diff --git a/Docs/default/6150/caller/colleagues.nlm b/Docs/default/6150/caller/colleagues.nlm new file mode 100644 index 0000000..6346bc4 Binary files /dev/null and b/Docs/default/6150/caller/colleagues.nlm differ diff --git a/Docs/default/6150/caller/family.nlm b/Docs/default/6150/caller/family.nlm new file mode 100644 index 0000000..6aa0bf3 Binary files /dev/null and b/Docs/default/6150/caller/family.nlm differ diff --git a/Docs/default/6150/caller/friends.nlm b/Docs/default/6150/caller/friends.nlm new file mode 100644 index 0000000..1ae5a1d Binary files /dev/null and b/Docs/default/6150/caller/friends.nlm differ diff --git a/Docs/default/6150/caller/other.nlm b/Docs/default/6150/caller/other.nlm new file mode 100644 index 0000000..df78781 Binary files /dev/null and b/Docs/default/6150/caller/other.nlm differ diff --git a/Docs/default/6150/caller/vip.nlm b/Docs/default/6150/caller/vip.nlm new file mode 100644 index 0000000..e3855f2 Binary files /dev/null and b/Docs/default/6150/caller/vip.nlm differ diff --git a/Docs/default/6150/startup.nlm b/Docs/default/6150/startup.nlm new file mode 100644 index 0000000..a339ef6 Binary files /dev/null and b/Docs/default/6150/startup.nlm differ diff --git a/Docs/default/6210/caller/colleagues.bmp b/Docs/default/6210/caller/colleagues.bmp new file mode 100644 index 0000000..35e78d0 Binary files /dev/null and b/Docs/default/6210/caller/colleagues.bmp differ diff --git a/Docs/default/6210/caller/family.bmp b/Docs/default/6210/caller/family.bmp new file mode 100644 index 0000000..481a311 Binary files /dev/null and b/Docs/default/6210/caller/family.bmp differ diff --git a/Docs/default/6210/caller/friends.bmp b/Docs/default/6210/caller/friends.bmp new file mode 100644 index 0000000..bc246e6 Binary files /dev/null and b/Docs/default/6210/caller/friends.bmp differ diff --git a/Docs/default/6210/caller/other.bmp b/Docs/default/6210/caller/other.bmp new file mode 100644 index 0000000..da3b928 Binary files /dev/null and b/Docs/default/6210/caller/other.bmp differ diff --git a/Docs/default/6210/caller/vip.bmp b/Docs/default/6210/caller/vip.bmp new file mode 100644 index 0000000..08dfc56 Binary files /dev/null and b/Docs/default/6210/caller/vip.bmp differ diff --git a/Docs/default/6210/picture/picture1.nlm b/Docs/default/6210/picture/picture1.nlm new file mode 100644 index 0000000..4db41a3 Binary files /dev/null and b/Docs/default/6210/picture/picture1.nlm differ diff --git a/Docs/default/6210/picture/picture10.nlm b/Docs/default/6210/picture/picture10.nlm new file mode 100644 index 0000000..7dca99b Binary files /dev/null and b/Docs/default/6210/picture/picture10.nlm differ diff --git a/Docs/default/6210/picture/picture2.nlm b/Docs/default/6210/picture/picture2.nlm new file mode 100644 index 0000000..85aee07 Binary files /dev/null and b/Docs/default/6210/picture/picture2.nlm differ diff --git a/Docs/default/6210/picture/picture3.nlm b/Docs/default/6210/picture/picture3.nlm new file mode 100644 index 0000000..5f736a7 Binary files /dev/null and b/Docs/default/6210/picture/picture3.nlm differ diff --git a/Docs/default/6210/picture/picture4.nlm b/Docs/default/6210/picture/picture4.nlm new file mode 100644 index 0000000..546dcd6 Binary files /dev/null and b/Docs/default/6210/picture/picture4.nlm differ diff --git a/Docs/default/6210/picture/picture5.nlm b/Docs/default/6210/picture/picture5.nlm new file mode 100644 index 0000000..d525fec Binary files /dev/null and b/Docs/default/6210/picture/picture5.nlm differ diff --git a/Docs/default/6210/picture/picture6.nlm b/Docs/default/6210/picture/picture6.nlm new file mode 100644 index 0000000..27588dd Binary files /dev/null and b/Docs/default/6210/picture/picture6.nlm differ diff --git a/Docs/default/6210/picture/picture7.nlm b/Docs/default/6210/picture/picture7.nlm new file mode 100644 index 0000000..fb9f031 Binary files /dev/null and b/Docs/default/6210/picture/picture7.nlm differ diff --git a/Docs/default/6210/picture/picture8.nlm b/Docs/default/6210/picture/picture8.nlm new file mode 100644 index 0000000..3db6fca Binary files /dev/null and b/Docs/default/6210/picture/picture8.nlm differ diff --git a/Docs/default/6210/picture/picture9.nlm b/Docs/default/6210/picture/picture9.nlm new file mode 100644 index 0000000..0081da6 Binary files /dev/null and b/Docs/default/6210/picture/picture9.nlm differ diff --git a/Docs/default/6210/startup.bmp b/Docs/default/6210/startup.bmp new file mode 100644 index 0000000..0365bd6 Binary files /dev/null and b/Docs/default/6210/startup.bmp differ diff --git a/Docs/default/6250/picture1.nlm b/Docs/default/6250/picture1.nlm new file mode 100644 index 0000000..71095da Binary files /dev/null and b/Docs/default/6250/picture1.nlm differ diff --git a/Docs/default/6250/picture10.nlm b/Docs/default/6250/picture10.nlm new file mode 100644 index 0000000..b5fbd69 Binary files /dev/null and b/Docs/default/6250/picture10.nlm differ diff --git a/Docs/default/6250/picture2.nlm b/Docs/default/6250/picture2.nlm new file mode 100644 index 0000000..bdc680f Binary files /dev/null and b/Docs/default/6250/picture2.nlm differ diff --git a/Docs/default/6250/picture3.nlm b/Docs/default/6250/picture3.nlm new file mode 100644 index 0000000..85aee07 Binary files /dev/null and b/Docs/default/6250/picture3.nlm differ diff --git a/Docs/default/6250/picture4.nlm b/Docs/default/6250/picture4.nlm new file mode 100644 index 0000000..4284ac2 Binary files /dev/null and b/Docs/default/6250/picture4.nlm differ diff --git a/Docs/default/6250/picture5.nlm b/Docs/default/6250/picture5.nlm new file mode 100644 index 0000000..4db41a3 Binary files /dev/null and b/Docs/default/6250/picture5.nlm differ diff --git a/Docs/default/6250/picture6.nlm b/Docs/default/6250/picture6.nlm new file mode 100644 index 0000000..2f76e7c Binary files /dev/null and b/Docs/default/6250/picture6.nlm differ diff --git a/Docs/default/6250/picture7.nlm b/Docs/default/6250/picture7.nlm new file mode 100644 index 0000000..58e1797 Binary files /dev/null and b/Docs/default/6250/picture7.nlm differ diff --git a/Docs/default/6250/picture8.nlm b/Docs/default/6250/picture8.nlm new file mode 100644 index 0000000..2b79a73 Binary files /dev/null and b/Docs/default/6250/picture8.nlm differ diff --git a/Docs/default/6250/picture9.nlm b/Docs/default/6250/picture9.nlm new file mode 100644 index 0000000..6ef7bcf Binary files /dev/null and b/Docs/default/6250/picture9.nlm differ diff --git a/Docs/default/sounds/readme b/Docs/default/sounds/readme new file mode 100644 index 0000000..dd59e7a --- /dev/null +++ b/Docs/default/sounds/readme @@ -0,0 +1,45 @@ +In subdirs there are original ringtones and SMS tones +from various Nokia phones. They're saved in special +binary format used in phone's firmware. You can download them to your phone, +if it has downloadable ringtone(s) - use +"gnokii --setbinringtone file [location]". I tested Nokia 6150 5.22 and it was +OK. I hope, that Nokia will not change this format and you will be able to +use it with new phones too (update: 3310 seems to have different format). + +I also noticed, that with Nokia 6150 some ringtones required small changes +(inserting space (0x20 char) after name displayed in phone's menu). +Maximal length of names for this phone is 12 chars (that's why "Moon & clouds" +is only "Moon & cloud", "Mexican Hat Dance" -> "Mexican Dance", +"Piano concerto" -> "Piano concer", "WalzeBrillant" -> "WalzeBrilla") + +I wasn't also to restore Badinerie, Tchaikovsky, +Entertainer, Valkyrie, Four seasons, Auld lang syne, Bumblebee, +Brave Scotland, Liszt, Hungarian, Left Hand +(I had it in the file - it was no problem to save +it), because it was too long (ringtones in phone's firmware in flash +can be infinitely long, downloadable not - frame can be 317 chars long +only)... I had to short name in "Swan Lake" to "Swan" because of it... + +In Get_Cool,Sunny_Walks,Tick tick ringtones there is and error - small +"pyk" on the end. It's not my fault, it was made by Nokia... + +Similiary Hopping-down seems to cut (next Nokia fault ?)... + +PS. I didn't compared many of these ringtones with original phones. +If there are differences, please let me know (my files could be broken too) + +PS2. I tried to understand this format, but I didn't make it at all (too small +free time, etc.). Here are some observations: + +Format is used by 0x40/0x9e and 0x40/0xa0 frames. General format is: + +0x00,0x01,0xa0(0x9e),location,0x00,0xc1,0x01,?,name,0x00,0x00,0x02, +commands and tones?each probably in two bytes?,0x0b + +where: location=0x00,0x01,etc. + name=name in ASCII displayed in menu + +If phone doesn't find 0xc1,0x01,? bytes in 7,8,9 byte, don't display ringtone +name and treat them (if there are next) as ringtone contenst + +Marcin-Wiacek@Topnet.PL \ No newline at end of file diff --git a/Docs/default/sounds/ring2.txt b/Docs/default/sounds/ring2.txt new file mode 100644 index 0000000..e91f6a6 --- /dev/null +++ b/Docs/default/sounds/ring2.txt @@ -0,0 +1,799 @@ +http://www.gsmcity.de/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=001084&counterhit=yes +03.09.2001 19:00 + + can i change the original ringtones on 5110? i've heard that + with datasuite u can change the ringtones. pls let me know + regards + -------------------- + ---I'M UNIQUE AND SO IS MY PHONE--- + -- sms,logos,soft,ringtones and many more free -- + + + Posts: 247 | From: Bucharest,Romania | Registered: May 2001 | + IP: + + azywerks + Newbie + + posted 09 June 2001 18:58 + + No. + You can add/change 1 ringtone (Received tone) for a 61XX phone + using Datasuite though. + + aCe + + + IP: + + mrENigma + Moderator + + Member # 4409 + Member Rated: + posted 09 June 2001 19:01 + + + TOO BAD!!!! + IS ANY WAY TO DO THIS? ON ANY NOKIA HANDY??? + -------------------- + ---I'M UNIQUE AND SO IS MY PHONE--- + -- sms,logos,soft,ringtones and many more free -- + + + Posts: 247 | From: Bucharest,Romania | Registered: May 2001 | + IP: + + azywerks + Newbie + + posted 09 June 2001 19:48 + + Except for the downloaded ringtones which is available to most + nokia phones(GSM) except 5110, no. + Maybe if you can understand the two byte(i guess, or was it + four) sequence for the tones notation in the PPM section and + have it manually changed to a tone of your desire then your + probably half way there. + The other half would then be spent on how to get your phone to + accept the new PPM package you've just made without causing + any problems like Contact Service, sim locks, and Network + Access. Heck, I can't even change just the simple "Insert" + from "Insert SIM Card" to tresnI without causing my phone to + display Contact Service. Must have some security data + elsewhere. + + Anyway, we'll keep on trying. + + aCe + + + IP: + + zizo + Freak Poster + + Member # 2631 + Member Rated: + posted 10 June 2001 00:32 + + Hi mrENigma! + U can not change a ringtone on your phone, U have only I think + 2 byte free memory there u can recive one ringtone on it. + Good luck! + -------------------- + /Z + + + Posts: 102 | From: Sweden | Registered: Nov 2000 | IP: + + mrENigma + Moderator + + Member # 4409 + Member Rated: + posted 10 June 2001 20:44 + + even if i erase some of them? 10 originals for one of mine + it's kind a stupid can't do this.... + -------------------- + ---I'M UNIQUE AND SO IS MY PHONE--- + -- sms,logos,soft,ringtones and many more free -- + + + Posts: 247 | From: Bucharest,Romania | Registered: May 2001 | + IP: + + Ice Dragon + Freak Poster + + Member # 3365 + Member Rated: + posted 14 June 2001 03:23 + + + quote: + + Originally posted by mrENigma: + even if i erase some of them? 10 originals for one of mine + it's kind a stupid can't do this.... + + + Well, I have a post of this a while (months) ago. + It's not possible to ADD TONES to the Nokia 5110 but it is + possible to CHANGE TONES on the Nokia 5110. + Well, changing RING TONES is a bit hard but changing ALERT + TONES is relatively easier to do. + Of course us all Nokia users can add ring tones to phone like + the 61xx, 6210, 3210, 33xx, etc. but I bet most of our alert + tones are all the same. + The beep, the standard (which is a dit-dit tone), the special + (which is a dit-dit-dit-dat-dat-dit-dit-dit, which is actually + a Morse code for "SMS"), and the ascending (which is actualy a + Morse code for "connecting people") are the same to all Nokia + phones unless there is one I don't know about. + Anyway, have any of you once experienced when on a crowd when + a SMS message came and most people around you have Nokia + phones (riding a bus for example or on a bar). + Some of us would check their phone if it was for them, like I + did. + So I changed my standard tone which is a dit-dit to dit-dat to + sound differently. And my special tone from + dit-dit-dit-dat-dat-dit-dit-dit to + dat-dit-dit-dit-dat-dit-dit-dit (which sounds like "Who let + the dogs out" with dit-dit-dit at the end). So when I myself + received a message, I know that it's for me coz I only have to + take note of the tone. + Too bad, Viper stopped his research with the NFREE project. I + have been inquiring about the checksums but he's no longer + responding. So I guess I have to do this on my own. + I'm coming up with a software to change the ringtone on the + 5110, just like I came up with the soft for changing the alert + tone on my 5110. Imagine, we have 30 changeable ringtones on + our Nokia, not just the 5110 but also with the 3210, 33xx, + 51xx, 61xx, 62xx, 7110, 82xx, 88xx, etc. + The info about this is not for free of course. Anyone + experimenting with his Nokia can come with a way to change the + fixed ringtones and alert tones on his phone. + BTW, the ringtones can be found on the PPM part of the phone. + Regards... + [ 15 June 2001 06:43: Message edited 1 time, lastly by Ice + Dragon ] + -------------------- + "Keyboard not found. Press F1 to continue." + ICQ#:97427188 + ------------------- + Send me private messages if any, no kinky stuff though. :-) + + + Posts: 171 | From: Bacolod, Philippines | Registered: Feb 2001 + | IP: + + azywerks + Newbie + + posted 14 June 2001 18:05 + + Yo Ice! Could you share with me the search values for the SMS + tones. Pleazzee. + BTW, have you tried changing the words in our PPM package (i.e + "Insert" in Insert SIM card to something else). I've tried + even simply reversing Insert to tresnI so as not to get any + checksum problems but still I get the CS. + Maybe their using a different method of calculation (CRC + perhaps) or they have a compare module elsewhere? + Just wondering, + aCe + + + IP: + + Leeloo + Major Poster + + Member # 2809 + Rate Member posted 16 June 2001 13:31 + + If the ringtones are saved in the ppm pack, and you get cs + when trying to change places of some letters in ppm.....what + happens in the phon when you download a new ringtone ? + does it recalculate the cs for ppm itself ? + I thought these ringtones where saved in a area without any cs + check. + /Leeloo + + + Posts: 46 | From: Sweden | Registered: Dec 2000 | IP: + + azywerks + Newbie + + posted 17 June 2001 20:27 + + The downloaded tones aren't stored in your PPM, they are + stored in your EEPROM. It is in the EEPROM where checksum + recalculation takes place. + The tones that are in the PPM are the static tones (i.e Ring + Ring, Mosquito). + The SMS alert tones on the other hand (according to ICE + DRAGON) are located at the MCU portion of your flash. + Hope this clears up the confusion. + Regards, + aCe + + + IP: + + Ice Dragon + Freak Poster + + Member # 3365 + Member Rated: + posted 03 July 2001 04:11 + + + quote: + + Originally posted by aZyWeRks: + Yo Ice! Could you share with me the search values for the + SMS tones. Pleazzee. + BTW, have you tried changing the words in our PPM package + (i.e "Insert" in Insert SIM card to something else). I've + tried even simply reversing Insert to tresnI so as not to + get any checksum problems but still I get the CS. + Maybe their using a different method of calculation (CRC + perhaps) or they have a compare module elsewhere? + Just wondering, + aCe + + + + Yo aCe! Here's the hex values particularly for the Special and + Ascending alerts tones. + Using flash from a 5110v5.30C: + For Special (morse code for "SMS"): + 5A0C,400C,5A0C,400C,0AFE,5A0C, + 4025,0A01,5A25,400C,5A25,4025, + 0AFE,5A0C,400C,5A0C,400C,5A0C + So it sounds like: + dit-dit-dit dat-dat dit-dit-dit + "5A0C" is a "dit" with a duration of 0C + "5A25" is a "dat" with a duration of 25 + "400C" is a pause with a duration of 0C + "4025" is a pause with a duration of 25 + "0AFE" is.... I don't know what this means, let me know + For Ascending (morse code for "connecting people"): + 5A25,400C,5A0C,0AFE,400C,5A25,400C,5A0C,4025,0A01, + 5A25,400C,5A25,0AFE,400C,5A25,4025, + 5A25,400C,5A0C,4025, + 5A25,400C,5A0C,4025, + 5A0C,4025, + 5A25,400C,5A0C,400C,5A25,400C,5A0C,4025, + 5A25,4025, + 5A0C,400C,5A0C,4025, + 5A25,400C,5A0C,4025, + 5A25,400C,5A25,400C,5A0C,4064 + 5A0C,400C,5A25,400C,5A25,400C,5A0C,4025 + 5A0C,4025 + 5A25,400C,5A25,400C,5A25,4025 + 5A0C,400C,5A25,400C,5A25,400C,5A0C,4025 + 5A0C,400C,5A25,400C,5A0C,400C,5A0C,4025 + 5A0C,4025 + So it sounds like: + dat-dit-dat-dit dat-dat-dat dat-dit dat-dit dit + dat-dit-dat-dit dat dit-dit dat-dit dat-dat-dit + dit-dat-dat-dit dit dat-dat-dat dit-dat-dat-dit + dit-dat-dit-dit dit + Again: + "5A0C" is a "dit" with a duration of 0C + "5A25" is a "dat" with a duration of 25 + "400C" is a pause with a duration of 0C + "4025" is a pause with a duration of 25 + "4064" is a pause with a duration of 64 (long pause) + "0A01" and "0AFE" are.... I don't know what these means, let + me know + Correct me if I'm wrong, I think "0A01" and "0AEF" is a system + pause to let the user interrupt the beeping. for sure, it's + not a checksum. + On other phone models: + Read a full flash from any model of Nokia phone (from 3210, + 33xx, 51xx, 61xx, 62xx, 7110, 82xx, 88xx) and use these search + strings on a hex editor (I use HexWorks): + For alert tones: 8005020A01 + Following hex values after these hex are actual alert tones + For ringtones: 0905020A01 or 0A05020A01 + Hex values following after these hex are not necessarily ring + tones but you can see the names of the ring tones and + following them are their ringtone values. Just see for + yourself what I mean. + Can I ask one-thing? If any of you find these info + interesting, please rate me + Thanks and best regards... + P.S. Oh, about changing the "Insert" to "tresnI" in PPM won't + work. + You see, checksum calculation in PPM is not done by + byte-addition (byte added to another byte) but by + word-addition (two bytes added to the next two bytes). + Let's take "Insert" as an example: + Letter - Hex value - Decimal + I 49 73 + n 6E 110 + s 73 115 + e 65 101 + r 72 114 + t 74 116 + In a byte-to-byte addition, the resulting checksum should be: + hex 275, decimal 629 + And it would be equal to the checksum of "tresnI" + But in a word-to-word addition, checksum is computed in + byte-pairs, therefore taking "In" as one word or hex + equivalent to 496E, decimal 18798 + So if we are to add them in words: + Letters - Hex values - Decimal + In 496E 18798 + se 7365 29541 + rt 7274 29300 + The checksum should be: hex 2F47 or decimal 12103. + Now with "tresnI", the first two letter pair would be "tr" + with a hex equivalent to 7472, decimal 29810. + So if we are to add them in words: + Letters - Hex values - Decimal + tr 7472 29810 + es 6573 25971 + nI 6E49 28233 + The checksum should be: hex 482E or decimal 18478. + Therefore, changing "Insert" to "tresnI" would yield a + "Contact Service" error. + Again, I only ask one favor. If any of you find these info + interesting, please rate me + Cheers... + [ 03 July 2001 04:43: Message edited 1 time, lastly by Ice + Dragon ] + -------------------- + "Keyboard not found. Press F1 to continue." + ICQ#:97427188 + ------------------- + Send me private messages if any, no kinky stuff though. :-) + + + Posts: 171 | From: Bacolod, Philippines | Registered: Feb 2001 + | IP: + + mrENigma + Moderator + + Member # 4409 + Member Rated: + posted 03 July 2001 08:06 + + i'm confuse a little bit, but i think that i learn something. + and when release software to do this pls let me know 'cause i + want to get ride off those stupid ringtones. + thx again and keep in touch. + -------------------- + ---I'M UNIQUE AND SO IS MY PHONE--- + -- sms,logos,soft,ringtones and many more free -- + + + Posts: 247 | From: Bucharest,Romania | Registered: May 2001 | + IP: + + qtboy + Major Poster + + Member # 3427 + Rate Member posted 03 July 2001 13:03 + + yo ice!!! + da bes ka gid migs bah! + pakopyahon mo na lang ko kung matapos na imo + program. hehehe + + + Posts: 46 | From: davao city, philippines | Registered: Feb + 2001 | IP: + + mrENigma + Moderator + + Member # 4409 + Member Rated: + posted 03 July 2001 13:53 + + yo qtboy......... english pls + -------------------- + ---I'M UNIQUE AND SO IS MY PHONE--- + -- sms,logos,soft,ringtones and many more free -- + + + Posts: 247 | From: Bucharest,Romania | Registered: May 2001 | + IP: + + brittnee + Insane Poster + + Member # 2085 + Rate Member posted 03 July 2001 16:06 + + nice job, i would just like to ask if i should have the same + number of dits and dats as to avoid contact service? + salamat + + Posts: 94 | Registered: Sep 2000 | IP: + + Ice Dragon + Freak Poster + + Member # 3365 + Member Rated: + posted 04 July 2001 04:17 + + + quote: + + Originally posted by brittnee: + nice job, i would just like to ask if i should have the same + number of dits and dats as to avoid contact service? + salamat + + + Not necessarily. + Let's take the Standard alert tone (Morse code for "M") as an + example (using the 5110v5.30C flash): + 5519, 400A, 5519, 400A + So it sounds like "dat-dat" + 5519 - is a "dat" with a duration of 19 + 400A - is a pause with a duration of 0C + We could change it to: + 550C, 400A, 5526, 400A + So it sounds like "dit-dat" + Take note that we subtracted hex 0D from the first 5519 and + added it to the second 5519 to compensate the values so we + wont have a contact service message. + Here's a more interesting one. Change the Standard alert tone + (5519,400A, 5519,400A) to something like this: + 5B19, 4005, 4F19, 400F + So it sounds like high-note-dat, low-note-dat + Or to something like: + 4C0C, 4005, 5E25, 400F + So it sounds like low-note-dit, high-note-dat + Notice that we subtracted duration values from the first pause + and add it to the next pause, and so with the first tone to + the second tone. + Sometimes I get an error when I subtract values from the pause + and add it to the tone. Or vice versa. It won't work. + So the following won't work in changing Special alert (morse + code for "SMS"): + 5A0C,400C,5A0C,400C,0AFE,5A0C,4025, + 0A01,5A25,400C,5A25,4025,0AFE, + 5A0C,400C,5A0C,400C,5A0C + That sounds like: + dit-dit-dit dat-dat dit-dit-dit + "5A0C" is a "dit" with a duration of 0C + "5A25" is a "dat" with a duration of 25 + "400C" is a pause with a duration of 0C + "4025" is a pause with a duration of 25 + "0AFE" is.... I don't know what this means, let me know + Into a variation of "Let's go": + 5A0C,4025,5A0C,4025,0AFE, + 5A0C,400C,0A01,5A0C,400C,5A0C,400C,0AFE,5A0C,4025, + 5A0C,4025,5A0C + That sounds like: + dit-dit dit-dit-dit-dit dit-dit + "5A0C" is a "dit" with a duration of 0C + "400C" is a pause with a duration of 0C + "4025" is a pause with a duration of 25 + "0AFE" is.... I don't know what this means, let me know + It wont work because we subtract values from pause and add it + to the tone. + So that's that. I'm still studying the behaviour for the + default ringtones. + Sure I can change some values without incurring a "Contact + Service" but the tones won't make any sense. + Anyway, I would know who reads this forum in my area when I + start hearing a different alert tone around here. + P.S. If you find some info here to be interesting, I only ask + one thing: please rate me + BR + -------------------- + "Keyboard not found. Press F1 to continue." + ICQ#:97427188 + ------------------- + Send me private messages if any, no kinky stuff though. :-) + + + Posts: 171 | From: Bacolod, Philippines | Registered: Feb 2001 + | IP: + + brittnee + Insane Poster + + Member # 2085 + Rate Member posted 04 July 2001 17:16 + + very nice indeed, i've change the alert tone of my 6210, still + looking for the standard tone, but i found the special tone + which is the one i change, thanks a lot!!!! + + Posts: 94 | Registered: Sep 2000 | IP: + + Ice Dragon + Freak Poster + + Member # 3365 + Member Rated: + posted 05 July 2001 03:50 + + + quote: + + Originally posted by brittnee: + very nice indeed, i've change the alert tone of my 6210, + still looking for the standard tone, but i found the special + tone which is the one i change, thanks a lot!!!! + + + + On a 6210: + As always, before tinkering with your phone flash, make a full + backup of your phone flash if you haven't yet. + Let's assume you don't have a full backup of your phone flash. + 1. Read the flash address 00200000 to 00600000. + 2. Copy the \flasher\flash.out to \nk_files\6210full.fls + 3. Use a hex editor (I suggest Hexworks), open the + \nk_files\6210full.fls and do the following to obtain a full + flash without the EEPROM: + WARNING: If you notice the file contains FF00,FF00 from + beginning to end, DO NOT PROCEED because this is a bad read + flash. + 3.1 Go to address 3FC000 (this is equivalent to flash address + 005FC000) + 3.2 Press Shift-Ctrl-Home. This will highlight the data from + offset 00000000 to 003FC000. Release the keys. + 3.3 Press Ctrl-C. This will copy the highlighted data to the + clipboard or memory. + 3.4 Press Ctrl-N. This will create an empty file. + 3.5 Press Ctrl-V. you will be asked "Are you sure you want to + insert?", select "Ok". + This will copy the previously highlighted data to the new + file. + 3.6 Save the file as "my6210.fls" + 4. Make a copy of the flash that contains the alert tones. + 4.1 Still using the hex editor, open the file "my6210.fls" + 4.2 Go to offset 350000. Press Shift-Ctrl-Home. This will + highlight the data from offset 00000000 to 003FC000. Release + the keys. + 4.3 Press Del. You will be asked "Are you sure you want to + delete?". Press "Ok". This will delete the data from 0 to + 350000. + 4.4 Go to offset 10000. Press Shift-Ctrl-End. This will + highlight the data from offset 10000 to the end of file. + 4.5 Press Del. You will be asked "Are you sure you want to + delete?". Press "Ok". This will leave you a 64k data from 0 to + 10000 (which is equivalent to flash address 00550000 to + 00560000). + 4.6 Save the file as \nk_files\6210al.fls + 5. Copy \nk_files\6210al.fls to \nk_files\alert.fls + 6. Open the \nk_files\alert.fls with a hex editor (I use + Hexworks). + 7. Use the search string "8005020A01". + First stop should be the Special alert tone. + You will notice that there's "SMSS.......S.p.e.c.i.a.l" before + it. + Pressing F3 will take you to the next found string. This is + the Standard alert. You will notice that there's + "SMS.......S.t.a.n.d.a.r.d" before it. + Again pressing F3 will take you to the next found string. This + is the Ascending alert. You will notice that there's + "SMSL.......L.o.n.g. .l.o.u.d" before it. + Don't forget when you flash it back, you should use alert.fls + as source and the address should be 00550000. + Assuming you have flashed it back to the correct address and + it shows a "Contact Service", you may have incorrectly + modified your alert tone. If this happens, proceed to number 5. + If you want to flash it back to its original alert tones, + flash it back with 6210al.fls at address 00550000. + But if it still has a Contact Service, flash it back with a + my6210.fls starting from address 00200000. This should restore + your original flash without the EEPROM part. + This procedure is a little bit for advanced flasher users. If + you don't know what you're doing, don't try it out. You have + yourself to blame if something pukes up. + Hmmm... I guess few people are interested in what I'm posting + here. Out of more than 100 readers since my first posting in + this thread, only 2 person rated me. + Oh well, all I'm asking is: rate me please + ----------------- + Misqouted qoutes: + "Don't judge the book without its cover" + "Birds flock together on the same feather" + "Don't cross the bridge when you get there" + "There's no water under the bridge" + -------------------- + "Keyboard not found. Press F1 to continue." + ICQ#:97427188 + ------------------- + Send me private messages if any, no kinky stuff though. :-) + + + Posts: 171 | From: Bacolod, Philippines | Registered: Feb 2001 + | IP: + + nuggie + Junior Member + + Member # 3304 + Member Rated: + posted 05 July 2001 13:34 + + I've tryed to do this like that : + 1.make a full backup 002 to 006 (6210) + 2.edit with hexworkshop and change the SMS alert + 3.try to correct checksums with NK1.2 to avoid Contact Service + 4.put flash back to phone + 5.works fine + Ice Dragon: does point 3 make any sense? + [ 05 July 2001 13:38: Message edited 3 times, lastly by nuggie ] + + + Posts: 27 | From: Westcoast, Poland | Registered: Feb 2001 | + IP: + + Ice Dragon + Freak Poster + + Member # 3365 + Member Rated: + posted 06 July 2001 03:07 + + + quote: + + Originally posted by nuggie: + I've tryed to do this like that : + 1.make a full backup 002 to 006 (6210) + 2.edit with hexworkshop and change the SMS alert + 3.try to correct checksums with NK1.2 to avoid Contact + Service + 4.put flash back to phone + 5.works fine + Ice Dragon: does point 3 make any sense? + + + + Not only "sense" (cents), but also dollars... heh..heh...heh... + I did that already but it always take a long wait to write the + whole modified flash back to the phone. + With a 5110v530C flash, I also tried cutting the first part of + the modified flash (flash address 00200000-00210000), write it + back to the phone, then cut the last part of the modified + flash (002F0000-00300000) back to the phone so it would take a + much lesser time. + The one I posted earlier is also to let our members reader + learn a little bit about the alert and ring tones in the + flash, and the possibility of changing them. Although I + believe that our members here know more than I do. + Cheers to you... and best regards to all + [ 06 July 2001 03:10: Message edited 1 time, lastly by Ice + Dragon ] + -------------------- + "Keyboard not found. Press F1 to continue." + ICQ#:97427188 + ------------------- + Send me private messages if any, no kinky stuff though. :-) + + + Posts: 171 | From: Bacolod, Philippines | Registered: Feb 2001 + | IP: + + aZyWeRks + Freak Poster + + Member # 3170 + Member Rated: + posted 06 July 2001 15:56 + + Man, thanks a lot for the values. I'll try it. + And about the word addition information. I'll try to make a + workaround on this if I have enough time. I've been off the + internet for a time. + Thanks a lot man. You're great. + + Regards, + aCe + -------------------- + http://getit.at/azywerks + + + Posts: 131 | From: I.C., R.P. | Registered: Jan 2001 | IP: + + koloksky + Freak Poster + + Member # 718 posted 07 July 2001 00:26 + + hi, + That is really cool!! thanks IceDragon! + u deserve a + regards + + + Posts: 156 | Registered: Nov 1999 | IP: + + nuggie + Junior Member + + Member # 3304 + Member Rated: + posted 14 July 2001 20:23 + + Ice Dragon: + Look here at the ringtone info. + web page + [ 14 July 2001 20:26: Message edited 2 times, lastly by nuggie + ] + + + Posts: 27 | From: Westcoast, Poland | Registered: Feb 2001 | + IP: + + Rayborg + Newbie + + Member # 5357 + Rate Member posted 19 July 2001 14:37 + + How does it works with a Nokia 3310? + I think there are other HexValues, but I´m not able to find + them! Please help me! + + Posts: 8 | From: Germany | Registered: Jul 2001 | IP: + + Ice Dragon + Freak Poster + + Member # 3365 + Member Rated: + posted 23 July 2001 03:32 + + + quote: + + Originally posted by Rayborg: + How does it works with a Nokia 3310? + I think there are other HexValues, but I´m not able to find + them! Please help me! + + + Still use the search string: "8005020A01". + First stop should be the Special alert tone. + You will notice that previously the tones have 5A0C, 400C, + 5A25, 400C values. With the 3310, it uses the 5B0C, 400C, + 5A25, 400c values. + "5B0C" is a "dit" with a duration of 0C + "5B25" is a "dat" with a duration of 25 + "400C" is a pause with a duration of 0C + "4025" is a pause with a duration of 25 + Pressing F3 will take you to the next found string. This is + the Standard alert. It uses the 5619, 400A, 5618, 400A values. + "5619" is a "dit" with a duration of 19 + "400A" is a pause with a duration of 0A + Again pressing F3 will take you to the next found string. This + is the Ascending alert. It uses the 5B0C, 400C, 5B25, 400C + values. + "5B0C" is a "dit" with a duration of 0C + "5B25" is a "dat" with a duration of 25 + "400C" is a pause with a duration of 0C + "4025" is a pause with a duration of 25 + The alert tones on the 3310 reside in the MCU part of the full + flash. + Best regards and cheers... + [ 23 July 2001 03:45: Message edited 1 time, lastly by Ice + Dragon ] + -------------------- + "Keyboard not found. Press F1 to continue." + ICQ#:97427188 + ------------------- + Send me private messages if any, no kinky stuff though. :-) + + diff --git a/Docs/default/sounds/ringtones/12_months b/Docs/default/sounds/ringtones/12_months new file mode 100644 index 0000000..32d49b3 Binary files /dev/null and b/Docs/default/sounds/ringtones/12_months differ diff --git a/Docs/default/sounds/ringtones/9th_Symphony b/Docs/default/sounds/ringtones/9th_Symphony new file mode 100644 index 0000000..5c15561 Binary files /dev/null and b/Docs/default/sounds/ringtones/9th_Symphony differ diff --git a/Docs/default/sounds/ringtones/Alamuhan b/Docs/default/sounds/ringtones/Alamuhan new file mode 100644 index 0000000..ae726d1 Binary files /dev/null and b/Docs/default/sounds/ringtones/Alamuhan differ diff --git a/Docs/default/sounds/ringtones/Attraction b/Docs/default/sounds/ringtones/Attraction new file mode 100644 index 0000000..87acb08 Binary files /dev/null and b/Docs/default/sounds/ringtones/Attraction differ diff --git a/Docs/default/sounds/ringtones/Auld_Lang_Syne b/Docs/default/sounds/ringtones/Auld_Lang_Syne new file mode 100644 index 0000000..617baaf Binary files /dev/null and b/Docs/default/sounds/ringtones/Auld_Lang_Syne differ diff --git a/Docs/default/sounds/ringtones/Bach_nr_3 b/Docs/default/sounds/ringtones/Bach_nr_3 new file mode 100644 index 0000000..7959b85 Binary files /dev/null and b/Docs/default/sounds/ringtones/Bach_nr_3 differ diff --git a/Docs/default/sounds/ringtones/Badinerie b/Docs/default/sounds/ringtones/Badinerie new file mode 100644 index 0000000..75f6dd6 Binary files /dev/null and b/Docs/default/sounds/ringtones/Badinerie differ diff --git a/Docs/default/sounds/ringtones/Barn_dance b/Docs/default/sounds/ringtones/Barn_dance new file mode 100644 index 0000000..5b5f46b Binary files /dev/null and b/Docs/default/sounds/ringtones/Barn_dance differ diff --git a/Docs/default/sounds/ringtones/Baroque b/Docs/default/sounds/ringtones/Baroque new file mode 100644 index 0000000..9d145a9 Binary files /dev/null and b/Docs/default/sounds/ringtones/Baroque differ diff --git a/Docs/default/sounds/ringtones/Basic_rock b/Docs/default/sounds/ringtones/Basic_rock new file mode 100644 index 0000000..bdf8e19 Binary files /dev/null and b/Docs/default/sounds/ringtones/Basic_rock differ diff --git a/Docs/default/sounds/ringtones/Bee b/Docs/default/sounds/ringtones/Bee new file mode 100644 index 0000000..1199357 Binary files /dev/null and b/Docs/default/sounds/ringtones/Bee differ diff --git a/Docs/default/sounds/ringtones/Bossanova b/Docs/default/sounds/ringtones/Bossanova new file mode 100644 index 0000000..89eda9f Binary files /dev/null and b/Docs/default/sounds/ringtones/Bossanova differ diff --git a/Docs/default/sounds/ringtones/Bounce b/Docs/default/sounds/ringtones/Bounce new file mode 100644 index 0000000..12f04be Binary files /dev/null and b/Docs/default/sounds/ringtones/Bounce differ diff --git a/Docs/default/sounds/ringtones/Brave_Scotland b/Docs/default/sounds/ringtones/Brave_Scotland new file mode 100644 index 0000000..a0d7506 Binary files /dev/null and b/Docs/default/sounds/ringtones/Brave_Scotland differ diff --git a/Docs/default/sounds/ringtones/Bumblebee b/Docs/default/sounds/ringtones/Bumblebee new file mode 100644 index 0000000..ba733a1 Binary files /dev/null and b/Docs/default/sounds/ringtones/Bumblebee differ diff --git a/Docs/default/sounds/ringtones/Canter b/Docs/default/sounds/ringtones/Canter new file mode 100644 index 0000000..5ac90bb Binary files /dev/null and b/Docs/default/sounds/ringtones/Canter differ diff --git a/Docs/default/sounds/ringtones/Carioca b/Docs/default/sounds/ringtones/Carioca new file mode 100644 index 0000000..30de51d Binary files /dev/null and b/Docs/default/sounds/ringtones/Carioca differ diff --git a/Docs/default/sounds/ringtones/Charleston b/Docs/default/sounds/ringtones/Charleston new file mode 100644 index 0000000..bfbd4a1 Binary files /dev/null and b/Docs/default/sounds/ringtones/Charleston differ diff --git a/Docs/default/sounds/ringtones/Chase b/Docs/default/sounds/ringtones/Chase new file mode 100644 index 0000000..39e47ea Binary files /dev/null and b/Docs/default/sounds/ringtones/Chase differ diff --git a/Docs/default/sounds/ringtones/Cicada b/Docs/default/sounds/ringtones/Cicada new file mode 100644 index 0000000..4c3b457 Binary files /dev/null and b/Docs/default/sounds/ringtones/Cicada differ diff --git a/Docs/default/sounds/ringtones/Circles b/Docs/default/sounds/ringtones/Circles new file mode 100644 index 0000000..6c3d165 Binary files /dev/null and b/Docs/default/sounds/ringtones/Circles differ diff --git a/Docs/default/sounds/ringtones/City_Slicker b/Docs/default/sounds/ringtones/City_Slicker new file mode 100644 index 0000000..3bc8ed8 Binary files /dev/null and b/Docs/default/sounds/ringtones/City_Slicker differ diff --git a/Docs/default/sounds/ringtones/City_bird b/Docs/default/sounds/ringtones/City_bird new file mode 100644 index 0000000..9869c95 Binary files /dev/null and b/Docs/default/sounds/ringtones/City_bird differ diff --git a/Docs/default/sounds/ringtones/Cladoceran b/Docs/default/sounds/ringtones/Cladoceran new file mode 100644 index 0000000..e767324 Binary files /dev/null and b/Docs/default/sounds/ringtones/Cladoceran differ diff --git a/Docs/default/sounds/ringtones/Classical b/Docs/default/sounds/ringtones/Classical new file mode 100644 index 0000000..8c399a6 Binary files /dev/null and b/Docs/default/sounds/ringtones/Classical differ diff --git a/Docs/default/sounds/ringtones/Croak b/Docs/default/sounds/ringtones/Croak new file mode 100644 index 0000000..3fae222 Binary files /dev/null and b/Docs/default/sounds/ringtones/Croak differ diff --git a/Docs/default/sounds/ringtones/Dawn b/Docs/default/sounds/ringtones/Dawn new file mode 100644 index 0000000..760b462 Binary files /dev/null and b/Docs/default/sounds/ringtones/Dawn differ diff --git a/Docs/default/sounds/ringtones/Dizzy b/Docs/default/sounds/ringtones/Dizzy new file mode 100644 index 0000000..5634e9d Binary files /dev/null and b/Docs/default/sounds/ringtones/Dizzy differ diff --git a/Docs/default/sounds/ringtones/Do-mi-so b/Docs/default/sounds/ringtones/Do-mi-so new file mode 100644 index 0000000..c3f2a29 Binary files /dev/null and b/Docs/default/sounds/ringtones/Do-mi-so differ diff --git a/Docs/default/sounds/ringtones/Electric_eel b/Docs/default/sounds/ringtones/Electric_eel new file mode 100644 index 0000000..59a0069 Binary files /dev/null and b/Docs/default/sounds/ringtones/Electric_eel differ diff --git a/Docs/default/sounds/ringtones/Elise b/Docs/default/sounds/ringtones/Elise new file mode 100644 index 0000000..b7061ec Binary files /dev/null and b/Docs/default/sounds/ringtones/Elise differ diff --git a/Docs/default/sounds/ringtones/Entertainer b/Docs/default/sounds/ringtones/Entertainer new file mode 100644 index 0000000..8a73fe4 Binary files /dev/null and b/Docs/default/sounds/ringtones/Entertainer differ diff --git a/Docs/default/sounds/ringtones/Etude b/Docs/default/sounds/ringtones/Etude new file mode 100644 index 0000000..fe6775d Binary files /dev/null and b/Docs/default/sounds/ringtones/Etude differ diff --git a/Docs/default/sounds/ringtones/Fly b/Docs/default/sounds/ringtones/Fly new file mode 100644 index 0000000..3f5987e Binary files /dev/null and b/Docs/default/sounds/ringtones/Fly differ diff --git a/Docs/default/sounds/ringtones/Fool about b/Docs/default/sounds/ringtones/Fool about new file mode 100644 index 0000000..4278722 Binary files /dev/null and b/Docs/default/sounds/ringtones/Fool about differ diff --git a/Docs/default/sounds/ringtones/Four_seasons b/Docs/default/sounds/ringtones/Four_seasons new file mode 100644 index 0000000..fff359c Binary files /dev/null and b/Docs/default/sounds/ringtones/Four_seasons differ diff --git a/Docs/default/sounds/ringtones/Frantic b/Docs/default/sounds/ringtones/Frantic new file mode 100644 index 0000000..1047a97 Binary files /dev/null and b/Docs/default/sounds/ringtones/Frantic differ diff --git a/Docs/default/sounds/ringtones/Frog b/Docs/default/sounds/ringtones/Frog new file mode 100644 index 0000000..9cf1784 Binary files /dev/null and b/Docs/default/sounds/ringtones/Frog differ diff --git a/Docs/default/sounds/ringtones/Fuga b/Docs/default/sounds/ringtones/Fuga new file mode 100644 index 0000000..5824c84 Binary files /dev/null and b/Docs/default/sounds/ringtones/Fuga differ diff --git a/Docs/default/sounds/ringtones/Funfair b/Docs/default/sounds/ringtones/Funfair new file mode 100644 index 0000000..ff1fcfe Binary files /dev/null and b/Docs/default/sounds/ringtones/Funfair differ diff --git a/Docs/default/sounds/ringtones/Fusion b/Docs/default/sounds/ringtones/Fusion new file mode 100644 index 0000000..d8795d1 Binary files /dev/null and b/Docs/default/sounds/ringtones/Fusion differ diff --git a/Docs/default/sounds/ringtones/Get_cool b/Docs/default/sounds/ringtones/Get_cool new file mode 100644 index 0000000..87c9c85 Binary files /dev/null and b/Docs/default/sounds/ringtones/Get_cool differ diff --git a/Docs/default/sounds/ringtones/Going_up b/Docs/default/sounds/ringtones/Going_up new file mode 100644 index 0000000..687f694 Binary files /dev/null and b/Docs/default/sounds/ringtones/Going_up differ diff --git a/Docs/default/sounds/ringtones/Grande_valse b/Docs/default/sounds/ringtones/Grande_valse new file mode 100644 index 0000000..d882865 Binary files /dev/null and b/Docs/default/sounds/ringtones/Grande_valse differ diff --git a/Docs/default/sounds/ringtones/Groovy_blue b/Docs/default/sounds/ringtones/Groovy_blue new file mode 100644 index 0000000..1828317 Binary files /dev/null and b/Docs/default/sounds/ringtones/Groovy_blue differ diff --git a/Docs/default/sounds/ringtones/Happy_return b/Docs/default/sounds/ringtones/Happy_return new file mode 100644 index 0000000..14ece84 Binary files /dev/null and b/Docs/default/sounds/ringtones/Happy_return differ diff --git a/Docs/default/sounds/ringtones/Helan b/Docs/default/sounds/ringtones/Helan new file mode 100644 index 0000000..5bce4d6 Binary files /dev/null and b/Docs/default/sounds/ringtones/Helan differ diff --git a/Docs/default/sounds/ringtones/HipHop b/Docs/default/sounds/ringtones/HipHop new file mode 100644 index 0000000..b0ea0b6 Binary files /dev/null and b/Docs/default/sounds/ringtones/HipHop differ diff --git a/Docs/default/sounds/ringtones/Hopping_down b/Docs/default/sounds/ringtones/Hopping_down new file mode 100644 index 0000000..f6d4bed Binary files /dev/null and b/Docs/default/sounds/ringtones/Hopping_down differ diff --git a/Docs/default/sounds/ringtones/Hummingbird b/Docs/default/sounds/ringtones/Hummingbird new file mode 100644 index 0000000..a35e6f5 Binary files /dev/null and b/Docs/default/sounds/ringtones/Hummingbird differ diff --git a/Docs/default/sounds/ringtones/Hunt b/Docs/default/sounds/ringtones/Hunt new file mode 100644 index 0000000..4f87ea0 Binary files /dev/null and b/Docs/default/sounds/ringtones/Hunt differ diff --git a/Docs/default/sounds/ringtones/Hurdy-gurdy b/Docs/default/sounds/ringtones/Hurdy-gurdy new file mode 100644 index 0000000..329175a Binary files /dev/null and b/Docs/default/sounds/ringtones/Hurdy-gurdy differ diff --git a/Docs/default/sounds/ringtones/Hurry_up b/Docs/default/sounds/ringtones/Hurry_up new file mode 100644 index 0000000..fa89fcd Binary files /dev/null and b/Docs/default/sounds/ringtones/Hurry_up differ diff --git a/Docs/default/sounds/ringtones/Improvisation b/Docs/default/sounds/ringtones/Improvisation new file mode 100644 index 0000000..8ed2373 Binary files /dev/null and b/Docs/default/sounds/ringtones/Improvisation differ diff --git a/Docs/default/sounds/ringtones/Indifference b/Docs/default/sounds/ringtones/Indifference new file mode 100644 index 0000000..a2ba420 Binary files /dev/null and b/Docs/default/sounds/ringtones/Indifference differ diff --git a/Docs/default/sounds/ringtones/Intro b/Docs/default/sounds/ringtones/Intro new file mode 100644 index 0000000..46a87ba Binary files /dev/null and b/Docs/default/sounds/ringtones/Intro differ diff --git a/Docs/default/sounds/ringtones/Jingle_bells b/Docs/default/sounds/ringtones/Jingle_bells new file mode 100644 index 0000000..140a9c9 Binary files /dev/null and b/Docs/default/sounds/ringtones/Jingle_bells differ diff --git a/Docs/default/sounds/ringtones/Jitters b/Docs/default/sounds/ringtones/Jitters new file mode 100644 index 0000000..5d53494 Binary files /dev/null and b/Docs/default/sounds/ringtones/Jitters differ diff --git a/Docs/default/sounds/ringtones/Jumping b/Docs/default/sounds/ringtones/Jumping new file mode 100644 index 0000000..3c3035d Binary files /dev/null and b/Docs/default/sounds/ringtones/Jumping differ diff --git a/Docs/default/sounds/ringtones/Kick b/Docs/default/sounds/ringtones/Kick new file mode 100644 index 0000000..67f208f Binary files /dev/null and b/Docs/default/sounds/ringtones/Kick differ diff --git a/Docs/default/sounds/ringtones/Knick-knack b/Docs/default/sounds/ringtones/Knick-knack new file mode 100644 index 0000000..a42ddc1 Binary files /dev/null and b/Docs/default/sounds/ringtones/Knick-knack differ diff --git a/Docs/default/sounds/ringtones/Knock_again b/Docs/default/sounds/ringtones/Knock_again new file mode 100644 index 0000000..3655b13 Binary files /dev/null and b/Docs/default/sounds/ringtones/Knock_again differ diff --git a/Docs/default/sounds/ringtones/Knock_knock b/Docs/default/sounds/ringtones/Knock_knock new file mode 100644 index 0000000..941602a Binary files /dev/null and b/Docs/default/sounds/ringtones/Knock_knock differ diff --git a/Docs/default/sounds/ringtones/Lamb b/Docs/default/sounds/ringtones/Lamb new file mode 100644 index 0000000..783af35 Binary files /dev/null and b/Docs/default/sounds/ringtones/Lamb differ diff --git a/Docs/default/sounds/ringtones/Languor b/Docs/default/sounds/ringtones/Languor new file mode 100644 index 0000000..554d129 Binary files /dev/null and b/Docs/default/sounds/ringtones/Languor differ diff --git a/Docs/default/sounds/ringtones/Left_hand b/Docs/default/sounds/ringtones/Left_hand new file mode 100644 index 0000000..1e4aea1 Binary files /dev/null and b/Docs/default/sounds/ringtones/Left_hand differ diff --git a/Docs/default/sounds/ringtones/Liszt b/Docs/default/sounds/ringtones/Liszt new file mode 100644 index 0000000..c0848a1 Binary files /dev/null and b/Docs/default/sounds/ringtones/Liszt differ diff --git a/Docs/default/sounds/ringtones/Low b/Docs/default/sounds/ringtones/Low new file mode 100644 index 0000000..f18eb25 Binary files /dev/null and b/Docs/default/sounds/ringtones/Low differ diff --git a/Docs/default/sounds/ringtones/Mangrove b/Docs/default/sounds/ringtones/Mangrove new file mode 100644 index 0000000..7ff92bf Binary files /dev/null and b/Docs/default/sounds/ringtones/Mangrove differ diff --git a/Docs/default/sounds/ringtones/Marry b/Docs/default/sounds/ringtones/Marry new file mode 100644 index 0000000..8276fda Binary files /dev/null and b/Docs/default/sounds/ringtones/Marry differ diff --git a/Docs/default/sounds/ringtones/Matilda b/Docs/default/sounds/ringtones/Matilda new file mode 100644 index 0000000..64820f7 Binary files /dev/null and b/Docs/default/sounds/ringtones/Matilda differ diff --git a/Docs/default/sounds/ringtones/Menuet b/Docs/default/sounds/ringtones/Menuet new file mode 100644 index 0000000..11dc800 Binary files /dev/null and b/Docs/default/sounds/ringtones/Menuet differ diff --git a/Docs/default/sounds/ringtones/Merry_Xmas b/Docs/default/sounds/ringtones/Merry_Xmas new file mode 100644 index 0000000..d90d05b Binary files /dev/null and b/Docs/default/sounds/ringtones/Merry_Xmas differ diff --git a/Docs/default/sounds/ringtones/Mexican_Hat_Dance b/Docs/default/sounds/ringtones/Mexican_Hat_Dance new file mode 100644 index 0000000..3bb9482 Binary files /dev/null and b/Docs/default/sounds/ringtones/Mexican_Hat_Dance differ diff --git a/Docs/default/sounds/ringtones/Moon & clouds b/Docs/default/sounds/ringtones/Moon & clouds new file mode 100644 index 0000000..205ac91 Binary files /dev/null and b/Docs/default/sounds/ringtones/Moon & clouds differ diff --git a/Docs/default/sounds/ringtones/Morning b/Docs/default/sounds/ringtones/Morning new file mode 100644 index 0000000..c2bc12f Binary files /dev/null and b/Docs/default/sounds/ringtones/Morning differ diff --git a/Docs/default/sounds/ringtones/Mosquito b/Docs/default/sounds/ringtones/Mosquito new file mode 100644 index 0000000..deb3678 Binary files /dev/null and b/Docs/default/sounds/ringtones/Mosquito differ diff --git a/Docs/default/sounds/ringtones/Mozart40 b/Docs/default/sounds/ringtones/Mozart40 new file mode 100644 index 0000000..2547f35 Binary files /dev/null and b/Docs/default/sounds/ringtones/Mozart40 differ diff --git a/Docs/default/sounds/ringtones/Nokia_tune b/Docs/default/sounds/ringtones/Nokia_tune new file mode 100644 index 0000000..7291c69 Binary files /dev/null and b/Docs/default/sounds/ringtones/Nokia_tune differ diff --git a/Docs/default/sounds/ringtones/Ode_to_Joy b/Docs/default/sounds/ringtones/Ode_to_Joy new file mode 100644 index 0000000..0376b05 Binary files /dev/null and b/Docs/default/sounds/ringtones/Ode_to_Joy differ diff --git a/Docs/default/sounds/ringtones/Orient b/Docs/default/sounds/ringtones/Orient new file mode 100644 index 0000000..1e4f1c4 Binary files /dev/null and b/Docs/default/sounds/ringtones/Orient differ diff --git a/Docs/default/sounds/ringtones/Persuasion b/Docs/default/sounds/ringtones/Persuasion new file mode 100644 index 0000000..f6d5aac Binary files /dev/null and b/Docs/default/sounds/ringtones/Persuasion differ diff --git a/Docs/default/sounds/ringtones/Piano_concerto b/Docs/default/sounds/ringtones/Piano_concerto new file mode 100644 index 0000000..826bfa6 Binary files /dev/null and b/Docs/default/sounds/ringtones/Piano_concerto differ diff --git a/Docs/default/sounds/ringtones/Playground b/Docs/default/sounds/ringtones/Playground new file mode 100644 index 0000000..55660c4 Binary files /dev/null and b/Docs/default/sounds/ringtones/Playground differ diff --git a/Docs/default/sounds/ringtones/Polite b/Docs/default/sounds/ringtones/Polite new file mode 100644 index 0000000..a4fa533 Binary files /dev/null and b/Docs/default/sounds/ringtones/Polite differ diff --git a/Docs/default/sounds/ringtones/Polka b/Docs/default/sounds/ringtones/Polka new file mode 100644 index 0000000..1db9c2a Binary files /dev/null and b/Docs/default/sounds/ringtones/Polka differ diff --git a/Docs/default/sounds/ringtones/Polska b/Docs/default/sounds/ringtones/Polska new file mode 100644 index 0000000..f7ae44d Binary files /dev/null and b/Docs/default/sounds/ringtones/Polska differ diff --git a/Docs/default/sounds/ringtones/Private_eye b/Docs/default/sounds/ringtones/Private_eye new file mode 100644 index 0000000..be3043c Binary files /dev/null and b/Docs/default/sounds/ringtones/Private_eye differ diff --git a/Docs/default/sounds/ringtones/Progress b/Docs/default/sounds/ringtones/Progress new file mode 100644 index 0000000..bb14b8d Binary files /dev/null and b/Docs/default/sounds/ringtones/Progress differ diff --git a/Docs/default/sounds/ringtones/Reveille b/Docs/default/sounds/ringtones/Reveille new file mode 100644 index 0000000..5dc251c Binary files /dev/null and b/Docs/default/sounds/ringtones/Reveille differ diff --git a/Docs/default/sounds/ringtones/Right_Hand b/Docs/default/sounds/ringtones/Right_Hand new file mode 100644 index 0000000..8bfcd75 Binary files /dev/null and b/Docs/default/sounds/ringtones/Right_Hand differ diff --git a/Docs/default/sounds/ringtones/Ring_ring b/Docs/default/sounds/ringtones/Ring_ring new file mode 100644 index 0000000..f6384ad Binary files /dev/null and b/Docs/default/sounds/ringtones/Ring_ring differ diff --git a/Docs/default/sounds/ringtones/Robo_N1X b/Docs/default/sounds/ringtones/Robo_N1X new file mode 100644 index 0000000..c3fbec7 Binary files /dev/null and b/Docs/default/sounds/ringtones/Robo_N1X differ diff --git a/Docs/default/sounds/ringtones/Rocket b/Docs/default/sounds/ringtones/Rocket new file mode 100644 index 0000000..c276b52 Binary files /dev/null and b/Docs/default/sounds/ringtones/Rocket differ diff --git a/Docs/default/sounds/ringtones/Running_horse b/Docs/default/sounds/ringtones/Running_horse new file mode 100644 index 0000000..bc04acf Binary files /dev/null and b/Docs/default/sounds/ringtones/Running_horse differ diff --git a/Docs/default/sounds/ringtones/Salsa b/Docs/default/sounds/ringtones/Salsa new file mode 100644 index 0000000..0ff5015 Binary files /dev/null and b/Docs/default/sounds/ringtones/Salsa differ diff --git a/Docs/default/sounds/ringtones/Samba b/Docs/default/sounds/ringtones/Samba new file mode 100644 index 0000000..26caf11 Binary files /dev/null and b/Docs/default/sounds/ringtones/Samba differ diff --git a/Docs/default/sounds/ringtones/Samba_rumble b/Docs/default/sounds/ringtones/Samba_rumble new file mode 100644 index 0000000..7c04599 Binary files /dev/null and b/Docs/default/sounds/ringtones/Samba_rumble differ diff --git a/Docs/default/sounds/ringtones/Sare b/Docs/default/sounds/ringtones/Sare new file mode 100644 index 0000000..4439a31 Binary files /dev/null and b/Docs/default/sounds/ringtones/Sare differ diff --git a/Docs/default/sounds/ringtones/Scifi b/Docs/default/sounds/ringtones/Scifi new file mode 100644 index 0000000..473e160 Binary files /dev/null and b/Docs/default/sounds/ringtones/Scifi differ diff --git a/Docs/default/sounds/ringtones/Side_step b/Docs/default/sounds/ringtones/Side_step new file mode 100644 index 0000000..bb14383 Binary files /dev/null and b/Docs/default/sounds/ringtones/Side_step differ diff --git a/Docs/default/sounds/ringtones/Siren b/Docs/default/sounds/ringtones/Siren new file mode 100644 index 0000000..668536e Binary files /dev/null and b/Docs/default/sounds/ringtones/Siren differ diff --git a/Docs/default/sounds/ringtones/Songette b/Docs/default/sounds/ringtones/Songette new file mode 100644 index 0000000..1dfca10 Binary files /dev/null and b/Docs/default/sounds/ringtones/Songette differ diff --git a/Docs/default/sounds/ringtones/Speedy b/Docs/default/sounds/ringtones/Speedy new file mode 100644 index 0000000..0743a0d Binary files /dev/null and b/Docs/default/sounds/ringtones/Speedy differ diff --git a/Docs/default/sounds/ringtones/Sunny_walks b/Docs/default/sounds/ringtones/Sunny_walks new file mode 100644 index 0000000..bc5020b Binary files /dev/null and b/Docs/default/sounds/ringtones/Sunny_walks differ diff --git a/Docs/default/sounds/ringtones/Swan_Lake b/Docs/default/sounds/ringtones/Swan_Lake new file mode 100644 index 0000000..ce54f04 Binary files /dev/null and b/Docs/default/sounds/ringtones/Swan_Lake differ diff --git a/Docs/default/sounds/ringtones/Tango b/Docs/default/sounds/ringtones/Tango new file mode 100644 index 0000000..291a160 Binary files /dev/null and b/Docs/default/sounds/ringtones/Tango differ diff --git a/Docs/default/sounds/ringtones/Tangoed b/Docs/default/sounds/ringtones/Tangoed new file mode 100644 index 0000000..e40a762 Binary files /dev/null and b/Docs/default/sounds/ringtones/Tangoed differ diff --git a/Docs/default/sounds/ringtones/Tap dance b/Docs/default/sounds/ringtones/Tap dance new file mode 100644 index 0000000..b03ac5a Binary files /dev/null and b/Docs/default/sounds/ringtones/Tap dance differ diff --git a/Docs/default/sounds/ringtones/Tchaikovsky b/Docs/default/sounds/ringtones/Tchaikovsky new file mode 100644 index 0000000..2a85984 Binary files /dev/null and b/Docs/default/sounds/ringtones/Tchaikovsky differ diff --git a/Docs/default/sounds/ringtones/That_is_it b/Docs/default/sounds/ringtones/That_is_it new file mode 100644 index 0000000..dbd398f Binary files /dev/null and b/Docs/default/sounds/ringtones/That_is_it differ diff --git a/Docs/default/sounds/ringtones/The_Buffoon b/Docs/default/sounds/ringtones/The_Buffoon new file mode 100644 index 0000000..1d9b67c Binary files /dev/null and b/Docs/default/sounds/ringtones/The_Buffoon differ diff --git a/Docs/default/sounds/ringtones/Tick_tick b/Docs/default/sounds/ringtones/Tick_tick new file mode 100644 index 0000000..a27c005 Binary files /dev/null and b/Docs/default/sounds/ringtones/Tick_tick differ diff --git a/Docs/default/sounds/ringtones/Tingle b/Docs/default/sounds/ringtones/Tingle new file mode 100644 index 0000000..9d0c336 Binary files /dev/null and b/Docs/default/sounds/ringtones/Tingle differ diff --git a/Docs/default/sounds/ringtones/Toreador b/Docs/default/sounds/ringtones/Toreador new file mode 100644 index 0000000..ba2007a Binary files /dev/null and b/Docs/default/sounds/ringtones/Toreador differ diff --git a/Docs/default/sounds/ringtones/Toreador1 b/Docs/default/sounds/ringtones/Toreador1 new file mode 100644 index 0000000..03088e5 Binary files /dev/null and b/Docs/default/sounds/ringtones/Toreador1 differ diff --git a/Docs/default/sounds/ringtones/Transylvania b/Docs/default/sounds/ringtones/Transylvania new file mode 100644 index 0000000..4e3e49f Binary files /dev/null and b/Docs/default/sounds/ringtones/Transylvania differ diff --git a/Docs/default/sounds/ringtones/Treadmill b/Docs/default/sounds/ringtones/Treadmill new file mode 100644 index 0000000..61d520c Binary files /dev/null and b/Docs/default/sounds/ringtones/Treadmill differ diff --git a/Docs/default/sounds/ringtones/Trio b/Docs/default/sounds/ringtones/Trio new file mode 100644 index 0000000..b713fe3 Binary files /dev/null and b/Docs/default/sounds/ringtones/Trio differ diff --git a/Docs/default/sounds/ringtones/Tripod b/Docs/default/sounds/ringtones/Tripod new file mode 100644 index 0000000..ffa2340 Binary files /dev/null and b/Docs/default/sounds/ringtones/Tripod differ diff --git a/Docs/default/sounds/ringtones/Tweet b/Docs/default/sounds/ringtones/Tweet new file mode 100644 index 0000000..2bf9291 Binary files /dev/null and b/Docs/default/sounds/ringtones/Tweet differ diff --git a/Docs/default/sounds/ringtones/Valkyrie b/Docs/default/sounds/ringtones/Valkyrie new file mode 100644 index 0000000..924d87a Binary files /dev/null and b/Docs/default/sounds/ringtones/Valkyrie differ diff --git a/Docs/default/sounds/ringtones/Walze_Brillant b/Docs/default/sounds/ringtones/Walze_Brillant new file mode 100644 index 0000000..fbd67bb Binary files /dev/null and b/Docs/default/sounds/ringtones/Walze_Brillant differ diff --git a/Docs/default/sounds/ringtones/William_Tell b/Docs/default/sounds/ringtones/William_Tell new file mode 100644 index 0000000..ae397b5 Binary files /dev/null and b/Docs/default/sounds/ringtones/William_Tell differ diff --git a/Docs/default/sounds/sms/SMS_Ancending b/Docs/default/sounds/sms/SMS_Ancending new file mode 100644 index 0000000..0832385 Binary files /dev/null and b/Docs/default/sounds/sms/SMS_Ancending differ diff --git a/Docs/default/sounds/sms/SMS_Beep_once b/Docs/default/sounds/sms/SMS_Beep_once new file mode 100644 index 0000000..7f51c27 Binary files /dev/null and b/Docs/default/sounds/sms/SMS_Beep_once differ diff --git a/Docs/default/sounds/sms/SMS_Special b/Docs/default/sounds/sms/SMS_Special new file mode 100644 index 0000000..37c3fdb Binary files /dev/null and b/Docs/default/sounds/sms/SMS_Special differ diff --git a/Docs/default/sounds/sms/SMS_Standard b/Docs/default/sounds/sms/SMS_Standard new file mode 100644 index 0000000..fa14589 Binary files /dev/null and b/Docs/default/sounds/sms/SMS_Standard differ diff --git a/Docs/developers/gnokii/CodingStyle b/Docs/developers/gnokii/CodingStyle new file mode 100644 index 0000000..e0915bd --- /dev/null +++ b/Docs/developers/gnokii/CodingStyle @@ -0,0 +1,235 @@ + + Linux kernel coding style + +This is a short document describing the preferred coding style for the +linux kernel. Coding style is very personal, and I won't _force_ my +views on anybody, but this is what goes for anything that I have to be +able to maintain, and I'd prefer it for most other things too. Please +at least consider the points made here. + +First off, I'd suggest printing out a copy of the GNU coding standards, +and NOT read it. Burn them, it's a great symbolic gesture. + +Anyway, here goes: + + + Chapter 1: Indentation + +Tabs are 8 characters, and thus indentations are also 8 characters. +There are heretic movements that try to make indentations 4 (or even 2!) +characters deep, and that is akin to trying to define the value of PI to +be 3. + +Rationale: The whole idea behind indentation is to clearly define where +a block of control starts and ends. Especially when you've been looking +at your screen for 20 straight hours, you'll find it a lot easier to see +how the indentation works if you have large indentations. + +Now, some people will claim that having 8-character indentations makes +the code move too far to the right, and makes it hard to read on a +80-character terminal screen. The answer to that is that if you need +more than 3 levels of indentation, you're screwed anyway, and should fix +your program. + +In short, 8-char indents make things easier to read, and have the added +benefit of warning you when you're nesting your functions too deep. +Heed that warning. + + + Chapter 2: Placing Braces + +The other issue that always comes up in C styling is the placement of +braces. Unlike the indent size, there are few technical reasons to +choose one placement strategy over the other, but the preferred way, as +shown to us by the prophets Kernighan and Ritchie, is to put the opening +brace last on the line, and put the closing brace first, thusly: + + if (x is true) { + we do y + } + +However, there is one special case, namely functions: they have the +opening brace at the beginning of the next line, thus: + + int function(int x) + { + body of function + } + +Heretic people all over the world have claimed that this inconsistency +is ... well ... inconsistent, but all right-thinking people know that +(a) K&R are _right_ and (b) K&R are right. Besides, functions are +special anyway (you can't nest them in C). + +Note that the closing brace is empty on a line of its own, _except_ in +the cases where it is followed by a continuation of the same statement, +ie a "while" in a do-statement or an "else" in an if-statement, like +this: + + do { + body of do-loop + } while (condition); + +and + + if (x == y) { + .. + } else if (x > y) { + ... + } else { + .... + } + +Rationale: K&R. + +Also, note that this brace-placement also minimizes the number of empty +(or almost empty) lines, without any loss of readability. Thus, as the +supply of new-lines on your screen is not a renewable resource (think +25-line terminal screens here), you have more empty lines to put +comments on. + + + Chapter 3: Naming + +C is a Spartan language, and so should your naming be. Unlike Modula-2 +and Pascal programmers, C programmers do not use cute names like +ThisVariableIsATemporaryCounter. A C programmer would call that +variable "tmp", which is much easier to write, and not the least more +difficult to understand. + +HOWEVER, while mixed-case names are frowned upon, descriptive names for +global variables are a must. To call a global function "foo" is a +shooting offense. + +GLOBAL variables (to be used only if you _really_ need them) need to +have descriptive names, as do global functions. If you have a function +that counts the number of active users, you should call that +"count_active_users()" or similar, you should _not_ call it "cntusr()". + +Encoding the type of a function into the name (so-called Hungarian +notation) is brain damaged - the compiler knows the types anyway and can +check those, and it only confuses the programmer. No wonder MicroSoft +makes buggy programs. + +LOCAL variable names should be short, and to the point. If you have +some random integer loop counter, it should probably be called "i". +Calling it "loop_counter" is non-productive, if there is no chance of it +being mis-understood. Similarly, "tmp" can be just about any type of +variable that is used to hold a temporary value. + +If you are afraid to mix up your local variable names, you have another +problem, which is called the function-growth-hormone-imbalance syndrome. +See next chapter. + + + Chapter 4: Functions + +Functions should be short and sweet, and do just one thing. They should +fit on one or two screenfuls of text (the ISO/ANSI screen size is 80x24, +as we all know), and do one thing and do that well. + +The maximum length of a function is inversely proportional to the +complexity and indentation level of that function. So, if you have a +conceptually simple function that is just one long (but simple) +case-statement, where you have to do lots of small things for a lot of +different cases, it's OK to have a longer function. + +However, if you have a complex function, and you suspect that a +less-than-gifted first-year high-school student might not even +understand what the function is all about, you should adhere to the +maximum limits all the more closely. Use helper functions with +descriptive names (you can ask the compiler to in-line them if you think +it's performance-critical, and it will probably do a better job of it +that you would have done). + +Another measure of the function is the number of local variables. They +shouldn't exceed 5-10, or you're doing something wrong. Re-think the +function, and split it into smaller pieces. A human brain can +generally easily keep track of about 7 different things, anything more +and it gets confused. You know you're brilliant, but maybe you'd like +to understand what you did 2 weeks from now. + + + Chapter 5: Commenting + +Comments are good, but there is also a danger of over-commenting. NEVER +try to explain HOW your code works in a comment: it's much better to +write the code so that the _working_ is obvious, and it's a waste of +time to explain badly written code. + +Generally, you want your comments to tell WHAT your code does, not HOW. +Also, try to avoid putting comments inside a function body: if the +function is so complex that you need to separately comment parts of it, +you should probably go back to chapter 4 for a while. You can make +small comments to note or warn about something particularly clever (or +ugly), but try to avoid excess. Instead, put the comments at the head +of the function, telling people what it does, and possibly WHY it does +it. + + + Chapter 6: You've made a mess of it + +That's OK, we all do. You've probably been told by your long-time Unix +user helper that "GNU emacs" automatically formats the C sources for +you, and you've noticed that yes, it does do that, but the defaults it +uses are less than desirable (in fact, they are worse than random +typing - a infinite number of monkeys typing into GNU emacs would never +make a good program). + +So, you can either get rid of GNU emacs, or change it to use saner +values. To do the latter, you can stick the following in your .emacs file: + +(defun linux-c-mode () + "C mode with adjusted defaults for use with the Linux kernel." + (interactive) + (c-mode) + (c-set-style "K&R") + (setq c-basic-offset 8)) + +This will define the M-x linux-c-mode command. When hacking on a +module, if you put the string -*- linux-c -*- somewhere on the first +two lines, this mode will be automatically invoked. Also, you may want +to add + +(setq auto-mode-alist (cons '("/usr/src/linux.*/.*\\.[ch]$" . linux-c-mode) + auto-mode-alist)) + +to your .emacs file if you want to have linux-c-mode switched on +automagically when you edit source files under /usr/src/linux. + +But even if you fail in getting emacs to do sane formatting, not +everything is lost: use "indent". + +Now, again, GNU indent has the same brain dead settings that GNU emacs +has, which is why you need to give it a few command line options. +However, that's not too bad, because even the makers of GNU indent +recognize the authority of K&R (the GNU people aren't evil, they are +just severely misguided in this matter), so you just give indent the +options "-kr -i8" (stands for "K&R, 8 character indents"). + +"indent" has a lot of options, and especially when it comes to comment +re-formatting you may want to take a look at the manual page. But +remember: "indent" is not a fix for bad programming. + + + Chapter 7: Configuration-files + +For configuration options (arch/xxx/config.in, and all the Config.in files), +somewhat different indentation is used. + +An indention level of 3 is used in the code, while the text in the config- +options should have an indention-level of 2 to indicate dependencies. The +latter only applies to bool/tristate options. For other options, just use +common sense. An example: + +if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + tristate 'Apply nitroglycerine inside the keyboard (DANGEROUS)' CONFIG_BOOM + if [ "$CONFIG_BOOM" != "n" ]; then + bool ' Output nice messages when you explode' CONFIG_CHEER + fi +fi + +Generally, CONFIG_EXPERIMENTAL should surround all options not considered +stable. All options that are known to trash data (experimental write- +support for file-systems, for instance) should be denoted (DANGEROUS), other +Experimental options should be denoted (EXPERIMENTAL). diff --git a/Docs/developers/gnokii/gettext-howto b/Docs/developers/gnokii/gettext-howto new file mode 100644 index 0000000..c24e67d --- /dev/null +++ b/Docs/developers/gnokii/gettext-howto @@ -0,0 +1,102 @@ +1. What do I need? + +- a reasonably recent version of GNU gettext (e.g. 0.10.35) + Check the version using e.g. msgfmt -V + +- autoconf + +- gnokii distribution :-) + +- if you have the variable LINGUAS in the environment + (most Red Hats have, no idea about other distributions), + unset it + + +2. How to make gnokii.pot file? + +gnokii.pot file is a collection of all localizable strings +in the gnokii package. It will be generated automagically +and is included in the standard distribution package. + +If you need to regenerate it, goto "po" directory, +remove gnokii.pot and say + + make gnokii.pot + + +3.1 How to start translating for a new language? + +First, you would like to contact the authors or write +to the mailing list - maybe there already is someone +working on this translation. + +If you get the OK from the maintainer, there are several +steps to do: + +- add the code of your language to the ALL_LINGUAS line + in the configure.in file + + Caution: the language code may differ from the country + code, e.g. czech language is cs, Czech Republic is cz + +- run autoconf to recreate configure script + +- reconfigure the package (./configure) + +- in the po directory, copy gnokii.pot to .po + +- start translating + + +3.2 How to merge existing translations with the updated gnokii.pot? + +This is simple. Rename the old file and use msgmerge to create +an updated one: + + mv cs.po cs.po.bak + msgmerge -o cs.po cs.po.bak gnokii.pot + + +4. How to generate a .mo file + +When you say make in the po directory, all existing +translations will be generated. The suffix will be .gmo. + +If you want to do this manually, use the msgfmt utility, e.g. + + msgfmt -o cs.mo -v cs.po + + +5. How to install the files + +Again, the makefile takes care of this. Simply use (as root) + + make install + +in the po directory. If you want to do this manually (and/or +for your language only), move the .mo file to +/usr/share/locale//LC_MESSAGES/gnokii.mo + + +I'm from Czech republic, so I did (well, I did not, but if you would +like to localize gnokii, you should :-): + + cd po + make gnokii.pot + cp gnokii.pot cs.po + + msgfmt -o cs.mo -v cs.po + make + make install + +And now: + +SnowWhite:/tmp/gnokii$ export LC_MESSAGES=cs_CZ +SnowWhite:/tmp/gnokii$ ./gnokii --version +GNOKII Version 0.3.1 Copyright (C) Hugh Blemings 1999. + Kompilace: 19:09:02 Mar 13 1999 pro model 6110 na portu /dev/ttyS0 +SnowWhite:/tmp/gnokii$ + +The second line is in czech language :-) There are some problems - for +example with "Mar" which is substitute by the C preprocessor. + diff --git a/Docs/developers/gnokii/gnokii.txt b/Docs/developers/gnokii/gnokii.txt new file mode 100644 index 0000000..f24e690 --- /dev/null +++ b/Docs/developers/gnokii/gnokii.txt @@ -0,0 +1,69 @@ +NOTE for command line gnokii: + +--netmonitordata + + we have used two data structure, defined in gnokii.h : + + PARAM_INFO_MON wich is a single linked recursive list of pointers, + each pointers contain the complete description of one netmonitor param. + + /////////////////////////////////////////////////////////////////////// + // start->next->next->next-> ...->next->NULL + // | | | | + // V V V V + // par0 par1 par2 parN + /////////////////////////////////////////////////////////////////////// + + OUT_INFO_MON, contains parameters as specified + from the command line and an array of data pointers requested by user, + each one point to a single PARAM_INFO_MON + for optimization reason, also we filled in one array of required screen. + + + this the block diagram of program: + + PARAM_INFO_MON *info: + OUT_INFO_MON *out: + + netmonitordata() + + check for -S option, assign filename + + check for -I option, assign filename + + autodetect_phonemodel_phone_version() This is TO DO + + info = get_min_param_info() // nedeed here, so later we can check args param + + // here we check command line arguments + if -I option + + for each line + do + parse_check(f_argc, f_argv, info, file, line) + done + else + parse_check(argc, argv, info, NULL, 0) + fi + + + // HERE, ALL IS CHECKED + + // here we make OUT_INFO_MON + if -I option + + for each line + do + out = parse_process(f_argc, f_argv, info, file, line) + + nmd_output(out) + + free(out) + done + else + out = parse_process(argc, argv, info, NULL, 0) + + nmd_output(out) + + free(out) + fi diff --git a/Docs/developers/gnokii/packaging-howto b/Docs/developers/gnokii/packaging-howto new file mode 100644 index 0000000..988ee92 --- /dev/null +++ b/Docs/developers/gnokii/packaging-howto @@ -0,0 +1,60 @@ + + Common information: + + For more install/compilation information see the INSTALL file. + + (!) Makefiles support make install prefix= + for package building. You can use it example in for .spec: + + ./configure --prefix=/usr + make install prefix=$RPM_BUILD_ROOT/usr + + (You not need create any dirs - all make make install.) + + For a installation procedure is used 'make install' or + 'make install prefix=', and all outputs from this routine must be + correct. Please, not make any correction in your package specific + build system (example use 'cp' in package routines - .spec - + it is job for Makefiles). Write more different routines for + instalation is good way to hell... + + 'make install' not install documentation, because for this use + any distribution itself routines. If you want install docs via + Makefile you must type 'make install-docs' + + Debian: + + 1/ Add new lines to Debian/changelog and set corect verion in this + file. + + 2/ Check files: rules, menu, docs + + 3/ Well, because gnokii's debian directory is in subdirectory + 'packaging' and it is total non-standard for Debian package + building system, you must firstly type in top directory: + + # ln -s packaging/Debian debian + + 3/ In source type: + + # debian/rules binary + # debian/rules clean + + 4/ Delete symlink + + # rm debian + + + + FreeBSD: + + + + RedHat: + + + + + + Win32: + \ No newline at end of file diff --git a/Docs/developers/gnokii/untitled.txt b/Docs/developers/gnokii/untitled.txt new file mode 100644 index 0000000..f06a8f6 --- /dev/null +++ b/Docs/developers/gnokii/untitled.txt @@ -0,0 +1,42 @@ +Subject: RE: Xgnokii in win32 ? +Date: Mon, 29 Nov 1999 08:45:31 +0100 +From: Acquadro Daniele +To: marcinw0@poczta.onet.pl +CC: gnokii + +Hi , +gtk for windows can be donloaded from www.gtk.org. On the left there's a +link to GTK+ on win32 (on the bottom of the page). + +To compile xGnokii, using VC ide, you have to create a new win32 CONSOLE +application (NOT a win32 application) and then add the libraries. +TO COMPILE you need those libraries +gdk-1.3.lib +gtk-1.3.lib +glib-1.3.lib + + bye + Daniele +> -----Original Message----- +> From: Marcin Wiacek [SMTP:marcinw0@poczta.onet.pl] +> Sent: domenica 28 novembre 1999 22.50 +> To: GNU Nokia mailing List +> Subject: Xgnokii in win32 ? +> +> +> Hi, +> +> I want to know only, where can I get GTK libraries for win32 (they're +> required for compiling xgnokii) from ? +> +> Or maybe somebody will write on the list/some WWW page, what to do to +> compile xgnokii in win32 (how to replace GTK libraries with win procedures +> - +> I think, it will be better) ? +> +> ...maybe I shouldn't ask for it, but it isn't written in gnokii source... +> +> Regards, +> +> Marcin +> diff --git a/Docs/developers/other/RE RE.txt b/Docs/developers/other/RE RE.txt new file mode 100644 index 0000000..aa25178 --- /dev/null +++ b/Docs/developers/other/RE RE.txt @@ -0,0 +1,66 @@ +Do: Markus Plail +Temat: RE: RE: + + +Hi, + +> Sorry for the confusion. I wrote the subject (getsms for 6210) in +> the CC field. +No problem :-) + +> So this is what I want to try, in linux btw. U wrote that u can +> give some information on that topic. +OK. Good. + +First of all, you HAVE to understand, how/where are created all phone functions. Look into n7110.c for N7110_Functions. This is our structure for each function - getting SMS, etc. You have pointers to each function sending request. + +Example: N6110_NetMonitor for netmonitor function. + +If each function (let's say N6110_NetMonitor) you send frame for phone: +----------------------------- + unsigned char req[] = { 0x00, 0x01, 0x7e, 0x00 }; + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + CurrentNetmonitor=Screen; + + req[3]=mode; + + return N6110_SendMessageSequence + (20, &CurrentNetmonitorError, 4, 0x40, req); +--------------------------- +In req you prepare it (see 6110.txt/7110.txt for frame for netmonitor and compare it with req). + +First (this is specific for netmonitor and some other) need to send something, we call EnableExtendedCommands - we must send special frame and wait for answer. And ONLY after it phone will answer with 0x40 frames. For SMS in 6210 it's not required. + +After it we set pointer to structure given by user (pointers are declared in gsm-api.c & gsm-api.h): CurrentNetmonitor=Screen; + +Prepare frame send to phone... + +And use N6110_SendMessageSequence -> first is, how long we can wait for phone answer (20), next: what variable is used to see, if phone answered (I will later describe more - variable created in gsm-api.c & gsm-api.h), how many bytes in req, frame type and req. + +That's all here. + +All answers are handled in N7110_DispatchMessage + +In example look for: + + fprintf(stdout, _("Message: Netmonitor menu %d received:\n"), MessageBuffer[3]); + +You copy formatted answer to structure pointed by CurrentNetmonitor (in example) and set CurrentNetmonitorError to GE_NONE (it makes, that N6110_SendMessageSequence returns: NO error). That's all. +-------------------- +If you understand, let's start: + +1.need to make new N7110_GetSMSFolders similiar to N6110_GetSMSFolders (send frame - it's described in 7110.txt: "Get folder names", wait for answer and return it) and set N7110_Functions to point on it (in line 127). + +After it we will be able to make "real" getsms... + +Any questions ? + +Pozdrowienia/Best Regards +-- +Marcin Wiacek -> mailto:marcinwiacek@topnet.pl http://marcin-wiacek.topnet.pl (http://www.fkn.pl/marcinw) -> netmonitor, firmware, mygnokii (GSM & Nokia) +http://www.mds.mdh.se/~cel95eig/mygnokii/ & http://grumble.zereau.com/gnokii/ & http://reinhold.bachrain.de/ -> mygnokii mirrors \ No newline at end of file diff --git a/Docs/developers/other/dmcp/addsms b/Docs/developers/other/dmcp/addsms new file mode 100644 index 0000000..bc4b0bf --- /dev/null +++ b/Docs/developers/other/dmcp/addsms @@ -0,0 +1,19 @@ +//SCKL1584 +BODY: +IA: +OPER ariel +Link up +N + +M SMS ++6421XXXXXX/+6421YYYYYY +6:LINKUP +-- +IA: +OPER ariel +Link down +N + +M SMS ++6421XXXXXX/+6421YYYYYY +8:LINKDOWN diff --git a/Docs/developers/other/dmcp/readme b/Docs/developers/other/dmcp/readme new file mode 100644 index 0000000..9d9aefe --- /dev/null +++ b/Docs/developers/other/dmcp/readme @@ -0,0 +1,148 @@ + +1.see Smart Messaging 2.0 for info, what the DMCP is + +2.I didn't have success in changing menus via cable (without sending SMS). + Here is example foogle funtion. You will see only "Nokia service update failed" +------------------------------------ +int foogle(char *argv[]) +{ + GSM_NetworkInfo NetworkInfo; + int i; + + char buffer[100]= { 0x0c, 0x01, + 0x06, /* User Data Header Length */ + 0x05, /* IEI: application port addressing scheme, 16 bit address */ + 0x04, /* IEDL (IED length ?) */ + 0x15, /* destination address: high byte */ + 0x84, /* destination address: low byte */ + 0x00, /* originator address: high byte */ + 0x00}; /* originator address: low byte */ + + int MSGLEN=9; + + /* Initialise the code for the GSM interface. */ + + fbusinit(NULL); + + buffer[MSGLEN++]='B'; + buffer[MSGLEN++]='O'; + buffer[MSGLEN++]='D'; + buffer[MSGLEN++]='Y'; + buffer[MSGLEN++]=':'; + buffer[MSGLEN++]=10; + buffer[MSGLEN++]='I'; + buffer[MSGLEN++]='A'; + buffer[MSGLEN++]=':'; + buffer[MSGLEN++]=10; + buffer[MSGLEN++]='O'; + buffer[MSGLEN++]='P'; + buffer[MSGLEN++]='E'; + buffer[MSGLEN++]='R'; + buffer[MSGLEN++]=' '; + buffer[MSGLEN++]='a'; + buffer[MSGLEN++]='l'; + buffer[MSGLEN++]=10; + buffer[MSGLEN++]='L'; + buffer[MSGLEN++]='i'; + buffer[MSGLEN++]='n'; + buffer[MSGLEN++]='k'; + buffer[MSGLEN++]=10; + buffer[MSGLEN++]='N'; + buffer[MSGLEN++]=10; + buffer[MSGLEN++]=10; + buffer[MSGLEN++]='M'; + buffer[MSGLEN++]=' '; + buffer[MSGLEN++]='S'; + buffer[MSGLEN++]='M'; + buffer[MSGLEN++]='S'; + buffer[MSGLEN++]=10; + buffer[MSGLEN++]='+'; + buffer[MSGLEN++]='4'; + buffer[MSGLEN++]='8'; + buffer[MSGLEN++]='6'; + buffer[MSGLEN++]='0'; + buffer[MSGLEN++]='2'; + buffer[MSGLEN++]='9'; + buffer[MSGLEN++]='5'; + buffer[MSGLEN++]='1'; + buffer[MSGLEN++]='1'; + buffer[MSGLEN++]='1'; + buffer[MSGLEN++]='1'; + buffer[MSGLEN++]='/'; + buffer[MSGLEN++]='+'; + buffer[MSGLEN++]='4'; + buffer[MSGLEN++]='8'; + buffer[MSGLEN++]='6'; + buffer[MSGLEN++]='0'; + buffer[MSGLEN++]='2'; + buffer[MSGLEN++]='9'; + buffer[MSGLEN++]='5'; + buffer[MSGLEN++]='1'; + buffer[MSGLEN++]='1'; + buffer[MSGLEN++]='1'; + buffer[MSGLEN++]='1'; + + for (i=0;iSendMessage(MSGLEN, 0x12, buffer); + GSM->GetNetworkInfo(&NetworkInfo); //need to make something + + + GSM->Terminate(); + + return 0; +} +----------------------------------- +3.to change via SMS - read parts of email sent by Martin Lucina [mato@kotelna.sk] +----------------------------------- + +1. First of all, use the OPER (Operator) services rather than the Nokia + services. There's probably no reason why you couldn't use either but + there may be extra hooks in the phone firmware regarding Nokia + services that I don't know about. + +2. Make sure that "Operator access number 1" and "Operator access number + 2" are set correctly in the services menu. The former should be set + to the SMS centre the messages you send are going to come from + (important, send yourself a test message and check it's details, some + operators set the sending SMSC number to one different from the one + you originally sent the message to). The latter should be the number + of the MS you are sending the SMS from. + +3. Don't send the messages as binary NBS messsages using the UDH. I + haven't been able to get this method to work and besides, the //SCK + compatibility header works just fine. + + Also, while I haven't seen this, it's possible that if you send a + message in binary format, the destination MS will reply in binary + format. This makes the reply useless if you are sending from another + NBS-aware phone, since the NBS router will most likely silently + discard it (or try to forward it to the phones TTML/DMCP server, + which won't help either). + + If you send the messages as text, the replies I've seen also come + back as text so you can retrieve them from the phone in the normal + fashion. + +One caveat I've noticed with sending NBS messages using the //SCK +compatibility header is that the NBS grammar in the Nokia SM spec +version 2 contradicts the grammar in the original Intel NBS spec. Nokia +says you can using either a newline or space as the delimiter after +"//SCK", it turns out that you _must_ use a space (as stated in the +Intel spec). Of course you can still stick a newline in afterwards. + +I have attached a test file that will add two menu items that send SMS +messages to your services menu. I send this to the phone using + +$ sendsms +6421XXXXXX < addsms + +[...] + +Cheers, + +-- +Martin Lucina http://www.kotelna.sk/mato/ Wellington, New Zealand +I've always been mad I know I've been mad like the most of us are +Pretty hard to explain why you're a madman even if you're not mad diff --git a/Docs/developers/other/dmcp/removesms b/Docs/developers/other/dmcp/removesms new file mode 100644 index 0000000..06a47ab --- /dev/null +++ b/Docs/developers/other/dmcp/removesms @@ -0,0 +1,5 @@ +//SCKL1584 +BODY: +IR: +OPER ariel +Link up diff --git a/Docs/developers/other/ringtones.txt b/Docs/developers/other/ringtones.txt new file mode 100644 index 0000000..c896658 --- /dev/null +++ b/Docs/developers/other/ringtones.txt @@ -0,0 +1,115 @@ +Subject: Ringtones +Date: Wed, 2 Feb 2000 13:32:47 -0000 +From: "Mike Bradley" +To: "GNU Nokia mailing List" + +Does anyone know anything about the ringtone IDs in the group info? It +seems that all the various handsets have different ID codes and different +sets of tones. Is there any order to all this? Here's what I've got: + +RINGTONEDESC +eNam +100 + + 0x10, "Preset", + 0x11, "Custom", + 0x12, "Ring ring", // + 0x13, "Low", // + 0x14, "Fly", + 0x15, "Mosquito", // + 0x16, "Bee", // + 0x17, "Intro", + 0x18, "Etude", + 0x19, "Hunt", + 0x1a, "Going up", + 0x1b, "City bird", // + 0x1e, "Chase", + 0x20, "Scifi", + 0x23, "Do-mi-so", // + 0x24, "Robo N1X", + 0x27, "Playground", + 0x2b, "That's It!", + 0x2f, "Grande valse", // + 0x30, "Helan", + 0x31, "Fuga", + 0x32, "Menuet", + 0x33, "Ode to Joy", + 0x34, "Elise", // + 0x35, "Mozart 40", // + 0x36, "Piano Concerto", // + 0x37, "William Tell", + 0x38, "Badinerie", // + 0x39, "Polka", + 0x3a, "Attraction", // + 0x3c, "Polite", + 0x3d, "Persuasion",// + 0x43, "Tick tick",// + 0x44, "Samba",// + 0x46, "Orient",// + 0x47, "Charleston",// + 0x49, "Jumping",// + + 0x00, "??" +}; + +// the following are also on the 8850 +//Trio +//Knock knock +//Cicada +//Kick +//Dawn +//Buffoon +//Barn dance +//Basic rock +//Groovy blue +//Frantic +//Baroque +//Entertainer +//Indifference +//Swan Lake +//Tchaikovsky +//Liszt +//Bounce + +RINGTONEDESC +eNam +100 + + 0xff, "Default", + 0x2c, "That's It!", + 0x2d, "Siren", + 0x2e, "Tripod", + 0x2f, "Ring ring", + 0x30, "Low", + 0x31, "Intro", + 0x32, "Bee", + 0x33, "Etude", + 0x34, "Polite", + 0x35, "Persuasion", + 0x36, "Attraction", + 0x37, "Bumblebee", + 0x38, "Menuet", + 0x39, "Grande valse", + 0x3a, "Ode to Joy", + 0x3b, "Mozart 40", + 0x3c, "Elise", + 0x3d, "William Tell", + 0x3e, "Charleston", + 0x3f, "Helan", + 0x40, "Left Hand", + 0x41, "Right Hand", + 0x42, "Happy Birthday", + 0x43, "Playground", + 0x44, "Fuga", + 0x45, "Chase", + 0x46, "Classical", + 0x47, "Hungarian", + 0x48, "Valkyrie", + 0x49, "Badinerie", + 0x4a, "Bach #3", + 0x4b, "Swan Lake", + 0x4c, "Tchaikovsky", + 0x4d, "Samba", + 0x4e, "Mosquito", + 0x00, "??" +}; diff --git a/Docs/developers/other/sniffs/Telefonbucheditor7110.txt b/Docs/developers/other/sniffs/Telefonbucheditor7110.txt new file mode 100644 index 0000000..2ca658c --- /dev/null +++ b/Docs/developers/other/sniffs/Telefonbucheditor7110.txt @@ -0,0 +1,19 @@ +Od: owner-gnokii@net.lut.ac.uk w imieniu Bernhard Mähr [Bernhard.Maehr@GMX.at] +Wysłano: 25 listopada 2000 17:06 +Do: gnokii@net.lut.ac.uk +Temat: Telefonbucheditor 7110 + +For everyone who trys to decode the 7110 FBUS protocol a tip: +If in the Windows-Registry HKEY_LOCAL_MACHINE\SOFTWARE\moosy.development\TBE7110 +the String Data is replaced with a Binary with the name Data the program shows a +error message at the begin but it also enables a option debug. This option +displays a second window showing the trace of the FBUS. So it should be easier +to decode the protocol. So it is possible to see the communiction while loading +the phone numbers, adresses,... and also syncronizing the calendar. + +I know it is a little bit unfair, don't tell me that. + +I hope this is useful for someone + +Bernhard Mähr + diff --git a/Docs/developers/other/sniffs/irda/info.txt b/Docs/developers/other/sniffs/irda/info.txt new file mode 100644 index 0000000..ca030f9 --- /dev/null +++ b/Docs/developers/other/sniffs/irda/info.txt @@ -0,0 +1,12 @@ +To irda sniffs use irda_intercept.tgz +(http://www.dev-thomynet.de/nokworld/noktrace/index.html or tools directory +- unpacked source is there) from Thomas Schneider + +how to use it: +you MUST stop irda support ('rcirda stop' fur SUSE) +to free the infrared tty port. +just type irda_intercept and you should see +irda packages of port /dv/ttyS1 (hardcoded in source). +The tool writes also to file 'out.trc'. +Use this file to decode: 'gnokii --decodefile out.trc' +(mygnokii have to be compiled with debug) diff --git a/Docs/developers/other/sniffs/irda/tools/fcs/fcs.c b/Docs/developers/other/sniffs/irda/tools/fcs/fcs.c new file mode 100644 index 0000000..60fc687 --- /dev/null +++ b/Docs/developers/other/sniffs/irda/tools/fcs/fcs.c @@ -0,0 +1,62 @@ +/********************************************************************* + * + * Filename: fcs.c + * Version: 0.1 + * Description: fcs calculation routines + * Status: Experimental. + * Author: Dag Brattli + * Created at: Mon Aug 4 20:40:53 1997 + * Modified at: Sat Jul 17 08:43:59 1999 + * Modified by: Thomas Schneider + * Sources: crc.h by Dag Brattli in + * linux-irda-project, + * ppp.c by Michael Callahan + * Al Longyear + * + ********************************************************************/ + +#include "fcs.h" + +__u16 irda_fcs16_table[256] = +{ + 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf, + 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7, + 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e, + 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876, + 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd, + 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5, + 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c, + 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974, + 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb, + 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3, + 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a, + 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72, + 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9, + 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1, + 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738, + 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70, + 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7, + 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff, + 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036, + 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e, + 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5, + 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd, + 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134, + 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c, + 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3, + 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb, + 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232, + 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a, + 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1, + 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9, + 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330, + 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78 +}; + +unsigned short fcs_calc( __u16 oldfcs, __u8 *buf, int len) { + __u16 fcs = oldfcs; + + while ( len--) + fcs = IR_FCS(fcs, *buf++); + return (fcs); +} diff --git a/Docs/developers/other/sniffs/irda/tools/fcs/fcs.h b/Docs/developers/other/sniffs/irda/tools/fcs/fcs.h new file mode 100644 index 0000000..721be89 --- /dev/null +++ b/Docs/developers/other/sniffs/irda/tools/fcs/fcs.h @@ -0,0 +1,30 @@ +/********************************************************************* + * + * Filename: fcs.h + * Version: + * Description: fcs routines for irda + * Status: Experimental. + * Author: Dag Brattli + * Created at: Mon Aug 4 20:40:53 1997 + * Modified at: Sat Jul 17 08:43:59 1999 + * Modified by: Thomas Schneider + * Sources: crc.h by Dag Brattli in + * linux-irda-project + * + ********************************************************************/ + +#ifndef FCS_H +#define FCS_H + +#include + +#define INIT_FCS 0xffff /* Initial FCS value */ +#define GOOD_FCS 0xf0b8 /* Good final FCS value */ + +#define IR_FCS(fcs, byte)((fcs >> 8)^irda_fcs16_table[ (fcs^byte) & 0xff]) + +unsigned short fcs_calc( __u16 oldfcs, __u8 *buf, int len); + +extern __u16 irda_fcs16_table[]; + +#endif diff --git a/Docs/developers/other/sniffs/irda/tools/include/irda.h b/Docs/developers/other/sniffs/irda/tools/include/irda.h new file mode 100644 index 0000000..59ec63b --- /dev/null +++ b/Docs/developers/other/sniffs/irda/tools/include/irda.h @@ -0,0 +1,183 @@ +/********************************************************************* + * + * Filename: irda.h + * Version: + * Description: irda-specific defines + * Status: Experimental. + * Author: Thomas Schneider + * Created at: + * Modified at: + * Modified by: Thomas Schneider + * + * Copyright (c) 1999 Thomas Schneider, All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * IN NO EVENT SHALL THOMAS SCHNEIDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THOMAS SCHNEIDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THOMAS SCHNEIDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER + * IS ON AN "AS IS" BASIS, AND THOMAS SCHNEIDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + * MODIFICATIONS. + * + * This material is provided "AS-IS" and at no charge. + * + ********************************************************************/ + +#ifndef __NOKTRACE_IRDA_H +#define __NOKTRACE_IRDA_H + +#include + + +/* + * service hints + * ------------- + * - first byte + */ +#define PNP_COMP 0x00 +#define PDA_PALM 0x01 +#define COMPUTER 0x02 +#define PRINTER 0x03 +#define MODEM 0x04 +#define FAX 0x05 +#define LAN 0x06 +#define EXTENS 0x07 + + +/* + * output-defines + * -------------- + */ +#define OUT_ALL 0x01 +#define OUT_IRLAP 0x02 +#define OUT_IRLMP 0x03 +#define OUT_HIGH_LEVEL 0x04 + +#define OUT_FORM_LINE 0x01 +#define OUT_FORM_STEP 0x02 + +#define OUT_SCREEN 0x01 +#define OUT_FILE 0x02 + +/* + * some types + */ +typedef unsigned char BYTE; +typedef unsigned char U8 ; +typedef unsigned short U16 ; +typedef unsigned int U32 ; + +/* + * some structs + */ +typedef struct +{ + U16 length; + U16 a_offset; + BYTE buf[4096]; +} RAW_FRAME; + +typedef struct +{ + U16 bof_length; + BYTE * bof; + BYTE a; + BYTE c; + U16 info_length; + BYTE * info; + U32 fcs; /* must be U32 because escaped fcs */ + BYTE eof_length; + BYTE * eof; + BYTE esc_nr; /* all ce's - include also esc_fcs */ + BYTE esc_fcs; /* nr of ce's in fcs */ + U16 computed_fcs; +} IRLAP_FRAME; + +typedef struct +{ + U16 bof_length; + BYTE * bof; + BYTE a; + BYTE c; + U16 info_length; + BYTE * info; + U32 fcs; /* must be U32 because escaped fcs */ + BYTE eof_length; + BYTE * eof; + BYTE esc_nr; /* all ce's - include also esc_fcs */ + BYTE esc_fcs; /* nr of ce's in fcs */ + U16 computed_fcs; +} IRLAP_RAW_FRAME; + +typedef struct +{ + U8 cmd; + U8 dlsap_sel; + U8 slsap_sel; + U16 info_length; + U8 * info; +} IRLMP_FRAME; + +typedef struct +{ + BYTE baud_rate_master; + BYTE baud_rate_client; + BYTE baut_rate_connection; + BYTE state; +} NEGOTATION_PARAM; + +typedef struct +{ + BYTE irlap_state; + BYTE irlmp_state; + U32 p_src_adr; /* primary - source address */ + U32 s_src_adr; /* secondary - source address */ + U8 conn_adr; /* connection address */ +} CONNECTION; + +typedef struct +{ + U32 prim_nr_bytes; /* bytes from primary station */ + U32 sec_nr_bytes ; /* bytes from secomdary station */ + U32 prim_fcs_errors; /* nr of fcs-errors from prim. */ + U32 sec_fcs_errors; /* nr of fcs-errors from sec. */ + U32 prim_frames; /* frames from primary */ + U32 sec_frames; /* frames from secondary */ + U32 prim_esc_nr; /* nr of ecsapes from primary */ + U32 sec_esc_nr; /* nr of escapes from secondary */ +} CONNECT_STATISTIC; + +typedef struct +{ + BYTE deep; /* deep of output (L2, L3, ... */ + BYTE form; /* kind of output (line, steps) */ + BYTE bit_output; /* if output as bits */ + BYTE dest; /* file, screen */ + FILE input_fd; /* input FILE */ + GString infile_name; /* name of input-file */ + FILE output_file; /* output FILE */ + GString outfile_name; /* name of input-file */ +} OUTPUT_PARAMS; + + +#endif /* __NOKTRACE_IRDA_H */ + diff --git a/Docs/developers/other/sniffs/irda/tools/include/irlap.h b/Docs/developers/other/sniffs/irda/tools/include/irlap.h new file mode 100644 index 0000000..bd4a11d --- /dev/null +++ b/Docs/developers/other/sniffs/irda/tools/include/irlap.h @@ -0,0 +1,242 @@ +/********************************************************************* + * + * Filename: irlap.h + * Version: + * Description: in this file you can only find define´s for parts + * of the irlap-layer. If you want read the typedef´s + * for struct´s look into irda.h + * Status: Experimental. + * Author: Thomas Schneider + * Created at: + * Modified at: + * Modified by: Thomas Schneider + * + * Copyright (c) 1999 Thomas Schneider, All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * IN NO EVENT SHALL THOMAS SCHNEIDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THOMAS SCHNEIDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THOMAS SCHNEIDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER + * IS ON AN "AS IS" BASIS, AND THOMAS SCHNEIDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + * MODIFICATIONS. + * + * This material is provided "AS-IS" and at no charge. + * + ********************************************************************/ +/* + * in this file you can only find define´s for parts + * of the irlap-layer. If you want read the typedef´s + * for struct´s look into irda.h + */ + +#ifndef __IRLAP_H +#define __IRLAP_H + +#include + + +#define IRDA_XBOF 0xFF +#define IRDA_BOF 0xC0 +#define IRDA_EOF 0xC1 + +/* + * IrLAP-OFFSETS + * ------------- + */ +#define IRLAP_A_OFF 0x00 +#define IRLAP_C_OFF 0x01 +#define IRLAP_I_OFF 0x02 + +/* + * IrLAP-DEFINES + * ------------- + */ +#define IRLAP_XBOF 0xFF +#define IRLAP_BOF 0xC0 +#define IRLAP_EOF 0xC1 +#define IRLAP_CE 0x7D +#define IRLAP_ESC IRLAP_CE + +#define IRLAP_ESC_MASK (~0xDF) + +#define IRLAP_A_LENGTH 1 +#define IRLAP_C_LENGTH 1 +#define IRLAP_FCS_LENGTH 2 +#define IRLAP_EOF_LENGTH 1 + +#define IRLAP_C_MASK 0x03 +#define IRLAP_U_FRAME 0x03 +#define IRLAP_S_FRAME 0x01 +#define IRLAP_PF_BIT_MASK (~0xEF) +#define IRLAP_PF_BIT_CLR_MASK (~0x10) +#define IRLAP_Nr_CLR_MASK 0x1F + +/* + * IRLAP U cmd/response + * -------------------- + * - all defines use a cleared P/F-Bit + * (irlap_frame -> c & IRLAP_PF_BIT_CLR_MASK) + * - page 26 in IrLAP-spec + * - if no _CMD or _RSP name is _CMD_RSP (e.g. 0x83) + */ +#define IRLAP_SNRM_RNRM 0x83 +#define IRLAP_DISC_RD 0x43 +#define IRLAP_UI_UI 0x03 +#define IRLAP_XID_CMD 0x2F +#define IRLAP_TEST_TEST 0xE3 +#define IRLAP_UA_RSP 0x63 +#define IRLAP_FRMR_RSP 0x87 +#define IRLAP_DM_RSP 0x0F +#define IRLAP_XID_RSP 0xAF + +/* + * IRLAP S cmd/response + * -------------------- + * - all defines use a cleared P/F-Bit and cleared Nr + * (irlap_frame -> c & IRLAP_PF_BIT_CLR_MASK & IRLAP_Nr_CLR_MASK) + * - page 32 in IrLAP-spec + * - for both (cmd and response) the same mask is defined + */ +#define IRLAP_RR 0x01 +#define IRLAP_RNR 0x05 +#define IRLAP_REJ 0x09 +#define IRLAP_SREJ 0x0D + + +/* + * irlap-connection-states + * ----------------------- + * - negotation defines are also conn-states + */ +#define IRLAP_DISC 0x00 /* disconnected */ +#define IRLAP_NDM 0x01 /* normaldisconnect mode */ +#define IRLAP_NRM 0x02 /* normal response mode */ + +/* + * negotation-defines + * ------------------ + */ +/* negotation-states */ +#define NEG_SNRM_OK 0x01 +#define NEG_WAIT_FOR_UA 0x02 +#define NEG_UA_OK 0x03 +#define NEG_COMPLETE 0x04 + +#define B576000 576000 +#define B1152000 1152000 + +#define IRLAP_SNRM_SRC_ADR 0x00 /* src in SNRM */ +#define IRLAP_SNRM_DEST_ADR 0x04 /* dest in SNRM */ +#define IRLAP_SNRM_CONN_ADR 0x08 /* connection-adr in SNRM */ +#define IRLAP_UA_SRC_ADR 0x00 /* src in UA */ +#define IRLAP_UA_DEST_ADR 0x04 /* dest in UA */ +#define IRLAP_NEG_SNRM_PARAM_OFF 0x09 /* src(U32) dest(U32) adr(8) */ +#define IRLAP_NEG_UA_PARAM_OFF 0x08 /* src(U32) dest(U32) */ +#define IRLAP_NEG_BPS_PI 0x01 /* IrLAP page 39 */ +#define IRLAP_PI_LENGTH 1 /* no more longer used */ +#define IRLAP_PL_LENGTH 1 /* no more longer used */ + +/* + * defines for decode xid-cmd + * -------------------------- + */ +#define XID_C_FI_OFFSET 0x00 /* offset for format identifier (U8) */ +#define XID_C_SRC_ADR_OFF 0x01 /* offset for source address (U32) */ +#define XID_C_DEST_ADR_OFF 0x05 /* offset for dest address (U32) */ +#define XID_C_DISC_F_OFF 0x09 /* offset for discovery flags (U8) */ +#define XID_C_SLOT_NR_OFF 0x0A /* offset for slot number (U8) */ +#define XID_C_VERSION_OFF 0x0B /* offset for version (U8) */ +#define XID_C_DISC_I_OFF 0x0C /* offset for discovery information */ +#define XID_C_FLAG_TRUE 0x01 /* flags in cmd only if FI == 0x01 */ +#define XID_C_F_SLOT_MASK 0x03 /* mask for slot numbers in di-flag */ +#define XID_C_F_NEW_ADR_M 0x04 /* mask for new device-address-gen. */ +#define XID_C_LAST_SLOT 0xFF /* nr. for last slot in xid-cmd */ +#define XID_C_DISC_I_M_L 0x20 /* max length of discovery info */ +#define XID_C_DI_S_H_OFF 0x0C /* 1. service hint offset in disc-inf */ +#define XID_C_DI_S_H_EX_M 0x07 /* serv.hint extent. mask in disc_inf */ + +/* + * defines for decode xid-rsp + * -------------------------- + */ +#define XID_R_FI_OFFSET 0x00 /* offset for format identifier (U8) */ +#define XID_R_SRC_ADR_OFF 0x01 /* offset for source address (U32) */ +#define XID_R_DEST_ADR_OFF 0x05 /* offset for dest address (U32) */ +#define XID_R_DISC_F_OFF 0x09 /* offset for discovery flags (U8) */ +#define XID_R_SLOT_NR_OFF 0x0A /* offset for slot number (U8) */ +#define XID_R_VERSION_OFF 0x0B /* offset for version (U8) */ +#define XID_R_DISC_I_OFF 0x0C /* offset for discovery information */ +#define XID_R_FLAG_TRUE 0x01 /* flags in rsp only if FI == 0x01 */ +#define XID_R_F_SLOT_MASK 0x03 /* mask for slot numbers in di-flag */ +#define XID_R_F_NEW_ADR_M 0x04 /* mask for new device-address-gen. */ +#define XID_R_LAST_SLOT 0xFF /* nr. for last slot in xid-cmd/rsp */ +#define XID_R_DISC_I_M_L 0x20 /* max length of discovery info */ +#define XID_R_DI_S_H_OFF 0x0C /* 1. service hint offset in disc-inf */ +#define XID_R_DI_S_H_EX_M 0x07 /* serv.hint extent. mask in disc_inf */ +#define XID_R_SNIFF_FRAME 0xFFFFFFFF /* dest address for sniffing */ + +/* + * defines for snrm-cmd + * -------------------- + */ +#define SNRM_CMD_RESET_LEN 0x00 /* no i-field is present */ +#define SNRM_EST_CONNECT_ADR 0xFF /* conn.adr. in case con.establish */ +#define SNRM_C_SRC_ADR_OFF 0x00 /* offset for source address (U32) */ +#define SNRM_C_DEST_ADR_OFF 0x04 /* offset for dest address (U32) */ +#define SNRM_C_N_C_ADR_OFF 0x08 /* new conn. adr. offset (U8) */ +#define SNRM_C_NEG_OFF 0x09 /* negotation-fields offset */ +#define SNRM_BPS_PI 0x01 /* bps-pi */ +#define SNRM_MAX_TAT_PI 0x82 /* max. turn around time pi */ +#define SNRM_DATA_SIZE_PI 0x83 /* data size pi */ +#define SNRM_WIN_SIZE_PI 0x84 /* window size pi */ +#define SNRM_ADD_BOF_PI 0x85 /* addition BOFs pi */ +#define SNRM_MIN_TAT_PI 0x86 /* min. turn around time pi */ +#define SNRM_LD_TT_PI 0x08 /* link disc./threshold time pi */ + +/* + * defines for ua-rsp-frame + * ------------------------ + */ +#define UA_CONNECT_MIN_LENGTH 0x0E /* 14 are min length to use the frame + * for response to snrm used to + * establish a connection - look at + * page 39 - negotation: type 0 params + * must be negotiated at both stations + * bps and link disc/threshold time - + * in this case also src and dest are + * used ( 4 + 4 + 3 + 3), page 31 */ +#define UA_WITH_SRC_DST_LEN 0x08 /* ua len with src and dest */ +#define UA_SRC_ADR_OFF 0x00 /* offset for source address (U32) */ +#define UA_DEST_ADR_OFF 0x04 /* offset for dest address (U32) */ +#define UA_NEG_OFF 0x08 /* negotation-fields offset */ +#define UA_BPS_PI 0x01 /* bps-pi */ +#define UA_MAX_TAT_PI 0x82 /* max. turn around time pi */ +#define UA_DATA_SIZE_PI 0x83 /* data size pi */ +#define UA_WIN_SIZE_PI 0x84 /* window size pi */ +#define UA_ADD_BOF_PI 0x85 /* addition BOFs pi */ +#define UA_MIN_TAT_PI 0x86 /* min. turn around time pi */ +#define UA_LD_TT_PI 0x08 /* link disc./threshold time pi */ + + +#endif /* __IRLAP_H */ + diff --git a/Docs/developers/other/sniffs/irda/tools/intercept/Makefile b/Docs/developers/other/sniffs/irda/tools/intercept/Makefile new file mode 100644 index 0000000..5737602 --- /dev/null +++ b/Docs/developers/other/sniffs/irda/tools/intercept/Makefile @@ -0,0 +1,72 @@ +# +#/********************************************************************* +# * +# * Filename: Makefile +# * Version: +# * Description: Makefile for irda_intercept +# * Status: Experimental. +# * Author: Thomas Schneider +# * Created at: Thomas Schneider +# * Modified at: Sun Jul 18 12:03:03 1999 +# * Modified by: Thomas Schneider +# * +# * Copyright (c) 1999 Thomas Schneider, All Rights Reserved. +# * +# * This program is free software; you can redistribute it and/or +# * modify it under the terms of the GNU General Public License as +# * published by the Free Software Foundation; either version 2 of +# * the License, or (at your option) any later version. +# * +# * This program is distributed in the hope that it will be useful, but +# * WITHOUT ANY WARRANTY; without even the implied warranty of +# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# * General Public License for more details. +# * +# * You should have received a copy of the GNU General Public License +# * along with this program; if not, write to the Free Software +# * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# * +# * IN NO EVENT SHALL THOMAS SCHNEIDER BE LIABLE TO ANY PARTY FOR +# * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES +# * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN +# * IF THOMAS SCHNEIDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +# * DAMAGE. +# * +# * THOMAS SCHNEIDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, +# * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +# * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER +# * IS ON AN "AS IS" BASIS, AND THOMAS SCHNEIDER HAS NO OBLIGATION TO +# * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR +# * MODIFICATIONS. +# * +# * This material is provided "AS-IS" and at no charge. +# * +# ********************************************************************/ + +# +# Serial port for communication +# + +MODEMDEVICE=-DMODEMDEVICE="\"/dev/ttyS1\"" + +COMMON=-Wall -O2 \ + ${MODEMDEVICE} + +all: irda_intercept + + +irda_intercept: irda_intercept.o ../fcs/fcs.o + cc ${COMMON} \ + `gtk-config --cflags` `gtk-config --libs`\ + irda_intercept.o ../fcs/fcs.o\ + -o irda_intercept + +irda_intercept.o: irda_intercept.c ../include/irda.h ../include/irlap.h + cc ${COMMON} \ + `gtk-config --cflags` \ + -c irda_intercept.c + +../fcs/fcs.o: ../fcs/fcs.c ../fcs/fcs.h + cc ${COMMON} \ + `gtk-config --cflags` \ + -c $*.c -o $@ diff --git a/Docs/developers/other/sniffs/irda/tools/intercept/irda_intercept.c b/Docs/developers/other/sniffs/irda/tools/intercept/irda_intercept.c new file mode 100644 index 0000000..1381418 --- /dev/null +++ b/Docs/developers/other/sniffs/irda/tools/intercept/irda_intercept.c @@ -0,0 +1,613 @@ +/********************************************************************* + * + * Filename: irda_intercept.c + * Version: + * Description: intercept irda-traffic incl. negotation and write + * output to a file + * Status: Experimental. + * Author: Thomas Schneider + * Created at: + * Modified at: + * Modified by: Thomas Schneider + * + * Copyright (c) 1999 Thomas Schneider, All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + * IN NO EVENT SHALL THOMAS SCHNEIDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THOMAS SCHNEIDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THOMAS SCHNEIDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER + * IS ON AN "AS IS" BASIS, AND THOMAS SCHNEIDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR + * MODIFICATIONS. + * + * This material is provided "AS-IS" and at no charge. + * + ********************************************************************/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "../include/irda.h" +#include "../include/irlap.h" +#include "../fcs/fcs.h" + +#define INIT_BAUDRATE B9600 + +#define _POSIX_SOURCE 1 /* POSIX compliant source */ + +#define INITIAL_TIMEOUT 15 +#define DEFAULT_TIMEOUT 5 + +#define OUTFILE_SUFFIX ".trc" +#define DEFAULT_OUTFILE "out"OUTFILE_SUFFIX + +static int initfdflags = -1; /* Initial file descriptor flags */ +static struct termios old_port_sets; /* old port-termios for restore */ + +int port_fd; + +NEGOTATION_PARAM negotation_param; +CONNECTION connection; + +static speed_t speed_list[8] = { B2400, B9600, B19200, B38400, + B57600, B115200, B576000, B1152000 }; +static const char *speed_name[] = { "2400", "9600", "19200", "38400", + "57600", "115200", "576000", "1152000"}; + +/* + * negotation + * ---------- + * - in negotation set new device speed + */ +void negotation ( IRLAP_FRAME * irlap_frame ) +{ + BYTE cmd = irlap_frame -> a & 0x01; + speed_t new_speed = 0; + int i = 0; + int m = 0; + struct termios set; + BYTE tmp = 0; + + /* + * snrm-frame + * ---------- + * - 4 src + * - 4 dest + * - 1 new connection address + * - 1 pi + * - 1 pl + * - [pl] pv + * ua-frame + * -------- + * - 4 src + * - 4 dest + * - 1 pi + * - 1 pl + * - [pl] pv + */ + + if ( cmd ) { + /* + * SNRM - CMD + * ---------- + * - in IrLAP (V. 1.1) page 27 + * - U32 : src-dev-adr + * - U32 : dest-dev-adr + * - U8 : connection address + * - start of neg. params + */ + if ( irlap_frame -> info_length < ( IRLAP_NEG_SNRM_PARAM_OFF +3 ) ) { + printf ("\t==> IrLAP: in SNRM-CMD no Info! <==\n"); + } else { + memcpy ( &connection.p_src_adr, + &(irlap_frame -> info[IRLAP_SNRM_SRC_ADR]), + sizeof(connection.p_src_adr)); + memcpy ( &connection.s_src_adr, + &(irlap_frame -> info[IRLAP_SNRM_DEST_ADR]), + sizeof(connection.s_src_adr)); + connection.conn_adr = irlap_frame -> info[IRLAP_SNRM_CONN_ADR]; + if ( irlap_frame -> info[IRLAP_NEG_SNRM_PARAM_OFF] == + IRLAP_NEG_BPS_PI ) { + /* really bps-parameter-identifier */ + if ( irlap_frame -> info[IRLAP_NEG_SNRM_PARAM_OFF + 1] == 1 ) { + negotation_param.baud_rate_master = + irlap_frame -> info [IRLAP_NEG_SNRM_PARAM_OFF + 2]; + negotation_param.state = NEG_WAIT_FOR_UA; + } else { + printf ("\t==> IrLAP: SNRM-CMD: speed in 2 bytes! <==\n"); + printf ("\t\t==> IrLAP: my max. speed is 115.2 kbps! <==\n"); + negotation_param.baud_rate_master = + irlap_frame -> info [IRLAP_NEG_SNRM_PARAM_OFF + 3]; + } + } else { + printf ("\t==> IrLAP: SNRM-CMD: " + "No baud rate dictate in 1. byte! <==\n"); + } + } + } else { + /* UA -rsp */ + negotation_param.baud_rate_client = irlap_frame -> info [10]; + negotation_param.state = NEG_UA_OK; + + /* now compute the new speed */ + tmp = + negotation_param.baud_rate_master & negotation_param.baud_rate_client; + if ( tmp & 0x01 ) { + new_speed = speed_list[i]; + m = 0; + } + for ( i=1; i < 7; i++) { + tmp = tmp >> 1; + if ( tmp & 0x01 ) { + new_speed = speed_list[i]; + m = i; + } + } + if ( m > 5 ) { + /* not defined as B... on my system */ + printf ("Sorry: Required speed (%s baud) not supported!\n", + speed_name[m]); + } else { + printf ("New speed is: %s\n", speed_name[m]); + /* now set the new speed */ + tcgetattr (port_fd, &set); + cfsetospeed(&set, new_speed); + cfsetispeed(&set, new_speed); + tcsetattr(port_fd, TCSANOW, &set); + tcgetattr(port_fd, &set); + if ( (cfgetospeed(&set) != new_speed) || + (cfgetispeed(&set) != new_speed) ) { + printf ("New speed is not set!\n"); + } + } + } +} + +/* + * decode_irlap_frame + * ------------------ + * - decode the irlap-c-field + */ +void decode_irlap_frame ( IRLAP_FRAME * irlap_frame) +{ + BYTE cmd = irlap_frame -> a & 0x01; + BYTE poll = irlap_frame -> c & (IRLAP_PF_BIT_MASK); + BYTE adr = (irlap_frame -> a) >> 1; + + switch ( irlap_frame -> c & IRLAP_C_MASK ) { + case IRLAP_U_FRAME: + printf ("U-Frame:\tAdr: %02X Nr: %02X ", adr, + (irlap_frame -> c & 0xE0) >> 5); + printf ("P/F: %X \t\t", poll >> 4); + switch (irlap_frame -> c & IRLAP_PF_BIT_CLR_MASK ) { + case IRLAP_SNRM_RNRM: + /* SNRM cmd/RNRM response */ + if ( cmd ) { + printf ("SNRM cmd\n"); + switch (connection.irlap_state) { + case IRLAP_DISC: + printf ("\t==> IrLAP in DISC but SNRM-CMD? <==\n"); + break; + case IRLAP_NDM: + printf ("\t==> Start IrLAP - negotation <==\n"); + negotation ( irlap_frame ); + break; + case IRLAP_NRM: + printf ("\t==> IrLAP in NRM but SNRM-CMD? <==\n"); + break; + default: + printf ("\t==> IrLAP in not defined state but SNRM-CMD? <==\n"); + } + } else { + printf ("RNRM response\n"); + } + break; + case IRLAP_DISC_RD: + /* DISC cmd/RD response */ + if ( cmd ) { + printf ("DISC cmd\n"); + } else { + printf ("RD response\n"); + } + break; + case IRLAP_UI_UI: + /* UI cmd/UI response */ + if ( cmd ) { + printf ("UI cmd\n"); + } else { + printf ("UI response\n"); + } + break; + case IRLAP_XID_CMD: + /* XID cmd */ + printf ("XID cmd\n"); + if ( connection.irlap_state == IRLAP_DISC ) { + connection.irlap_state = IRLAP_NDM; + printf ("\t==> Set IrLAP-state to:" + "NDM (normal disconnected mode) <==\n"); + } + break; + case IRLAP_TEST_TEST: + /* Test cmd/response */ + if ( cmd ) { + printf ("TEST cmd\n"); + } else { + printf ("TEST response\n"); + } + break; + case IRLAP_UA_RSP: + /* UA response */ + printf ("UA response\n"); + switch (connection.irlap_state) { + case IRLAP_DISC: + printf ("\t==> IrLAP in DISC but UA-RESPONSE? <==\n"); + break; + case IRLAP_NDM: + if ( negotation_param.state == NEG_WAIT_FOR_UA ) { + printf ("\t==> Continue IrLAP - negotation! <==\n"); + negotation ( irlap_frame ); + } else { + printf ("\t==> IrLAP in NDM but not wait for negotation! <==\n"); + } + break; + case IRLAP_NRM: + printf ("\t==> UA: IrLAP was/is in NRM ... <==\n"); + break; + default: + printf ("\t==> IrLAP in not defined state but UA-RESPONSE? <==\n"); + } + break; + case IRLAP_FRMR_RSP: + /* FRMR response */ + printf ("FRMR response\n"); + break; + case IRLAP_DM_RSP: + /* DM response */ + printf ("DM response\n"); + break; + case IRLAP_XID_RSP: + /* XID response */ + printf ("XID response\n"); + break; + default: + /* unknown cmd/response */ + printf ("Unknown IrLAP-U-Frame\n"); + } /* end of irlap-u-frames */ + break; + case IRLAP_S_FRAME: + printf ("S-Frame:\tAdr: %02X Nr: %02X ", adr, + (irlap_frame -> c & 0xE0) >> 5); + printf ("P/F: %X \t\t", poll >> 4); + switch ( irlap_frame -> c & + (IRLAP_PF_BIT_CLR_MASK & IRLAP_Nr_CLR_MASK) ) { + case IRLAP_RR: + /* RR command/response */ + if ( cmd ) { + printf ("RR cmd\n"); + } else { + printf ("RR response\n"); + } + break; + case IRLAP_RNR: + /* RNR cmd/response */ + printf ("RNR cmd/response\n"); + break; + case IRLAP_REJ: + /* REJ cmd/response */ + printf ("REJ cmd/response\n"); + break; + case IRLAP_SREJ: + /* SREJ cmd/response */ + printf ("SREJ cmd/response\n"); + break; + default: + /* unknown cmd/response */ + printf ("Unknown IrLAP-S-Frame\n"); + } /* end of irlap-s-frames */ + break; + default: + printf ("I-Frame:\tAdr: %02X Nr: %02X ", adr, + (irlap_frame -> c & 0xE0) >> 5); + printf ("\tP/F: %X\t", poll >> 4); + printf ("Ns: %02X \t", (irlap_frame -> c & 0x0E) >> 1); + printf ("Information\n"); + } +} + +/* unwrap_raw_frame + * ---------------- + * - put raw-frame-datas in irlap-frame + */ +void unwrap_raw_frame ( RAW_FRAME * raw_frame ) +{ + IRLAP_FRAME irlap_frame; + BYTE * info_ptr; + + bzero ( &irlap_frame, sizeof(irlap_frame) ); + + irlap_frame.a = raw_frame -> buf[IRLAP_A_OFF]; + irlap_frame.c = raw_frame -> buf[IRLAP_C_OFF]; + irlap_frame.fcs = raw_frame -> buf [(raw_frame -> length) -2] << 8; + irlap_frame.fcs |= raw_frame -> buf [(raw_frame -> length) -1]; + + irlap_frame.info_length = raw_frame -> length - + IRLAP_A_LENGTH - IRLAP_C_LENGTH - IRLAP_FCS_LENGTH; + + info_ptr = g_malloc ( irlap_frame.info_length * sizeof (BYTE) ); + memcpy ( info_ptr, &(raw_frame -> buf[IRLAP_I_OFF]), + irlap_frame.info_length); + irlap_frame.info = info_ptr; + decode_irlap_frame ( &irlap_frame ); + g_free(info_ptr); + + printf ("IrLAP: FCS: %04X \n\n", irlap_frame.fcs ); + +} + +/* + * cleanup_termios + * --------------- + * - call on some signals from signalhandler + * - before end set the original setting + */ +void cleanup_termios ( int signal ) +{ + tcsetattr(port_fd, TCSANOW, &old_port_sets); + exit (0); +} + +/* + * init_port + * --------- + * - get original port-settings and store it + * - set new port-settings + */ +void init_port ( void ) +{ + struct termios new_port_sets; + + /* get the original settings and store it for restore */ + tcgetattr( port_fd, &old_port_sets); + + /* init new settings */ + bzero(&new_port_sets, sizeof(new_port_sets)); + new_port_sets.c_cflag = INIT_BAUDRATE | CRTSCTS | CS8 | CLOCAL | CREAD; + new_port_sets.c_iflag = IGNBRK | IGNPAR; + new_port_sets.c_oflag = 0; + + /* set input mode (non-canonical, no echo,...) */ + new_port_sets.c_lflag = 0; + + /* inter-character timer unused x0.1s */ + new_port_sets.c_cc[VTIME] = 0; + /* blocking read until 5 chars received */ + new_port_sets.c_cc[VMIN] = 1; + + /* set the port now */ + tcflush(port_fd, TCIFLUSH); + tcsetattr(port_fd, TCSANOW, &new_port_sets); +} + +/* + * main + * ---- + * - output-file and port open + * - get/set port settings + * - dataread-loop + */ +int main( int argc, char * argv[] ) +{ + struct sigaction sact; /* signalhandle */ + GString *outfile_name = g_string_new(DEFAULT_OUTFILE); /* outfile name */ + FILE *outfile; /* outfile FILE */ + fd_set ready; /* for select */ + struct timeval timeout; /* select-timeout */ + int no_timeout = 1; /* timeout reached */ + int nr_read = 0; /* byte readed */ + unsigned char in_buffer[255]; /* temp. buffer */ + RAW_FRAME raw_frame; /* a raw frame */ + int is_inframe = FALSE; /* loop in frame */ + int frame_complete = FALSE; /* frame complete */ + int done = 0; /* loop control */ + int i = 0; /* for-index */ + int nr_of_bytes = 0; /* total bytes */ + int nr_of_frames = 0; /* total frames */ + int irlap_bytes = 0; /* w/o BOF etc. */ + BYTE must_escaped = FALSE; /* after CE = 0x07 */ + U16 fcsrx = INIT_FCS; /* for fcs-comput. */ + BYTE nr_esc = 0; /* nr of CE's */ +//CONNECT_STATISTIC statistic; /* statistic */ +//OUTPUT_PARAMS output_params; /* output-control */ + + /* + * Open the serial device + */ + if ( (port_fd = open( MODEMDEVICE, O_NONBLOCK | O_RDWR)) < 0 ) { + printf ( "Failed to open %s!\n", MODEMDEVICE); + exit(1); + } + + /* + * get/set device fd flags + */ + if ( (initfdflags = fcntl( port_fd, F_GETFL)) == -1 ) { + printf ( "Couldn't get device fd flags for: %s!", MODEMDEVICE); + exit(1); + } + initfdflags &= ~O_NONBLOCK; + fcntl( port_fd, F_SETFL, initfdflags); + + init_port(); + + /* + * set signal-handler + */ + sact.sa_handler = cleanup_termios; + sigaction( SIGHUP, &sact, NULL); + sigaction( SIGINT, &sact, NULL); + sigaction( SIGPIPE, &sact, NULL); + sigaction( SIGTERM, &sact, NULL); + + /* + * Set device for non-blocking reads. + */ + if ( fcntl( port_fd, F_SETFL, initfdflags | O_NONBLOCK) == -1) { + printf ("Couldn't set device to non-blocking mode (%s)!\n", MODEMDEVICE); + exit(1); + } + + /* + * output-file-handling + */ + if ( argc < 2 ) { + printf ("Use default OutPutFile: %s\n", outfile_name -> str); + } else { + g_string_assign(outfile_name, argv[1]); + g_string_append(outfile_name, OUTFILE_SUFFIX); + printf ("Use OutPutFile: %s\n", outfile_name -> str); + } + if ( (outfile = fopen( outfile_name -> str, "wb")) == NULL ) { + printf ("Failed to open OutPutFile: %s\n", outfile_name -> str); + exit (1); + } + + /* + * initial timeout + * --------------- + * - wait 15 seconds + */ + timeout.tv_sec = INITIAL_TIMEOUT; + timeout.tv_usec = 0; + + /* + * init raw-frame, negotation-struct, connection + */ + bzero(&raw_frame, sizeof(raw_frame)); + bzero(&negotation_param, sizeof(negotation_param)); + bzero(&connection, sizeof(connection)); + + /* hope we have no irda traffic in moment */ + connection.irlap_state = IRLAP_DISC; + + /* + * now make the data-read-loop + */ + do { + FD_ZERO(&ready); + FD_SET(port_fd, &ready); + no_timeout = select(port_fd + 1, &ready, NULL, NULL, &timeout); + if ( FD_ISSET(port_fd, &ready) ) { + /* data on port - returns after 16 chars have been input */ + nr_read = read(port_fd, in_buffer, 16); + nr_of_bytes = nr_of_bytes + nr_read; + if ( nr_read >= 1 ) { + /* write all readed bytes to file */ + fwrite( in_buffer, 1, nr_read, outfile); + /* process every single byte */ + for (i=0; i < nr_read; i++) { + if (raw_frame.length < (4096-1) ) { + switch ( in_buffer[i] ) { + case IRLAP_XBOF: + if ( is_inframe ) { + /* + * no - its not a XBOF we are inside a frame + * broadcast in xid for example + */ + irlap_bytes++; + fcsrx = IR_FCS(fcsrx, in_buffer[i]); + is_inframe = TRUE; + raw_frame.buf[raw_frame.length] = in_buffer[i]; + } + break; + case IRLAP_BOF: + is_inframe = TRUE; + break; + case IRLAP_EOF: + frame_complete = TRUE; + is_inframe = FALSE; + break; + case IRLAP_CE: + must_escaped = TRUE; + is_inframe = TRUE; + nr_esc++; + break; + default: + is_inframe = TRUE; + if ( must_escaped ) { + fcsrx = IR_FCS(fcsrx, (in_buffer[i] ^ IRLAP_ESC_MASK) ); + raw_frame.buf[raw_frame.length] = + (in_buffer[i]^IRLAP_ESC_MASK); + must_escaped = FALSE; + } else { + fcsrx = IR_FCS(fcsrx, in_buffer[i]); + raw_frame.buf[raw_frame.length] = in_buffer[i]; + } + irlap_bytes++; + } + raw_frame.length = irlap_bytes; + if ( frame_complete ) { + /* now raw-frame is complete */ + if ( fcsrx != GOOD_FCS ) { + printf (" **** !!! FCS-ERROR !!! ****\n"); + } else { + unwrap_raw_frame ( &raw_frame ); + } + nr_of_frames++; + /* reset all to defaults */ + raw_frame.length = 0; + raw_frame.a_offset = 0; + frame_complete = FALSE; + fcsrx = INIT_FCS; + nr_esc = 0; + irlap_bytes = 0; + } + } + } + } else { + printf ("No data to read - why?\n"); + done = 1; + } + } + /* + * reset timeout - wait 5 seconds + */ + timeout.tv_sec = DEFAULT_TIMEOUT; + timeout.tv_usec = 0; + if ( ! no_timeout ) { + printf ("TimeOut!\nConnection summary:\n-------------------\n"); + printf ("Total nr of received bytes : %i\n", nr_of_bytes); + printf ("Total nr of received frames: %i\n", nr_of_frames); + done = 1; + } + } while ( ! done ); + + g_string_free(outfile_name, TRUE); + fclose (outfile); + tcsetattr(port_fd, TCSANOW, &old_port_sets); + exit(0); +} diff --git a/Docs/developers/other/sniffs/sniffing.txt b/Docs/developers/other/sniffs/sniffing.txt new file mode 100644 index 0000000..e109bdb --- /dev/null +++ b/Docs/developers/other/sniffs/sniffing.txt @@ -0,0 +1,21 @@ + +All this software was created from observating other programs - what they +send to/from phone. There two methods to dump transmission: + +1.hardware + + You have to connect RxD (or TxD) and GND pin from the COM port, you use with + phone, to the second COM port. Then you run soft, which will show, what is + received by second port (now in win32 with enabled debug it can be + "gnokii --sniff port") + + TIP: if you want to sniff MBUS, connect RxD (everything, what goes from + TxD is repeated on RxD) + +2.software + + You run emulator of OS, where program work. Then using emulator functions + see, what is send (emulator is between phone and program, isn't it ?). + +When you have transmission, try to find some identical sequences. If you will +have them, try to find each frame format... \ No newline at end of file diff --git a/Docs/developers/protocol/n3110.txt b/Docs/developers/protocol/n3110.txt new file mode 100644 index 0000000..10c3326 --- /dev/null +++ b/Docs/developers/protocol/n3110.txt @@ -0,0 +1,233 @@ + +Last update 01.03.2001 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Assembled by + Marcin Wiacek (Marcin-Wiacek@TOPNET.PL) + ... and other members of gnokii mailing list + and authors of some WWW pages. + +The data provided is for information purposes only. +Some of the frames might be hazardous to your phone. Be careful!!! +We do not take any responsibility or liability for damages, etc. + +NOTE: this information isn't (and can't be) complete. If you know anything +about features not listed here or you noticed a bug in this list, please +notify us via e-mail. Thank you. + +Document describing frames used in +GSM Nokia 3110 and derivatives (3810,8110,8110i): +Correct format is FBUS version 1/MBUS version 1 (?) +(see nokia.txt for protocol details): + + List: + +0x02: + r RLP ? {....} +0x0a: + s Make call {+type of call, type of number?, numlen, number, uk1, uk2, uk3 } + where type of call: see 0x0b + Note: If destination number is "1" - "9", + call for number in corresponding memory location is made. +0x0b: + r Incoming call {+type of call, 0x00, namelen, name } + where type of call: + 0x01 Data + 0x02 ?? + 0x03 ?? + 0x04 ?? + 0x05 Voice +0x0c: + s Answer incoming call {} +0x0d: + r Incoming call answered{} + from ME +0x0e: + r Call established {+type of call, 0x00, 0x00 } + where type of call: see 0x0b +0x0f: + s Call hang up {} +0x10: + r Call hanged up from ME{} + seq1 +0x11: + r CallClosed-by other end{+unknown, reason} + where: + unknown reason + 0x65 0x10 Hanged up by other end + 0x1c virheellinen numero + 0x65 0x1f Number is not in use + 0x65 0x4f Check operator services + 0x65 0xa6 No destination number (sms sending) + 0x65 0xe4 --''-- + 0x6f 0x6f + 0x7d 0x7d + 0x7f 0x7f + 0x83 0x83 +0x12: + r Call hanged up from ME{} + seq2 +0x13: + r Power ON seq {} +0x15: + s Initialization {} +0x16: + r Initialization OK {+simstate } + where simstate: + 0x01 No SIM present, or waiting for PIN + 0x02 SIM present and ready. +0x17: + r Initialization err {+error } +0x20: + s Send DTMF {+length,string} +0x21: + r Send DTMF OK {} +0x22: + r Send DTMF err {+error } + where error: + 0x70: invalid location +0x23: + s Send SMS Header {+first octet, PID, DCS, validity(7 bytes), UDL, SMSClen, SMSC, receiverlen, receiver} +0x24: + s Save SMS Header {+memtype,status(2bytes),PID, DCS, validity(7 bytes), UDL, SMSClen, SMSC, receiverlen, receiver, receivertype } + where: memtype: + 2=SIM + 3=ME + status: see 0x2c +0x25: + s Get SMS message {+memtype, location } + where: memtype - see 0x30 + Note: In successful request, phone sends one "SMS Header" and one or more "SMS Data" packets. + In failure, phone sends "Get SMS message err" packet +0x26: + s Delete SMS message {+memtype, location } + where: memtype - see 0x30 +0x27: + r SMS Data {+seq,block} + where: seq: starts from 0x01 and is increased by 1 after each block transmitted. + block: Block of User Data (max 55 chars) + s Send/Save SMS Data {+seq,block} +0x28: + r SMS sent OK {+reference?} +0x29: + r SMS sent error {+error1, error2} +0x2a: + r SMS saved OK {+memtype} + where: memtype - memory, where SMS was saved +0x2b: + r SMS saving err {+error} +0x2c: + r SMS Header {+memtype, location, status(2 bytes), PID, DCS, date (7 bytes), UDL, senderlen, sender, SMSClen, SMSC, sendertype} + where: + memtype, PID, DCS, date, UDL, sender, SMSC, sendertype - see 0x30 + status: 0701: Saved, not sent + 0501: Sent + 0304: Received, unread + 0204: Unread + 0104: Received, read +0x2d: + r Get SMS message err {+error} +0x2e: + r Delere SMS message OK {} +0x2f: + r Delete SMS message err{+error} +0x30: + r SMS message received {+memtype, location, unknown, PID, DCS, date(7 bytes), UDL, senderlen, sender, SMSClen, SMSC, sendertype} + where: memtype: + 0x01 Phone Selected + 0x02 SIM + 0x03 ME + location: Memory location (1...) + unknown: most of time 0x04 + PID: Protocol Identifier + DCS: Data Coding Scheme + date: sending date in BCD + UDL: User Data Length + sender: sender number + SMSC: SMSC number + sendertype: type of sender number: + 0x31 International without leading '+' ??? + 0x91 International +0x32: + r Delivery report receiv{+unknown,delivery time(7 bytes),report time(7 bytes),0x00,MR, + destinationlen,destination,SMSClen,SMSC,destinationtype} +0x3c: + s Set SMSC {+bitmask,format,unknown1,validity,reply,reports,unusedlen,unused,SMSClen,SMSC} + where: + bitmask: info, what we change + 7 ?? + 6 reports + 5 reply + 4 SMSC number + 3 unused + 2 validity + 1 unknown + 0 format + format: + 0x00 Text + 0x22 Fax + 0x24 Voice + 0x25 ERMES + 0x26 Paging + 0x2d E-mail + 0x31 X.400 + validity: + 0 to 143 (validity + 1) * 5 minutes (i.e. 5 minutes intervals up to 12 hours) + 144 to 167 12 hours + ((validity - 143) * 30 minutes) + 168 to 196 (validity - 166) * 1 day + 197 to 255 (validity - 192) * 1 week +0x3d: + r Set SMSC OK {} +0x3e: + r Set SMSC err {} +0x3f: + s Get SMSC {} +0x40: + r Get SMSC {+memory,AllSMSphone,unreadSMSphone,AllSMSSIM,unreadSMSSIM, + format,unknown1,validity,reply,reports,unusedlen,unused,SMSClen,SMSC} + where: format,unknown1,validity,reply,reports,unusedlen,unused,SMSClen,SMSC - see 0x3c + memory: selected memory + AllSMSphone: number of all SMS in phone + unreadSMSphone: number of unread SMS in phone + AllSMSSIM: number of all SMS on SIM + unreadSMSSIM: number of unread SMS on SIM +0x42: + s Set mem location {+memtype, location, namelen, name, numlen, number } + where memtype: see 0x43 +0x43: + s Get mem location {+memtype, location } + where: memtype: + 0x01 Phone Selected + 0x02 SIM + 0x03 ME + 0x04 Own numbers (at SIM) +0x44: + r Set mem location OK {} +0x45: + r Set mem location err {+error } +0x46: + r Get mem location OK {+namelen, name, numlen, number } +0x47: + r Get mem location err {+error } +0x48: + r PIN entered {} +0x49: + r Power OFF seq {} +0x4a: + s Status request {} +0x4b: + r Status request {+status, network, battery } + where status: + 0x01 Idle + 0x02 Network interworking + 0x03 Call open + 0x04 No Network Access (Waiting for PIN or + Unaccessable Operator selected) + network and battery - signal level +0x4c: + s Get phone info {} +0x4d: + r Get phone info {+IMEI, 0x00, Code, 0x00, HW, 0x00 } + where IMEI: IMEI Code + CODE: Same as Code in phones back side + HW: hardware version diff --git a/Docs/developers/protocol/n6110.txt b/Docs/developers/protocol/n6110.txt new file mode 100644 index 0000000..afd92e4 --- /dev/null +++ b/Docs/developers/protocol/n6110.txt @@ -0,0 +1,859 @@ + +Last update 23.02.2002 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Assembled by + Balazs Nagy (js@lsc.hu) + Harri Yli-Torkko (hyt@surfeu.fi) + Alfred R. Nurnberger + Hugh Blemings + Mike Bradley + Odinokov Serge + Pavel Janik + BORBELY Zoltan (bozo@andrews.hu) + Pawel Kot + Marcin Wiacek (Marcin-Wiacek@TOPNET.PL) + ... and other members of gnokii mailing list + and authors of some WWW pages. + +The data provided is for information purposes only. +Some of the frames might be hazardous to your phone. Be careful!!! +We do not take any responsibility or liability for damages, etc. + +NOTE: this information isn't (and can't be) complete. If you know anything +about features not listed here or you noticed a bug in this list, please +notify us via e-mail. Thank you. + +Document describing frames used in +GSM/PCN Nokia 6110 and derivatives (Nokia 6130, 6150, 6190, 5110, 5130, 5150, +5190, 3210, 3310) +Correct format is FBUS version 2/Direct IRDA/MBUS version 2 +(see nokia.txt for protocol details): + + List: + +0x00: Monitoring values + r monitoring value {+0x01, 0x01, block... } + where block: 0x5e, 0x05, 0x7a(?), 0xd0(?), 0x85(?), 0x02, percentHI, percentLO + Battery percent level + 0x5e, 0x0c, 0x52(?), 0x4b(?), 0x6f(?), 0x02, voltageHI, voltageLO + Battery standby voltage + ............ +0x01: Call Information + s Make call { 0x0001, "number", type, block } + where type: + 0x01 - data call + 0x05 - voice call + block: + data call (non digital lines): + 0x02,0x01,0x05,0x81,0x01,0x00,0x00,0x01,0x02,0x0a, + 0x07,0xa2,0x88,0x81,0x21,0x15,0x63,0xa8,0x00,0x00 + data call (digital lines): + 0x02,0x01,0x05,0x81,0x01,0x00,0x00,0x01,0x02,0x0a, + 0x07,0xa1,0x88,0x89,0x21,0x15,0x63,0xa0,0x00,0x06, + 0x88,0x90,0x21,0x48,0x40,0xbb + voice call: + 0x01, 0x01, 0x05, 0x81/0x00, sendnum, 0x00, 0x00, 0x01 + where: + sendnum (own number sending): + 0x01: preset (depends on network) + 0x03: on + 0x02: off + r Call going msg { 0x0002 } + r Call in progress { 0x0003, seqnr } + r Remote end hang up { 0x0004, seqnr, ?, error (like in netmon in 39) } + r incoming call alert { 0x0005, seqnr, numlen, "number", namelen, "name" } + s Answer call part 2 { 0x0006, seqnr, 0x00 } + r answered call { 0x0007, seqnr } + s Hang up { 0x0008, seqnr, 0x85 } + r terminated call { 0x0009, seqnr } + r call msg { 0x000a, seqnr } + r call held { 0x0023, seqnr, 0x01 } + r call resumed { 0x0025, seqnr, 0x01 } + r Send DTMF/voice call { 0x0040} + s Answer call part 1 { 0x0042,0x05,0x01,0x07,0xa2,0x88,0x81,0x21,0x15,0x63,0xa8,0x00,0x00, + 0x07,0xa3,0xb8,0x81,0x20,0x15,0x63,0x80 } + s Sent after issuing { 0x0042,0x05,0x81,0x07,0xa1,0x88,0x89,0x21,0x15,0x63,0xa0,0x00,0x06, + data call 0x88,0x90,0x21,0x48,0x40,0xbb,0x07,0xa3, + (digital lines) 0xb8,0x81,0x20,0x15,0x63,0x80 } + s Sent after issuing { 0x0042,0x05,0x01,0x07,0xa2,0xc8,0x81,0x21,0x15,0x63,0xa8,0x00,0x00, + data call 0x07,0xa3,0xb8,0x81,0x20,0x15,0x63,0x80, + (non digital lines) 0x01,0x60 } + s Send DTMF { 0x0050, length, {ascii codes for DTMF}, 0x01 } + + Note: + to make data call (non digital lines): + 1.send "Make call" for non digital lines + 2.send "Sent after issuing data call (non digital lines)" + to make data call (digital lines): + 1.send "Answer call part 1" + 2.send "Sent after issuing data call (digital lines)" + 3.send "Make call" for digital lines + to answer call: + 1.send "Answer call part 1" + 2.send "Answer call part 2" + +0x02: SMS handling + s Send SMS message { 0x0001, 0x02, 0x00 (SEND REQUEST), ... } + r Message sent { 0x0002 } + r Send failed { 0x0003, ?, ?, error (like in netmon in 65)} + s Get SMS message { 0x0007, 0x02, location, 0x01, 0x64 } + s Initiate connection { 0x000d, 0x00, 0x00, 0x02 } + r Initiate ACK { 0x000e, 0x01 } + r SMS message received { 0x0010, ...... } (whole message) + s Set CellBroadcast { 0x0020, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01 } + for enable cell broadcast ? + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } + for disable cell broadcast ? + r Set CellBroadcast OK { 0x0021, 0x01 } + r Read CellBroadcast { 0x0023, ?, ?, ?, channel, ?, message... } ? + s Set SMS center { 0x0030, 0x64, priority, checksum? ,0?, format, + validity, {DefaultRecipient no.}[12], + {SMScenter no.}[12], {SMSC name}, 0x00} + where tel.no.[12]: {len, type, {number(BCD)}} + type: 0x81: normal + 0x91: + (international) + 0xd0: alphanumeric + format: 0x00: text + 0x22: fax + 0x24: voice + 0x25: ERMES + 0x26: paging + 0x31: X.400 + 0x32: email + validity: 0x0b: 1 hour + 0x47: 6 hours + 0xa7: 24 hours + 0xa9: 72 hours + 0xad: 1 week + 0xff: max.time + r Set SMS center OK { 0x0031 } + r Set SMS center error { 0x0032, reason } + s Get SMS center { 0x0033, 0x64, priority } + r SMS center received { 0x0034, priority, checksum?, format, 0x00?, + validity, {DefaultRecipient no.}[12], + {SMScenter no.}[12], {SMSC name}, 0x00} + tel.no[12]: {len, type, {number(BCD)}} + where priority, checksum, type, validity, + tel.no.[12]: see 0x02/0x0030 + r SMS center error recv { 0x0035, reason } +0x03: Phonebook functions + s Get mem location { 0x0001, memtype, location, 0 } + where memory: + 0x01: telephone and SIM phonebook (in one) + 0x02: telephone phonebook + 0x03: SIM phonebook + 0x04: SIM fixdialling-phonebook (?) + 0x05: Own numbers + 0x07: Dialled numbers + 0x08: Missed calls + 0x09: Received calls + 0x0b: voice mailbox (location not important) + r mem location recvd { 0x0002, 0x00,namelen,"name",numlen,"number",groupID, 0x01?, yearLO, yearHI, month, day, hour, minute, sec. } + Note: in 3310 all entries have null name ("feature" of bug ?) + r mem loc error recvd { 0x0003, errtype } + where errtype: 0x7d: invalid memory type + s Set mem location { 0x0004, memtype,location,namelen,"Name",numlen,"number",groupID } + r mem set OK { 0x0005 } + r mem set error { 0x0006, errtype } + where errtype: 0x7d: name is too long + s Mem status request { 0x0007, memtype } + r Mem status recvd { 0x0008, memtype, free, used } + r Mem status error recv { 0x0009, errtype } + where errtype: 0x6f: mem status error + 0x7d: invalid memory type + 0x8d: waiting for pin + s Get caller group data { 0x0010, groupID } + r Get caller group data { 0x0011, groupID, size, "Name", ringtoneID, graphic_on?1:0, lenHI, lenLO, OTABitmap (72x14 logo) } + r Get call.group error { 0x0012, reason } + where reason: 0x7d: invalid location + s Set caller group data { 0x0013, groupID, size, "Name", ringtoneID, graphic_on?1:0, lenHI, lenLO, OTABitmap (72x14 logo) } + r Set caller group OK { 0x0014 } + r Set call.group error { 0x0015, reason } + where reason: 0x7d: invalid location + s Get speed dial { 0x0016, index(1-9) } + r Get speed dial OK { 0x0017, mem.type, location } + where mem.type: 0x02: ME (== 0 if not stored) + 0x03: SIM + location: memory location (== 0 if not stored) + r Get speed dial error { 0x0018 } + s Set speed dial { 0x0019, index(1-9), mem.type, location } + r Set speed dial OK { 0x001a } + r Set speed dial error { 0x001b } +0x04: Phone Status + s Phone status { 0x0001 } + r Phone status { 0x0002, mode, signal str, ???, pwr, batt.level } + where mode: 1: registered within the network + 2: call in progress + 3: waiting for pin + 4: powered off + pwr: 1: AC/DC + 2: battery + s Request Phone ID { 0x0003 } + r RequestPhone ID { 0x0004, 0x01,"NOKIA""imei", 0, "model", 0, "prod.code", 0, "HW", 0, "firmware", 0x00, 0x01 } +0x05: Profile settings + s Set profile feature { 0x0010, 1, nr, feature, a, 1 } + where nr: see 0x05/0x0013 + feature: see 0x05/0x0014 + a: see 0x05/0x0014 + r Set profile feat. OK { 0x0011, 1 } + s Get profile feature { 0x0013, 1, nr, feature, 1 } + where nr is profile number (general=0, silent, meeting, outdoor, pager, car, headset=6) + feature: see 0x05/0x0014 + r Get profile feature { 0x0014, 1, nr, feature, 4, a, b, c, d, 1 } + + Note: For Nokia 3330 settings num 0x00 .. 0x09 can be assigned + separately to each profile (0x00 .. 0x05), but rest are common + to all profiles. + + Features and answers (in a, b, c, d form): + 0x00: keypad notes (in Nokia 33x0 feature 0x00) + xx, 1, 0, 2 + xx: 0xff: off + 0x00: level 1 + 0x01: level 2 + 0x02: level 3 + 0x01: lights (? only in car profile) (what number in Nokia 3310 ?) + xx, 0, 0, 1 + xx: 0x00: off + 0x??: on (maybe 0x01) + 0x02: incoming call alert (in Nokia 33x0 feature 0x01) + xx, 1, 0, 7 + xx: 1: ringing, + 2: beep once, + 3: unknown + 4: off + 5: ring once + 6: ascending + 7: caller groups (see feature #0x08) + 0x03: ringing tone (in Nokia 33x0 feature 0x02) + xx, 0, 0, 0 + xx: 0x12: ring ring + 0x13: low + etc + 0x04: ringing volume (in Nokia 33x0 feature 0x03) + xx, 0, 0, 0 + xx: level 1 (0x06) - level 5 (0x0a) + 0x05: message alert tone (in Nokia 33x0 feature 0x04) + xx, 1, 0, 4 + xx: 0: no tone + 1: standard + 2: special + 3: beep once + 4: ascending + 0x06: vibration (in Nokia 33x0 feature 0x05) + xx: 0: off + 1: on + 2: Vibrate first + 0x07: warning and game tones (in Nokia 33x0 feature 0x06 called warning tones) + xx, 4, 0, 4 + xx: 0xff: off + 0x04: on + 0x07: screen saver - Nokia 33x0 + xx: 1: on + 0: off + 0x08: incoming caller groups (what number in Nokia 3310 ?) + xx, 0, 0, 0 + xx: 1: family + 2: VIP + 4: friends + 8: collegues + 16: other + 0x08: Screen saver -> Timeout (Nokia 33xx): + 0x00 = 5 sec + 0x01 = 20 sec + .... + + 0x09: automatic answer (what number in Nokia 3310 ?) + xx, 0, 0, 1 + xx: 0x00: off + 0x01: on + + 0x09: Screen saver -> Screen saver (Nokia 33xx): + 0x00 ... 0x0d = Number of picture image + + 0x0a: ???: + ...: ???: + 0x15: ???: Read only? + + 0x16: ???: + 0x00 = ??? + 0x01 = ??? + + 0x17: Phone book -> Options -> Memory in use (Nokia 3330): + 0x00 = Phone + 0x01 = SIM card + + 0x18: Settings -> Phone settings -> Network selection (Nokia 3330): + 0x00 = Automatic + 0x01 = Manual + + 0x19 Settings -> Call settings -> Automatic redial(Nokia 3330): + 0x00 = Off + 0x01 = On + + 0x1a: Settings -> Call settings -> Speed dialling (Nokia 3330): + 0x00 = Off + 0x01 = On + + 0x1b: Settings -> Call settings -> Own number sending (Nokia 3330): + 0x00 = Set by network + 0x01 = On + 0x02 = Off + + 0x1c: Settings -> Phone settings -> Cell info display (Nokia 3330): + 0x00 = Off + + 0x1d: Phone book -> Options -> Type of view (Nokia 3330): + 0x00 = Name list + 0x01 = Name, number + 0x02 = Large font + + 0x1e: Settings -> Phone settings -> Language (Nokia 3330): + 0x00 = English + 0x07 = Dansk + 0x08 = Svenska + 0x09 = Suomi + 0x0c = Turcke + 0x0e = Norsk + 0x10 = Automatic + + 0x32 = Reboots ME (3330) + + 0x1f: ???: Read only? (3330) + + 0x20: Messages -> Message settings -> Common -> Reply via same centre (N3330): + 0x00 = No + 0x01 = Yes + + 0x21: Messages -> Message settings -> Common -> Delivery reports (3330): + 0x00 = No + 0x01 = Yes + + 0x22: Clock -> Clock settings -> Show/Hide clock (3330): + 0x00 = Show + 0x01 = Hide + + 0x23: Clock -> Clock settings -> Time format (N3330): + 0x00 = 24-hour + 0x01 = 12-hour + + 0x24: Select profile (N3330): + 0x00 = General + 0x01 ... 0x05 = rest of them + + 0x25: ???: Read only? (N3330) + + 0x26: Settings -> Phone settings -> Confirm SIM service actions (N3330): + 0x00 = Not asked + 0x01 = Asked + + 0x27: Messages -> Write messages -> Options -> Dictionary (N3330): + 0x00 = Off + 0x01 = English + 0x0a = Suomi + + 0x28: Messages -> Message settings -> Common -> Character support (N3330): + 0x00 = Automatic + 0x01 = GSM alphabet + 0x02 = Unicode + + 0x29: Startup logo settings (N33x0): + 0x00 = Your own uploaded logo + 0x01 = Nokia + 0x02 = Draft HUMAN technology(tm) + 0x03 = Itineris + + 0x2a:???: 0x00 = ??? 0x01 = ??? (N3330) + + 0x2b: ???: 0x00 = ??? 0x01 = ??? (N3330) + + 0x2c: ???: Read only? (N3330) + + 0x2d: Clock -> Auto update of date and time (N3330): + 0x00 = Off + 0x01 = Confirm first + 0x02 = On + + s Get welcome message { 0x0016 } + r Get welcome message { 0x0017, no.of blocks, { block } * } + where block: { id, {blockspecific} } + id: 1: startup logo { y, x, picture (coding?) } + 2: welcome note { len, "message" } + 3: operator msg { len, "message" } + s Set welcome message { 0x0018, no.of blocks, { block } * } + where block: see 0x05/0x0017 + r Set welcome OK { 0x0019, 0x01 } + s Get profile name { 0x001a, nr } + where nr: see 0x05/0x0013 + r Profile name { 0x001b, 1, 1, 3, flen, nr, len, {text} } + where nr: see 0x05/0x0013 + len: text length + flen len + len(nr, len) = len + 2 + Note: in Nokia 3310 name is in Unicode + s ??? { 0x001c } + r ??? { 0x001d, 0x93 } + s Set oplogo { 0x0030, location, MCC1, MCC2, MNC, lenhi=0x00, lenlo=0x82, OTABitmap } + r Set oplogo OK { 0x0031 } + r Set oplogo error { 0x0032, reason } + where reason: 0x7d invalid location + s Get oplogo { 0x0033, location } + where location: 1 (doesn't seem to matter) + r Get oplogo { 0x0034, location, MCC1, MCC2, MNC, lenhi=0x00, lenlo=0x82, OTABitmap } + r Get oplogo error { 0x0035, reason } + where reason: 0x7d invalid location + s Set ringtone { 0x0036, location,0x00,0x78, ringtone packed according to SM2.0} + r Set ringtone OK { 0x0037 } + r Set ringtone error { 0x0038, reason } + where reason=0x7d, when not supported location + s Get services settings { 0x0080, setting (2 bytes) } + where: setting: 0x02,0x00=Nokia access number 1 + 0x02,0x01=Operator access number 1 + 0x01,0x00=Personal bookmark 1 settings (name only ?) + 0x01,0x01=? + 0x02,0x02=? + r Get services sett.OK { 0x0081, .... } + r Get services sett.err { 0x0082, 0x7b } +0x06: Calling line restriction/Call forwarding etc + r Get call divert { 0x0001, 0x02, x, 0x00, divtype, 0x02, calltype, y, z, 0x0b, number, 0x00...0x00, timeout (byte 45) } + s Set call divert { 0x0001, 0x03, 0x00, divtype, calltype, 0x01, number(packed like in SMS), 0x00 ... 0x00, + length of number (byte 29), 0x00 ... 0x00, timeout (byte 52), 0x00, 0x00, 0x00} + NOTE: msglen=0x37 + where timeout: + 0x00: not set ? + 0x05: 5 second + 0x0a: 10 second + 0x0f: 15 second + 0x14: 20 second + 0x19: 25 second + 0x1e: 30 second + where divtype: + 0x02: all diverts for all call types ? + Found only, when deactivate all diverts for all call types (with call type 0x00) + 0x15: all calls + 0x43: when busy + 0x3d: when not answered + 0x3e: if not reached + calltype: + 0x00: all calls (data, voice, fax) + 0x0b: voice calls + 0x0d: fax calla + 0x19: data calls + s Deactivate calldiverts{ 0x0001, 0x04, 0x00, divtype, calltype, 0x00 } + where divtype, calltype: see above + s Get call diverts { 0x0001, 0x05, 0x00, divtype, calltype, 0x00 } + where divtype, calltype: see above + r Get prepaid(?) info { 0x0005, ?,?,?,length,message(packed like in 7bit SMS)} +0x07: + s ??? { 0x0022, ? (1&2 sounds OK) } + r ??? OK { 0x0023, ?,?,? } + r ??? error { 0x0024, reason } + s ??? { 0x0025, ??? } + r ??? OK { 0x0026, ??? } + r ??? error { 0x0027, reason } +0x08: Security codes + s Change code { 0x0004, code, "current", 0x00, "new", 0x00 } + where code: 1: security code (5 chars) + 2: PIN (4 chars) + 3: PIN2 (4 chars) + 4: PUK (8 chars) + 5: PUK2 (8 chars) + s Status request { 0x0007, 0x01 } + r pin recvd { 0x0008, accepted } + where accepted: 0x0c (or 0x06): OK + code: waiting for (0x08/0x0004) code + s entering code { 0x000a, code, "code", 0x00 } + where code: see 0x08/0x0004 +0x09: SIM login + r login { 0x0080 } + r logout { 0x0081 } +0x0a: Network status + s Key duplication on/off{ 0x0044, on? 0x01: 0x02 } + s get used network { 0x0070 } + r network registration { 0x0071, ?,?,?,length,netstatus,netsel,cellIDH,cellIDL,lacH,lacL,netcode,netcode,netcode } +0x0c: Keys + s Get key assignments { 0x0040, 0x01 } + r Get key assignments { 0x0041, {key '1'}, 0x00, {key '2'} ... {key '0'}, 0,0,0, {symbols}, 0 } + where {key '0'} => ' ', '0' + s Press key { 0x0042, press: 0x01; release: 0x02, button, 0x01 } + where button: 0x01 - 0x09: 1-9 + 0x0a: 0 + 0x0b: # + 0x0c: * + 0x0d: Power + 0x0e: Pick up phone + 0x0f: Hang + 0x10: Volume + + 0x11: Volume - + 0x17: Up + 0x18: Down + 0x19: Menu + 0x1a: Names + 0x1B onwards: don't know but they do produce + a beep and light up the keypad as if + a key had been pressed. + r Press key ack { 0x0043, press/release/error(0x05) } + s ??? { 0x0044 } + r ??? ack { 0x0045, 0x01 } +0x0d: Status + r Display { 0x0050, 0x01, y, x, len, "string"(unicode) } + s Status request { 0x0051 } + r Status { 0x0052, no. of byte pairs, {byte pair} } + where {byte pair}: {cmd, 1:off 2:on} + cmd: 1: call in progress + 2: ??? + 3: have unread sms + 4: voice call active + 5: fax call active + 6: data call active + 7: key lock active + 8: is SMS storage full + s Display status { 0x0053, 1:on 2:off } + (will send displayed messages with x,y coordinates) + r Display status ack { 0x0054, 1 } +0x11: Phone clock & alarm + s set date and time { 0x0060, 1,1,7,yearh,yearl,month,mday,hour,min,0x00 } + r date and time set { 0x0061 } + s get date and time { 0x0062 } + r date and time recvd { 0x0063,date_set?,time_set?,?,?,yearh,yearl,month,mday,hour,min,second } + where: date_set & time_set==0x01 - set + 0x00 - not set, ?,?,yearh,yearl,month,mday,hour,min,second + not available in frame + s set alarm { 0x006b, 1,32,3,0x02(on-off),hour,min,0x00 } + r alarm set { 0x006c } + s get alarm { 0x006d } + r alarm received { 0x006e,?,?,?,?,alrm(==2:on),hour,min } +0x12: Connect to NBS port (61xx only ?) + s Send {+0x0c, 0x01, UDH header, data} + (without 0,1 header -- for oplogo, cli, ringtone etc upload) + where: UDH header = 0x06, 0x05, 0x04,destporth,destportl,srcporth,srcportl +0x13: Calendar notes + s Write calendar note { 0x0064, 0x01, 0x10, length, type, yearH, yearL, month, day, hour, timezone, + alarm?(alarm yearH, yearL, month, day, hour, timezone): (0,0,0,0,0,0), + textlen, "text" } + r Write cal.note report { 0x0065, return } + where return: 0x01: ok + 0x73: failure + 0x81: calendar functions busy. Exit Calendar menu and try again + s Calendar notes set { 0x0066... } + r Calendar note recvd { 0x0067, 0x01, ?, length, type, yrH,yrL,mon,day,hr,tz,alrm yrH,yrL,mon,day,hr,tz,textlen, "text" } + r Cal.note recvd error { 0x0067, err } + where err: 0x93: not available + (0x01: OK) + other: error + s Delete cal.note { 0x0068, location } + r Del. cal.note report { 0x0069, err } + where err: 0x01: OK + 0x93: cannot delete +0x14: SMS funcs + s Write SMS to SIM { 0x0004, .... } + s Mark SMS as read { 0x0007, 0x02, location, 0x00, 0x64 } + r SMS message frame rcv { 0x0008,subtype,?,num,?,BCD(smscenter)...} 20->type, 22->status + where type: 0x06: delivery report + status: 0x00: delivered + 0x30: pending + 0x46: failed + 0x09: reading failed + subtype: 0x02: invalid mem type + 0x07: empty SMS location + 0x0c: no access to memory (no PIN in card, etc.) + s Delete SMS message { 0x000a, 0x02, location } + r Delete OK { 0x000b } + s SMS status request { 0x0036, 0x64 } + r SMS status { 0x0037,?,?,?,?,?,?,msgnumber,unread } + r SMS status error { 0x0038 } +0x3f: WAP + s Enable WAP frames { 0x0000} + r Enable WAP frames { 0x0002, 0x01} + + s ?? { 0x0003} + r ?? { 0x0004} + + s Get WAP bookmark { 0x0006, 0x00, location} + where location: 0 - 14 + r Get WAP bookmark { 0x0007, 0x00, name_len, name(unicode), + url_len, url(unicode), 0x01,0x80,0x00[7]} + r Get WAP bookmark err { 0x0008, error } + where error: + 0x00(?)invalid position + 0x01 user inside "Bookmarks" menu. Must leave it + 0x02 invalid/too high/empty location + + s Set WAP bookmark { 0x0009, 0xff, 0xff, name_len, name(unicode), + url_len, url(unicode), 0x01,0x80,0x00[7] } + Note: bookmark is added to the first free location. + r Set WAP bookmark OK {+0x01, 0x36, 0x0a, block } + where block: + 0x0a, location_of_just_written_bookmark(?), + 0x00, next_free_location(?) + r Set WAP bookmark err {+0x01, 0x36, 0x0b, error } + where error: + 0x04 - memory is full + 0x01 - we are in the bookmark menu + 0x00 - unknown reason for now ;( + +? s Delete WAP bookmark { 0x000c, 0x00, location } + where: location = 0-14 +? r Delete WAR bookmark OK{ 0x000d } +? r Delete WAPbookmark err{ 0x000e, 0x02 } + + s ?? { 0x000F} + r ?? { 0x0010, 0x00} + + s Get WAP settings 1 { 0x0015, location} + where location: 0x00 - 0x05 + r Get WAP settings 1 OK { 0x0016, title length, title (Unicode), URL length, URL(Unicode),con_type, ???[6 bytes],location, ???[5 bytes],security,...} + where: + con_type: 0x00 - temporary + 0x01 - continuous + location: when use "Get WAP settings 2 frame", must give it + security: 0x00 = no, 0x01 = yes + r Get WAP settings 1 err{ 0x0017, error } + where error: + 0x01 user inside "Settings" menu. Must leave it + 0x02 invalid/too high/empty location + + s Get WAP settings 2 { 0x001b, location} + where location: 0x00 - 0x1d (you get it in "Get WAP settings 1" frame) + r Get WAP settings 2 OK { 0x001c, 0x01, type, frame...} + where type : 0x00 - SMS bearer + frame: + service_num_len, service_num (Unicode), server_num_len, server_num(Unicode) + 0x01 - data bearer + frame: + auth, call_type, call_speed, ?, IP len, IP (Unicode), dialup len, dialup (Unicode), + user len, user (Unicode), password len, password (Unicode) + where auth: 0x00 - normal, 0x01 - secure + call_type: 0x00 - analogue, 0x01 - ISDN + call_speed: 0x00 - 9600, 0x01 - 14400 + 0x02 - USSD bearer + frame: type, service number len/IP len,service num (Unicode)/IP (Unicode),service code len, + service code (Unicode) + where type: 0x01 - service number, 0x00 - IP + r Get WAP settings 2 err{ 0x001d,error} + where: error=0x05 +0x40: Security commands + s ??? {+0x00, 0x00, 0x07, 0x11, 0x00, 0x10, 0x00, 0x00} + This frame hangs phone (N3310 4.02). Meaning unknown ! + s Open simlock 1 { 0x02, 0x03, 0x1f, 0x11, 0x01, 0x01, 0x10, 0x00} + r Open simlock 1 { 0x02 } + s ???(N6150) { 0x08, 0x00 } + r ???(N6150) { 0x08 } + s Enable extended cmds { 0x64, cmd } + where cmd: 0x00: off + 0x01: on + 0x02: enter service mode ? + 0x03: reset (doesn't ask for PIN again) + 0x04: reset (PIN is requested) + In 5110 makes reset without PIN + 0x06: CONTACT SERVICE!!! Don't try it! + s Reset phone settings { 0x65, value, 0x00 } + where value: 0x08 - reset UI (User Interface) settings + 0x38 - reset UI, SCM and call counters + r Reset phone settings { 0x65, 0x00 } + s Get IMEI { 0x66 } + r Get IMEI { 0x66, 0x01, IMEI, 0x00} + s (ACD Readings)?(N6150 { 0x68 } + r (ACD Readings)?(N6150 { 0x68, ... } + s Get Product Profile + Settings { 0x6a} + r Get Product Profile + Settings { 0x6a, 4bytes with Product Profile Settings } + s Set Product Profile + Settings { 0x6b, 4bytes with Product Profile Settings } + r Set Product Profile + Settings OK ? { 0x6b } + s Get code { 0x6e, code } + where code: see 0x08/0x0004 (only sec.code is allowed) + r Get code { 0x6e, code, allowed, allowed? (sec code (text)) } + where code: see 0x08/0x0004 + allowed: 0: no + 1: yes + s Set code { 0x6f, code, sec code(text), 0x00 } + where code: see 0x08/0x0004 + s Start monitoring { 0x70, block } + where block(N6150): + 0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xf9,0x76,0x65,0x20,0x00, + 0x00,0x00,0x00,0x00,0x18,0x26,0x15,0x7d,0x0a,0x00, + 0xf5,0x82,0x7f,0xff,0xff,0xff,0xff,0xff,0xff,0xff, + 0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0x77,0x80, + 0x77,0x80,0xf2,0x82,0x20,0x20,0x20,0x20,0x20,0x20, + 0x20,0x20,0x20,0x20 + This block enables probably all possible monitorred parameters. + After it phone sends 0x00 message type values + s Break monitoring { 0x71 } + r Break monitoring { 0x71 } + s Reset Permanent + Counters (nm->test36) { 0x74, 0x01, 0x01, 0x0e } + r Reset Permanent + Counters (nm->test36) { 0x74 } + s Call commands { 0x7c, block } + where where: command, (values) + command: 0x01 + values: number(ASCII), 0x00 - makes voice call + command: 0x02 - answer call + command: 0x03 - release call + r Call commands { 0x7c, command } + s Netmonitor { 0x7e, field } + where: field: 00: next + F0: reset + F1: off + F2: field test menus + F3: developer menus + s Open simlock 2 { 0x81, 0x01, locknumber, 0x10, 0x10, 0x10, 0x10, 0x10 } + Note: sets simlock type to factory? + where locknumber: 1,2,4,8 + s Open simlock 2 { 0x81, 0x01, locknumber } + where locknumber: 1,2,4,8 + s Close simlock { 0x82, 0x01, locknumber, 0x00, 0x00, locksinfo(lock1,4,2,3), 0x00 } + where locknumber: 1,2,4,8 + r Close simlock { 0x82, the rest like in 0x40/0x8a } + s Get simlock info { 0x8a, 0x00} + r Get simlock info { 0x8a, 0x00, 0x01, lockstype, locksclosed, 0x00, 0x00, locksinfo(lock1,4,2,3), counter1,counter2,counter4,counter4,0x00 } + where: lockstype: bit1,bit2,bit3,bit4 - if set, selected lock is user lock + locksclosed: bit1,bit2,bit3,bit4 - if set, selected lock is closed + counter1 - counter4: counters for locks + s Set downloaded OpName { 0x8b, 0x00, MCC1, MCC2, MNC, Name, 0x00 } + r SetdownloadedOpNameOK?{ 0x8b, 0x00, 0x01 } + s Get downloaded OpName { 0x8c, 0x00 } + r Get downloaded OpName { 0x8c, 0x00, 0x01, MCC1, MCC2, MNC, Name, 0x00,...} + s Buzzer pitch { 0x8f, volume, hzLO, hzHI } + if volume and hz is 0, it's off + r Buzzer pitch { 0x8f} + s ACD Readings ? { 0x91, parameter?(0x02,0x03,0x04,0x05,0x07) } + r ACD Readings ? { 0x91, parameter?, value? } + s Sleep mode test { 0x92, 0x00, 0x00, howlong(2 bytes), enable } + where: enable == 0x01 - enable after test + 0x00 - don't enable after test + howlong (ms) = 0x07, 0xd0 = 2000 + s ???(N6150) { 0x98, 0x00 } + r ???(N6150) { 0x98, 0x00, 0x04 } + s Get bin ringtone { 0x9e, location } + where: location=0,1,etc. + r Get bin ringtone { 0x9e, location, error, contents... } + where location=0,1,etc. + error=0x0a, ringtone NOT available + 0x00, OK + s Set bin ringtone { 0xa0, location, 0x00, contenst... } + where: location=0,1,etc. + r Set bin ringtone { 0xa0, location, error } + where location=0,1,etc. + error=0x0a, ringtone NOT set + 0x00, ringtone set OK + r Get MSid { 0xb5, 0x01, 0x2f, msid, 0x25 } + s Get info about phone { 0xc8, 0x01 } + r Get info about phone { 0xc8, 0x01, 0x00, "V ", "firmware", 0x0a, "firmware date", 0x0a, "model", 0x0a, "(c) NMP.", 0x00 } + s Get MCU SW Checksum { 0xc8, 0x02 } + r Get MCU SW Checksum { 0xc8, 0x02, 0x00, checksum (4 bytes),0x00 } + s DPS External SW { 0xc7, 0x03 } + r DSP External SW { 0xc7, 0x03, 0x00, string,0x00 } + s Get HW { 0xc8, 0x05 } + r Get HW { 0xc8, 0x05, 0x00, HW version (4 bytes), 0x00 } + s Get "Made" Date { 0xc8, 0x05 } + r Get "Made" Date { 0xc8, 0x05, 0x00, date(4 bytes), 0x00 } + s Get DSP Internal SW { 0xc8, 0x09 } + r Get DSP Internal SW { 0xc8, 0x09, 0x00, version (1 bytes), 0x00 } + s Get PCI version { 0xc8, 0x0b } + r Get PCI version { 0xc8, 0x0b, 0x00, version, 0x00 } + s Get system ASIC { 0xc8, 0x0c } + r Get system ASIC { 0xc8, 0x0c, 0x00, string, 0x00 } + s Get COBBA { 0xc8, 0x0d } + r Get COBBA { 0xc8, 0x0d, 0x00, string, 0x00 } + s Get PLUSSA { 0xc8, 0x0e } + r Get PLUSSA { 0xc8, 0x0e, available, 0x00 } + where available: 0x01: not available + s Get CCONT { 0xc8, 0x0f } + r Get CCONT { 0xc8, 0x0f, available, 0x00 } + where available: 0x01: not available + s Get PPM version { 0xc8, 0x10 } + r Get PPM version { 0xc8, 0x10, 0x00, "V ", "firmware", 0x0a, "firmware date", 0x0a, "model", 0x0a, "(c) NMP.", 0x00 } + s Get PPM info { 0xc8, 0x12 } + r Get PPM info { 0xc8, 0x12, 0x00, PPM version ("B", "C", etc.), 0x00 } + s Set HW version { 0xc9, 0x05, version, 0x00 } + s Get Product Code { 0xca, 0x01 } + r Get Product Code { 0xca, 0x01, 0x00, number, 0x00 } + s Get Order Number { 0xca, 0x02 } + r Get Order Number { 0xca, 0x02, 0x00, string, 0x00 } + s Get Prod.Ser.Number { 0xca, 0x03 } + r Get Prod.Ser.Number { 0xca, 0x03, 0x00, number, 0x00 } + s Get Basic Prod.Code { 0xca, 0x04 } + r Get Basic Prod.Code { 0xca, 0x04, 0x00, number, 0x00 } + s Set Product Code { 0xcb, 0x01, product code, 0x00 } + s Set Order Number { 0xcb, 0x02, number, 0x00 } + s Set Prod.Ser.Number { 0xcb, 0x03, number, 0x00 } + s Get (original ?)IMEI { 0xcc, 0x01 } + r Get (original ?)IMEI { 0xcc, 0x01, IMEI, 0x00 } + s Get Manufacture Month { 0xcc, 0x02 } + r Get Manufacture Month { 0xcc, 0x02, 0x00, string, 0x00 } + s Get Purchare date { 0xcc, 0x04 } + r Get Purchare date { 0xcc, 0x04, 0x00, string, 0x00 } + s Set "Made" date { 0xcd, 0x02, string, 0x00 } + s Make "all" phone tests{ 0xce,0x1d,0xfe,0x23,0x00,0x00} + s Make one phone test { 0xce,0x1d,num1,num2,num3,num4} + Where num1-num4: 0x02,0x00,0x00,0x00; + 0x04,0x00,0x00,0x00; + 0x08,0x00,0x00,0x00; + 0x10,0x00,0x00,0x00; + 0x20,0x00,0x00,0x00; + 0x40,0x00,0x00,0x00; + 0x80,0x00,0x00,0x00; + 0x00,0x01,0x00,0x00; + 0x00,0x02,0x00,0x00; + 0x00,0x04,0x00,0x00; - "Power off" + No test for "Security data" + 0x00,0x10,0x00,0x00; + 0x00,0x20,0x00,0x00; + 0x00,0x40,0x00,0x00; + 0x00,0x80,0x00,0x00; + 0x00,0x00,0x01,0x00; + .... + 0x00,0x00,0x10,0x00; + s Result of phone tests { 0xcf } + r Result of phone tests { 0xcf, number of tests, results of next tests } + s ??? { 0xd1 } + r ???(N5110) { 0xd1, 0x00, 0x1d, 0x00, 0x01, 0x08, 0x00 } + s LCD Test { 0xd3, value } + where value: 0x03, 0x02 - 1'st test + 0x03, 0x01 - 2'nd test + 0x02, 0x03 - clears screen + s ACD Readings(N6150)? { 0xd4, 0x02, 0x00, 0x02, 0x00, 0x0e, 0x01} + r ACD Readings(N6150)? { 0xd4, 0x02, 0x00, 0x02, 0x00, 0x0e, 0x01, ?} + s Get EEPROM { 0xd4, 0x02, 0x00, 0xa0, locationLo, locationHi, numofbytes } + where: numofbytes - how many bytes to read + Note: Works ONLY in MBUS + r Get EEPROM { 0xd4, 0x02, 0x00, 0xa0, locationLo, locationHi, numofbytes, contest... } + where numofbytes - how many bytes available + contest - bytes with contests (if numofbytes != 0) +0x41: Snake game ? +0x47: + s Get Picture Image { 0x0001, location } + r Get Picture Image when contains sender number + { 0x0002, location, number(like in SMS), 0x00, len, text, 0x00, width, height, 0x01, bitmap } + NOTE: + Supports only 0x81 and 0x91 coding (NOT alphanumeric numbers!) + in sender without sender number + { 0x0002, location, 0x00, 0x00, 0x00, len, text, 0x00, width, height, 0x01, bitmap } + s Set Picture Image { 0x0003, frame...} + where frame: see 0x47/0x0002 + r Get/Set PictureImageOK{ 0x0004 } + r Set Picture Image err { 0x0005, error? } + where error=0x74 - wrong location ? +0x64: + s Phone ID request { 0x0010 } + r Phone ID recvd { 0x0011, "NOKIA", "imei", 0, "model", 0, "prod.code", 0, "HW", 0, "firmware", magic bytes x 4 ... } + s Accessory connection { 0x0012, 16x0x00, 'NOKIA&NOKIA accessory', 3x0x00 } (45 bytes) +0x7f: Acknowledge(FBUS/IRDA){+type, seq } + Acknowledge(MBUS)... +0xd0: + s Power on message seq1 {+04 } + r Power on message seq1 {+05 } +0xd1: + s Get HW&SW version { 0x0003, 0x00 } +0xd2: + r Get HW&SW version { 0x0003 "V " "firmware\n" "firmware date\n" + "model\n" "(c) NMP." } +0xda: ? (during playing 2 player snake) +0xf0: + s Send RLP frame {+0x00, 0xd9, ... } +0xf4: Power on message seq 2 diff --git a/Docs/developers/protocol/n7110.txt b/Docs/developers/protocol/n7110.txt new file mode 100644 index 0000000..2e051aa --- /dev/null +++ b/Docs/developers/protocol/n7110.txt @@ -0,0 +1,703 @@ + +Last update 16.02.2002 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Assembled by + Balazs Nagy (js@lsc.hu) + Marcin Wiacek (Marcin-Wiacek@TOPNET.PL) + Jens Bennfors + Michael Hund + Jay Bertrand + Gabriele Zappi + Markus Plail + Ralf Thelen + ... and other members of gnokii mailing list + and authors of some WWW pages. + +The data provided is for information purposes only. +Some of the frames might be hazardous to your phone. Be careful!!! +We do not take any responsibility or liability for damages, etc. + +NOTE: this information isn't (and can't be) complete. If you know anything +about features not listed here or you noticed a bug in this list, please +notify us via e-mail. Thank you. + +Document describing frames used in +GSM Nokia 6210 and derivatives (7110) +Correct format is FBUS version 2/Infrared/MBUS version 2 +(see nokia.txt for protocol details): + + List: + +0x00: Connect to NBS port ? + r Set ringtone {+0x7c,0x01,0x00,0x0d,0x06[6],0x78,ringtone packed according to SM2.0} + Seems not to work in MBUS! +0x01: Communication Status +? r Call msg { 0x0002 } +? r Call in progress { 0x0003, seqnr } +? r Remote end hang up { 0x0004, seqnr, ?, error (like in netmon in 39) } +? r incoming call alert { 0x0005, seqnr, numlen, "number", namelen, "name" } +? r answered call { 0x0007, seqnr } +? r terminated call { 0x0009, seqnr } +? r call msg { 0x000a, seqnr } + Note: in 6210 4.27 all msg from 0x01 seems to be unavailable +0x02: SMS handling + s Send SMS message { 0x0001, 0x02, 0x00 (SEND REQUEST), ... } + r Message sent { 0x0002 } + r Send failed { 0x0003, ?, ?, error (like in netmon in 65)} + s Incoming SMS info on { 0x000d, 0x00, 0x00, 0x02} + note: no info about Delivery Reports + r Incoming SMS info onOK{ 0x000e } + note: no info about Delivery Reports + r Incoming SMS infoonerr{ 0x000f, error } + where error: 0x0c - no PIN + r SMS message received { 0x0011, ...... } (whole message) + s Set CellBroadcast { 0x0020, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01 } + for enable cell broadcast ? + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } + for disable cell broadcast ? + r Set CellBroadcast OK { 0x0021, 0x01 } + r Read CellBroadcast { 0x0023, ?, ?, ?, channel, ?, message... } ? + s Set SMS center { 0x0030, 0x64, priority, checksum?, format, + validity[2], {DefaultRecipient no.}[12], + {SMScenter no.}[12], {SMSC name}, 0x00} + where tel.no.[12]: {len, type, {number(BCD)}} + type: 0x81: normal + 0x91: + (international) + 0xd0: alphanumeric + format: 0x00: text + 0x22: fax + 0x24: voice + 0x25: ERMES + 0x26: paging + 0x31: X.400 + 0x32: email + validity: 0x000b: 1 hour + 0x0047: 6 hours + 0x00a7: 24 hours + 0x00a9: 72 hours + 0x00ad: 1 week + 0x00ff: max.time + r Set SMS center OK { 0x0031 } + r Set SMS center error { 0x0032, reason } + s Get SMS center { 0x0033, 0x64, priority } + r SMS center received { 0x0034, priority, checksum?, type, + validity[2], {DefaultRecipient no.}[12], + {SMScenter no.}[12], {SMSC name}, 0x00 } + where priority, checksum, type, validity, + tel.no.[12]: see 0x02/0x0030 + r SMS center error recv { 0x0035, reason } + s?? { 0x0074} + r?? { 0x0075, 0xFF, 0x11, 0x98} + s?? { 0x008C} + r?? { 0x008D, 0x00} +0x03: Phonebook functions + s Get memory status { 0x0103, 0x02, memory type } + where: memory type - see 0x03/0x0107 + r Get memory status { 0x0104, 0x00, xL, 0x00[2], y1H, y1L, 0x10, + 0x00[2], z?, ymaxH, ymaxL, y2H, y2L, + 0x0d?, xH?, 0x00[2]? } + where y1: location (lowermost) + y2: no. of locations + ymax: maximum location no. + s Read memory { 0x0107, 0x01, 0x01, 0x00, 0x01, xH, xL, + yH, yL, 0x00, 0x00} + where x: memory type + 0x01: (256) Dialled numbers + 0x02: (512) Missed calls + 0x03: (768) Received calls + 0x05: (500) telephone phonebook + 0x06: (160) SIM phonebook + 0x07: (10/0) + 0x08: (1/0) + 0x09: (4) voice mailbox + 0x0e: (10) speed dials + 0x10: (5) caller groups + y: location + r Read memory error { 0x0108, 0x00, 0x01, + code,0x00, 0x00, z, error} + where code==0x0f + error: 0x34 - phonebook location not found + 0x3b - speed dial not assigned + r Read memory OK { 0x0108, 0x00, 0x01, + code,0x00, 0x00, z, xH, xL, yH, yL, 0x00, 0x00, 0x00, no.of blocks, { block } * } + where code: != 0x0f + y: location + z: generic block size + block: {id, 0, 0, blocksize, block no., + {contents}, 0x00} + id: 0x04 pointer to another memory location { 0xff?, yH, yL, xL,0x00[3] } + 0x07 name {len, (unicode)}, + 0x08 email + 0x09 postal + 0x0a note {len, (unicode)} + 0x0b number {type, 0x00[3], len, (unicode)} + 0x0c ringtone {ringtone no., 0, 0} + 0x13 date for a called list (DC, RC, etc.) + 0x1b caller group graphic {width, height, 0, 0 {bitmap}} + 0x1c caller group graphic on? {(1: yes, 0: no), 0, 0} + 0x1e caller group number {number, 0, 0} + type: 0x0a: General, + 0x03: Mobile (office ?), + 0x06: Work, + 0x04: Fax, + 0x02: Home (mobile ?) + s Set mem location { 0x010b, 0x00, 0x01, 0x01, 0x00, 0x00, z, + xH, xL, yH, yL, 0x00, 0x00, 0x00, + no.of blocks, { block }[no.of blocks] } + r Set mem location { 0x010c, 0?, 1?, code, 0?, 0?, z?, 0?, 0?, + yH, yL, xL } + where code: + 0x3d - wrong entry type + 0x3e - too much entries + s Delete mem location { 0x010f, 0x00, 0x01, 0x04, 0x00, 0x00, 0x0c, 0x01, 0xff, xH, xL, + yH, yL, 0x00, 0x00} + where x: location + y: memory type + r Delete mem location { 0x0110, 0x00, 0x00 } +0x06: Calling line restriction/Call forwarding etc + r Get call divert { 0x0001, 0x02, x, 0x00, divtype, 0x02, calltype, y, z, 0x0b, number, 0x00...0x00, timeout (byte 45) } + s Set call divert { 0x0001, 0x03, 0x00, divtype, calltype, 0x01, number(packed like in SMS), 0x00 ... 0x00, + length of number (byte 29), 0x00 ... 0x00, timeout (byte 52), 0x00, 0x00, 0x00} + NOTE: msglen=0x37 + where timeout: + 0x00: not set ? + 0x05: 5 second + 0x0a: 10 second + 0x0f: 15 second + 0x1e: 20 second + 0x14: 25 second + 0x19: 30 second + where divtype: + 0x02: all diverts for all call types ? + Found only, when deactivate all diverts for all call types (with call type 0x00) + 0x15: all calls + 0x43: when busy + 0x3d: when not answered + 0x3e: if not reached + calltype: + 0x00: all calls (data, voice, fax) + 0x0b: voice calls + 0x0d: fax calla + 0x19: data calls + s Deactivate calldiverts{ 0x0001, 0x04, 0x00, divtype, calltype, 0x00 } + where divtype, calltype: see above + s Get call diverts { 0x0001, 0x05, 0x00, divtype, calltype, 0x00 } + where divtype, calltype: see above +0x0a: Network status + s get used network { 0x0070 } + r get used network { 0x0071, available,?,?,length,netstatus,netsel,cellIDH, + cellIDL,lacH,lacL,MCC+MNC[3],{Opstr}, 4?, + len, xlen(78), ylen(21), 0, {bitmap} } + where {Opstr}: namelen, {operator name(unicode)} + len: {xlen, ylen, 0, {bitmap} + 2 + {bitmap}: bitmaplen, 0, 0, {OTA bitmap} + available: 0x02 if the logo following is valid, + 0x01 for no operator logo following + s get network status { 0x0081 } + r get network status { 0x0082, network%, 0x14? } + s set operator logo { 0x01a3 0x01, oplogo?, MCC+MNC[3], 0?,4?,len, + xlen(78),ylen(21), 0 (frames?), + {bitmap}*?, 0x00(padding) } + where len, {bitmap}: see 0x0a/0x0071 + r set operator logo OK { 0x01a4 } + s clear operator logo { 0x00af, x} + where x==0 to 4 + r clear operator logo { 0x00bf} +0x13: Calendar notes + s Add meeting note { 0x0001, body like in subtype 0x001a...} + r Add meeting note { 0x0002, location (2 bytes), status (2 bytes)} + s Add call note { 0x0003, body like in subtype 0x001a...} + r Add call note { 0x0004, location (2 bytes), status (2 bytes)} + s Add birthday note { 0x0005, location (2 bytes), entry type, 0x00, year of birth(2 bytes), + Month, Day, 0x00, 0x00, alarm (4 bytes), alarm type, length, text (Unicode)} + r Add birthday note { 0x0006, location (2 bytes), status (2 bytes)} + s Add reminder note { 0x0007, body like in subtype 0x001a...} + r Add reminder note { 0x0008, location (2 bytes), status (2 bytes)} + s Delete calendar note { 0x000b, location (2 bytes) } + r Delete calendar note { 0x000c, location (2 bytes), ?, ?, ?, ? } + s Get calendar note { 0x0019, location (2 bytes) } + r Calendar note recvd { 0x001a, location (2 bytes), entry type, 0x00, year (2 bytes), Month, Day, block} + where: entry type - 0x01 - Meeting, 0x02 - Call, 0x04 - Birthday, 0x08 - Reminder + block: for Meeting:{hour,minute,alarm (two bytes),recurrance (two bytes),len,0x00,string(unicode)} + where alarm=Number of minutes before the time of the meeting + that the alarm should be triggered: + For meetings with "No alarm"=0xFFFF (-1). + For "On time"=0x0000 + half an hour=0x001E, and so on. + Recurrance=in hours, between future occurances of this meeting. + If there is no repeat, this value is 0x0000. The special value 0xffff + means 1 Year! + for Call:{Hour,Minute,Alarm (as above),Recurrance (as above),namelen,numberlen, + name(unicode),number(unicode)} + for Reminder:{Recurrance (as above),len,0x00,string(unicode)} + for Birthday:{byte1,byte2,alarm(4 bytes),yearofbirth,alarmtype,len,string(unicode)} + byte1 and byte2 may vary (???). Usually are 0x00 both (but not always) + In Birthday, the Year in the common part, usually contains a strange year. + So, don't consider it as Year of note, neither year of BirthDay (for Year of + Birthday use the value described below). + where alarm=32-bit integer that is the number of seconds between the desired + alarm time and 11:59:58pm on the birthday.For "No Alarm", the value is + 0x0000FFFF (65535). + YearOfBirth=used instead of the one in the common part of the entry (see above) + but only when reading birthday entries. For storing entries, this field does + not exist. + AlarmType: 0x00 - Tone, 0x01 - Silent +? s??? { 0x0021 } +? r??? { 0x0022, 0x5A, 0x00 } +? s??? { 0x0025 } +? r??? { 0x0026, 0x04, 0x00 } +? s { 0x0029 } +? r { 0x002A, 0x04, 0x00 } + s Get first free pos { 0x0031 } + r Get first free pos { 0x0032, location (2bytes) } + s Get notes info { 0x003a, 0xFF, 0xFE} + r Get notes info { 0x003b, how many notes used (2 bytes), 0x01, 0x07, { two bytes with location for each note} *} +? s Get calendar note?? { 0x003E, location (2 bytes) } +? r Get calendar note?? { 0x003F, location (2bytes), ... } +0x14: + s Get Picture Image { 0x0007, location, number[2 bytes], 0x00, 0x64 } + r Get Picture Image { 0x0008, 0x07, location, number[2 bytes], 0x07, ??[38], + width, height, lenH, lenL, {bitmap}, 0x00, 0x00, text len, text(coded like in SMS)...} + r Get SMS failed { 0x0009, 0x02 }, + s Get SMS status { 0x0036, 0x64 } + r Get SMS Status { 0x0037, 0x05/0x03, 0x01, 0x00, 0x00, + a (2 octets), b (2 octets), c (2 octets), + d (2 octets), e (2 octets), 0x00 + where: + a - according to P.Kot: + Number of locations in "fixed" memory. These are all + Templates entries in my Nokias 6210 (NPE-3 (c) NMP V05.36 + 14-11-01, NPE-3 (c) NMP V05.27 01-08-01). + I can't remove any of Templates entries in my phone. + Marcin Wi¥cek: Rather not ! I don't agree. + I have 0x00, 0x0f and 10 templates and 3 SMS + and 10 Picture Images. + b - Number of used messages in phone memory. These + are messages manually moved from the other folders. + Picture messages are saved here. + c - Number of unread messages in phone memory. Probably + only smart messsages. + d - Number of used messages in SIM memory. These are + either received messages or saved into Outbox/Inbox. + Note that you *can't* save message into this memory + using 'Move' option. Picture messages are not here. + e - Number of unread messages in SIM memory + + s Set Picture Image { 0x0050, 0x07, location, number[2 bytes], 0x07, ??[38], + width, height, lenH, lenL, {bitmap}, 0x00, 0x00, text len, text(coded like in SMS)...} + std. size: 72x28 + r Set Picture Image { 0x0051, location, number[2 bytes], 0x07 } + s Set SMS name { 0x0083,folder,location(2bytes),name(Unicode),0x00 , 0x00} + r Set SMS name { 0x0084,folder,0x00, 0x00, name (Unicode),0x00,0x00} + s List Picture Images { 0x0096, location, 0x0f, 0x07 } + where location: + LM tries with 0x09, 0x11, 0x19, 0x21, 0x29, 0x31, 0x39, 0x41, 0x49 + Returned value with 0x21 + r List Picture Images { 0x0097, number of pictures[2 bytes], number1[2 bytes], number2[2 bytes], ..., } + s Write SMS to folder { 0x0104, status, folder ID, location(2 bytes), 0x02, 0x01, SMS stuff ... } + r Write SMS to folder { 0x0105, folder ID, location(2 bytes), 0x00 } + r Write SMS to folder { 0x0106, 0x02 (write failed errorcode ?) } + s Get SMS from folder { 0x0107, folderID, location(2 bytes), 0x01, 0x65, 0x01} + where: folderID - see 0x14/0x017B + r Get SMS from folder { 0x0108, status, folderID, 0x00, location, type, sender number,...} + + where: status=0x01 - reveived/read + 0x03 - received/unread + 0x05 - stored/sent + 0x07 - stored/not sent + + where: folderID - see 0x14/0x017B + + where: type=0x00 - received SMS + 0x01 - delivery report + 0x02 - stored SMS + 0x07 - picture message + s Delete SMS message { 0x010a, folderID, location(2 bytes), 0x01 } + r Delete SMS { 0x010b } + s Get folder status { 0x016b, folderID, 0x0F, 0x01} + where: folderID - see 0x14/0x017B + r Get folder status { 0x016c, number of entries (2 bytes), entry1number (2 bytes), entry2number(2 bytes), ....} + s Get folder names { 0x017A, 0x00, 0x00} + r Get folder names { 0x017B, number of strings, folderID, name1, 0x00, folderID, name2, 0x00, name3, 0x00,...} + where: folderID=0x08 - Inbox + 0x10 - Outbox + 0x18 - Archive + 0x20 - Templates + 0x29 - first "My folders" + 0x31 - second "My folders" + 0x39 - third -"- + and so on +0x17: + s Get Battery info { 0x0002 } + r Get Battery info { 0x0003, 0x0b, batt%, 0x14?, 0x01? } +0x19: Phone clock & alarm + + These frames are like the same frames subtypes in 0x11 in 6110 + + s set date and time { 0x0060, 1,1,7,yearh,yearl,month,mday,hour,min,0x00 } + r date and time set { 0x0061 } + s get date and time { 0x0062 } + r date and time recvd { 0x0063,date_set?,time_set?,?,?,yearh,yearl,month,mday,hour,min,second } + where: date_set & time_set==0x01 - set + 0x00 - not set, ?,?,yearh,yearl,month,mday,hour,min,second + not available in frame + s set alarm { 0x006b, 1,32,3,0x02(on-off),hour,min,0x00 } + r alarm set { 0x006c } + s get alarm { 0x006d } + r alarm received { 0x006e,?,?,?,?,alrm(==2:on),hour,min } + + These are new (?) + +? s ?? { 0x0083, id } +? r ?? { 0x0084, 0x01, 0x40, 0x03, id, 0x00, 0x00 } +? r ?? { 0x0084, 0x01, 0x40, 0x03, id, 0x00, 0x01 } +? r ?? { 0x0084, 0x01, 0x40, 0x03, id, 0x01, 0x00 } + where: id=0x27,0x2a,0x32,0x28,0x40 +0x1b: + s Get IMEI { 0x0001 } + r Get IMEI { 0x0002, {IMEI(ASCII)}, 0x00 } + s get HW&SW version { 0x0003, 0x01, 0x32 } + r get HW&SW version { 0x0004, "V " "firmware\n" "firmware date\n" + "model\n" "(c) NMP." 0x00 0xff[14] } +0x1f: + s ??? { 0x0010, 0x02, 0x00, 0xff, 0xff } + r ??? { 0x0011, length, 0x00, {block}[length] } + where block: { unicode letter[2], 0x0000, + 0x00, 0x55, ??, ?? } + s Set ringtone { 0x011f, 0x00, location, 0x00, name(Unicode), + ringtone(format the same to 0x40/0x019e and 0x40/0x01a0) } + where: location: 0x87 to 0x8b on N6210 + 0x74 to ... on N7110 + s Get ringtone { 0x0122, 0x00, location} + r Get ringtone { 0x0123, 0x00, location, name(Unicode), 0x00,...,0x00, 0x02,0xFC,0x09(ringtone contenst)} + r Get ringtone error { 0x0124, ...} +0x39: + s get profile feature { 0x0101, 0x01, 0x01, 0x01, number1, number2} + where number1: from 0x00 to 0x07 (for each profile ?) + number2: 0x00 - 0x09, 0x0A, 0x16 - 0x19, 0x1a - 0x1f, 0x20 - 0x29, 0x2a - 0x2c, 0xff + where 0x09: keypad tones 0x02: incoming call alert 0x03: ringtone number + 0x04: ringing volume + 0x05: message alert tone 0x06: vibra 0x07: warning tones 0x08: caller groups alert for 0x09: automatic answer + 0xff: name + r get profile feature { 0x0102, 0x01, 0x02, number2, block...} + for number2==0xff: (Profile Name) + block: 0x01, length, name(Unicode), 0x00, 0x00 + for number2==0x00: (Keypad Tones) + block: 0x01, 0x01, 0x01, Type, 0x01 + where: Type : 0x00 = Off + 0x01 to 0x03 = Level1 .. Level3 + for number2==0x02: (Incoming Call Alert) + block: 0x01, 0x01, 0x01, Type, 0x01 + where: Type : 0x00 = Ringing + 0x01 = Ascending + 0x02 = Ring Once + 0x03 = Beep Once + 0x05 = Off + for number2==0x03: (Ringtone Number) + block: 0x01, 0x01, 0x01, Number, 0x01 + where: Number : 0x40 to 0x62 - gives number of factory ringtone. The number of menu is + obtained by doing (Number - 0x3f); + where: Number : 0x89 to 0x8d - gives number of uploaded ringtone. The number of menu is + obtained by doing (Number - 0x65),while the uploaded ringtone number is + obtained by doing (Number - 0x88). + for number2==0x04: (Ringing volume) + block: 0x01, 0x??, 0x??, Volume, 0x01 + where: Volume : 0 = Level1 .. to 4 = Level5 + for number2==0x05: (Message Alert Tone) + block: 0x01, 0x01, 0x??, Type, 0x01 + where: Type : 0x00 = Off + 0x01 = Standard + 0x02 = Special + 0x03 = Beep Once + 0x04 = Ascending + for number2==0x06: (Vibration) + block: 0x01, 0x??, 0x??, Switch, 0x01 + where: Switch : 0 = Off, 1 = On + for number2==0x07: (Warning Tones) + block: 0x01, 0x??, 0x??, Switch, 0x01 + where: Switch : 0 = Off, 1 = On + for number2==0x08: (Caller groups Alert for) + block: 0x01, 0x??, 0x??, Callers, 0x01 + where: Callers : 0xff = All calls alert (Read below *) + 0x01 = Family + 0x02 = VIP + 0x04 = Friends + 0x08 = Colleagues + 0x10 = Others + All logical OR among groups are valid, so if you select from one phone's profile + alert for Friends and Collegues, a 0x0c will return (because 0x04 OR 0x08 = 0x0c). + (*) If Callers==0xff, means "Alert for All calls". Then, in this case, you don't + need to read other groups selection. + for number2==0x09: (Automatic answer) + block: 0x01, 0x??, 0x??, Switch, 0x01 + where: Switch : 0 = Off, 1 = On + N.B. This feature is valid for Handsfree and Headset profiles only! + s ??? { 0x0101, 0x04, 0x01, 0x01, 0xff, 0x03 } + r ??? { 0x0102, 0x01, 0x02, 0x03, 0x01, 0x01, 0x01, 0x85/0x087 } + + s ? { 0x0105} + r ? { 0x0106, 0x01, 0x04} +0x3f: WAP + s Enable WAP frames { 0x0000} + r Enable WAP frames { 0x0002, 0x01} + + s ?? { 0x0003} + r ?? { 0x0004} + + s Get WAP bookmark { 0x0006, 0x00, location} + where location: 0 - 14 + r Get WAP bookmark { 0x0007, 0x00, name_len, name(unicode), + url_len, url(unicode), 0x01,0x80,0x00[7]} + r Get WAP bookmark err { 0x0008, error } + where error: + 0x00(?)invalid position + 0x01 user inside "Bookmarks" menu. Must leave it + 0x02 invalid/too high/empty location + + s Set WAP bookmark { 0x0009, 0xff, 0xff, name_len, name(unicode), + url_len, url(unicode), 0x01,0x80,0x00[7] } + Note: bookmark is added to the first free location. + r Set WAP bookmark OK {+0x01, 0x36, 0x0a, block } + where block: + 0x0a, location_of_just_written_bookmark(?), + 0x00, next_free_location(?) + r Set WAP bookmark err {+0x01, 0x36, 0x0b, error } + where error: + 0x04 - memory is full + 0x01 - we are in the bookmark menu + 0x00 - unknown reason for now ;( + +? s Delete WAP bookmark { 0x000c, 0x00, location } + where: location = 0-14 +? r Delete WAR bookmark OK{ 0x000d } +? r Delete WAPbookmark err{ 0x000e, 0x02 } + + s ?? { 0x000F} + r ?? { 0x0010, 0x00} + + s Get WAP settings 1 { 0x0015, location} + where location: 0x00 - 0x05 + r Get WAP settings 1 OK { 0x0016, title length, title (Unicode), URL length, URL(Unicode),con_type, ???[6 bytes],location, ???[5 bytes],security,...} + where: + con_type: 0x00 - temporary + 0x01 - continuous + location: when use "Get WAP settings 2 frame", must give it + security: 0x00 = no, 0x01 = yes + r Get WAP settings 1 err{ 0x0017, error } + where error: + 0x01 user inside "Settings" menu. Must leave it + 0x02 invalid/too high/empty location + s Get WAP settings 2 { 0x001b, location} + where location: 0x00 - 0x1d (you get it in "Get WAP settings 1" frame) + r Get WAP settings 2 OK { 0x001c, 0x01, type, frame...} + where type : 0x00 - SMS bearer + frame: + service_num_len, service_num (Unicode), server_num_len, server_num(Unicode) + 0x01 - data bearer + frame: + auth, call_type, call_speed, ?, IP len, IP (Unicode), dialup len, dialup (Unicode), + user len, user (Unicode), password len, password (Unicode) + where auth: 0x00 - normal, 0x01 - secure + call_type: 0x00 - analogue, 0x01 - ISDN + call_speed: 0x00 - 9600, 0x01 - 14400 + 0x02 - USSD bearer + frame: type, service number len/IP len,service num (Unicode)/IP (Unicode),service code len, + service code (Unicode) + where type: 0x01 - service number, 0x00 - IP + r Get WAP settings 2 err{ 0x001d,error} + where: error=0x05 +0x40: Security commands +? s ???(N6150) { 0x08, 0x00 } +? r ???(N6150) { 0x08 } + s Enable extended cmds { 0x64, cmd } + where cmd: 0x00: off + 0x01: on + 0x03: reset (doesn't ask for PIN again) + 0x04: reset (PIN is requested) + In 5110 makes reset without PIN + 0x06: CONTACT SERVICE!!! Don't try it! + s Get IMEI { 0x66 } + r Get IMEI { 0x66, 0x01, IMEI, 0x00} + s (ACD Readings)?(N6150 { 0x68 } + r (ACD Readings)?(N6150 { 0x68, ... } + s Get Product Profile + Settings { 0x6a} + r Get Product Profile + Settings { 0x6a, 4bytes with Product Profile Settings } + s Set Product Profile + Settings { 0x6b, 4bytes with Product Profile Settings } + r Set Product Profile + Settings OK ? { 0x6b } + s Get code { 0x6e, code } + where code: see 0x08/0x0004 (no allowed code !) + r Get code { 0x6e, code, allowed, allowed? (sec code (text)) } + where code: see 0x08/0x0004 + allowed: 0: no + 1: yes +? s Reset Permanent +? Counters (nm->test36) { 0x74, 0x01, 0x01, 0x0e } +? r Reset Permanent +? Counters (nm->test36) { 0x74 } + s Call commands { 0x7c, block } + where where: command, (values) + command: 0x01 + values: number(ASCII), 0x00 - makes voice call + command: 0x02 - answer call + command: 0x03 - release call + r Call commands { 0x7c, command } + s Netmonitor { 0x7e, field } + where: field: 00: next + F0: reset + F1: off + F2: field test menus + F3: developer menus + s Get simlock info { 0x8a, 0x00} + r Get simlock info { 0x8a, 0x00, 0x01, lockstype, locksclosed, 0x00, 0x00, locksinfo(lock1,4,2,3), counter1,counter2,counter4,counter4,0x00 } + where: lockstype: bit1,bit2,bit3,bit4 - if set, selected lock is user lock + locksclosed: bit1,bit2,bit3,bit4 - if set, selected lock is closed + counter1 - counter4: counters for locks + s Buzzer pitch { 0x8f, volume, hzLO, hzHI } + if volume and hz is 0, it's off + r Buzzer pitch { 0x8f} + s ACD Readings ? { 0x91, parameter?(0x02,0x03,0x04,0x05,0x07) } + r ACD Readings ? { 0x91, parameter?, value? } +? s ???(N6150) { 0x98, 0x00 } +? r ???(N6150) { 0x98, 0x00, 0x04 } + s Get bin ringtone { 0x9e, location } + where: location=0,1,etc. + r Get bin ringtone { 0x9e, location, error, contents... } + where location=0,1,etc. + error=0x0a, ringtone NOT available + 0x00, OK + s Set bin ringtone { 0xa0, location, 0x00, contenst... } + where: location=0,1,etc. + r Set bin ringtone { 0xa0, location, error } + where location=0,1,etc. + error=0x0a, ringtone NOT set + 0x00, ringtone set OK +? r Get MSid { 0xb5, 0x01, 0x2f, msid, 0x25 } + s Get info about phone { 0xc8, 0x01 } + r Get info about phone { 0xc8, 0x01, 0x00, "V ", "firmware", 0x0a, "firmware date", 0x0a, "model", 0x0a, "(c) NMP.", 0x00 } + s Get MCU SW Checksum { 0xc8, 0x02 } + r Get MCU SW Checksum { 0xc8, 0x02, 0x00, checksum (4 bytes),0x00 } + s DPS External SW { 0xc7, 0x03 } + r DSP External SW { 0xc7, 0x03, 0x00, string,0x00 } + s Get HW { 0xc8, 0x05 } + r Get HW { 0xc8, 0x05, 0x00, HW version (4 bytes), 0x00 } + s Get "Made" Date { 0xc8, 0x05 } + r Get "Made" Date { 0xc8, 0x05, 0x00, date(4 bytes), 0x00 } + s Get DSP Internal SW { 0xc8, 0x09 } + r Get DSP Internal SW { 0xc8, 0x09, 0x00, version (1 bytes), 0x00 } + s Get PCI version { 0xc8, 0x0b } + r Get PCI version { 0xc8, 0x0b, 0x00, version, 0x00 } + s Get system ASIC { 0xc8, 0x0c } + r Get system ASIC { 0xc8, 0x0c, 0x00, string, 0x00 } + s Get COBBA { 0xc8, 0x0d } + r Get COBBA { 0xc8, 0x0d, 0x00, string, 0x00 } + s Get PLUSSA { 0xc8, 0x0e } + r Get PLUSSA { 0xc8, 0x0e, available, 0x00 } + where available: 0x01: not available + s Get CCONT { 0xc8, 0x0f } + r Get CCONT { 0xc8, 0x0f, available, 0x00 } + where available: 0x01: not available + s Get PPM version { 0xc8, 0x10 } + r Get PPM version { 0xc8, 0x10, 0x00, "V ", "firmware", 0x0a, "firmware date", 0x0a, "model", 0x0a, "(c) NMP.", 0x00 } + s Get PPM info { 0xc8, 0x12 } + r Get PPM info { 0xc8, 0x12, 0x00, PPM version ("B", "C", etc.), 0x00 } + s Set HW version { 0xc9, 0x05, version, 0x00 } + s Get Product Code { 0xca, 0x01 } + r Get Product Code { 0xca, 0x01, 0x00, number, 0x00 } + s Get Order Number { 0xca, 0x02 } + r Get Order Number { 0xca, 0x02, 0x00, string, 0x00 } + s Get Prod.Ser.Number { 0xca, 0x03 } + r Get Prod.Ser.Number { 0xca, 0x03, 0x00, number, 0x00 } + s Get Basic Prod.Code { 0xca, 0x04 } + r Get Basic Prod.Code { 0xca, 0x04, 0x00, number, 0x00 } + s Set Product Code { 0xcb, 0x01, product code, 0x00 } + s Set Order Number { 0xcb, 0x02, number, 0x00 } + s Set Prod.Ser.Number { 0xcb, 0x03, number, 0x00 } + s Get (original ?)IMEI { 0xcc, 0x01 } + r Get (original ?)IMEI { 0xcc, 0x01, IMEI, 0x00 } + s Get Manufacture Month { 0xcc, 0x02 } + r Get Manufacture Month { 0xcc, 0x02, 0x00, string, 0x00 } + s Get Purchare date { 0xcc, 0x04 } + r Get Purchare date { 0xcc, 0x04, 0x00, string, 0x00 } + s Set "Made" date { 0xcd, 0x02, string, 0x00 } + s Make "all" phone tests{ 0xce,0x1d,0xfe,0x23,0x00,0x00} + s Make one phone test { 0xce,0x1d,num1,num2,num3,num4} + Where num1-num4: 0x02,0x00,0x00,0x00; + 0x04,0x00,0x00,0x00; + 0x08,0x00,0x00,0x00; + 0x10,0x00,0x00,0x00; + 0x20,0x00,0x00,0x00; + 0x40,0x00,0x00,0x00; + 0x80,0x00,0x00,0x00; + 0x00,0x01,0x00,0x00; + 0x00,0x02,0x00,0x00; + 0x00,0x04,0x00,0x00; - "Power off" + No test for "Security data" + 0x00,0x10,0x00,0x00; + 0x00,0x20,0x00,0x00; + 0x00,0x40,0x00,0x00; + 0x00,0x80,0x00,0x00; + 0x00,0x00,0x01,0x00; + .... + 0x00,0x00,0x10,0x00; + s Result of phone tests { 0xcf } + r Result of phone tests { 0xcf, number of tests, results of next tests } +? s ??? { 0xd1 } +? r ???(N5110) { 0xd1, 0x00, 0x1d, 0x00, 0x01, 0x08, 0x00 } + s LCD Test { 0xd3, value } + where value: 0x03, 0x02 - 1'st test + 0x03, 0x01 - 2'nd test + 0x02, 0x03 - clears screen + s ACD Readings(N6150)? { 0xd4, 0x02, 0x00, 0x02, 0x00, 0x0e, 0x01} + r ACD Readings(N6150)? { 0xd4, 0x02, 0x00, 0x02, 0x00, 0x0e, 0x01, ?} + r Function of { 0xff, 0x8c } + 0x40 msgtype not + supported ? +0x78: + s Status confirm { 0x0201, 0x03 } + r Incoming call seq1 { 0x0102 0x0e 0x03 } + r Incoming call seq2 { 0x0102 0x7e 0x01 } +0x79: + s CarKit enable { 0x0201 0x01 0x62 0x00 } + r CarKit enabled { 0x0201 0x02 0x06 0x00 "V " {version} "\nHFU" + 0x00 } +0x7a: settings + r Set setting { 0x01eb, number, 0x00 } + s Set setting { 0x01ec, number, contents } + where for number: + 0x02 (startup text) : 0x00, text (Unicode) + 0x15 (startup logo) : 0x00, 0x00, 0x00, 0x04, + 0xc0, 0x02, 0x00, height, 0xc0, 0x03, 0x00, width, + 0xc0, 0x04, 0x03, 0x00, {bitmap} } + where width, height, {bitmap}: see 0x7a/0x01ed 0x15 + s Get setting { 0x01ee, number} + where number: 0x01 - 0x1e + 0x02: startup text + 0x15: startup logo + 0x1c: security code + r Get setting { 0x01ed,number, 0x00, contents} + where for number: + 0x02 (startup text) : 0x00, text (Unicode) + 0x15 (startup logo) : 0x00, 0x00, 0x00, 0x04, + 0xc0, 0x02, 0x00, height, 0xc0, 0x03, 0x00, width, + 0xc0, 0x04, 0x03, 0x00, {bitmap} } + where height: 60 (0x3c) or 65 + width: 96 (0x60) + {bitmap}: like other bitmaps but pixels + placed vertically. + 0x1c (security code): {code(ascii)}, 0x00 +0x7f: Acknowledge(FBUS/IRDA){+type, seq } + Acknowledge(MBUS)... +0xd0: + s Power on message seq1 {+04 } + r Power on message seq1 {+05 } +0xd1: + s Get HW&SW version { 0x0003, 0x00 } +0xd2: + r Get HW&SW version { 0x0003 "V " "firmware\n" "firmware date\n" + "model\n" "(c) NMP." } +0xf4: Power on message seq 2 diff --git a/Docs/developers/protocol/nokia.txt b/Docs/developers/protocol/nokia.txt new file mode 100644 index 0000000..965dc59 --- /dev/null +++ b/Docs/developers/protocol/nokia.txt @@ -0,0 +1,279 @@ + +Document describing protocol used in Nokia phones. + +The data provided is for information purposes only. +Some of the frames might be hazardous to your phone. Be careful!!! +We do not take any responsibility or liability for damages, etc. + +Last update 01.03.2001 +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Assembled by + Balazs Nagy (js@lsc.hu) + Alfred R. Nurnberger + Hugh Blemings + Mike Bradley + Odinokov Serge + Pavel Janik + Pawe³ Kot + Marcin Wiacek (Marcin-Wiacek@TOPNET.PL) + Jens Bennfors + Michael Hund + Jay Bertrand + + Andrew Kozin + Pavel Machek + Diego Betancor + ... and other members of gnokii mailing list + and authors of some WWW pages. + +NOTE: this information isn't (and can't be) complete. If you know anything +about features not listed here or you noticed a bug in this list, please +notify us via e-mail. Thank you. + + Frame format for MBUS version 1: + + Request from Computer/Answer from Phone: + + { DestDEV, SrcDEV, FrameLength, MsgType, {block}, id, ChkSum } + + where DestDEV, SrcDEV: 0x00: phone + 0xf8: PC (wakeup msg) + 0xe4: PC (normal msg) + FrameLength: length of data frame. Maximal 0x78. Longer + frames are divided into smaller. + MsgType: see List + {block}: main frame + id: request identity number 1..n, incremented after + the request is accepted + ChkSum: XOR on frame's all numbers + + Ack from Phone: + + { DestDEV, 0x00, FrameLength, MsgType, {block} , id, ChkSum } + + where DestDEV: taken from original request packet + FrameLength: 0x7f, when DestDEV = 0xe4 + 0x7e, when DestDEV = 0xf8 + MsgType: see List. Present only, when DestDEV = 0xf8 + {block}: main frame. Present only, when DestDEV = 0xf8 + id: request identity number 1..?, corresponding + to the original request packet id + the request is accepted + ChkSum: XOR on frame's all numbers + + Update: description above according to the + http://www.gadgets.demon.co.uk/nokia21xx/protocol.html. + + Pavel Machek wrote: + 0x7e is actually registration acknowledge. Both have nothing to do + with DestDEV, except that special device needs to be used for + registration. + + Ack from Computer: + + { 0x00, SrcDEV, 0x7f, id, ChkSum } + + where SrcDEV: taken from response packet + id: request identity number 1..?, corresponding + to the response packet id + the request is accepted + ChkSum: XOR on frame's all numbers + + Port settings: + Speed 9600 bps, Bits 8, ParityOdd, Stop Bits 1, DTR and RTS logic 0 + + In the MBUS bus, the phone has only one connector for transmition and + reception. + + Because of this characteristics of the phone connector, every time that the + PC writes into the phone it is writing as well into its own Rx. So every + time the PC sends info into the phone it finds that same information in its + own Rx buffers, like a mirror copy. This should be discarded. + + The communications is made like an old cb radio, only one + talking at a time. Many transmission are made this way: + + + + + + + Some frames are sent from phone without asking for them + + You have to implement collision protocol. IE. you should listen for + what you are transmitting, and if it does not come back, you have + collision. + + You should wait for bus to be free for 3 miliseconds before normal + message, and for 2.5 miliseconds before acknowledge. You should wait + for acknowledge for 200 miliseconds, then retransmit. + + Frame format for FBUS version 1: + + { FrameID, FrameLength, MsgType, {block}, SeqNo, ChkSum } + + where FrameID: 0x01 Command frame from computer to Nokia + 0x02 ??? - Data call frame from computer to Nokia - ??? + 0x03 Data call frame from Nokia to computer + 0x04 Command frame from Nokia to computer + FrameLength: {block} + 2 + MsgType: see List + SeqNum: Sequence number of command in case where direction is + from ME to computer, the sequence number is + counting from 0x30 to 0x37 and resetting back to 0x30. + When direction is from computer to ME, + sequence number counts from 0x08 to 0x0f and resets back to 0x08. + It may not be required to be this way. + Sequence numbers are used in acknowledging commands. + ChkSum1: CRC = 0; + for (i = 0; i < (2 + CMD_LEN); i++) + CRC ^= frame[i]; + + Frame format for FBUS version 2/Direct IRDA: + + { FrameID, DestDEV, SrcDEV, MsgType, 0x00, FrameLength, {block}, FramesToGo, + SeqNo, PaddingByte?, ChkSum1, ChkSum2 } + + where FrameID: 0x1c: IR / FBUS + 0x1e: Serial / FBUS + DestDev, SrcDev: 0x00: mobile phone + 0x0c: TE (FBUS) [eg. PC] + MsgType: see List + FrameLength: {block} + 2 (+ 1 if PaddingByte exists) + FramesToGo: 0x01 means the last frame + SeqNo: [0xXY] + X: 4: first block + 0: continuing block + Y: sequence number + PaddingByte: 0x00 if FrameLength would be an odd number + anyways it doesn't exists + ChkSum1: XOR on frame's odd numbers + ChkSum2?: XOR on frame's even numbers + + Frame format for MBUS version 2: + + { FrameID, DestDEV, SrcDEV, MsgType, FrameLengthLO, FrameLengthHI, {block}, + SeqNo, ChkSum } + + where FrameID: 0x1f: Serial / M2BUS + DestDev, SrcDev: 0x00: mobile phone + 0x1d: TE (M2BUS) + 0x10: TE (M2BUS) (Service Software ?) + 0x04: Carkit? + 0x48: DLR3 cable? + 0xF8: unknown target? + 0xFF: global target? + MsgType: see List + FrameLength: {block} + SeqNo: sequence number + ChkSum: XOR on frame's all numbers + + Please note that M2BUS has only one checksum: XOR on frame[FrameID..SeqNo] + + Ack: + + { FrameID, DestDEV, SrcDEV, 0x7f, Id_SeqNo, ChkSum } + + where Id_SeqNo: Is the sequence number that you are + acknowleging (from the other part). + + Frame format for Infrared: + + { FrameID, DestDEV, SrcDEV, MsgType, FrameLengthLo, FrameLengthHi, {block}} + + where FrameID: 0x14 + DestDev, SrcDev: 0x00: mobile phone + 0x0c: TE [eg. PC] + MsgType: see List + FrameLength: {block} + + Frames list format: + + hex: Short description + x msg desc { ... } + 0xXX -> one byte + 0xXXYY -> two bytes (== 0xXX, 0xYY) + + where hex: message type + x: s=send (eg. to mobile), r=receive + { ... }: data after 0x00, 0x01 header + {+... }: raw data (without header) + +------------------------------------------------------------------------------- + +Misc (about MBUS version 2): + +0x4E commands: + (sent from a 5160i TDMA / 6160i TDMA / 6185 CDMA or 7110 GSM + phone to the uC in the DLR-3 cable) +DLR-3 req: + 1F 48 00 4E 00 02 01 XX SQ CS + frame sent from the phone to the DLR-3 cable + (after 15kOhm resistor detected betw. XMIC (3) and DGND (9).) + DSR,DCD,CTS flow control data is coded into the 2nd databyte + XX: bit.0=/CTS + bit.1=/DCD + bit.2=CMD/DATA + bit.3=DSR + bit.4-7=0 + +0x78 / 0x79 commands: + (used by handsfree carkit) Works also on GSM phones (5110 / 6110 / etc) +These commands are used by the Nokia Carkits to switch the phone audio path to +XMiC and XEAR , turn the phone on/off according to the car ignition, and +control the PA loudspeaker amplifier in the carkit and the car radio mute +output which silences the car radio during a call +mute status tone: + 1F 04 00 78 00 04 01 02 0E 00 SQ CS + status indication = disable carkit audio amplifier (no audio / no tone) +mute status tone: + 1F 04 00 78 00 04 01 02 0E 03 SQ CS + status indication = enable carkit audio amplifier (audio / tone present) +mute status call: + 1F 04 00 78 00 04 01 02 07 00 SQ CS + status indication = disable radio mute output (no call) +mute status call: + 1F 04 00 78 00 04 01 02 07 01 SQ CS + status indication = enable radio mute output (call active) +enable ???: + 1F 04 00 78 00 04 01 02 08 01 SQ CS + status indication = enable ??? sent to HFU-2 on power on + byte 9 (07,08,0E) seems to be a pointer to a memory location, + byte 10 is the data at this memeory location. +response from HFU: + 1F 00 04 78 00 03 02 01 03 SQ CS + response message from HFU-2 (use unknown) +go HF and IGN on: + 1F 00 04 79 00 05 02 01 01 63 00 SQ CS + enables carkit mode + turns phone on + req. mute status +go HF and IGN off: + 1F 00 04 79 00 05 02 01 01 61 00 SQ CS + enables carkit mode + powers phone off (1 min delay) + req. mute status +ext. HS Offhk: + 1F 00 04 79 00 05 02 01 01 23 00 SQ CS + enables carkit mode + external handset lifted (OFF-Hook) +ext. HS Onhk: + 1F 00 04 79 00 05 02 01 01 63 00 SQ CS + enables carkit mode + external handset put back (ON-Hook) + Ignition and Hook are coded into one byte + bit.0 = 0:on power on 1:when in operation + bit.1 = IGNITION STATUS + bit.2 = x can be 1 or 0 + bit.3 = 0 + bit.4 = 0 + bit.5 = 1 + bit.6 = Hook (inverted) + bit.7 = 0 +HFU-2 version: + 1F 00 04 79 00 12 02 01 02 06 00 56 20 30 36 2E 30 30 0A 48 46 55 32 00 SQ CS +for HFU-2: + 1F 04 00 DA 00 02 00 02 SQ CS + function unknown - sent from Nokia phone to HFU-2mute output (call active ) + +0xD0 commands: +init: + 1F 00 1D D0 00 01 04 SQ CS + sent by the Service Software or HFU-2 on startup +init resp: + 1F 1D 00 D0 00 01 05 SQ CS + response from phone to above frame diff --git a/Docs/developers/protocol/readme b/Docs/developers/protocol/readme new file mode 100644 index 0000000..1df354d --- /dev/null +++ b/Docs/developers/protocol/readme @@ -0,0 +1,2 @@ +This is part of files available in mygnokii_developer.tar.gz +available in http://marcin-wiacek.topnet.pl diff --git a/Docs/en_US/gnokii/config.htm b/Docs/en_US/gnokii/config.htm new file mode 100644 index 0000000..7724082 --- /dev/null +++ b/Docs/en_US/gnokii/config.htm @@ -0,0 +1,632 @@ + + + + + Configuration + + + + + +

Main page

+
Configuration
+ +


+ +

How to install it from the source ?
+


+ +

If you get the sources you need to create script +configure. You do it by typing: +

tfuj:~/gnokii-0.3.3pre5$ autoconf
+ +

If you get the sources from the tarball you don't need to do +this - configure is already made for you. For quick install do simply: +

tfuj:~/gnokii-0.3.3pre5$ ./configure
+tfuj:~/gnokii-0.3.3pre5$ make
+tfuj:~/gnokii-0.3.3pre5$ make install
+
+ +

But configure has some options. Except obvious +parameters as --prefix which specifies a path to install GNOKII, you +can specify one of the following: + +

+
--help +
Shows you list of available options
+
+
--enable-debug +
Turns on debugging. It's usefull especially for developers. But if you + find a bug in GNOKII, please compile the sources with debugging enabled and + send this output to the GNOKII mailing list. This is used by gnokii + program.
+
+
--enable-xdebug +
The same as above but used by xgnokii.
+
+
--enable-rlpdebug +
This option turns on debugging specific to the RLP stuff. Note, that it's + very important at the moment as this part of GNOKII is under the hardest + development.
+
+
--without-x +
Don't include X Window system support - xgnokii.
+
+
--enable-security +
Turns on some security functions:.... Use them with caution.
+
+
--enable-win32 +
Include MS Windows support. Yes, it really exists. ;-)
+
+
--with-model=MODEL, --with-port=PORT +
Specify the model of the phone (eg. 6150) and the port it is connected to + (eg. /dev/ttyS1). These values can be overwritten with ones from the config + files. +
+
+ +

The sample usage: +

tfuj:~/gnokii-0.3.3pre5$ ./configure --prefix=/usr2 --enable-debug --without-x \
+--enable-security --with-model=6130 --with-port=/dev/ttyS1
+
+ +

When the configure succeed, it shows options GNOKII +will be compiled with: +

    Host system:        linux-gnulibc1
+    Gnokii version:     0.3.3_pre5
+    Xgnokii version:    20000613
+    Phone model:        6130
+    Serial port:        /dev/ttyS1
+    X (GTK) support:    no
+    Debug:              yes
+    XDebug:             no
+    RLPDebug:           no
+    NLS:                yes
+    Security:           yes
+    Win32:               
+    Prefix:             /usr2
+
+ +

Now, the only thing left to do is just ro run: +

tfuj:~/gnokii-0.3.3pre5$ make
+tfuj:~/gnokii-0.3.3pre5$ make install
+
+ +

Finally, you have GNOKII installed in your system. And now REAL +FUN begins. :-) + +

How to install it from binaries ?
+


+ +

If you downloaded gnokii as a pre-built binary you should install +it in the conventional manner for the package type in question. +For example if you downloaded a .rpm file you can install it by +running the following as root. + +

rpm -i gnokii-0.3.2-i386.rpm + +

If you are using a Debian based system, you can use dpackage +to do the installation (FIXME - is this correct ?) + +

How to make connection with phone ?
+


+ +

There are three ways to make it: + +

    +
  • connecting phone with computer using cable. All phones allow to make it +(even 3210 - connector is inside). If you want to know more +about creating your own cable, read cables faq.
  • +
  • using IrDa port in phone and computer. Notice, that your computer +and phone must have it (only some series of Nokia phones has it - for example, +6110, 6150)
  • +
  • connecting to phone special device called "dongle" (it has IrDa port) +and making IrDa connection between it and phone. Current gnokii cas use +Tekram IRmate 210 - see patches
  • +
+ +

How to configure gnokii ?
+


+ +

First it to use --with-model and --with-port options for +configure script. But I do not recommend this. In my opinion these should be +removed from configure. Second disadvantage is that you can't use it when +you are installing a binary package. + +

So, will use better method :-). +You should copy the gnokiirc +file from the Docs/examples directory to your +home directory and name it gnokiirc or copy it into /etc directory +and name gnokiirc. + +

Using your favorite +editor ensure that the settings are correct for your system, +the sample file has details of the various options available. The most +difficult problem could be discovering model of your phone - go into +our firmware page +and try to use codes written in column +Firmware version code. If your phone will display something, +see model number on the third line, look on the +firmware page +again (for it) and read phone model then. + +

Note that you will need read/write permissions on whatever +serial port you specify in gnokiirc. You can now use gnokii +and xgnokii. + +

Of course, you don't have to make any config, if you will use +these config options. There are default: + +

+

+[global]
+port = /dev/ttyS0
+model = 6110
+connection = serial
+initlength = default
+bindir=/usr/local/sbin
+
+ +

How to configure infrared connection ?
+


+ +

+

    + +
  • Go into configuration of your IrDa port (the most often it's made in +BIOS, sometimes using program provided by computer's producer): + +

    +

      +
    • Enable it
    • +
    • Setup the COM-Port on which it should work. +Here are addresses: +
      ttyS0 (COM1): 3F8, IRQ: 4 +
      ttyS1 (COM2): 2F8, IRQ: 3 +
      ttyS2 (COM3): 3E8, IRQ: 4 +
      ttyS3 (COM4): 2E8, IRQ: 3 +
        +
    • +
    +
  • + +
  • Configure gnokii (see previous question) +setting type of connection to +infrared.
  • + +
  • If you are using linux, put linux-irda off (you can't use gnokii over infrared and +linux-irda at the same time - it means too, if you want use +linux-irda you must close all gnokii-applications what +use the infrared-port in moment). +
  • +
+ +

How to configure gnokii driver for data connection ?
+


+ +

After installing and configuring gnokii you should make another group +and allow mgnokiidev (it our virtual modem driver) +to use it. For example (if you have installed gnokii +into /usr/local): + +

+groupadd gnokii
+chown root:gnokii /usr/local/sbin/mgnokiidev
+chmod 4750 /usr/local/sbin/mgnokiidev
+ +

And now connect (FIRST EXAMPLE): + +

Then connect your phone to your PC and then run gnokiid: + +

[ first console ]
+tfuj:/home/pawel/gnokii# ./gnokiid/gnokiid 
+
+ +

If successful, you should see a message saying that mgnokiidev has been +run to create /dev/gnokii. If you're using a 5110/6110 series phone +you should hear a beep and see an "accessory connected" message on +the phone. If you're using a 3810 series phone you won't see anything +on the phones LCD. + +

And now: + +

+

+[ second console ]
+[- running minicom -]
+
+[ third console ]
+[- when connection is estabilished -]
+tfuj:/etc/ppp# /usr/sbin/pppd -d -detach /dev/gnokii 115200
+Using interface ppp0
+Connect: ppp0 <--> /dev/gnokii
+sent [LCP ConfReq id=0x1     ]
+rcvd [LCP ConfReq id=0x8e     < 11 04 05 f4> < 13 0d 01 70 69 65 6b 6e 61 2d 61 73 34>]
+sent [LCP ConfRej id=0x8e < 11 04 05 f4> < 13 0d 01 70 69 65 6b 6e 61 2d 61 73 34>]
+rcvd [LCP ConfNak id=0x1 ]
+sent [LCP ConfReq id=0x2    ]
+rcvd [LCP ConfReq id=0x8f    ]
+sent [LCP ConfAck id=0x8f    ]
+rcvd [LCP ConfAck id=0x2    ]
+sent [IPCP ConfReq id=0x1  ]
+sent [CCP ConfReq id=0x1   ]
+rcvd [IPCP ConfReq id=0x16  ]
+sent [IPCP ConfAck id=0x16  ]
+rcvd [IPCP ConfNak id=0x1 ]
+sent [IPCP ConfReq id=0x2  ]
+rcvd [LCP ProtRej id=0x90 80 fd 01 01 00 0f 1a 04 78 00 18 04 78 00 15 03 2f]
+rcvd [IPCP ConfAck id=0x2  ]
+local  IP address 157.25.94.141
+remote IP address 157.25.75.129
+Terminating on signal 2.
+sent [LCP TermReq id=0x3 "User request"]
+rcvd [LCP TermAck id=0x3]
+Connection terminated.
+Connect time 5.6 minutes.
+Sent 30568 bytes, received 197133 bytes.
+tfuj:/etc/ppp# 
+
+ +

SECOND EXAMPLE (I used such scripts): + +

/home/pawel/.gnokiirc
+---------------------
+global]
+port = /dev/ttyS1
+model = 6110
+connection = serial
+initlength = 1
+
+/usr/sbin/ppp-gnokii
+--------------------
+#!/bin/sh
+LOCAL_IP=0.0.0.0       
+REMOTE_IP=0.0.0.0     
+NETMASK=255.255.255.0   
+DIALER_SCRIPT=/etc/ppp/ppp-gnokii
+exec /usr/sbin/pppd debug /dev/gnokii 115200 \
+$LOCAL_IP:$REMOTE_IP \
+connect $DIALER_SCRIPT
+
+/etc/ppp/ppp-gnokii
+-------------------
+#!/bin/sh
+/usr/sbin/chat -v                                       \
+        TIMEOUT         30                              \
+        ABORT           '\nBUSY\r'                      \
+        ABORT           '\nNO ANSWER\r'                 \
+        ABORT           '\nRINGING\r\n\r\nRINGING\r'    \
+        ABORT           '\nNO CARRIER\r'                \
+        ''              ATDT501808080                   \
+        CONNECT         ''
+
+/etc/ppp/options
+----------------
+-detach
+modem
+crtscts
+defaultroute
+asyncmap 0
+mtu 552
+mru 552
+
+/etc/ppp/pap-secrets
+--------------------
+ppp * ppp
+
+ +

Number 501808080 is an Internet access number for all Idea +Centertel (Polish GSM operator) abonents. With these files the only thing to do +is to run gnokiid and /usr/sbin/ppp-gnokii. Note that both: +/usr/sbin/ppp-gnokii and /etc/ppp/ppp-gnokii must be +executable files. At the moment you have to run ppp-gnokii as the +superuser unless the simple user has a permission to write to a pty +device. gnokiid must be run as the user belinging to gnokii +group. + +

+[ first console ]
+tfuj:~S /usr/sbin/gnokiid
+Initialising GSM
+Slave pty is /dev/ttyp9, calling /usr/sbin/mgnokiidev to create /dev/gnokii.
+
+[ second console ]
+tfuj:~# /usr/sbin/ppp-gnokii
+Serial connection established.
+Using interface ppp0
+Connect: ppp0 <--> /dev/gnokii
+Warning - secret file /etc/ppp/pap-secrets has world and/or group access
+sent [LCP ConfReq id=0x1     ]
+rcvd [LCP ConfReq id=0xbb     ]
+sent [LCP ConfAck id=0xbb     ]
+rcvd [LCP ConfNak id=0x1 ]
+sent [LCP ConfReq id=0x2    ]
+rcvd [LCP ConfAck id=0x2    ]
+Warning - secret file /etc/ppp/pap-secrets has world and/or group access
+sent [PAP AuthReq id=0x1 user="ppp" password="ppp"]
+rcvd [PAP AuthAck id=0x1 ""]
+Remote message: ^F
+sent [IPCP ConfReq id=0x1  ]
+sent [CCP ConfReq id=0x1   ]
+rcvd [IPCP ConfReq id=0x49  ]
+sent [IPCP ConfAck id=0x49  ]
+rcvd [IPCP ConfNak id=0x1 ]
+sent [IPCP ConfReq id=0x2  ]
+rcvd [IPCP ConfAck id=0x2  ]
+local  IP address 192.168.23.55
+remote IP address 192.168.9.2
+
+ +

THIRD EXAMPLE: + +

Use /dev/gnokii as a modem: + +

e.g. ppp session
+--------------- /etc/ppp/peers/demon-gnokii ---------------------
+/dev/gnokii 115200
+modem crtscts defaultroute
+connect 'chat -v ABORT BUSY ABORT ERROR ABORT "NO CARRIER" "" AT OK-AT-OK ATD02083389666 CONNECT'
+user XXXX.demon.co.uk
+noauth
+mtu 296
+debug
+----------------------------------------------------------------
+--------------- /etc/ppp/pap-secrets ---------------------------
+XXXX.demon.co.uk demon-gnokii
+----------------------------------------------------------------
+
+ +

Then "pppd call demon-gnokii" should connect +
('tail -f /var/log/messages' to see what is happening) + +

If a call terminates you should get 'NO CARRIER' and gnokiid should +continue to work, but this is early code and you may find you have to +Ctrl-C and restart gnokiid (especially if the phone says the terminal +connection has been lost) + +

AND ANOTHER EXAMPLE PPP SCRIPT FROM Jon Wikne: + +

+ +#!/bin/sh
+#
+# Script to launch PPP over a Nokia 5110 / 6110 mobile phone
+# 20-06-2000 -- Jon Wikne
+#
+### NOTE: "01234567" and "username" below must be replaced
+### with your actual ISP's phone number and your user name.
+#
+### NOTE 2: If you are calling an ISDN number or a digital
+### line you may also need ATS35=0 in the chat sequence.

+# Launch gnokiid....
+echo "Launching gnokiid... "
+/usr/local/sbin/gnokiid &

+# Wait for gnokiid to find the phone.
+sleep 7

+# Now, down to business!
+echo "Calling and starting pppd... "
+pppd /dev/gnokii 115200 debug connect \
+'chat -v ECHO ON ABORT BUSY ABORT ERROR ABORT "NO CARRIER" \
+"" AT OK ATDT01234567 CONNECT ""' \
+noipdefault ipcp-accept-local ipcp-accept-remote \
+user username

+# Some cleaning up to do....
+
+echo -n "Stopping gnokiid... "
+ps ax | awk 'BEGIN { prog="/usr/local/sbin/gnokiid"; ARGC=1 }
+{ if (prog == $5) { print $1 ; exit 0 } }' $1
+kill "$1"
+echo $1 +
+ +

Permission problem...
+


+ +
+> Now xgnokii want  to connecting.....  and some minutes later it's say:
+>  Gnokii serial_open: open: Permission denied
+> Couldn't open FB61 device: Permission denied
+
+you should set your /dev/ttySx to:
+
+crw-rw----    1 root     dialout    4,  65 Jul  5  2000 /dev/ttyS1
+
+and add yourself to the group dialout. or make a new group gnokii 
+and do the same thing for this group. see the gnokii doc about 
+this, especialy if you want to use gnokiid.
+
+ +

Xgnokii files missed...
+


+ +
+> > I start to configure:
+> > 
+> > elwinx:/usr/src/gnokii# ./configure  --prefix=/usr/local/
+> > 
+> > checking for X... (cached) libraries /usr/X11R6/lib, headers
+> > /usr/X11R6/include
+> > checking for X11/xpm.h... (cached) no
+> > configure: warning: Cannot find include X11/xpm.h
+> > configure: warning: Disabling xgnokii.
+
+ +

For Debian GNU/Linux 2.2 potato: + +

+

+> Do:
+> dpkg -S \*xpm.h
+> and show the result. You can't use xgnokii without libxpm.
+
+After I installed the xpm4g-dev_3.4k-5.deb xgnokii found my X
+
+My next Problem was the Program didn't find the gtk.h
+
+I installed this lib's
+libglib1.2-dev
+libgtk1.2-dev_1.2.7-1.deb
+
+and xgnokii are start up
+
+ +

For Redhat: + +

+

+On Red Hat 6.2 (or derived?)
+
+sloth:danielm[12]% locate xpm.h
+/usr/X11R6/include/X11/xpm.h
+sloth:danielm[13]% rpm -qf /usr/X11R6/include/X11/xpm.h
+xpm-devel-3.4k-2
+
+On Red Hat 7 (or derived?)
+
+mouth:danielm[4]% locate xpm.h
+/usr/X11R6/include/X11/xpm.h
+mouth:danielm[5]% rpm -qf /usr/X11R6/include/X11/xpm.h
+XFree86-devel-4.0.1-1
+
+ +

Infrared problem
+


+ +
+> I'm having trouble getting Gnokii to work with my Nokia 6110 using the
+> infrared connection. It works perfectly with the cable. When I run gnokii
+> as non-root I get the following output:
+> 
+> Added new section global
+> Adding key/value port//dev/ttyS3
+> Adding key/value model/6110
+> Adding key/value initlength/default
+> Adding key/value connection/infrared
+> Adding key/value bindir//usr/local/sbin/
+> Entering monitor mode...
+> Initialising GSM interface...
+> Starting IR mode...!
+> Couldn't open FB61 infrared device: Device or resource busy
+> Hmmm... GSM_LinkOK never went true. Quitting.
+> 
+> And if I run it as root it looks like this:
+> 
+> Added new section global
+> Adding key/value port//dev/ttyS3
+> Adding key/value model/6110
+> Adding key/value initlength/default
+> Adding key/value connection/infrared
+> Adding key/value bindir//usr/local/sbin/
+> Entering monitor mode...
+> Initialising GSM interface...
+> Starting IR mode...!
+> PC: 1c:00:0c:02:00:09:00:01:00:0d:00:00:02:01:40:00:52:06:
+> Timeout in IR-mode
+> PC: 1c:00:0c:02:00:09:00:01:00:0d:00:00:02:01:41:00:53:06:
+> Timeout in IR-mode
+> PC: 1c:00:0c:02:00:09:00:01:00:0d:00:00:02:01:42:00:50:06:
+> Timeout in IR-mode
+> PC: 1c:00:0c:02:00:09:00:01:00:0d:00:00:02:01:43:00:51:06:
+> Timeout in IR-mode
+> PC: 1c:00:0c:02:00:09:00:01:00:0d:00:00:02:01:44:00:56:06:
+> Timeout in IR-mode
+> Hmmm... GSM_LinkOK never went true. Quitting.
+> 
+> It makes no difference if IR-reception is activated or not (well maybe the
+> numbers are different, I haven't checked)
+> 
+> I have followed the Alessandro's beta-HOWTO which was posted June 22 2000
+> with the subject "Re: IR setup".
+> 
+> In /var/log/messages I have found the following:
+> 
+> Feb 18 23:34:16 bmw kernel: ircomm_tty: virtual tty driver for IrCOMM (
+> revision:Wed May 26 00:49:11 1999 ) 
+> Feb 18 23:34:16 bmw kernel: ttyS00 at 0x03f8 (irq = 4) is a 16550A 
+> Feb 18 23:34:16 bmw kernel: ttyS03 at 0x02e8 (irq = 3) is a 16550A 
+> 
+> I have tried both with and without the irda-module loaded (insmod
+> irda) but without luck.
+> 
+> I'm using a Fujitsu C325 Lifebook (labtop) and my Nokia 6110 is version
+> 4.33. Has anyone experienced problems like these and hopefully has found a
+> solution, or maybe just have some ideas for what I should try next.
+
+"I also had removed the Ethernet PCcard.
+That thing got assigned the _interrupt_ (irq 3) that the serial interface
+for the IR port needs. Without it gnokii works."
+
+Now I've got contact to my Nokia 6110 using the infrared port.
+
+ +

Answering data calls problem...
+


+ +
+> It seems like it's some sort of PacBell or Verizon thing, because I
+> get a ring when I try to dial a voice call, but when I dial from
+> minicom/gnokiid I get "NO CARRIER" ("Check Operator Services" on the
+> phone), and dialing in from the Palm still gets no ring.
+
+First we should know how operators manage data call services,
+is there any international standard (it would be, to make international data
+calls possible). I described, how it works with my operator (Plusgsm/PL)
+and I'm interesting if it's a worldwide standard for these services?
+Did somebody tried to make a cellular-to-cellular international data transfer ?
+
+In Plusgsm there are three kinds of data calls :
+1. OUTGOING CALLS. Service activation is free with no additional monthly charge.
+   For default this service is disabled, you have to call operator's helpdesk
+   to enable. With this service is possible to call:
+      a) any internet gate
+      b) WAP gate
+      c) any "private" computer with own transfer protocol
+      d) ?? send a fax ?? (with special fax software for cellular modem
+         included in NCDS)
+   1 minute charge is similar to voice calls. It's not allowed by the operator
+   to answer incoming data call.
+2. INCOMING CALLS. You have to pay for service activation (5$) and additional
+   monthly charge (10$). Then you will get a new SIM card with 2 phone numbers:
+   one for voice/sms and second one - for incoming data calls only.
+   1 min charge depends on the network from the call was initiated,
+   generally 1...2 times x voice call.
+3. FAX CALLS. Another payable service, not covered by above mentioned.
+   There is a special trick for incoming fax: it's stored in "FAX mailbox",
+   you can call this mailbox with standard fax machine
+   (or cellular modem connected to PC) to receive it.
+
+I guess your operator have similar restrictions for incoming data calls and
+here is your problem. Incoming call is recognized as a data type and rejected.
+It would be nice to know if it's rejected on the operator's software level or
+by the phone software (acc. to informations stored in the SIM).
+In the second case it's easier to omit these restrictions. But be careful !
+You will be treated by the law in the same way as if you try to hack
+Bill Gates credit card number ;-)  .
+
+ +

Xgnokii works, gnokii not...
+


+ +
+> 1. Why is it that xgnokii communicates perfectly with my 3210, while the
+> only thing that the command line gnokii does is:
+> GSM/FBUS init failed! (Unknown model ?). Quitting.
+> [cvd@sirius gnokii]$ ./gnokii --monitor
+> Opened configuration file /home/cvd/.gnokiirc
+> Added new section global
+> Adding key/value port//dev/ttyS1
+> Adding key/value model/3210
+> Adding key/value initlength/default
+> Adding key/value connection/serial
+
+Look into latest gnokiirc from /docs/default. "serial" setting for connection
+is not used from long time. Change to other actual parameter ("fbus" ?)...
+
+ + + + diff --git a/Docs/en_US/gnokii/faq.htm b/Docs/en_US/gnokii/faq.htm new file mode 100644 index 0000000..35850bc --- /dev/null +++ b/Docs/en_US/gnokii/faq.htm @@ -0,0 +1,356 @@ + + + + + GNOKII FAQ + + + + + +

Main page

+
GNOKII FAQ
+ +


+ +

What is gnokii ?
+


+ +

Generally, what is gnokii (G from GNU, NOKII from Nokia) ? + +

It is a name of project. The aim of it is to develop tools and drivers +for Nokia mobile phones. Of course, I think in this moment about really +different tools - for example, modem drivers, console tools, etc. +All created here software is released under the GNU +General Public License. Please see COPYING +for more details on license/copying issues, +the lack of warranty and where to send a postcard if you like gnokii :). +Anyway, our software works on many software (Linux, Free BSD, etc.) +and hardware (Intel, etc.) platforms... + +

What software applications are created in gnokii project ?
+


+ +
    + +
  • +The first application, gnokii, is a command line utility that was +originally provided to assist developers and interested users in +working with the low level API functions that were being developed. + +

    From these rather humble beginnings, it has evolved into a the main +command line tool of the suite. Many people now use it for +reading/writing phone book entries, sending and receiving SMS messages +etc. Ultimately it is intended that it will become a utility that +communicates with gnokiid to provide a command line interface to +the functionality provided by the gnokiid daemon. +
      +

  • + +
  • +The second application provided is xgnokii which as the name suggests +is a X-windows based application that provides a graphical interface +to your phone. Amongst other things, xgnokii allows you to read and +write phone book entries, read, write and send SMS messages, monitor +battery and received signal strength. + +

    At present xgnokii works directly with the phone, however in the +future it will more likely use the "side" interface of gnokiid. + +

    The main author of it is Jan Derfinak +
      +

  • + +
  • +The third part of the suite is gnokiid. gnokiid provides a +virtual modem interface, /dev/gnokii that looks like a regular +Hayes-AT compatible modem with the ETSI defined extensions for +GSM phones. What this means in practical terms is that you can +treat the /dev/gnokii device like an ordinary modem and use it +to make data calls from pppd or a terminal application like +minicom. + +

    +gnokiid is still under development, it's ultimate aim being to +act as a "master" daemon that interfaces with your phone on one +side and gnokii or xgnokii on the other. This "side" code is still +under discussion, particularly with respect to the most appropriate +choice of communication method (IPC, TCP/IP etc.) +
      +

  • + +
  • +The last application provided with the suite is mgnokiidev which is +used by gnokiid to create on demand a symbolic link between +/dev/gnokii and the pseudo tty used by gnokiid for the virtual +modem interface. It's operation is transparent under normal +usage as gnokiid takes care of calling it when required. +
  • + +
+ +

This project also inspired some people to write other software for Nokia. +For example: + +

+

    +
  • +There is a perlmodule available for gnokii. It gives access to all +the routines that are defined in gsm-common.h from a perl-program. It +is intended for application developers who want to use their favorite +language in interfacing the phone data with databases, ldap-directories +and (in the future) different calendar applications. It is written by +Konstantin Agouros +and support starts with revision 0.2.6-pre3 of gnokii. + +

    The homepage of this module is +http://www.agouros.de/gnokii +
      +

  • + +
  • +http://anders.fix.no/software/gnokline-1.0.tgz +and http://alamin.sourceforge.net - +software, which interprets received by connected Nokia phone SMSes and makes some things +
  • + +
+

Which phones are supported ?
+


+ +

You can also ask, what phones are supported ? All, you want :-) Really ! + +

At first, we were making in gnokii project modules +for Nokia 3810/8110 and 51x0/61x0 phones. Later users started to +write parts for other Nokia phones. And we hope to extend it to another +models: 7110, etc. Remember: it's even possible to write modules +for other than Nokia phones +too (just imagine: support for the most popular phones in one software !)... + +

Here is more detailed table with supported phones info... + +

You can also look into +registered gnokii users database +too see used by them phones... + +

What is compatibility with hardware ?
+


+ +

Generally, gnokii can work with all computers, which have serial port +(over cable). + +

If you want to use infrared, sometimes are small problems, because some +IrDa connectors are not compatible with some standards... + +

How can I get support for it ?
+


+ +

We our only people and we sometimes make mistakes. But don't worry: +support for gnokii is really great. At first, you can tell your problem +to all gnokii users (in May 2000 on the list there were subscribed about +1000 people). + +

The most often it's enough. If not, contact with authors: + +

When problem is connected with module for concrete phone, write to people +listed in answer for question Which phones are supported ?. +For other parts: Jan Derfinak +is responsible for xgnokii. + +

How to contact with gnokii users ?
+


+ +

Thanks to the efforts of +Martin Hamilton we have a Majordomo based mailing +list gnokii@net.lut.ac.uk. + +

You can subscribe by sending email to +gnokii-request@net.lut.ac.uk with the word subscribe in the body of the text. + +

+Note that the list is not a forum for discussion on how to obtain copies of +Nokia's proprietary software. +It is the primary discussion forum for the project. + +

Archive of the list + +

Does Nokia sponsors/supports this work ?
+


+ +

In the early stages of the project there were indications that +Nokia would provide some support for the project. Regrettably, these +negotiations stalled over the issue of binary versus open source +releases and the project has proceeded without official or unofficial +assistance. + +

How can I help with creating it ?
+


+ +

There are some things, you can do you gnokii: + +

+

    +
  • Tell us that you're interested, or that you would use the resulting +software or that you would be happy to test it out. + +

    The best method to make it is to adding yourself to the user database +at http://gnokii.org/users. +
      +

  • + +
  • +Give your input in discussions about the design and development of the suite +now that we are at that stage. In particular the best model of driver +interface will need to be discussed broadly to get the best result. +We've only had limited driver writing experience so if you've more, let us know! +
      +
  • + +
  • +Help examining the protocol and its differences between phone models. +
      +
  • + +
  • +Port the software to a new platform. Please tell us before you do so to ensure +that the port will integrate nicely into the source code tree. +
      +
  • + +
  • +Help us in writing our software or preparing help into it. +
  • +
+ +

Where to get latest versions ?
+


+ +

The source of gnokii aplications is in the CSV server. + +

We want to thank to Andrew Tridgell, Samba team for it... +and Czech Linux Users Group for hosting the original +CVS repository at cvs.linux.cz. + +

The server's address is pserver.samba.org. If you +are already familiar with CVS, set the CVSROOT to + +

:pserver:cvs@pserver.samba.org:/cvsroot + +

and use the password cvs for checking out the repository with the name +gnokii. + +

If you are not familiar with cvs, don't worry. It's very simple. +First, you need some of older gnokii releases (sources) - see for example +links in the end of this question. Unpack them to some directory. Then: + +

+

    + +
  • +For Unix/Linux +just install the cvs package for your distribution and follow these steps: + +

    +

      +
    • set your environmental variable CVSROOT. If you have bash (Bourne +Again Shell): + +

      export CVSROOT=:pserver:cvs@pserver.samba.org:/cvsroot + +

      If you have different shell, use different command (e.g. setenv). + +

        +

    • + +
    • Log in to the CVS server as anonymous reader by typing + +

      cvs login + +

      Use cvs as your password. + +

        +

    • + +
    • If you are logged in you are ready to checkout the latest sources: + +

      cvs co gnokii +

      +

    • +
    + +
  • + +
  • +for win32 and (WinCVS): + +

    +

      + +
    • +Go to the Admin/Preferences window +
    • + +
    • +In the "general" tab set CVSROOT to the cvs@pserver.samba.org:/cvsroot +and local mounted directory to the "passwd" file on the server +

      +

    • + +
    • Go to the Admin/Login window
    • + +
    • Enter cvs as the password

    • + +
    • Go to the Admin/Create/Checkout module
    • + +
    • Enter gnokii as module name and directory where have gnokii source +(WinCVS will + create a directory called gnokii under the one you specify)
    • +
    + +

    +

  • +
+ +

If you prefer, there is a WWW interface to the CVS server at +http://samba.org/cgi-bin/cvsweb/gnokii/. + +

Now you are on your own - you have the current sources on your disk +in the directory gnokii. If you are going to make substantial changes +and feel that they should be included into gnokii please mention it +on the list first to avoid duplicated effort. + +

If you would like to receive email when updates are made to the CVS +repository, just send email to +Hugh Blemings email to that effect +and you'll be added to the recipients list. + +

Another way to get almost latest (x)gnokii tools is to download it from +pages of authors: + +

+

+ +

Remember: it's still work in progress. It means, that we very often change it, +add new functions and correct our bugs (sometimes once a day :-))... So, +it's good to check it often... + + + + diff --git a/Docs/en_US/gnokii/gnokii-6210-7110-IrDA b/Docs/en_US/gnokii/gnokii-6210-7110-IrDA new file mode 100644 index 0000000..65e879d --- /dev/null +++ b/Docs/en_US/gnokii/gnokii-6210-7110-IrDA @@ -0,0 +1,96 @@ +Getting gnokii to work with a 6210 under linux +============================================== + +- Compile your kernel with IrDA support for your chipset. + +For me on my VAIO this was: +CONFIG_IRDA=m +CONFIG_IRCOMM=m +CONFIG_IRDA_OPTIONS=y +CONFIG_IRDA_DEBUG=y + +CONFIG_IRTTY_SIR=m + Use the emulation of serial port part of your IrDA chipset or... +CONFIG_NSC_FIR=m + Specify the one you have (I have a NSC 87338) + +- Reboot onto new kernel etc. +- Check your serial devices don't conflict with the ioport/irq that your + chipset driver will try to use: + setserial /dev/ttySX (where X is 0 -> 3) should give you the information + you need. + If you have a device that conflicts with your ioport/irq then you will + need to remove the serial driver's control over it with: + setserial /dev/ttySX uart none port 0 irq 0 + (where X is there relevant port mine is /dev/ttyS2) +- I used the chipset way to get IrDA working. + I needed: + options nsc-ircc dongle_id=0x09 + alias irda0 nsc-ircc + in /etc/modules.conf + Then just irattach irda0 -s 1 which *should* load all the modules you need + and start it doing irda discovery. + The modules I have loaded at this point are: nsc-ircc and irda. +- Run irdadump to see that it is indeed attempting to discover something. + You should see messages like: +15:24:07.380360 xid:cmd 0c57083d > ffffffff S=6 s=0 (14) +15:24:07.470333 xid:cmd 0c57083d > ffffffff S=6 s=1 (14) +15:24:07.560310 xid:cmd 0c57083d > ffffffff S=6 s=2 (14) +15:24:07.650283 xid:cmd 0c57083d > ffffffff S=6 s=3 (14) +15:24:07.740279 xid:cmd 0c57083d > ffffffff S=6 s=4 (14) +15:24:07.830279 xid:cmd 0c57083d > ffffffff S=6 s=5 (14) +15:24:07.920311 xid:cmd 0c57083d > ffffffff S=6 s=* langly hint=0400 [ Computer +] (22) +- Place the phone in front of it, enable the Infrared parts of it (Menu 90) + then it should change to be like: +15:26:07.380336 xid:cmd 0c57083d > ffffffff S=6 s=0 (14) +15:26:07.470288 xid:cmd 0c57083d > ffffffff S=6 s=1 (14) +15:26:07.560284 xid:cmd 0c57083d > ffffffff S=6 s=2 (14) +15:26:07.650281 xid:cmd 0c57083d > ffffffff S=6 s=3 (14) +15:26:07.740280 xid:cmd 0c57083d > ffffffff S=6 s=4 (14) +15:26:07.847192 xid:rsp 0c57083d < d10e0000 S=6 s=4 Nokia 6210 hint=b125 [ PnP Modem Fax Telephony IrCOMM IrOBEX ] (27) +15:26:07.830293 xid:cmd 0c57083d > ffffffff S=6 s=5 (14) +15:26:07.920283 xid:cmd 0c57083d > ffffffff S=6 s=* langly hint=0400 [ Computer +] (22) +- Now try using ircomm to talk to the phone. Try minicom /dev/ircomm0 (you + may need to setup a default profile for this port as the root user with + minicom -s /dev/ircomm0). +- This depends on your distribution having the right lines in modules.conf + for ircomm to be loaded: +alias tty-ldisc-11 irtty +alias char-major-160 irda0 +alias char-major-161 ircomm-tty + And your /dev/ircomm0 should be character device 161,0. + Debian testing/unstable gets this right. + If these don't work you may need to load ircomm and ircomm-tty manually. +- minicom /dev/ircomm0 should now work and AT commands should function. +- With a .gnokiirc modified as follows: + port = /dev/ircomm0 + model = 6210 + connection = irda + gnokii --monitor should now function. + + [huggie@langly ~]$ gnokii --monitor + Entering monitor mode... + RFLevel: 100 + Battery: 100 + SIM: Used 5, Free 85 + etc. + + Not all the functions for 6210 work yet seemingly. + +- If instead gnokii hangs then you may have a version of gnokii that still + has recv() in irda_open of common/devices/unixirda.c. Just comment out + that line, recompile and try again. + + +Simon Huggins +------------------------------------------------------------------------------ +big performance boost !! +I kompile my kernel (linux 2.4.7) with: +CONFIG_IRDA_OPTIONS=y +CONFIG_IRDA_CACHE_LAST_LSAP=y +CONFIG_IRDA_FAST_RR=y +this reduce reading phonebook from 150 to 20 seconds !!! + +Ralf Thelen [ralf@mythelen.de] diff --git a/Docs/en_US/gnokii/gnokii.htm b/Docs/en_US/gnokii/gnokii.htm new file mode 100644 index 0000000..2e00fd1 --- /dev/null +++ b/Docs/en_US/gnokii/gnokii.htm @@ -0,0 +1,1654 @@ + + + + + Command line gnokii FAQ + + + + + +

Main page

+
Command line gnokii FAQ
+ +


+ +

What is command line gnokii ?
+


+ +

It was first our testing tool. Now it can be used for making almost all things +possible with gnokii package (and this is the only available tool for win32). + +

Some general commands...
+


+ +
+
gnokii --help +
Displays GNOKII list of parameters: +
c:\> gnokii --help
+   usage: gnokii [--help|--monitor|--version]
+          gnokii --getmemory memory_type start [end] [-d]
+          gnokii --writephonebook [-i]
+          gnokii --getspeeddial number
+          gnokii --setspeeddial number memory_type location
+          gnokii --getsms memory_type start [end] [-f file]
+          gnokii --deletesms memory_type start [end]
+          gnokii --sendsms destination [--smsc message_center_number |
+                 --smscno message_center_index] [--long n] [-s] [-C n]
+                 [-8] [-v n] [-d]
+          ........
+
+
+ +
+
gnokii --version +
Displays GNOKII version and copyright information: +
c:\> gnokii --version      
+GNOKII Version 0.3.3-pre8-gold
+Copyright (C) Hugh Blemings , 1999, 2000
+Copyright (C) Pavel Janík ml. , 1999, 2000
+Built 10:36:05 Dec 10 2000 for 6110 on com2: 
+
+
+ +

Managing phonebook and other (dialed, misssed, answered, own, etc.) memories
+


+ +
+
gnokii --getmemory memory_type start [end] [-d] +
Reads specificed memory location from phone.. +

You can specify such memories: + +

+

    +
  • ME - Phone phonebook memory
  • +
  • SM - SIM card phonebook memory,
  • +
  • FD - Fixed dial numbers,
  • +
  • ON - Own numbers,
  • +
  • EN - Emergency numbers,
  • +
  • DC - Dialled numbers,
  • +
  • RC - Received numbers,
  • +
  • MC - Missed numbers,
  • +
  • LD - Last dialed
  • +
+ +

+With memories DC, EC, MC you will see assigned date (yes, with all Dialled, +Received, Missed numbers phone saves date and time too !). If you don't want +it, use -d option + +

Note: Locations start from 0 ! + +

Usage examples: + +

tfuj:~$ gnokii --getmemory SM 1 5
+Maja ERA;+48604xxxxxx;SM;1;1
+Dom;+4822xxxxxxx;SM;2;5
+Maja;+4822xxxxxxx;SM;3;1
+Iza;+48601xxxxxx;SM;4;5
+Ania;+48501xxxxxx;SM;5;0
+
+tfuj:~$ gnokii --getmemory ON 1 5
+DOM;+4822xxxxxxx;ON;1;5
+;;ON;2;5
+;;ON;3;5
+;;ON;4;5
+ON|5|Bad location or other error!(22)
+
+tfuj:~$ gnokii --getmemory EN 1 5
+Memory type EN not supported!
+
+tfuj:~$ gnokii --getmemory MC 1 5
+Maja IDEA;501xxxxxx;MC;1;5
+21.06.2000 21:32:52
+Maja IDEA;0501xxxxxx;MC;2;5
+21.06.2000 18:06:02
+;;MC;3;5
+11.06.2000 15:09:33
+;;MC;4;5
+11.06.2000 12:44:55
+;;MC;5;5
+10.06.2000 16:59:13
+
+ +

The meaning of the fields in the output: +

    +
  • + ME/SM/ON/FD/EN/LD: +
      +
    1. Name
    2. +
    3. Number
    4. +
    5. Memory type
    6. +
    7. Location in the memory
    8. +
    9. Group number
    10. +
    +
  • + DN/RC/MC: +
      +
    1. Name
    2. +
    3. Number
    4. +
    5. Memory type
    6. +
    7. Location in the memory
    8. +
    9. Group number
    10. +
    11. Date and time of the call
    12. +
    +
  • +
+ +

Possible errors: +

    +
  1. Bad location or other error!(22)
  2. +
  3. Memory type XX not supported!
  4. +
+ +
+ +
+
gnokii --writephonebook [-i] +
+Reads the data from the standard input and saves it in the SIM Card/phone +memory. The input data is in the format as described above (in desciption +for --getmemory parameter). + +

Usage examples: + +

+tfuj:~$ gnokii --writephonebook
+
+Girlfriend;+48501000000;ME;1;1
+Write Succeeded: memory type: int, loc: 1, name: Girlfriend, number: +48501000000
+
+tfuj:~$ echo "Very_long_name_longer_then_the_phone_can_save;some_string;ME;2;1" | gnokii --writephonebook
+Write Succeeded: memory type: int, loc: 2, name: Very_long_name_longer_then_the_phone_can_some_string, number: some_string
+
+tfuj:~$ echo "Girlfriend;+48501000000;ME;200;1" | gnokii --writephonebook
+Write FAILED(22): memory type: int, loc: 200, name: Girlfriend, number: +48501000000
+
+tfuj:~$ echo "Girlfriend;+48501000000;ME;3;10" | gnokii --writephonebook
+Write Succeeded: memory type: int, loc: 3, name: Girlfriend, number: +48501000000
+
+tfuj:~$ gnokii --getmemory ME 1 5
+Girlfriend;+48501000000;ME;1;1
+Very_long_name_l;//3/////2#4;ME;2;1
+Girlfriend;+48501000000;ME;3;10
+;;ME;4;5
+;;ME;5;5
+
+tfuj:~$ echo "Girlfriend;+48501000000;PP;3;10" | gnokii --writephonebook
+Format problem on line 1 [Girlfriend;+48501000000;PP;3;10]
+
+tfuj:~$ echo "some_nonsense_string" | gnokii --writephonebook
+tfuj:~$ 
+
+ +

Some notes: +

    +
  1. Remember that any existent entries in the phonebook will be overwritten + (must use [-i] option, if you don't want it - you will be asked then, if + you want overwrite or not)
  2. +
  3. Names and numbers are truncated by the phone when saving.
  4. +
+ +

Possible errors: +

    +
  1. Wrong location: Write FAILED(22)
  2. +
  3. Wring memoty type: Format problem on line n
  4. +
  5. Other errors: [no output] - this should be changed
  6. +
+ +
+ +
+
gnokii --getvoicemailbox +
Get voice mailbox number + +

Example: +

+
+
+
+ +

Speed dials
+


+ +
+
gnokii --getspeeddial number +
Reads from the phone a number assigned to a shotrcut key + +

Example: +

+tfuj:~$ gnokii --getspeeddial 1
+SpeedDial nr. 1: 3:0
+
+The output format: SpeedDial nr. key_number: memory_type:location. + +

On error output is empty. +

+ +
+
gnokii --setspeeddial number memory_type location +
Writes to the phone a number assigned to a shotrcut key. +You can use memory SM or ME. + +

Example: + +

+tfuj:~$ gnokii --setspeeddial 1 SM 1
+Succesfully written!
+
+tfuj:~$ gnokii --setspeeddial 1 PP 1    
+Unknown memory type PP!
+
+ +

...but there are still some bugs: + +

+tfuj:~$ gnokii --setspeeddial 1 SM 10000
+Succesfully written!
+
+tfuj:~$ gnokii --getspeeddial 1
+SpeedDial nr. 1: 3:16
+
+
+ +

SMS (Smart Messaging System)
+


+ +

If you don't know anything about SMS, please read our SMS FAQ. + +

+
gnokii --getsms memory_type start [end] [-f file] +
Reads SMS messages from the specified memory_type (it can +be phone's internal memory - ME - or SIM card - SM memory) starting at +start and ending at end. If end argument is not +present only one location - start - is read. + +

Examples: + +

tfuj:~$ gnokii --getsms SM 11
+11. Inbox Message (read)
+Date/time: 29/6/0 13:41:22 +0100
+Sender: 102 Msg Center: +48501200777
+Text:
+SMS OD: Mariusz, Wszystkiego najlepszego z okazji imienin! Mariusz
+
+tfuj:~$ gnokii --getsms SM 3
+3. Delivery Report (read)
+Sending date/time: 25/5/0 13:58:24 +0100
+Response date/time: 25/5/0 13:58:32 +0100
+Receiver: +48605000000 Msg Center: +48501200777
+Text: Delivered
+
+tfuj:~$ gnokii --getsms SM 5
+5. Outbox Message (not sent)
+Text: UU0i7eec
+
+tfuj:~$ gnokii --getsms SM 12
+GetSMS SM 12 failed!(4)
+
+tfuj:~$ gnokii --getsms SM 15
+15. Delivery Report (read)
+Sending date/time: 3/1/0 10:49:51 +0100
+Response date/time: 6/1/0 10:51:06 +0100
+Receiver: 1921681052342802 Msg Center: +48501200777
+Text: Failed
+
+tfuj:~$ gnokii --getsms SM 28
+SMS location SM 28 empty.
+
+tfuj:~$ gnokii --getsms SM 25 28
+25. Inbox Message (read)
+Date/time: 18/6/0 12:17:30 +0100
+Sender: 501 Msg Center: +48501200777
+Text:
+Liczba wiadomosci:1,nowych:1,faksow:0
+
+SMS location SM 26 empty.
+27. Inbox Message (read)
+Date/time: 21/6/0 19:45:11 +0100
+Sender: 123 Msg Center: +48501200777
+Text:
+Informujemy, ze wyslalismy do Panstwa fakture z terminem platnosci do 28.06.00. Dziekujemy za wybranie sieci Idea.
+
+SMS location SM 28 empty.
+
+tfuj:~$ gnokii --getsms SM 31
+Invalid location: SM 31
+
+
+
+ +
+
gnokii --deletesms memory_type start [end] +
+Deletes SMS messages from specified memory type (SM or ME) +starting at entry start and ending at end + +

Examples: + +

+
+
+ +
+
+gnokii --sendsms destination [--smsc message_center_number | +--smscno message_center_index] [--long n] [-s] [-C n] +[-8] [-v n] [-d] +[--enablevoice|--disablevoice|--enablefax|--disablefax| +--enableemail|--disableemail|--void] [--unicode] +
+Sends an SMS message to destination +via SMSC number given in message_center_number or SMSC number taken from +phone memory from address message_center_index. +If arguments --smsc and --smscno is ommited SMSC number is taken +from phone memory from location 1. Message text +is taken from standard input. + +

Meaning of optional parameters: +

    +
  • --smsc - specify SMSC set
  • +
  • --smscno - specify SMSC number
  • +
  • --long - reads n bytes and cut into Linked SMS +(only when contenst is longer than size of 1 SMS)
  • +
  • -s - set replying via the same centre
  • +
  • -C - specify SMS class
  • +
  • -8 - send as 8-bit SMS
  • +
  • -v - set validity
  • +
  • -d - you will receive delivery report
  • +
  • --enablevoice, --disablevoice, --enablefax, +--disablefax, --enableemail, --disableemail - +These switches makes, that SMS has different meaning and in some phones +will enable/disable voice/fax/email signs on phone's screen
  • +
  • --voidsms - +These switches makes, that SMS has different meaning and some phones +after receiving it won't +display anything on the screen, but it will make sound/enable vibra
  • +
  • --unicode - codes SMS as Unicode SMS. When put +'~' (tilde) char inside, phone will start/end +blinking text. When will put "{" char, +contents of SMS will be invisible in some phones.
  • +
+ +

Examples: + +

+gnokii --sendsms "+48601601601" < file
+
+
+Saves an SMS message in SIM. Message text is taken from stdin. + +
+
+gnokii --savesms destination|\"\" [--smsc +message_center_number] [--smscno message_center_index] +[--long n] [-r] [-i] [-s] [-C n] [-8] [-a] [-l] +[--enablevoice|--disablevoice|--enablefax|--disablefax| +--enableemail|--disableemail|--void|--hang|--bug] [--unicode] + +
+ +

Meaning of optional parameters: +

    +
  • --smsc - specify SMSC set
  • +
  • --smscno - specify SMSC number
  • +
  • --long - reads n bytes and cut into Linked SMS +(only when contenst is longer than size of 1 SMS)
  • +
  • -r - mark SMS as read/sent
  • +
  • -i - saves SMS to inbox
  • +
  • -s - set replying via the same centre
  • +
  • -C - specify SMS class
  • +
  • -8 - send as 8-bit SMS
  • +
  • -a - ask, when specify location and sms is already there
  • +
  • -l - specify location
  • +
  • --enablevoice, --disablevoice, --enablefax, +--disablefax, --enableemail, --disableemail - +These switches makes, that SMS has different meaning and in some phones +will enable/disable voice/fax/email signs on phone's screen
  • +
  • --voidsms - +These switches makes, that SMS has different meaning and some phones +after receiving it won't +display anything on the screen, but it will make sound/enable vibra
  • +
  • --hangsms - +This switch makes, that SMS has different meaning and in some phones +(like Nokia 5110) it will hang phone, when saved to Outbox and +you try to read it from phone's menu
  • +
  • --bug - +This switch makes, that SMS has different meaning and in some phones +(like Nokia 5110, 6150) has problems with this SMS, when try to read it +from phone's menu. It seems to be its firmware bug... +
  • +
  • --unicode - codes SMS as Unicode SMS. When put +'~' (tilde) char inside, phone will start/end +blinking text. When will put "{" char, +contents of SMS will be invisible in some phones.
  • +
+ +

Examples: + +

+gnokii --savesms "SavedSMS" -i < file
+
+
+ +
+
gnokii --getsmsc message_center_number +
show the SMSC number from location message_center_number. + +

Usage examples: + +

+tfuj:~$ gnokii --getsmsc 1
+1. SMS center (CENTERTEL) number is +48501200777
+Messages sent as Text
+Message validity is 72 hours
+
+tfuj:~$ gnokii --getsmsc 2
+2. SMS center () number is 
+Messages sent as Text
+Message validity is Unknown
+
+
+ +

Date/time and alarm
+


+ +
+
gnokii --getdatetime +
+Shows current date and time in the phone. + +

Example: + +

+tfuj:~$ gnokii --getdatetime
+Date: 2000/07/06
+Time: 23:50:43
+
+
+ +
+
gnokii --setdatetime [YYYY [MM [DD [HH [MM]]]]] +
+Set the date and the time of the phone. + +

Example: + +

+
+
+ +
+
gnokii --getalarm +
+Shows current alarm set in phone. + +

Example: + +

+
+
+ +
+
gnokii --setalarm HH MM +
+Set the alarm of the phone. + +

Example: + +

+
+
+ +

Calendar
+


+ +
+
gnokii --getcalendarnote index [-v] +
+Get the note with number index from calendar. It will be written in +vCalendar 1.0 format, when use -v option. + +

Example: + +

+tfuj:~$ gnokii --getcalendarnote 1
+   Type of the note: Reminder
+   Date: 2000-06-26
+   Time: 23:59:59
+   Text: GNOKII TEST
+
+tfuj:~$ gnokii --getcalendarnote 2
+The calendar note can not be read
+
+tfuj:~$ gnokii --getcalendarnote 1 -v
+BEGIN:VCALENDAR
+VERSION:1.0
+BEGIN:VEVENT
+CATEGORIES:MISCELLANEOUS
+SUMMARY:GNOKII TEST
+DTSTART:20000626T235959
+END:VEVENT
+END:VCALENDAR
+
+
+ +
+
gnokii --writecalendarnote vcardfile number +
+Write the note to calendar. + +

Example: + +

+
+
+ +
+
gnokii --deletecalendarnote index +
+Delete the note with number index from calendar. + +

Example: + +

+
+
+ +

+ +Netmonitor
+


+ +

If you don't know, what is this or how to use it, please read first +our Netmonitor manual. + +

+
gnokii --netmonitor {reset|off|field|devel|next|nr} +
+Setting/querying netmonitor mode. + +

Example: + +

+tfuj:~$ gnokii --netmonitor 0
+TMSI46963A06
+T321:  2/ 20
+PRP:5   0  0
+     0   784
+
+tfuj:~$ gnokii --netmonitor 1    
+ 784 -72 xxx
+ 0  0 x xxxx
+  29      29
+    CBCH
+
+tfuj:~$ gnokii --netmonitor 2
+ NO 2    B35
+ 16   x
+
+tfuj:~$ gnokii --netmonitor 3
+784 28-73 28
+781 19-82 19
+809 19-82 19
+     N  N
+
+tfuj:~$ gnokii --netmonitor 4
+778 12-89 12
+794 11-90 11
+774  8-93  8
+   N  N  N
+
+tfuj:~$ gnokii --netmonitor 5
+800-99-99-99
+xxxxxxxxxxxx
+xxxxxxxxxxxx
+   N xx xx
+
+tfuj:~$ gnokii --netmonitor 6
+26003  26002
+20420  26001
+26207  20810
+26203  20416
+
+tfuj:~$ gnokii --netmonitor 7
+E A H C I BR
+1 1 0 0 0 10
+
+tfuj:~$ gnokii --netmonitor 1000
+
+  NO TEST
+
+
+ +
+
gnokii --nm_collect [screen x] [screen y] [screen z] +
+This function is like --netmonitor, but: + +

+

    +
  • each screen is printed on one single line
  • +
  • it loop until user press CTRL-C, (like --monitor)
  • +
  • it output simultaneously 1, 2 or 3 netmonitor screen
  • +
+ +

Was originally developed for: + +

+

    +
  • comparing of data from differents screen.
  • +
  • log of netmonitor screen
  • +
+ +

It's easier and has less options than --netmonitordata, but +should work with every phone that has netmonitor enabled and +don't need any parameter specifications (like --netmonitordata, +which requires external file with info about parameters). + +

Author: Andrea Scopece + +

Example: + +

+
+
+ +
+
+gnokii --netmonitordata [-S file] [-I file] [-h] [-n n] [-ts n] [-tm n] +[-fs str] [-ls str] FLD1:FLD2:FLDn:... +
+ +

Meaning of parameters is: +

+

    +
  • -fs string - field separator, default " "
  • +
  • -ls string - line separator, default LF (CRLF for win32)
  • +
  • -ts seconds - seconds before of next output of data (min 1 s, +max 3600 s)
  • +
  • -tm milliseconds - milliseconds before of next output of data +(default 200 ms, min 200 ms, max 10000 ms)
  • +
  • -n times - stop data output after "times" cycle. + -ts and -tm are mutually exclusive
  • +
  • -h - no header output, (default yes)
  • +
  • DATE - output date, may be as normal YY-MM-DD
  • +
  • DATE-S - output date, may be as short MM-DD
  • +
  • DATE-L - output date, may be as long yyyy-mm-dd
  • +
  • TIME - output time, may be as normal hh:mm:ss
  • +
  • TIME-S - output time, may be as short hh:mm
  • +
  • TIME-L - output time, may be as long hh:mm:ss:cc
  • +
  •   + + + +
    PARAM1 +
    PARAM2 +
    PARAM3 +
    .... +
    PARAMn +
    +This is the name of a param as specified in file +info-mon/model/version +parameter names must be in this file, and are case sensitive. + +

    You can specify max 512 params at once. +

    +
  • + +
  • -S file - parameters of netmonitor screen +you can override the default specification +of netmonitor parameters, suppling a file here.
  • +
  • -I file - sequence of command line's argument +this is useful execute a series of different +operation, like calling: +
    gnokii --netmonitordata args_set_1 +
    gnokii --netmonitordata args_set_2 +
    gnokii --netmonitordata args_set_3 +
    gnokii --netmonitordata args_set_n +
    + +

    file contains arguments as normally specified +on command line, but: + +

    on every line you should specify -n n option +so processing can stop without user intervent, +and continue with next line args_set. + +

    May be useful to make some pre-made collection, +as one made for battery check poupose, as +anothor to monitor neighbor cells, and so on. + +

    Inside this file options -I and option -S +are silently ignored + +

    Line in this file may be max length 1024 +

  • +
+ +

Here is also note from author: + +

Checks of all arguments, and eventually files contents, are made +before start of data output. + +

Because of complexity of command line, phone spec, and eventually +command file, on error, you have datailed description of any error, + +

Also I attached here an examples of commands-file (see /Docs/examples) +that can run with: +mygnokii --netmonitordata -S netmonitordata_6150_413 -I nmd_commands + +

Users of same model but with other firmware version probably +should do very little work for an exact parameters specifications +of theirs phones. + +

Users of 5110 and 6110 probably should remove some parameters not +available, like parameters related to dual band. + +

Users of other phone models should write a new parameters-file: +some hints are available in file netmonitordata_6150_413. + +

If help is needed, please dump the screen, +(mygnokii --netmonitor 20 > screen_20.txt), +and send an e-mail to my address. + +

If available, check help screen by pressing '*' on phone +(during netmonitor session). + +

Scope of this work is monitoring some "user-interesting" +parameters, coming from differents screen, like battery charging +vs. time, cell ID and channel changes vs. signal strenght, ... + +

This is work in progress, so any input would be appreciated. + +

Author: Andrea Scopece + +

Example: + +

+gnokii --netmonitordata -S file RxL:LAC:CID
+
+gnokii --netmonitordata -S file -fs ";" RxL:LAC:CID
+
+
+ +

Logos and startup texts
+


+ +

If you don't know, what is logo, please read first our logos FAQ. + +

+
+gnokii --bitmapconvert source destination +
gnokii --bitmapconvert source destination op [network code] +
gnokii --bitmapconvert source destination caller [caller group number] +
gnokii --bitmapconvert source destination startup +
+
+Converts logo files. Supported formats: +NOL, NGG, NSL, NLM, BMP, OTA, XPM. +3'rd parameter allow to specify, what type should be destination +logo (when format allows for it). + +

Usage examples: + +

+
+
+ +
+
+gnokii --sendlogo op destination logofile network_code +[--smsc message_center_number] [--smscno message_center_index] +[-s] [-v n] [-d] +
gnokii --sendlogo caller destination logofile +[--smsc message_center_number] [--smscno message_center_index] +[-s] [-v n] [-d] +
+
+Send the logofile to destination as operator +or CLI logo. Optional parameters: + +

+

    +
  • --smsc - specify SMSC set
  • +
  • --smscno - specify SMSC number
  • +
  • -s - set replying via the same centre
  • +
  • -v - set validity
  • +
  • -d - you will receive delivery report
  • +
+ +

Usage examples: + +

+
+
+ +
+
+gnokii --savelogo op logofile network_code +[--smsc message_center_number] [--smscno message_center_index] +[-r] [-i] [-s] [-a] [-l] [--name name] +
gnokii --savelogo caller logofile +[--smsc message_center_number] [--smscno message_center_index] +[-r] [-i] [-s] [-a] [-l] [--name name] +
+
+Saves the logofile on SIM as operator +or CLI logo. Optional parameters: + +

+

    +
  • --smsc - specify SMSC set
  • +
  • --smscno - specify SMSC number
  • +
  • -r - mark as read
  • +
  • -i - save to inbox
  • +
  • -s - set replying via the same centre
  • +
  • -a - ask, when specify location and sms is already there
  • +
  • -l - specify location
  • +
  • --name - specify recipient/sender name instead of default
  • +
+ +

Usage examples: + +

+
+
+ +
+
+gnokii --setlogo op [logofile] [network code] +
gnokii --setlogo startup [logofile] +
gnokii --setlogo caller [logofile] [caller group number] [group name] +
gnokii --setlogo {dealer|text} [text] +
+
+Set caller, startup or operator logo or set (Dealer) welcome note. + +

In Nokia 6110/6130/6150 you will see menu in phone after using it... + +

Usage examples: + +

+
+
+ +
+
+gnokii --getlogo op [logofile] [network code] +
gnokii --getlogo startup [logofile] [network code] +
gnokii --getlogo caller [logofile][caller group number][network code] +
gnokii --getlogo {dealer|text} +
+
+Get caller, startup or operator logo or get (Dealer) welcome note. + +

Usage examples: + +

+
+
+ +

Ringtones
+


+ +
+
+gnokii --sendringtone destination ringtonefile +[--smsc message_center_number] [--smscno message_center_index] +[-s] [-v n] [-d] [--scale] + +
+Send the RTTL/OTT file to destination as ringtone. + +

+

    +
  • --smsc - specify SMSC set
  • +
  • --smscno - specify SMSC number
  • +
  • -s - set replying via the same centre
  • +
  • -v - set validity
  • +
  • -d - allow to receive delivery report, when send
  • +
  • --scale - saves scale info with all tones. It allow +to eliminate firmware bug in some Nokia phones.
  • +
+ +

Usage examples: + +

+
+
+ +
+
+gnokii --saveringtone ringtonefile +[--smsc message_center_number] [--smscno message_center_index] +[-r] [-i] [-s] [-a] [-l] [--name name] [--scale] + +
+Saves ringtone on SIM. + +

+

    +
  • --smsc - specify SMSC set
  • +
  • --smscno - specify SMSC number
  • +
  • -r - mark as read
  • +
  • -i - save to inbox
  • +
  • -s - set replying via the same centre
  • +
  • -s - set replying via the same centre
  • +
  • -a - ask, when specify location and sms is already there
  • +
  • -l - specify location
  • +
  • --name - specify recipient/sender name instead of default
  • +
  • --scale - saves scale info with all tones. It allow +to eliminate firmware bug in some Nokia phones.
  • +
+ +

Usage examples: + +

+
+
+ +
+
+gnokii --setringtone ringtonefile + [location] + +
+Set the RTTL/OTT as ringtone + +

In Nokia 6110/6130/6150 you will see menu in phone after using it... + +

Usage examples: + +

+
+
+ +
+
+gnokii --getbinringtone ringtonefile + [location] + +
+Gets downloadable ringtone and writes it in the special binary format +(it's not yes decoded - after making it this function can be unavailable). + +

Usage examples: + +

+
+
+ +
+
+gnokii --setbinringtone ringtonefile + [location] + +
+Sets downloadable ringtone. Ringtonefile is in format used by +--getbinringtone. Mygnokii contains some default Nokia phones +ringtones saved in this format. + +

Usage examples: + +

+
+
+ + +
+
+gnokii --ringtoneconvert source destination + +
+Converts ringtone files (RTTL, OTT) + +

Usage examples: + +

+
+
+ +
+
+gnokii --playringtone file + +
+Plays ringtone in phone + +

Usage examples: + +

+
+
+ +
+
+gnokii --composer ringtonefile + +
+Shows, how ringtone will look in Composer in phone...and how to enter it there... + +

Usage examples: + +

+
+
+ +
+
+gnokii --allringtones + +
+Shows names of ringtones in your phone (to test, if they're put into source) + +

Usage examples: + +

+
+
+ +

Backup/restore tool
+


+ +
+
+gnokii --backupsettings file [subformat] + +
+Writes various settings into one file + +

Supported formats: LMB (Logo Manager Backup - full support for +N61xx/51xx features; for N7110/6210 some things can be missed, when compare +to files saved by LM), +CSS (NCDS3 - only phonebook part), +CSV (subformats: ncds2, lm, ncds3_pl - some things missed for N7110/6210), +SCM (WinTesla) + + + +

Usage examples: + +

+
+
+ +
+
+gnokii --restoresettings file + +
+ +

+

    +
  1. restores various settings from one file
  2. +
  3. allow to write phonebooks and logos into separate files.
  4. +
+ +

Supported formats: LMB (Logo Manager Backup - full support for +N61xx/51xx features; for N7110/6210 some things can be missed, when compare +to files saved by LM), +CSS (NCDS3 - only phonebook part), +CSV (subformats: ncds2, lm, ncds3_pl - some things missed for N7110/6210), +SCM (WinTesla) + + + + +

Usage examples: + +

+
+
+ +

Profiles
+


+ +
+
+gnokii --getprofile [number] + +
+Show settings for selected(all) profile(s) + +

Usage examples: + +

+tfuj:~$ gnokii --getprofile 1
+1. "General"
+Incoming call alert: Ringing
+Ringtone number: 19
+Ringing volume: Level 3
+Message alert tone: Standard
+Keypad tones: Off
+Warning and game tones: On
+Vibration: On
+Caller groups: 0x00
+
+
+ +
+
+gnokii --setprofile number feature value + +
+Set profile feature + +

Possible features are: +

    +
  • callalert (Incoming call alert) +
    possible values are: +
      +
    • ringing (Ringing)
    • +
    • ascending (Ascending)
    • +
    • ringonce (Ring once)
    • +
    • beeponce (Beep once)
    • +
    • ringing (Ringing)
    • +
    • groups (Caller groups - not in N5110)
    • +
    • off,0 (Off)
    • +
    +
  • +
  • volume (Ringing volume) +
    possible values are: 1|2|3|4|5 +
  • +
  • keypad,keypadtone (Keypad tones) +
    possible values are: +
      +
    • 0,off (Off)
    • +
    • 1 (Level 1)
    • +
    • 2 (Level 2)
    • +
    • 3 (Level 3)
    • +
    +
  • +
  • smstone,messagetone,sms,message (Message alert tone) +
    possible values are: +
      +
    • 0,off (No tone)
    • +
    • standard (Standard)
    • +
    • special (Special)
    • +
    • beeponce,once (Beep once)
    • +
    • ascending (Ascending)
    • +
    +
  • +
  • warningtone,warning (Warning and game tones) +
    possible values are: 0|off|1|on +
  • +
  • vibra,vibration (Vibration) +
    possible values are: 0|off|1|on +
  • +
  • lights (Lights) +
    possible values are: +
      +
    • 0,off (Automatic)
    • +
    • 1,on (On)
    • +
    +
  • +
  • answer (Automatic answer) +
    possible values are: 0|off|1|on +
  • +
  • name - profile name (doesn't work in N5110) +
    value is new profile name +
  • +
  • ringtone (Ringing tone) +
    value is new ringing tone number +
  • +
  • groups - caller group name for profile +
    value is new caller group number +
  • +
+ +

Usage examples: + +

+
+
+ +

Security features
+


+ +

This functions are available ONLY, if gnokii was compiled with them ! + +

+
+gnokii --entersecuritycode PIN|PIN2|PUK|PUK2 + +
+Asks for the code and sends it to the phone + +

Usage examples: + +

+
+
+ +
+
+gnokii --getsecuritycodestatus + +
+Show if a security code is needed + +

Usage examples: + +

+
+
+ +
+
+gnokii --getsecuritycode PIN|PIN2|PUK|PUK2|SecurityCode + +
+Gets security code (only SecurityCode allowed !) + +

Usage examples: + +

+
+
+ +

Other functions
+


+ +
+
gnokii --monitor +
Runs gnokii in persistent communication state - displays all data +received from the phone to the stderr. Example session: + +
tfuj:~$ gnokii --monitor
+Entering monitor mode...
+Initialising GSM interface...
+RFLevel: 4
+Battery: 3
+Power Source: battery
+SIM: Used 42, Free 188
+Phone: Used 4, Free 46
+FD: Used 0, Free 20
+ON: Used 2, Free 3
+SMS Messages: UnRead 0, Number 26
+Network: IDEA Centertel (Poland), LAC: 00c8, CellID: 1024
+[...]
+
+
+ +
+
+gnokii --dialvoice number + +
+Initiate voice call from first number on SIM card. + +

Usage examples: + +

+
+
+ +
+
+gnokii --getdisplaystatus + +
+Shows what icons are displayed in phone's screen. + +

Usage examples: + +

+tfuj:~$ gnokii --getdisplaystatus    
+Call in progress: off
+Unknown: off
+Unread SMS: off
+Voice call: off
+Fax call active: off
+Data call active: off
+Keyboard lock: off
+SMS storage full: off
+
+
+ +
+
+gnokii --identify + +
+Get IMEI, model and revision +. In this moment doesn't work with MBUS connection +and Unix... + +

Usage examples: + +

+tfuj:~$ gnokii --identify    
+IMEI:     495502202470000
+Model:    NSK-3
+Revision: SW 4.11, HW2460
+
+
+ +
+
+gnokii --senddtmf string + +
+Sends DTMF sequence +. If you will start from "p" (Pause), phone will display +menu before sending it... + +

Usage examples: + +

+
+
+ +
+
+gnokii --presskeysequence sequence + +
+presses some keys in phone keyboard + +

Available keys: +

    +
  • 0..9
  • +
  • #
  • +
  • *
  • +
  • m (Menu)
  • +
  • n (Names)
  • +
  • p (Power)
  • +
  • g (Green)
  • +
  • r (Red)
  • +
  • +, - (Volume up or down)
  • +
  • u (Up arrow)
  • +
  • d (Down arrow)
  • +
  • w - 2 sec. pause (useful, when you simulate writing SMS)
  • +
+ +

Usage examples: + +

+
+
+ +
+
+gnokii --reset [soft|hard] + +
+Resets the phone. + You can use "soft" parameter (no question for PIN code - it's default) +or "hard" (phone will ask for PIN - of course, if you have it enabled in your card; +in some phones - for example N5110 - this type of reset will be like "soft") + +

Usage examples: + +

+
+
+ +
+
+gnokii --getphoneprofile + +
+Gets profile set normally with Product Profile Settings + +

Usage examples: + +

+
+
+ +
+
+gnokii --setphoneprofile feature value + +
+Set profile set normally with Product Profile Settings: + +

Features can be: + +

+

    +
  • "ALS" (Alternative Line Service) - values "0" or "1"
  • +
  • "HRData" (data transmission using Half Rate channels) - values "0" or "1"
  • +
+ +

Usage examples: + +

+
+
+ +
+
+gnokii --displayoutput + +
+Show texts displayed in phone's screen + +

Usage examples: + +

+tfuj:~$ gnokii --displayoutput
+Entering display monitoring mode...
+Accessory
+connected
+Names
+Menu
+23:59
+Messages
+Exit
+Select
+_
+Messages
+Exit
+Select
+_
+Call register
+Exit
+Select
+2
+Missed
+calls
+Back
+Select
+2-1
+Received
+calls
+Back
+Select
+2-2
+Dialled
+numbers
+Back
+Select
+2-3
+Erase recent
+call lists
+Back
+Select
+2-4
+Show call
+duration
+Back
+Select
+2-5
+Last call
+duration
+00:01:33
+Back
+2-5-1
+All calls'
+duration
+06:45:02
+Back
+2-5-2
+Received calls'
+duration
+02:49:38
+Back
+2-5-3
+Names
+Menu
+23:59
+...WAW... 
+POCZTA ELE
+...WAW... 
+Leaving display monitor mode...
+
+
+ +
+
+gnokii --getphoneprofile + +
+Gets Product Profile Settings from phone + +

Usage examples: + +

+
+
+ +
+
+gnokii --getoperatorname + +
+Get info about downloaded operator name + +

Usage examples: + +

+
+
+ +
+
+gnokii --setoperatorname code name + +
+Set downloaded operator name + +

Usage examples: + +

+
+
+ +

How to send SMS to multiple recipients using gnokii ?
+


+ +

+ +#!/bin/tcsh

+if ( $# == 0 ) then
+  echo "You must specify at least one recipient's number!"
+  exit 1
+endif

+echo -n "Enter SMS:"
+set sms="$<"

+foreach i ( $* )
+  echo "$sms" | gnokii --sendsms "$i"
+end +
+ + + + +

Sending script...
+


+ +

Author: oxana [rasqua@t-online.de] + +

+I use a simple perlscript to send sms from a daily generated file. The file +is generated by another script. + +

The script contains only one line like this "send following data : ++49179xxxxxxx Hallo Guillaume#Test#" + +

Where +49xxx the number, followed by text, # will be replaced with a +carriage return (\n) the string "send sms:" is only to prevent errors + +

I've modified the comments for english language ... the programm is very +simple (I'am perl-newbie too) but I hope you can read it. +I use this to send a daily status-sms to my phone. + +

+#!/usr/bin/perl
+use strict;
+while (1)                                               #example endlessloop
+{
+my ($strtosend, $valid, $rxnnummer, $smslaenge, $pid, $filename, $timeout);
+# (nummer is german for number, laenge is german for length)
+$filename = "/xxx/xxx/xxx/data/smstosend_data";                 # file with
+data
+$valid ="send sms:";
+# to prevent errors
+$timeout = 100;
+# timeout
+open(INPUT, "< $filename");                                              #
+or die "error opening: $!\n";           # hope here are no errors
+while()
+# if ok
+{
+$strtosend = $_;
+# copy input to strtosend
+if ($strtosend =~ /\A$valid/)
+# if $valid then
+{
+$strtosend = substr ($strtosend, index($strtosend,"+"));
+# cut all befor number (send sms:)
+if ($strtosend =~ /\+\d.*?\b/) {$rxnummer = $&} else {$rxnummer = 0};
+# all following numbers are phone-number and copy it to rxnummer (nummer is
+german for number)
+$strtosend =~ s/\+49179\d.*?\b\s//g;                                    #
+remove number
+$strtosend =~ s/\#/\n/g;
+# replace # by \n
+$smslaenge = length($strtosend);
+# check length
+$pid = open(FileHandle, "|gnokii --sendsms $rxnummer --long $smslaenge");#
+or die "Fehler bei fork: $!\n";     ### start gnokii and send sms
+print FileHandle "$strtosend\n";
+# send string to stdin
+select(undef,undef,undef,15);
+# i dont know
+close (FileHandle); # or die "Fehler bei close: $!\n";                #
+close gnokii
+close(INPUT);
+# close input-file
+unlink($filename);
+# remove input-file
+open(INPUT, ">> /xxx/xxx/xxx/smshistory_data") or die "error opening: $!\n";
+# open history for append
+print INPUT "\n",'-' x 80,"\n";
+# line with 80 "-"
+print INPUT ("send succeeded to : $rxnummer \nat :
+".localtime()."\n$strtosend \n");  # write text to file
+print INPUT "\n",'-' x 80,"\n";
+# line with 80 "-"
+close INPUT;
+# close file
+}
+else
+# if impossible (open file)
+{                                                                           
+  # do nothing
+}
+}
+select(undef,undef,undef,$timeout);
+# dont know
+}
+exit(0);
+# exit program
+
+ + + + diff --git a/Docs/en_US/gnokii/phones.htm b/Docs/en_US/gnokii/phones.htm new file mode 100644 index 0000000..69d7dfb --- /dev/null +++ b/Docs/en_US/gnokii/phones.htm @@ -0,0 +1,208 @@ + + + + + Supported phones + + + + + +

Main page

+
Supported phones
+ +


+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ModelConnectionLogosRingtonesData callsNotes
640(mbus)???
3110serial?-?
3210serial/mbusstartup (static)/operator/pictureuploading-
3310serial/mbusstartup (static)/operator/pictureuploading only-Each memory note has null name
3810serial?-?
5110serial/mbus or ATGSM (with NCDS)operator-yes
5130serial/mbus or ATGSM (with NCDS)operator-yes
5160(mbus)?-?
6110serial/mbus/infrared or ATGSM (with NCDS)startup/operator/calleruploading/downloadingyes
6130serial/mbus/infrared or ATGSM (with NCDS)startup/operator/calleruploading/downloadingyes
6150serial/mbus/infrared or ATGSM (with NCDS)startup/operator/calleruploading/downloadingyes
6160(mbus)???
6185(mbus)???
6210serial/mbus/dlr3 or ATGSMstartup/operator/callernono
7110serial/mbus/dlr3 or ATGSMstartup/operator/callernono
8110serial?-?
8110iserial?incoming?
9000i??incoming?
+ +

Note: + +

+

    +
  • ? - not tested
  • +
  • incoming - you have to find another phone supported by mygnokii and +send ringtone/logo/etc. to this one
  • +
  • no - feature not supported by mygnokii
  • +
  • yes - feature supported by mygnokii
  • +
  • - - feature not supported by phone
  • +
+ +

In connection you have types, you should enter in gnokiirc and which will +work in phone. When its' in brackets, it means, that this of connection is supported, +but "connection" parameter in gnokiirc is not important. ATGSM means, that you +should use ATGSM "model" in gnokiirc. + + + diff --git a/Docs/en_US/gnokii/todologo b/Docs/en_US/gnokii/todologo new file mode 100644 index 0000000..d497d86 --- /dev/null +++ b/Docs/en_US/gnokii/todologo @@ -0,0 +1,52 @@ + + +todologo.perl GNOKII Tools todologo.perl + + +NAME + todologo.perl - Create operator logo that contains 3 lines of text + +SYNOPSIS + todologo.perl - - + +DESCRIPTION + The `todologo.perl' program is used to create three lines of text + that fits to the standard Nokia operator logo space (i.e. 72x14 + pixel space). This is achieved by using a proportional tiny font + which most elements have size of 3x4 pixels (some are thinner). + + The name comes from an original intention that this program is + used to create todo entries to one's mobile phone screen so that + those are always visible and thus in user's memory. But the tool + can just be used to print arbitrary text to the space provided + by an operator logo. + + The hand-crafted font currently supports the following characters: + abcdefghijklmnopqrstuvwxyz and 0123456789 + +OUTPUT + The standard `.nol' formatted operator logo is printed to + standard output. The header information of that output is taken + from `gnokii.nol' that is distributed with Gnokii -- so you most + probably need to give your operator code when uploading it to your + mobile phone. Use `Gnokii' or `Xlogos' to do the uploading. + +EXAMPLES + First example writes some todo entries to todo.nol: + + todologo.perl pick up kids - call wife - order chinese >todo.nol + + This last example writes some wisdom to the stdout: + + todologo.perl Never underestimate - the power of the dork - \ + side of the force + +SEE ALSO + Gnokii, Xlogos + +COPYING + This program is distributed under the GNU Public License. + + + +Gnokii Tools 25oct2000 diff --git a/Docs/en_US/gnokii/xgnokii/calendar/index.htm b/Docs/en_US/gnokii/xgnokii/calendar/index.htm new file mode 100644 index 0000000..7e8da59 --- /dev/null +++ b/Docs/en_US/gnokii/xgnokii/calendar/index.htm @@ -0,0 +1,18 @@ + + + + + Calendar + + + + + +

Main page

+
Calendar
+ +

FIX ME: we need description of Calendar window in xgnokii here... + + + + diff --git a/Docs/en_US/gnokii/xgnokii/contacts/index.htm b/Docs/en_US/gnokii/xgnokii/contacts/index.htm new file mode 100644 index 0000000..d506422 --- /dev/null +++ b/Docs/en_US/gnokii/xgnokii/contacts/index.htm @@ -0,0 +1,18 @@ + + + + + Contacts + + + + + +

Main page

+
Contacts
+ +

FIX ME: we need description of Contacts window in xgnokii here... + + + + diff --git a/Docs/en_US/gnokii/xgnokii/dtmf/index.htm b/Docs/en_US/gnokii/xgnokii/dtmf/index.htm new file mode 100644 index 0000000..ce9c9e3 --- /dev/null +++ b/Docs/en_US/gnokii/xgnokii/dtmf/index.htm @@ -0,0 +1,18 @@ + + + + + DTMF + + + + + +

Main page

+
DTMF
+ +

FIX ME: we need description of DTMF window in xgnokii here... + + + + diff --git a/Docs/en_US/gnokii/xgnokii/main/index.htm b/Docs/en_US/gnokii/xgnokii/main/index.htm new file mode 100644 index 0000000..f1b4aaa --- /dev/null +++ b/Docs/en_US/gnokii/xgnokii/main/index.htm @@ -0,0 +1,18 @@ + + + + + XGNOKII + + + + + +

Main page

+
XGNOKII
+ +

FIX ME: we need description of main xgnokii window here... + + + + diff --git a/Docs/en_US/gnokii/xgnokii/netmon/index.htm b/Docs/en_US/gnokii/xgnokii/netmon/index.htm new file mode 100644 index 0000000..32d6173 --- /dev/null +++ b/Docs/en_US/gnokii/xgnokii/netmon/index.htm @@ -0,0 +1,21 @@ + + + + + Netmon + + + + + +

Main page

+
Netmon
+ +

FIX ME: we need description of Netmon window in xgnokii here... + +

Related links: +
Netmonitor manual + + + + diff --git a/Docs/en_US/gnokii/xgnokii/sms/index.htm b/Docs/en_US/gnokii/xgnokii/sms/index.htm new file mode 100644 index 0000000..e9447b2 --- /dev/null +++ b/Docs/en_US/gnokii/xgnokii/sms/index.htm @@ -0,0 +1,23 @@ + + + + + SMS + + + + + +

Main page

+
SMS
+ +

+ +

FIX ME: we need description of SMS window in xgnokii here... + +

Related topics: +
SMS FAQ + + + + diff --git a/Docs/en_US/gnokii/xgnokii/sms/sms.gif b/Docs/en_US/gnokii/xgnokii/sms/sms.gif new file mode 100644 index 0000000..c9869fc Binary files /dev/null and b/Docs/en_US/gnokii/xgnokii/sms/sms.gif differ diff --git a/Docs/en_US/gnokii/xgnokii/speeddial/index.htm b/Docs/en_US/gnokii/xgnokii/speeddial/index.htm new file mode 100644 index 0000000..a2a89f2 --- /dev/null +++ b/Docs/en_US/gnokii/xgnokii/speeddial/index.htm @@ -0,0 +1,18 @@ + + + + + Speed dial + + + + + +

Main page

+
Speed dial
+ +

FIX ME: we need description of Speed dial window in xgnokii here... + + + + diff --git a/Docs/en_US/gnokii/xgnokii/xkeyb/index.htm b/Docs/en_US/gnokii/xgnokii/xkeyb/index.htm new file mode 100644 index 0000000..91783e0 --- /dev/null +++ b/Docs/en_US/gnokii/xgnokii/xkeyb/index.htm @@ -0,0 +1,18 @@ + + + + + Keyboard + + + + + +

Main page

+
Keyboard
+ +

FIX ME: we need description of Keyboard window in xgnokii here... + + + + diff --git a/Docs/en_US/gsm/cables/cable1.gif b/Docs/en_US/gsm/cables/cable1.gif new file mode 100644 index 0000000..dbe36cc Binary files /dev/null and b/Docs/en_US/gsm/cables/cable1.gif differ diff --git a/Docs/en_US/gsm/cables/cable2.gif b/Docs/en_US/gsm/cables/cable2.gif new file mode 100644 index 0000000..a455f1d Binary files /dev/null and b/Docs/en_US/gsm/cables/cable2.gif differ diff --git a/Docs/en_US/gsm/cables/cables.htm b/Docs/en_US/gsm/cables/cables.htm new file mode 100644 index 0000000..a2f9fae --- /dev/null +++ b/Docs/en_US/gsm/cables/cables.htm @@ -0,0 +1,130 @@ + + + + + Cables FAQ + + + + + +

Main page

+
Cables FAQ
+ +


+ +

What cables are used for Nokia phones ?
+


+ +

Nokia phone can support three protocols of transmission over cable: + +

+

    +
  • M2BUS (called often simply MBUS) - 9600,N,...
  • +
  • FBUS - 115200
  • +
  • AT mode - 19600
  • +
+ +

You cable can support each of them...and phone must be compatible with it +(for example, CAN'T use DLR-3 with phone, which show "headset connected" +after connecting it)... + +

Schematics
+


+ +

Simple M2BUS (only) cable: +

+

Note: +
+

    +
  • 74HC04 must be in HC version
  • +
  • Dioda Zenera 3,2 V it required for phones different than 21xx, 3110
  • +
+ +

FBUS cable: +

+ +

Switch for M2BUS/FBUS for cable above: +

+ +

Cable for AT mode is unavailable here, because it needs programmed chip +and I don't know, what programm should be inside... + +

To make FBUS/MBUS cable you have to connect: +

+

    +
  • FBUS - GND, TX and RX
  • +
  • M2BUS - MBUS and GND
  • +
+ +

Phone connectors
+


+ + + +

What are original cables for Nokia phones ?
+


+ +

+

    +
  • DAU-3 (or DAU-3H) - cable for Nokia series 2100. +Sell with Nokia Cellularware (it isn't produced now). +
  • + +
  • +DAU-4S - cable for Nokia 3110 and all models in series 8100 (8110, 8110i, 8148 and 8148i). +Sell with Nokia Cellularware (it isn't produced now). +
  • + +
  • +DAU-4F - uniwersal (FBUS/M2BUS) cable without switch, +for Nokia 3110 and all models in series 8100 (8110, 8110i, 8148 and 8148i). +Sell with Nokia Cellular Data Suite 1.0 (it isn't produced now). +
  • + +
  • +DAU-9P - uniwersal (FBUS/M2BUS) cable without switch, for Nokia 51x0/61x0. +Sell with Nokia Cellular Data Suite 1.2 - 3.0a. +
  • + +
  • +DLR-1 - cable sell with Nokia 9000 Communicator. It can be used +to exchange date between phone and computer and installing software into phone. +It's M2BUS cable. +
  • + +
  • +DLR-2 - cable sell with Nokia 9110 Communicator. It can be used +to exchange date between phone and computer and installing software into phone. +It's M2BUS cable, but can't be used with programs working with this protocol (needs +some small changes - after them will not work original Communicator programms). + +
  • +DLR-3 and DLR-3P - cables for Nokia 7110/6210. Supports AT mode and FBUS. +FIXME: MBUS too ? +
  • +
+ +

Can I use DLR-3 cable with my phone ?
+


+ +

See post from gnokii maillist: + +

The dlr-3 CAN'T work with the older phones. this is because the +converter in the cable is powered by the phone. this is done by the +phone by raising the !mic-gnd! pin to vcc. if the cable doesn't +repond on the mbus after 1 second, the power is dropped. a older +phone doesn't do this, so the converter is unpowered. + +

To decide if a phone needs a dau-9 (the old one, powered by pc) or +the new one (dlr-3) simply connect a dlr-3 to the phone. if the +phone says "headset connected" it isn't capable of using a dlr-3 +and you have to change to a dau-9. + +


+ +

Page created from materials from www.fkn.pl + + + + diff --git a/Docs/en_US/gsm/cables/switch.gif b/Docs/en_US/gsm/cables/switch.gif new file mode 100644 index 0000000..7181b50 Binary files /dev/null and b/Docs/en_US/gsm/cables/switch.gif differ diff --git a/Docs/en_US/gsm/codes/codes.htm b/Docs/en_US/gsm/codes/codes.htm new file mode 100644 index 0000000..c8db321 --- /dev/null +++ b/Docs/en_US/gsm/codes/codes.htm @@ -0,0 +1,136 @@ + + + + + + + + + + + + + + + + + + + + FAQ - kable do Nokii + + + + + +

Strona g³ówna/Main +page

+ +
Kody do Nokii/Codes +for Nokia phones
+ +

+
+ +

Poni¿ej zosta³y zebrane wszystkie (?) kody do telefonów Nokia, które mo¿na +wpisaæ w momencie, gdy na wy¶wietlaczu jest widoczna nazwa sieci/logo i odblokowana +jest klawiatura:

+

You have here all (?) codes for Nokia phones. You can enter them, when +see on the screen network name/logo and keypad is unlocked.

+

+
    +
  • GSM/DCS/PCN: +
      +
    • *#06# - sprawdzanie IMEI/checking IMEI. +Wiêcej o IMEI/More about IMEI
    • +
    • *EFR0# w³±cza/enables EFR +, #EFR0# wy³±cza/disables EFR +. Je¿eli dzia³a w Twoim telefonie (GSM/DCS/PCN), telefon siê zrestartuje +po jego u¿yciu/If it works for your GSM/DCS/PCN phone, phone will restart +after using it. Je¿eli nie, mo¿esz u¿yæ np. mygnokii ze strony +Pliki do pobrania do jego w³±czenia/If not, you can use mygnokii from + Files for download page to +enable it. Wiêcej o EFR/More about EFR
    • +
    • *HRC0# w³±cza/enables HR +, #HRC0# wy³±cza/disables HR +. Je¿eli dzia³a w Twoim telefonie (GSM/DCS/PCN), telefon siê zrestartuje +po jego u¿yciu/If it works for your GSM/DCS/PCN phone, phone will restart +after using it. Je¿eli nie, mo¿esz u¿yæ np. mygnokii ze strony +Pliki do pobrania do jego w³±czenia/If not, you can use mygnokii from + Files for download page to +enable it. Wiêcej o HR/More about HR
    • +
    • *#sim0clock# - sprawdza, czy mo¿liwe jest zatrzymanie zegara +karty SIM/checks, if SIM card can stop its' clock (GSM/DCS/PCN)
    • + +
    +
  • +
  • analog: +
      +
    • *3001#12345, *#639# - Menu do programowania NAM/NAM programming +menu. W niektórych modelach pozwala w³±czyæ +monitor sieci (nazywany Field Test)/In some models allows to enable +netmonitor (called Field Test).
    • +
    • *#92772689# - checking ISDN number/sprawdzanie numeru ISDN (N6120/6160/6162)
    • +
    • *#EVRC# - w³±cza i wy³±cza AMPS (Enhanced Variable Rate Codec)/enables +and disables AMPS (Enhanced Variable Rate Codec) (N6185)
    • + +
    +
  • +
  • *#9999#, *#170602112302#, *#682371158412125#, + *#3110#, *#0000#, *#3810#, *#5190#, *#6120# +, *#837#, *#6190#, *#8110# - sprawdzanie wersji i daty +firmware, modelu telefonu/checking firmware date & version and phone +model. Wiêcej o firmware/More about firmware
  • +
  • #pw+Master code+Y# - kod pozwalaj±cy zdj±æ simlocka o numerze +Y (je¿eli podano prawid³owy 10-cyfrowy MasterCode) - wtedy zobaczysz +"SIM protection turn off". Je¿eli telefon ma simlocka i podano z³y MasterCode, +zobaczysz "Code error". Je¿eli telefon nie ma simlocka, zobaczysz + "SIM was not restricted". Mo¿esz sprawdziæ stan simlocka równie¿ +przy u¿yciu mygnokii ze strony Pliki do +pobrania This is code for disabling simlock number Y (if you gave correct +10-digits MasterCode) - you will see "SIM protection turn off". +If phone has simlock and MasterCode was wrong, you will see "Code error" +. If phone doesn't have simlock, you will see "SIM was not restricted" +. You can also check simlock state using mygnokii from page +Files for download too
  • +
  • *#war0anty#, *#warranty# - wej¶cie do menu serwisowego/entering +service menu. W niektórych telefonach nale¿y usun±æ modu³ analogowy przed +jego u¿yciem/In some phones you have to remove analog module before using +it. W niektórych starszych telefonach (np. Nokii 3110) trzeba tu podaæ dodatkowy +kod/ In some older phones (like Nokia 3110) you have to enter additional +code here: +
      +
    • 6232 (OK): Pokazuje miesi±c i rok produkcji/Displays the Month +and Year of Manufacture
    • +
    • 7332 (OK): Pokazuje datê ostatniej naprawy/Displays the date +of the last repairment, if found ('DATE NOT SAVED'...)
    • +
    • 7832 (OK): Pokazuje datê kupna telefonu/Displays (if found) +the date where the phone was purchased ('DATE NOT SAVED'...)
    • +
    • 9268 (OK): Pokazuje numer seryjny/Displays Serial Number
    • +
    • 37832 (OK): Zmienia datê kupna (TYLKO RAZ!)/Set the Purchasing +Date MMYY (Warning: You can only do this once - So be careful ...)
    • +
    • 87267 (OK): Transfer danych do nastêpnego telefonu/Transfers +ALL phone numbers, pictures, sounds from one phone to another
    • + +
    +
  • +
  • *#7780# - reset ustawieñ telefonu do fabrycznych (np. Nokia +3110)/reset settings to Factory (for example, Nokia 3110)
  • +
  • *#date# - pokazuje datê produkcji/data date of production (N2110)
  • +
  • *#srn0# - pokazuje numer seryjny/shows Serial Number (N6150)
  • +
  • *#opr0logo# - kasuje logo operatora. Dzia³a w Nokii 3310 4.06 +i nowszych/clears operator logo. Works in Nokia 3310 4.06 and newer
  • + +
+ +

Na pocz±tek/Back to the top

+

+
+
+

+Marcin Wi±cek ( +WWW)
+Ostatnia aktualizacja: 5 stycznia 2002/Last modification: 5 January 2002
+

+ + diff --git a/Docs/en_US/gsm/compare/1.htm b/Docs/en_US/gsm/compare/1.htm new file mode 100644 index 0000000..aad41a1 --- /dev/null +++ b/Docs/en_US/gsm/compare/1.htm @@ -0,0 +1,20 @@ + + + + + + + + + + Compare phones + + + + + + diff --git a/Docs/en_US/gsm/compare/compare.htm b/Docs/en_US/gsm/compare/compare.htm new file mode 100644 index 0000000..b306487 --- /dev/null +++ b/Docs/en_US/gsm/compare/compare.htm @@ -0,0 +1,21 @@ + + + + + + + + + + Compare your phone + + + + +

Strona g³ówna/Main page

+ +

Click here to open script in new window + +

Kliknij, aby otworzyæ skrypt w nowym oknie + + diff --git a/Docs/en_US/gsm/compare/index.htm b/Docs/en_US/gsm/compare/index.htm new file mode 100644 index 0000000..3645bb7 --- /dev/null +++ b/Docs/en_US/gsm/compare/index.htm @@ -0,0 +1,210 @@ + + + + + + + + + + Compare your phone + + + + + + diff --git a/Docs/en_US/gsm/compare/null.htm b/Docs/en_US/gsm/compare/null.htm new file mode 100644 index 0000000..a511ca4 --- /dev/null +++ b/Docs/en_US/gsm/compare/null.htm @@ -0,0 +1,6 @@ + + + + + + diff --git a/Docs/en_US/gsm/firmware/firm12.htm b/Docs/en_US/gsm/firmware/firm12.htm new file mode 100644 index 0000000..cd99f34 --- /dev/null +++ b/Docs/en_US/gsm/firmware/firm12.htm @@ -0,0 +1,358 @@ + + + + + + + + + + + Nokia identification & firmware/Identyfikacja i oprogramowanie telefonów Nokia + + + + +

+ +
+


Nokia identification & firmware/Identyfikacja +i oprogramowanie telefonów Nokia

+ +

+


+
    +
  1. +Ogólne b³êdy/General bugs
  2. + +
  3. +Ogólne informacje o IMEI/General info about +IMEI
  4. + +
  5. +Czy mogê wgraæ sobie oprogramowanie/Can I download +firmware to my phone ?
  6. + +
  7. +Czy to kosztuje ?/Does it cost ?
  8. + +
  9. +Gdzie tego dokonaæ ?/Where to make it ?
  10. + +
  11. +Jakie s± b³êdy/zmiany w kolejnych wersjach +?/What are bugs/changed things in next versions ?
  12. + +
  13. +Jak zmieniæ wersjê jêzykow±?/How to change +language in phone ?
  14. + +
  15. +U¿yte materia³y/Information sources
  16. +
+ +
+
+

Here is table describing firmware in various Nokia 1xxx/2xxx phones +
You can also see table for +
Nokia 1xxx/2xxx, Nokia +3xxx, Nokia 5xxx, Nokia +60xx/61xx, +
Nokia 62xx/63xx/65xx, Nokia +7xxx, Nokia 8xxx, Nokia +9xxx

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Phone (telefon)Model number (Oznaczenie)Firmware version code (kod do sprawdzania wersji oprogramowania)TAC in IMEI (TAC w IMEI)
100THX-9L
450TFH-9*#9999#
V1.04 03-02-97
540THF-11*#9999#
V1.01 18-11-97
550THF-10*#9999#
V1.04 09-06-97
640THF-13
650THF-12
V1.05 08-12-98
1011NHE-2
1610NHE-5*#170602112302#490139
V3.92 17-03-96 +
V4.12 30-05-96 +
V5.02 26-06-96 +

(V4.12) SMS sending added. +
(V4.12) Dodane wysy³anie SMS. +

V5.15 25-02-97 +
V5.23 02-11-98

1611NHE-5SX
V4.03 12-08-97 +

V4.05 09-11-98 (new 1611?) +

V5.02 26-06-96 +

Some firmware versions display full network names. +
Niektóre wersje oprogramowania wy¶wietlaj± pe³ne nazwy sieci. +

V5.23 02-11-98

1630NHE-5NA*#170602112302#
V5.23 02-11-98
1631NHE-5SA
16??NHE-5NX490152
V5.13 10-12-96
2010NHE-3*#9999#
2110NHE-1XN*#9999#
Vm4.95 02-07-96 +
V5.56 03-12-96
2110i, 2110e for GSM 900NHE-4*#170602112302#
V5.11 27-09-95 +
V5.62 05-05-97
2110i, 2110e for GSM 900NHE-4NX*#682371158412125#490130
V5.31 06-01-96 +
V5.49 09-10-96 +
V5.62 05-05-97 +
V5.70 15-11-97
2110i, 2110e for GSM 1800NHK-IEA*#682371158412125#
2140NHK-1XA
Vm4.92 01-06-95
2148NHK-1
2148iNHK-4
2160NHC-4NE
+Back to the top/Na pocz±tek +

+


+ + + + diff --git a/Docs/en_US/gsm/firmware/firm3.htm b/Docs/en_US/gsm/firmware/firm3.htm new file mode 100644 index 0000000..58d6c91 --- /dev/null +++ b/Docs/en_US/gsm/firmware/firm3.htm @@ -0,0 +1,1749 @@ + + + + + + + + + + + Nokia identification & firmware/Identyfikacja i oprogramowanie telefonów Nokia + + + + + + +
+


Nokia identification & firmware/Identyfikacja +i oprogramowanie telefonów Nokia

+ +

+


+
    +
  1. +Ogólne b³êdy/General bugs
  2. + +
  3. +Ogólne informacje o IMEI/General info about +IMEI
  4. + +
  5. +Czy mogê wgraæ sobie oprogramowanie/Can I download +firmware to my phone ?
  6. + +
  7. +Czy to kosztuje ?/Does it cost ?
  8. + +
  9. +Gdzie tego dokonaæ ?/Where to make it ?
  10. + +
  11. +Jakie s± b³êdy/zmiany w kolejnych wersjach +?/What are bugs/changed things in next versions ?
  12. + +
  13. +Jak zmieniæ wersjê jêzykow±?/How to change +language in phone ?
  14. + +
  15. +U¿yte materia³y/Information sources
  16. +
+ +
+
+

Here is table describing firmware in various Nokia 3xxx phones +
You can also see table for +
Nokia 1xxx/2xxx, Nokia +3xxx, Nokia 5xxx, Nokia +60xx/61xx, +
Nokia 62xx/63xx/65xx, Nokia +7xxx, Nokia 8xxx, Nokia +9xxx

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Phone (telefon)Model number (Oznaczenie)Firmware version code (kod do sprawdzania wersji oprogramowania)TAC in IMEI (TAC w IMEI)
3110NHE-8*#3110#490165, 490184 (Finland)
V6.52 15-05-97 +
V7.11 24-09-97 +

An updated GSM operators' list. +
Uaktualniona lista operatorów. +

By pressing C during a call which then changes the NaviKey's function +to Options that include putting the call on hold, address book, sending +DTMF and ending the Call (it can be activated via a settting menu item +"In Call functions"). +
Przez naci¶niêcie klawisza C w czasie rozmowy oznaczenie NaviKey zmienia +siê na "Opcje" daj±c dostêp do  menu zawieraj±cego ró¿ne opcje przydatne +podczas rozmowy (mo¿e byæ ono w³±czane przy pomocy opcji "Funkcje równoleg³e" +w menu). +

The hold function is complemented by a new Menu function "call waiting +service". +
Funkcja zawieszenia po³±czenia jest obecna w postaci nowej pozycji +menu ("Us³uga po³±czeñ oczekuj±c."). +

The leaflet also indicates that the volume of all ringing tones have +been raised. +
Zwiêkszono g³o¶no¶æ wszystkich dzwonków. +

The option to add a number directly from the dialled/received/missed +calls to the phonebook - When a number in those registers is highlighted +and is not in the phonebook already, the Navikey displays "Options" which +include save and dial. +
Dodano opcjê zapisu numeru do ksi±¿ki telefonicznej z menu z wybieranymi/odebranymi +i nieodebranymi po³±czeniami - je¿eli nie ma jakiego w ksi±¿ce, oznaczenie +Navikey zmienia siê na "Options", które pozwala w³a¶nie na zapis (i dzwonienie). +

A "fast silent mode" (like in 8110) - press Menu and #. +
Szybkie przej¶cie do cichego trybu (jak w Nokii 8110) - wystarczy nacisn±æ +Menu +i #. +

Any answer key function removed. +
Usuniêto funkcjê odbioru jednym klawiszem. +

V7.72 18-12-97 +

Support for vibra battery - added menu in option. +
Obs³uga baterii wibracyjnych - odpowiednia opcja w menu. +

Added "Cell Info Display" and "Broadcast Messages" options in menu. +
Dodana obs³uga cell info i cell broadcast (pozycje "Informacje o sieciach" +i "Wiadomo¶ci sieciowe" w menu) +

V7.73 30-01-98 +
V8.11 27-02-98 +

(NEWER TOO ?): when you're in menu and press (c) key, phone leaves menu +(it doesn't go to one level higher) +
(NOWSZE TE¯ ?): je¿eli u¿ytkownik jest w menu i naci¶nie klawisz (c), +opu¶ci ca³kowicie menu (a nie przejdzie do jednego poziomu wy¿ej). +

V8.30 16-04-98 +
V8.32 21-09-98 +
V8.50 20-10-98 +
+


+
B£¡D (nie wiem, czy z równie¿ z najnowszym oprogramowaniem): nie mo¿na +do³adowaæ karty SIM+ (zadzwoniæ pod 5555) po wyczerpaniu limitu do 0 PLN +lub zablokowaniu rozmów wychodz±cych (nale¿y kartê prze³o¿yæ do innego +telefonu i j± tam do³adowaæ albo skorzystaæ z numeru 0-22 6075555).
3210NSE-8/9*#0000#448896, 448903 (Finland), 449142 (Finland), 449143, 499149 (Germany), +449150, 449203 (Germany), 449204 (Germany), 449314
V2.54 20-01-99 +
V3.00 07-06-99 +
V3.01 10-06-99 +
V3.10 17-06-99 +
V4.02 20-07-99 +
V4.41 17-08-99 +
V4.43 14-09-99 +
V4.65 07-10-99 +
    +
  • +Improvement to charger detection and clock stoppings (in the display)
  • + +
  • +Menu support for OTA prepaid service implemented
  • + +
  • +Improved Short Term Memory: the number from e.g. missed calls list can +now be edited
  • + +
  • +SIM ATK message sent note improved. Now SMS message send indication is +shown only once when the message is sent.
  • + +
  • +SIM-card busy note implemented in SIM ATK. SIM card busy note is now displayed +when entering SIM ATK menu while SIM card is waiting for response to send +SMS or send SS command.
  • + +
  • +Keyguard can now be on, when the phone is connected to PPH-1 car kit
  • + +
  • +Operator name changed "KB Impuls" -> "Bee Line" (250/99)
  • + +
  • +T9 language databases updated
  • + +
  • +T9 case handling improved: Automatical change between upper and lower cases +after dot (.). Spell mode now uses the present case instead of always starting +in upper case.
  • + +
  • +Improvements in T9 special character handling and Matches menu
  • + +
  • +Improvement to T9 ('Insert word' and 'Insert number')
  • + +
  • +Improvement to USSD
  • + +
  • +Improvement to CPHS Information number handling
  • + +
  • +Improved reception of two consecutive OTA ringing tones.
  • + +
  • +Postponing alarm for over 90 minutes, improved. When the alarm is set and +activated, it is possible to postpone (snooze) it continuously (before +it was limited to 90 min.)
  • + +
  • +Destination number is now given as default if Picture Message sending fails. +This means that the user does not have to enter the destination number +again.
  • +
+V5.01 26-11-99 +

(V4.02) With connected headset the light turn on all time (previously +not always). +
(V4.02) Przy pod³±czaniu zestawu s³uchawkowego zawsze zapala siê pod¶wietlenie +(poprzednio nie zawsze). +

Added Menu 3-8 ("Prepaid credit"). +
Dodane Menu 3-8 ("Op³acony kredyt"). Nie dzia³a z SIM+. +

V5.10 21-01-00 +

Changes in parts connected with charging battery. +
Zmiany w czê¶ci odpowiedzialnej za ³adowanie baterii. +

V5.22 29-03-00 +

V5.26 07-04-00 +

Phone displays animated startup logo with "hands", not downloaded by +user. If you will reset phone settings (Menu3-3 in PC-LOCALS 1.3), it disappear +and downloaded logo will be displayed then. +
Telefon pokazuje animowane logo startowe z "r±czkami", a nie to wgrane +przez u¿ytkownika. Je¿eli zresetujesz ustawienia telefonu (Menu 3-3 w PC-LOCALS +1.3), zniknie ono i pokazywane bêdzie wtedy logo wgrane. +

V5.31 24-05-00 +

    +
  • +(V5.01): when you edit SMS and enter "*" key (symbols), pressing "#" will +move cursor to the next line
  • + +
  • +Can't open simlocks using NokiaTool only - must use EEPROM method
  • + +
  • +Dodano dwie ukryte gry (React i Logika). Aby je uaktywniæ (opis dla PC-LOCALS +1.3):
  • + +
      +
    • +Uruchom PCLOCALS
    • + +
    • +Wejd¼ w menu 3 ( ME Function)
    • + +
    • +Wybierz PRODUCT PROFILE SETTINGS
    • + +
    • +Zmieñ bit 29 (pozycja 1D) z 0 na 1
    • + +
    • +Wci¶nij F2, aby zapisaæ zmiany w EEPROMie
    • +
    + +
  • +Added two hidden games (React and Logic). To activate them (description +for PC-LOCALS 1.3):
  • + +
      +
    • +RUN PC Locals
    • + +
    • +Goto menu 3 ( ME Functions )
    • + +
    • +Choose PRODUCT PROFILE SETTINGS section
    • + +
    • +Change bit 29 ( place 1D ) from 0 to 1
    • + +
    • +Press F2 to save to EEPROM
    • +
    + +
  • +(NOWSZE TE¯ ?) B£¡D: Po wybraniu czasu 12-godzinnego i jêzyka polskiego +w godzinach popo³udniowych w menu ustawiaj±cym zegarek pojawia siê godzina, +"po po³." (po po³udniu) i ró¿ne dziwne znaczki...
  • + +
  • +(NEWER TOO ?) BUG: Test 45 in NetMonitor +and parameter ChCur in test 23 +don't work correctly.
  • + +
    (NOWSZE TE¯ ?) B£¡D: Test 45 +w monitorze sieci i parametr ChCur w te¶cie +23 nie dzia³aj± poprawnie. +
  • +(NEWER TOO ?) BUG: When you're in Composer (Menu 9-3), haven't set tempo +before and use "Tempo", will see blank screen with indicator on the right +side of screen. To change tempo must press any key.
  • + +
    (NOWSZE TE¯ ?) B£¡D: Kiedy jeste¶ w Kompozytorze (Menu 9-3), nie ustawia³e¶ +tempa melodii i u¿yjesz opcji "Tempo", zobaczysz pusty ekran ze wzka¼nikiem +po prawej stronie ekranu. Musisz teraz nacisn±æ jeden raz dowolny klawisz... +
  • +(NOWSZE TE¯ ?) B£¡D: Niedok³adne t³umaczenie w Menu 1-8-2 i Menu +1-4-1
  • + +
  • +Improvement to RF signal bars: When RX was reduced by e.g. 50 dB in phones +with software version 5.22 or 5.26, the RF signal bars may only decrease +by one bar instead of two-three bars.
  • + +
  • +Improvement to Picture messages: In previous versions Picture messages +couldn't be forwarded unless the text was edited.
  • + +
  • +SMS editor speed improved: In previous versions the SMS editor could appear +slow when entering long messages (100-160 characters)
  • + +
  • +Improvement to composer: In previous versions certain sequences of tones +could cause the phone to reset.
  • + +
  • +Operator list updated
  • +
+V5.36 25-07-00 or 08-08-20 or 27-07-00 +
V5.38 +

(?) When read info about simlocks via cable some programs (for example, +NokiaTool), they're CLOSED ! +
(?) Przy odczycie informacji o simlockach przez kabel przy u¿yciu pewnych +programów (np. NokiaTool), s± one ZAMYKANE ! +

V6.00 13-10-00 or 03-10-00 +
V6.00 23-08-01 (ROM6?) +
  +

    +
  • +(V5.24) In call register menu new option Send SMS in Dialled/Missed/Received +list
  • + +
  • +(V5.24)Changed ringing tones (for example, "Hurdy-gurdy")
  • + +
  • +(V5.36) "SIM card registration failed" message is shown when the SIM card +or phone is unknown or rejected from the network.
  • + +
    (V5.36) Komunikat "Rejestracja karty SIM nieudana" , gdy karta SIM +lub telefon nie mo¿e byæ zalogowany w sieci +
  • +(V5.36) Unknown callers (private/unlisted numbers) are now registered as +missed calls (for example, in the Call register (Menu 3-1)). They +are listed as "(no number)" and it is now possible to see Time of call
  • + +
  • +(V5.36) Arabic (Indian) numbers are used correctly
  • + +
  • +(V5.36) Improvement to receiving an over the air ringing tone. Earlier +when receiving an over the air ringing tone and selecting playback directly, +the first tone would be partially cut off during the playback (only when +the keypad tones were activated)
  • + +
  • +(V5.36) Improvement to SIM Application Toolkit
  • + +
  • +(V5.36) Improvements to T9 
  • + +
  • +(V5.36) When using Options menu to insert a symbol twice in an empty SMS +editor (e.g. @@) (This problem was presented only in SW versions 5.31 and +5.36) - phone remembers the T9 state after entering and leaving the options +menu (earlier when entering and leaving the options menu from the SMS editor +after having disabled T9 with the #-key, the phone would activate T9 again +automatically)
  • + +
  • +(V5.36) Operator list updated 
  • + +
  • +(V5.36) BUG REPAIRED: When edit long SMS (about 160 chars) and press Up/Down +key very long (until will scroll all SMS context - 160 chars) without releasing, +phone will restart after it - info from SkyBoy
  • + +
    (V5.36) POPRAWIONO B£¡D: Przy edycji d³ugiego SMSa (oko³o 160 znaków) +po naci¶niêciu klawisza Góra/Dó³ i przytrzymaniu (bez zwalniania), a¿ ca³y +SMS (160 znaków) zostanie przewiniêty, telefon zresetuje siê...  - +informacja od SkyBoy  +
  • +(V5.31) Memory game is named "memory", not "pairs" 
  • +
+ +
+
If you Activate and Deactivate the Phone Security (Menu 4-3-4) +on Software versions 5.26 - 5.36 the tick is incomplete. +

I have signals, that sometimes after making some things over cable (uploading +logo, etc.), contrast of LCD is changed ! Probably using Logo Manager makes +problem! +

Interesting facts: firmware seems to be cut version of firmware from +more expensive phones. There still some help texts inside, texts from some +functions (does it mean, that phone support them ?) - ("Rename this set" +- it can be done via cable !), text with name of "full" profiles - the +same question (Meeting, Outdoor, Pager, General), texts "Save to another +memory?, Saved to phone memory,Saved to SIM Card", "List of own numbers"... +

Asian versions have built in vibra in phone. European doesn't have vibra +motor, but have place for it and disabled option in firmware (so, it's +possible to easy add it).

3310NHM-5*#0000#350005, 350101 (Finland)
V3.24 22-08-00 +

BUG (NEWER TOO ?): With voice dialing and HF, when phone understand +your voice, "hanges". You can see "Dialing too..." and "End". When you +press "End" and keypad is locked, you will see "Press Unlock and then *" +and then (something lika that) "Enable SIM application?". When press "OK", +everything is again normal... +
B³±d (Nowsze te¿ ?): Przy wybieraniu g³osowym (przez zestaw HF) i pozytywnym +rozpoznaniu znaku, telefon "zamiera". Widaæ "Dzwoni do..." i "Zakoñcz". +Gdy chcemy Zakoñczyæ i s± zablokowane klawisze pojawia siê "Naci¶nij odblokuj, +a potem *", a nastêpnie (co¶ w rodzaju) "W³±czyæ aplikacje SIM?". Naciskamy +"OK" i wszystko wraca do "normy"...  +

V4.02 05-10-00 +

V4.06 21-11-00 +

    +
  • +Handling (e.g. sorting/adding/replacing) of names in phonebook corrected +in Turkish and Greek languages
  • + +
  • +Special characters corrected in Danish language (when sent to 8210/3210)
  • + +
  • +Improvements to SIM-ATK, e.g.:
  • + +
      +
    • +When USSD notify is send, the phone sends the response to the SIM card
    • + +
    • +Long press 'C' and short press 'C' gives correct value to SIM card
    • + +
    • +Call coming with SIM ATK gives correct result back to SIM
    • + +
    • +Display Text works with scroll key
    • +
    + +
  • +Improvements to SMS and T9:
  • + +
      +
    • +Delivery report 'pending' in Chat-mode corrected
    • + +
    • +Name were missing on delivery reports
    • + +
    • +Changes in cursor movements in SMS (with active T9)
    • + +
    • +Adding words to dictionary can be recognised
    • +
    + +
  • +Improvements to Reminder:
  • + +
      +
    • +Corrections on functionality when erasing one by one, pressing Clear during +erase
    • + +
    • +Receiving calendar requests from other phones improved
    • +
    + +
  • +USSD commands activated from AND (Abbreviated Dialling Numbers) when Speed +Dial selected
  • + +
  • +New code - you can Clear Operator Logo using *#67705646# command
  • + +
  • +Returning from game settings improved
  • + +
  • +Service numbers do not open anymore an empty screen
  • + +
  • +Improvement to phonebook number query count
  • + +
      +
    • +Caller groups in names on SIM card were not always removed
    • +
    + +
  • +Improvements to OTA functionality
  • +
+V4.18 12-01-01 (18-12-00 ?) +
Support for new Power Amplifier added +

V4.23 25-01-01 +

    +
  • +Improvements to SIM-ATK: Setup Call could reset phone, if text sent with +Setup Call  was very long 
  • + +
  • +Improvements to SMS and T9: 
  • + +
      +
    • +Receiving Picture Messages with Euro sign 
    • + +
    • +Counter in Picture Messages when Unicode is selected (Adding character +counter for message writen other than English ?)
    • + +
    • +'Send to many' option after reply 
    • + +
    • +Not able to fetch Phonebook (blank display) when forward / reply to SMS 
    • + +
    • +Errors receiving Concatenated SMS 
    • + +
    • +Inserting a Smiley 
    • +
    + +
  • +Improvements to Reminder: letter counter (earlier: when edit reminder text, +number of free chars is displayed incorrectly. First: one additional byte +is used for indicating coding (in fact you have maximally 35, not 36 chars), +second: some chars are saved as two 8 bit chars (indicator doesn't show +it) and when write only them, you can write only 17 chars. Summary: you +can write 17 - 35 chars (number of it depends, what chars are in text) +and indicator doesn't show number of free chars correctly...)
  • + +
  • +Improvements to Settings: Light managing in carkit 
  • + +
  • +Improvements to Composer: Screen blanked when selecting Tempo option with +some OTA ringing tones 
  • + +
  • +Improvements to Phonebook: 
  • + +
      +
    • +Indicator shown while sending message 
    • + +
    • +Long number correction 
    • +
    +
+V4.19 03-01-01 +
The same functionality as version 4.18 +

Note: New text strings (localisation), which were implemented in V4.23, +contained some specific characters (i.e. Clear Key when writing SMS). Software +version 4.19 will correct these failures. +

V4.24 23-02-01 +

    +
  • +Note: When using V4.23, deleting character with 'C' key was not possible +in language pack B, G and H. This has been corrected.
  • + +
  • +Contains all improvements made in V4.23
  • + +
  • +Support for RFMD Power Amplifier added 
  • + +
  • +Improvements to SIM-ATK: If Display text was (8n-1) long, an @ would show +at the end 
  • + +
  • +Improvements to SMS and T9: 
  • + +
      +
    • +Wrong counter in query 
    • + +
    • +Letter counter 
    • + +
    • +Euro-sign as second-last character in Reminder Text 
    • +
    + +
  • +Improvements to Reminder: Euro-sign as second-last character in Reminder +Text 
  • + +
  • +Improvements to ALS: Missing blinking indicator for non selected line 
  • + +
  • +Improvements to Phonebook: 
  • + +
      +
    • +Voice Mailbox DDI Interface improved 
    • + +
    • +Corrections to Turkish language (menu items, translations, message in Voice +dialling)
    • + +
    • +(removed bug) Can read phonebook and other memories via cable
    • +
    +
+V4.35 29-03-01 +
    +
  • +'Insert SIM' problem with certain 32K SIM cards improved 
  • + +
  • +(?) 'Uppercase ABC' in Chinese Language package corrected 
  • + +
  • +(?) 'Multi Sim Lock' included
  • +
+V4.45 21-06-01: +
V4.45 05-07-01 (ROM6?): +
    +
  • +Language: 
  • + +
      +
    • +General update of Dictionary in all languages 
    • + +
        +
      • +New T9-languages 
      • + +
          +
        • +Czech
        • + +
        • +Polish 
        • + +
        • +Hebrew 
        • +
        + +
      • +New UI-language 
      • + +
          +
        • +Ukrainian (No T9 input) 
        • + +
        • +Chinese 
        • +
        + +
      • +Selected 'word' shown as "square" in traditional Chinese 
      • + +
      • +Special word not selectable when Bopomofo 
      • + +
      • +Vietnamese 
      • + +
          +
        • +Translation to 'Countdown Timer' corrected 
        • +
        + +
      • +German 
      • + +
          +
        • +Translation of 'Highscore' corrected 
        • +
        + +
      • +Hebrew 
      • + +
          +
        • +input in all editors 
        • +
        +
      + +
    • +Composer 
    • + +
        +
      • +Vibrating in Composer stops when receiving an SMS 
      • + +
      • +Vibra active when composing a ringing tone 
      • + +
      • +Not possible to forward received ringing tones anymore 
      • +
      + +
    • +Phonebook 
    • + +
        +
      • +Mixed case multitap ('Abc') in phonebook implemented 
      • + +
      • +Alphabetic sorting order corrected when spaces in the beginning of a name 
      • + +
      • +Search in Phonebook now starts from the top 
      • + +
      • +Scrolling error in Chinese Phonebook corrected 
      • + +
      • +Leading blanks ignored in sorting 
      • + +
      • +When trying to save "no. too long, max. 20" next screen is number editor +but with name query 
      • +
      + +
    • +Dictionary / SMS / GMS 
    • + +
        +
      • +'Insert word' works without adding spaces 
      • + +
      • +'Insert symbol' will be placed at cursor position 
      • + +
      • +Mixed numbers and characters handeled correctly 
      • + +
      • +Phone freeze / reset when sending GMS if Message Center Number missing +is corrected
      • + +
      • +From Option menu in Write Message 'Upper / Lower' case latin 
      • + +
        input can be selected from menu in chinese language packs 
      + +
    • +MISC 
    • + +
        +
      • +Calculator: Exchange rate now done with higher precision 
      • + +
      • +SIM ATK: Clear key is now working properly in Play Tone 
      • + +
      • +Shortcut: Missing functionality in Reminder and Tone menu implemented 
      • + +
      • +General update of Operator Name List (#41) and UI Text
      • +
      +
    +
+Users info (corrected or changed things compared with V4.02): +
    +
  1. +the same:
  2. + +
      +
    1. +Picture Images:
    2. + +
        +
      1. +You can write Unicode chars. You can write, but when send image or get +via cable, they're converted to latin chars (I quess: for backward compatibility +with older phones)
      2. + +
      3. +You can have sender number for each Picture. Phone can't put alphanumeric +numbers (only "normal" and "international") there...
      4. +
      + +
    3. +SMS:
    4. + +
        +
      1. +Unicode SMS's saved in Outbox have Details in Options and "Sender" and +"Message centre: 0" there (sometimes date too)...
      2. + +
      3. +No differences between "Automatic" and "GSM alphabet" (Menu 2-7-6-3) +- Unicode SMS chars are translated to chars from GSM alphabet. IMHO, when +set to Automatic and write Unicode specific chars, Unicode should be used; +if don't use such chars, GSM Alphabet should be used (you should see in +editing screen info about this - different number of maximal chars)
      4. + +
      5. +When edit SMS, have some contenst inside, T9 dictionary is disabled and +write with large chars (ABC on the tope of the screen) and use any of functions +from Options (at least enter into it and return to editing), size of chars +for new text is set to small (abc on the top of the screen).
      6. + +
      7. +When open SMS from Outbox for editing, T9 dictionary is disabled, size +of chars for new text is set to small (abc on the top of the screen).
      8. + +
      9. +When save Linked SMS in Outbox, they're visible double...
      10. + +
      11. +(???) Some business cards (from 3210 ?), which contains some additional +data after correct business card contents are not recognized and you have +problems with editing them...
      12. + +
      13. +(???) Blinking SMS Unicode messages (contains 0x00,0x01 chars) can be edit +and forwared (GREAT!), but wrote appears few spaces in front of the cursor +(as if cursor was there, but it's not - it's few characters behind!)
      14. + +
      15. +T9 dictionary:
      16. + +
          +
        1. +When enable T9 dictionary, have "Insert number", "Insert symbol" and "Insert +word" in Options during editing SMS. They don't seem to be connected with +T9 (at least two first)
        2. +
        +
      + +
    5. +Reminders menu (very limited version of Calendar) is like joke:
    6. + +
        +
      1. +When use Menu 10-3-2 with empty reminders memory, phone goes out +from Reminders menu
      2. + +
      3. +when set notes via cable, year of them is set to 2090
      4. + +
      5. +(???) can receive notes from more expensive models (61xx) and send them +in one SMS (can not edit); when create reminder in phone and send it to +more expensive model (61xx), two SMS are required...
      6. + +
      7. +(???) don't display date from notes from more expensive models (61xx)
      8. + +
      9. +(???) when send note to more expensive models (61xx), date of it is 13.07.2041
      10. + +
      11. +(???) loss birthday date in note (in such situation: forward note from +61xx to 3310, from 3310 to 61xx)
      12. +
      + +
    7. +Ringtones:
    8. + +
        +
      1. +Phone incorrectly decodes some tones (their scale) in received tones (only +?) in Composer - to avoid this you must save Scale info with each ringtone +(--scale option in --saveringtone/--sendringtone in mygnokii).
      2. + +
      3. +(???) When receiving an over the air ringing tone and selecting playback +directly, the first tone would be partially cut off during the playback +(only when the keypad tones were activated)
      4. +
      + +
    9. +Games:
    10. + +
        +
      1. +Go into Bantumi game, select New Game, during animation press Navi key +and then C, select Continue and press any key. Interesting...
      2. + +
      3. +You must enable Warning Tones (Menu 5-7), when want to use Sound +(Menu 8-6-1). Old code (in older Nokias these options were connected)
      4. + +
      5. +You must enable Vibrating alert (Menu 5-8), when want to use Shakes +(Menu 8-6-3)
      6. + +
      7. +When select maze in Snake II, must play and end at least one game - maze +state is saved then into EEPROM
      8. + +
      9. +(???) Sometimes phones doesn't vibrate (with enabling shaking option) in +Snake II after eating food
      10. + +
      11. +(???) When play games (Space Impact only ?) and have "Battery full" message, +phone leaves menu...
      12. + +
      13. +(???) Sometimes doesn't write line in border in Snake II
      14. + +
      15. +(???) When end game with high score and press key during displaying score +info/animation, new score is not saved
      16. +
      + +
    11. +Language specific:
    12. + +
        +
      1. +PL: kiedy w Menu 8-6-4 masz zapisany identyfikator i wybierzesz +Wybierz, telefon pyta siê: Zastapic poprzedni identyfikator ? (niedok³adne +t³umaczenie).
      2. + +
      3. +PL: Niedok³adne t³umaczenie w Menu 1-8-2 i Menu 1-4-1 i Menu +10-3-1
      4. + +
      5. +To use some chars specific for some languages you need to activate them +(what, when phone doesn't have correct PPM package with specific language +?)
      6. + +
      7. +PL: Komunikat "Mikrofon wy³±czon"
      8. +
      + +
    13. +Warranty menu (*#war0anty#):
    14. + +
        +
      1. +if you haven't entered Purchasing date, press Edit, use up/down keys, press +any digit char and then you will have menu for editing Purchasing date...
      2. + +
      3. +(???) Life Timer doesn't work from the start (it starts showing correct +values, when all calls were longer than 1 h)
      4. +
      + +
    15. +Other:
    16. + +
        +
      1. +In netmonitor (all versions ?) in test +55 you have small type (one 's' too much in last line) in help and +info displayed in first line only
      2. + +
      3. +(???) After changing SIM card, voice tags weren't erased (manual connected +to phone writes, that they should be....) and T9 dictionary was enabled +and first number selected on SIM card and Cell info display (Menu 6-2-2) +set to off and and all tones assigned in Menu 1-6 set to default +(manual doesn't write about it).
      4. + +
      5. +Where is Menu 8-5 ?
      6. + +
      7. +(???) well, in Reminders and phonebook can have numbers of chars < 0 +(indicator on top screen). If it happens, phone informs about it or cut +some chars...
      8. + +
      9. +(???) Shortcut to Menu 6-1-1 doesn't work correctly
      10. +
      +
    + +
  3. +corrected or changed:
  4. + +
      +
    1. +Phonebook:
    2. + +
        +
      1. +Better sorting of entries with national chars. Phonebook is also returned +in Unicode now (via cable).
      2. +
      + +
    3. +SMS:
    4. + +
        +
      1. +(corrected - in some V4.02 it wasn't OK) In delivery reports don't have +names, only numbers (even, if numbers are in the phonebook)
      2. + +
      3. +T9 dictionary:
      4. + +
          +
        1. +(corrected) T9 dictionary state is not saved during disabling phone
        2. +
        +
      + +
    5. +Other:
    6. + +
        +
      1. +(new) Abc mode when write texts, SMS, etc.
      2. + +
      3. +(V4.06) when somebody calls you and will press "C" (drop a call or divert +it), for a moment (one, two seconds) screen looks like after answering +call...
      4. +
      + +
    7. +Ringtones:
    8. + +
        +
      1. +Phone is not compliant with Smart Messaging 2.0.
      2. + +
        Earlier: For received ringtones with some speed values (according +to SM2.0), when you edit them in Composer and use "Tempo", will see blank +screen with indicator on the right side of screen. To change tempo must +press any key. +
        In version 4.23 it was probably corrected +
        Now: when enter Composer, don't see even ringtone contenst
      + +
    9. +Reminders menu (very limited version of Calendar) is like joke:
    10. + +
        +
      1. +(corrected) sometimes doesn't delete notes (when memory is full):
      2. + +
          +
        1. +use Add new (Menu 10-1)
        2. + +
        3. +phone will display: "Memory full. Replace old reminder ?" - press NaviKey +(OK)
        4. + +
        5. +you will be able to select, which reminder should be deleted (NaviKey=Erase). +Select such reminder, which has default name (when created it, didn't write +anything in "Remind about" and phone write "Reminder" now)
        6. + +
        7. +Press NaviKey (Erase)
        8. + +
        9. +Phone will ask "Erase ?"
        10. + +
        11. +Press NaviKey (OK)
        12. + +
        13. +Phone will display "Reminder erased" and will display empty screen. When +will come back to viewing reminders, will see, that ist wasn't erased !
        14. +
        +
      + +
    11. +Netmonitor:
    12. + +
        +
      1. +(new - earlier it was always equal 0) Works "TIM" parameter in test +132
      2. + +
      3. +(new - earlier this test only reseted timers) Test +80 resets timers from test +82 and enables them (works as test +81)
      4. +
      +
    + +
  5. +Other: after upgrading firmware all Picture Images with sender numbers +have them changed (last digit changed to "0")
  6. +
+V5.03 10-10-01 +
    +
  • +Possibility for user to delete SIM-created SMS from inbox 
  • + +
  • +Operator Name List updated (#44) 
  • +
+V5.11 19-12-01 +
    +
  • +Following T9 languages have been added: Arabic, Hungarian, Slovakian 
  • + +
  • +Dictionary/SMS:
  • + +
      +
    • +Phone virus (SMS with corrupt header) can be deleted and only deleted 
    • + +
    • +Chat: editing Chatname cursor placement is fixed 
    • + +
    • +Hebrew: Templates, Searching and Keymap (in 'spell' state) improved. Writing +more than one capital letter is now possible 
    • + +
    • +Russian: Unicode and Latin letters in same SMS are now received correctly 
    • + +
    • +Picture Message: Blank screen after a call is now removed 
    • + +
    • +Improvement to Smiley editor counter 
    • +
    + +
  • +Phonebook: 
  • + +
      +
    • +Change Phone Line (with #) is now only possible from Idle 
    • + +
    • +Numbers matched even with + in it 
    • + +
    • +Incoming call is now indicated while erasing all in phonebook 
    • + +
    • +Possible to add new entries to internal Phonebook when FDN is on (but not +possible to dial) 
    • + +
    • +Missing information note added when copying entries between SIM and Phone +memory (Security level: Memory) 
    • + +
    • +Scrolling Phonebook entries with leading spaces possible for Latin as well +as for Chinese names 
    • + +
    • +Keypad lock can no longer be unlocked using special key string 
    • +
    + +
  • +Emergency call: During snooze softkey text is changed to 'call' Possible +while entering new PIN-code 
  • + +
  • +Euro-sign in picture message received successfully on other phones 
  • + +
  • +Counter overflow corrected (language pack G) in Reminder and Phonebook 
  • + +
  • +Alignment corrected in Stop Watch and Unit Price Editor (when charging +interrupted) 
  • + +
  • +Time: Improvement to 12-hour setting. Input contains now 4 digits in year +in Russian Time/Date. Russian Date is with a colon instead of a dot 
  • + +
  • +Reminder: Calendar date corrected on receiving end. Now DISPLAY TEXT with +the option 'wait for user to clear text' waits for user to clear the text +(earlier it was cleared automatically after 5 sec.) 
  • + +
  • +Display Text length increased (it was too short for Send SS) 
  • + +
  • +General vibration level increased to make it easier to feel that the vibra +function has been activated
  • + +
  • +NITZ: (Automatic update of time/date) Time set, even if the user hasn't +activated and set the clock 
  • + +
  • +SIM ATK: Refresh command no longer jams the keypad. Selectable header in +SIM ATK menu has been removed
  • +
+V5.13 11-01-02 +
+
+
WARNING: IF YOU GIVE YOUR PHONE TO SERVICE +FOR REPLACING FIRMWARE, DELETE ALL VOICE TAGS FROM ITS' MEMORY. IN OTHER +CASE YOU CAN LOST THIS PLACE IN PHONE'S MEMORY. EXAMPLE: IF YOU HAD 2 VOICE +TAGS IN MEMORY, WHEN PHONE WAS GIVEN TO SERVICE, AFTER REPLACING FIRMWARE +YOU CAN HAVE ONLY 6 PLACES (NOT 8) FOR VOICE TAGS. +

Phone doesn't work correctly with some SAT (SIM Application Toolkit) +SIM cards. I don't know, if problem depends on phone or these SIM cards +bugs.... If I have correctly info, users of Polish Plus GSM (260-01) network +with SIM cards with HRL 91 should change them... +

BUGS (all versions): +

    +
  • +When use shortcut for Menu 8-1, Menu 8-2, Menu 8-3, Menu 8-4, +Menu 8-6, for a moment displays incorrect data...
  • + +
  • +No Menu 8-5
  • + +
  • +You need to enter Menu 1-10-1 (after pressing 1 wait about 3 seconds +until you will see "-" in right side of "1" and menu will go higher level, +then enter 10 and 1). Now press Up or Down or wait small moment. You will +see now strange things - screen isn't refreshed, but keys work:
  • + +
      +
    • +When press C once, Navi description is deleted. After it press any key +and everything is OK.
    • + +
    • +When press Up or Down, you select person from phonebook (but of course +you won't see it).
    • + +
    • +Navi selects person
    • +
    + +
  • +when select shortcut to game (like Menu 8-1) and image disappear, +press fast C or Navi many times. Until they will be pressed, menu won't +change.
  • + +
  • +shortcuts Menu 8-6-1-1, Menu 8-6-1-2, Menu 8-6-2-1, Menu 8-6-2-2,Menu +8-6-3-1, Menu 8-6-3-2 and Menu 8-6-4 don't work too correctly
  • + +
  • +after enabling phone and entering PIN, very fast (before reading phonebook +from SIM card) enter Menu 1-9 (can be entered normally without shortcut). +Now leave. And enter again... Each time, when you will enter it, you will +different results. Sometimes phone can reboot...
  • +
+Interesting facts: firmware seems to be cut version of firmware from more +expensive phones. There still some help texts inside, texts from some functions +(does it mean, that phone support them ?) - ("Rename this set"- it can +be done via cable !), texts from "full" calendar ("Meeting", "Birthday", +etc.), texts "Save to another memory?, Saved to phone memory,Saved to SIM +Card","List of own numbers" (update: own numbers memory is available via +cable)...
3330NHM-6*#0000#350150
V2.49 19-03-01 +
V3.05 05-04-01 +

BUG: +

    +
  • +when have more than 3 voice tags, during using this function (voice dialling) +phone hangs and resets
  • + +
  • +Games:
  • + +
      +
    • +If you try to download (via wap) new "game levels".  The problem is +that after it phone do not display the "ranking list" of "snake2" and/or +"space impact". Problem appeared after downloading new "labirints" and +"new mission". When you try to download the same mission (promo 1, gratis) +after it. Result was the phone always don't display the ranking list and +also "space impact" don't run. "Bumper" runs ok.
    • + +
    • +Snake, if you reach an high level of scoring, when you select "continue" +the phone go locked.
    • +
    + +
  • +"ascending" attribute doesn' t work
  • + +
  • +bug connected with assigning ringtones: when I changed a name with a specific +ringtone, and I look at other names I see that also some one other name +was changed the ringtone. The I changed back this second name to original +ringtone,  and also the first came back to original ring tone. It +seems that you can change a ringtone for a specific position number, that +is in use simultaneously in use in SIM and Phone memory, without possibility +to distinguish them.
  • +
+V3.10 12-05-01 +

Inprovements in Voice Tags +

BUG removed: when trying to write a message with an uppercase accented +character  (i.e. character <?>) and saving SMS without sending +it, then entering "Own messages" the charater <?> become an <E>.  +To solve this use "left accent" insetad of right accent. (Ú) instead of +(À). +

BUG: if I set the alarm clock, phone "reset" (it go off and then on).  +in about 20% when alarm clock ring, and I press a key, phone go OFF, and +when I tryed to go ON it ask the calendar date. +

V3.12 +

Changed operator names +

Problems with games: snake, if you start a game and you exit from menu +when you return to the game you don't find ther item "continue" but only +a "new game". +

V4.12 +
  +

    +
  • +Languages:
  • + +
      +
    • +General update of Dictionary in all languages
    • + +
    • +New T9-languages: Check and Polish
    • + +
    • +New UI-language: Ukrainian (no T9 input)
    • + +
    • +In German language: Translation of 'Highscore' corrected
    • +
    + +
  • +Composer:
  • + +
      +
    • +Vibrating in Composer stops when receiving an SMS
    • + +
    • +Vibra active when composing a ringing tone
    • + +
    • +Not possible to forward received ringing tones anymore
    • +
    + +
  • +Phonebook
  • + +
      +
    • +It is now possible to erase all entries (earlier phone wrote "memory deleted" +and didn't erase it)
    • + +
    • +Mixed case multitap ('Abc') in phonebook implemented
    • + +
    • +Alphabetic sorting order corrected when spaces in the beginning of a name
    • + +
    • +Search in Phonebook now starts from the top
    • + +
    • +Leading blanks ignored in sorting
    • +
    + +
  • +Dictionary/SMS/Picture Messaging
  • + +
      +
    • +Phone reset sending Picture Message + 120 char text corrected
    • + +
    • +C-key no longer deletes all SMS if used twice in the end of a long SMS
    • + +
    • +'Insert word' works without adding spaces
    • + +
    • +'Insert symbol' will be placed at cursor position
    • +
    + +
  • +WAP
  • + +
      +
    • +Over The Air settings can now be saved and viewed
    • + +
    • +Freeze/reset using WAP combined with FDN corrected
    • + +
    • +Blank menu removed
    • + +
    • +#-key press: stays in WAP-session
    • + +
    • +Layout updated several places
    • + +
    • +After saving bookmark phone now returns to idle state
    • +
    + +
  • +USSD
  • + +
      +
    • +Never ending request (spinning globe) corrected
    • + +
    • +Connection timeout problem fixed
    • + +
    • +Memory leak fixed
    • + +
    • +Bearer setting "Address Type" removed
    • +
    + +
  • +Games
  • + +
      +
    • +Now it is possible to download games
    • + +
      WML page replies with "Download failed" if there is an error
    + +
  • +SIM ATK
  • + +
      +
    • +SIM ATK opened for WAP (send and receive SMS etc.)
    • + +
    • +Now showing more than only first error message
    • + +
    • +Clear key is now working properly in Play Tone
    • +
    + +
  • +Voicetag feature improved: 8 voicetags possible
  • + +
  • +Screensaver selection improved
  • + +
  • +Exchange rate now done with higher precision in Calculator
  • + +
  • +In Shortcut, missing functionality in Reminder and Tone menu implemented
  • + +
  • +Operator Name List and UI Text updated
  • +
+BUG:  If you are playing with "space impact", and a new SMS come in, +and you try to read it, when you continue the game after the 1st startship +lost, the game go on but without the starship. +

V4.16 25-06-01 +

    +
  • +Operator Name List and UI Text updated
  • + +
  • +Service indicator was missing totally with some new SIM-cards
  • +
+V4.30 20-08-01 (ROM6?): +
    +
  • +New features implemented
  • + +
      +
    • +Conference Call
    • + +
    • +T9 in WAP - Based on CUI editors
    • + +
    • +Languages:
    • + +
        +
      • +Chinese (T9 support)
      • + +
      • +Czech (T9 support)
      • + +
      • +Polish (T9 support)
      • + +
      • +Hebrew (T9 support)
      • + +
      • +Hungarian (T9 support)
      • + +
      • +Slovak (T9 support)
      • + +
      • +Ukrainian (no T9 support)
      • +
      +
    + +
  • +Improvement to Phonebook
  • + +
      +
    • +Matching the dialled phone number containing special character "+" is now +possible
    • +
    + +
  • +Improvements to SMS
  • + +
      +
    • +when changing T9 language
    • + +
    • +under Message Write it is now possible to write in Insert Word more than +one capital letter
    • + +
    • +SMS Input indicator changed (showed '123' after Send cancellation)
    • + +
    • +when receiving SMS containing special set-up
    • +
    + +
  • +Improvements to Tones
  • + +
      +
    • +possibility to save received OTA ringing tone
    • +
    + +
  • +in Profile menu Use of Warnings Tones changed
  • + +
  • +Improvements in charging (using ACP-7U in 110V/60Hz environment)
  • + +
  • +Improvements to Russian WML (Random Phone texts were shown)
  • + +
  • +SIM ATK: Selectable Header (menu_display_item) removed
  • + +
  • +Improvements to Activating/Deactivating of Cell Broadcast
  • + +
  • +Emergency dialling snooze; softkey text appears changed from 'Clear' to +'Call'
  • + +
  • +Operator Name list (#42) and UI Text updated
  • +
+V4.50 12-10-01: +
    +
  • +Improvements to WAP
  • + +
      +
    • +Word wrapping default is active ('On')
    • + +
    • +Input element indicator set up for numeric element dialog box added
    • +
    + +
  • +Improvements to Phonebook:
  • + +
      +
    • +Possible to edit/add/replace name/number in phonebook when SIM card memory +is full
    • + +
    • +Blank screen not shown anymore when replacing an entry and SIM card memory +is full
    • + +
    • +Scrolling Phonebook entries with leading spaces possible for Latin as well +for Chinese names
    • + +
    • +Missing information note added when copying entries between SIM and Phone +memory (Security level: Memory)
    • + +
    • +Possible to add new entries in Phonebook when FDN is no (.but not to dial)
    • + +
    • +Erase all entries in Phonebook will continue in background when interrupted +by a MT call
    • +
    + +
  • +Improvement to Dictionary/SMS
  • + +
      +
    • +Possible to save/view/send SMS containing only one character
    • + +
    • +Reminder sending; Correct Calendar date on receiving end (e.g. NPE-3)
    • + +
    • +Picture message: Euro-sign in message received successfully on other phones
    • + +
    • +Stop Watch and Unit Price Editor: Correct alignment in editors (when charging +interrupted)
    • +
    + +
  • +General vibration level increased, in order to make it easier to feel the +vibra function has been activated
  • + +
  • +Possibility for user, to delete SIM-created SMS from Inbox, added (if deleted +SIM will recreate the items)
  • + +
  • +Display Text length changed (it was too short for Send SS)
  • + +
  • +Change Phone Line (with #) is now only possible from Idle
  • + +
  • +DISPLAY TEXT with the option 'wait for user to clear text' now waits for +user to clear text (was cleared automatically after 5 sec.)
  • + +
  • +Operator Name list (#44) updated
  • +
+ +
+
Note: When use shortcut for Menu 8-3, for a moment displays +incorrect data... +

WARNING: THERE IS PROBABLY THE SAME PROBLEM +WITH VOICE TAGS AND UPGRADING FIRMWARE LIKE IN NOKIA 3310

3350NHM-9
3390NPB-1*#0000#
V7.03 10-11-00 +
V7.05 05-01-01 +
+
+
WARNING: THERE IS PROBABLY THE SAME PROBLEM +WITH VOICE TAGS AND UPGRADING FIRMWARE LIKE IN NOKIA 3310
3810NHE-9*#3810#
V6.20 21-03-97 +
V6.32 06-06-97 +
V6.61 19-08-97
+Back to the top/Na pocz±tek +

+


+ + + + diff --git a/Docs/en_US/gsm/firmware/firm5.htm b/Docs/en_US/gsm/firmware/firm5.htm new file mode 100644 index 0000000..1ee9159 --- /dev/null +++ b/Docs/en_US/gsm/firmware/firm5.htm @@ -0,0 +1,496 @@ + + + + + + + + + + + Nokia identification & firmware/Identyfikacja i oprogramowanie telefonów Nokia + + + + + + +
+


Nokia identification & firmware/Identyfikacja +i oprogramowanie telefonów Nokia

+ +

+


+
    +
  1. +Ogólne b³êdy/General bugs
  2. + +
  3. +Ogólne informacje o IMEI/General info about +IMEI
  4. + +
  5. +Czy mogê wgraæ sobie oprogramowanie/Can I download +firmware to my phone ?
  6. + +
  7. +Czy to kosztuje ?/Does it cost ?
  8. + +
  9. +Gdzie tego dokonaæ ?/Where to make it ?
  10. + +
  11. +Jakie s± b³êdy/zmiany w kolejnych wersjach +?/What are bugs/changed things in next versions ?
  12. + +
  13. +Jak zmieniæ wersjê jêzykow±?/How to change +language in phone ?
  14. + +
  15. +U¿yte materia³y/Information sources
  16. +
+ +
+
+

Here is table describing firmware in various Nokia 5xxx phones +
You can also see table for +
Nokia 1xxx/2xxx, Nokia +3xxx, Nokia 5xxx, Nokia +60xx/61xx, +
Nokia 62xx/63xx/65xx, Nokia +7xxx, Nokia 8xxx, Nokia +9xxx

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Phone (telefon)Model number (Oznaczenie)Firmware version code (kod do sprawdzania wersji oprogramowania)TAC in IMEI (TAC w IMEI)
5110NSE-1*#0000#449218, 490520, 490542, 490546, 490547 (Germany), 490549 (Germany), +490550 (Germany)
V3.02 06-02-98 +
V3.06 04-03-98 (ROM3) +
V4.51 26-03-98 (ROM3) +
V4.59 01-06-98 (ROM3) +
  +
    +
  • +Phone goes crazy if you scroll the received SMS with 160 dots.
  • + +
    Telefon wariuje przy przewijaniu odebranego SMSa zawieraj±cego 160 +kropek. +
  • +Phone clears "Headset" text from display after disconnecting HF.
  • + +
    Telefon kasuje napis "Mikrozestaw" z wy¶wietlacza po od³±czeniu zestawu +s³uchawkowego. +
  • +Half Rate codes (#HRC0# +and *HRC0#) don't work - to enable this channel you have to use +WinTesla or other software
  • + +
    Nie dzia³aj± kody do obs³ugi Half +Rate (#HRC0# i *HRC0#) - do w³±czenia tego kana³u trzeba +u¿yæ np. WinTesli albo innego oprogramowania
+ +


V4.62 14-08-98 (ROM3) +

V5.04 14-09-98 (ROM3) +
  +

+V5.07 22-11-98 (ROM3) +
V5.07 20-11-98 (ROM4 ?) +
  +
    +
  • +New 'Text version' parameter in test +89 of NetMonitor
  • + +
    Nowy parametr 'Text version' w te¶cie +89 monitora sieci +
  • +CCCH channel always used, when +network doesn't support cell broadcasting (in V5.04 CBCH +channel was used with enabled "Info service"or "Cell info display" +options)
  • + +
    U¿ywany jest zawsze kana³ CCCH, +gdy sieæ nie obs³uguje nadawania komórkowego (w wersji 5.04 u¿ywany by³ +kana³ +CBCH po w³±czeniu opcji "Info service" albo "Cell info display") +
  • +When you set "Incoming call alert" to "Ascending" and "Ringing volume" +to higher volume than 2, phone correctly changes volume from volume 1 to +set (previously it changed it only one level)
  • + +
    Przy ustawieniu "Sygna³ nadej¶cia po³±czenia" na "Rosn±co" i "G³o¶no¶æ +dzwonka" na wiêcej ni¿ poziom 2, telefon poprawnie zmienia g³o¶no¶æ od +poziomu 1 do ustawionego (wcze¶niej zmienia³ j± tylko o jeden poziom) +
  • +LAC and CID in test 11 in NetMonitor +are in decimal format.
  • + +
    LAC i CID w te¶cie 11 monitora +sieci s± podawane dziesiêtnie. +
  • +Newer versions(?):
  • + +
      +
    • +set profile to "Silent"
    • + +
    • +reset phone settings via cable
    • + +
    • +Phone will display "silent" mark on display with "Personal" profile selected...
    • +
    +
+ +


V5.10 23-12-98 (ROM3) +
V5.11 19-02-99 (ROM3) +
V5.11 18-02-99 (ROM4) +

(OLDER ?) Different meaning of Product Profile Settings - can't change +LCD Contrast +
(STARSZE ?) Inne znaczenie Product Profile Settings - nie mo¿na zmieniæ +kontrastu LCD +

V5.20 03-06-99 (ROM4) +
V5.22 01-07-99 (ROM3) +
V5.24 09-09-99 (ROM3) +
V5.24 03-09-99 (ROM4) +
+
(NOWSZE TE¯ ?) B£¡D: Niedok³adne t³umaczenie w Menu 1-7-2 i +Menu +1-4-1 +

(NEWER TOO ?) OTHER: This phone has working clock with date and interesting +thing is, that you can't set date from menu (you have to use gnokii) +
(NOWSZE TE¯ ?) INNE: Telefon ma poprawnie dzia³aj±cy zegar z dat±, +przy czym daty nie mo¿na ustawiæ z menu (ale np. przy pomocy gnokii) +

(NEWER TOO ?)ALARM BUGS: +

    +
  1. +first:
  2. + +
      +
    1. +set alarm
    2. + +
    3. +disable phone
    4. + +
    5. +when phone will alarm you, press "Snooze"
    6. + +
    7. +enable phone, until will alarm you again (6 minutes)
    8. + +
    9. +don't see "Snooze active" and alarm sign on the screen !
    10. +
    + +
  3. +when you're in the menu, alarm will enable, you will hear sound, but won't +see any info ! When leave menu, will see message, but without sound...
  4. + +
  5. +when keypad is locked and phone alarm you, you can disable it using 1-9, +*, 0, # keys
  6. +
+V5.26 15-12-99 (ROM4) +
V5.27 04-02-00 (ROM3) +
V5.27 03-02-00 (ROM4) +

Added code *#7760# for displaying Production Serial Number. +
Dodano kod *#7760# do pokazywania numeru seryjnego. +

V5.28 17-04-00 (ROM3 ?) +
V5.28 18-02-00 (ROM4)  +

Can't open simlocks using NokiaTool only - must use EEPROM method +

Added info new new GSM operators. For example: +
Dodano identyfikatory nowych operatorów. Na przyk³ad: +

ERONET, Mobilis, WATANIYA, K`CELL, LAO GSM, EMTEL, DHIMOBILE, Celtel, +JAWWAL, CELLTEL, Swazi-MTN, TT, ZANTEL, DIGITEL, ECONET +

Changes names for some GSM operators. For example: +
Zmieniono nazwy niektórych operatorów. Na przyk³ad: +
D1-TELEKOM ==> T-D1 +
D2 PRIVAT ==> D2 +
MaxTouch ==> Orange +
SENTELgsm ==> SENTEL +
HK TELECOM ==> C&W HKT +

(NEWER TOO ?) BUG:When edit long SMS (about 160 chars) and press Up/Down +key very long (until will scroll all SMS context - 160 chars) without releasing, +phone will restart after it - info from SkyBoy +
(NOWSZE TE¯ ?) B£¡D: Przy edycji d³ugiego SMSa (oko³o 160 znaków) po +naci¶niêciu klawisza Góra/Dó³ i przytrzymaniu (bez zwalniania), a¿ ca³y +SMS (160 znaków) zostanie przewiniêty, telefon zresetuje siê...  - +informacja od SkyBoy +

V5.29 24-07-00 (ROM4) +
MT Unicode USD activated +

GSM operators field updated: +
Uaktualnione nazwy operatorów: +
CT-GSM ==> CMCC +
LIBTEL  ==> LIBERTEL +

V5.30 28-09-00 (ROM4) +

GSM operators field updated +
Uaktualnione nazwy operatorów +

(V5.07) "SIM card registration failed" message is shown when the SIM +card or phone is unknown or rejected from the network. +
(V5.07) Komunikat "Rejestracja karty SIM nieudana" , gdy karta SIM +lub telefon nie mo¿e byæ zalogowany w sieci +
+


+
BUG (all versions ?): some SMS on SIM in Outbox can hang phone, when +try to read them (checked for N5110). Example (mygnokii can be download +from my www): try to use "mygnokii --savesms "test" --hangsms < file" +and read saved SMS +

Interesting facts: firmware seems to be cut version of firmware from +more expensive phones. There still some help texts inside, texts from some +functions (does it mean, that phone support them ?) - ("Anykey answer", +"Rename this set"- it can be done via cable !), text with name of "full" +profiles - the same question (Meeting, Outdoor, Pager, General), texts +"Save to another memory?, Saved to phone memory,Saved to SIM Card"...

5110iNSE-2
5130NSK-1*#0000#495503, 495508, 495509, 449210
V3.08 03-04-98 +
V4.11 12-06-98 +
V5.00 01-09-98 +
V5.30 23-04-99 +
V5.51 03-08-99 +
V5.60 14-10-99 +
V5.71 10-04-00 +
+
+
Interesting facts: firmware seems to be cut version of firmware from +more expensive phones. There still some help texts inside, texts from some +functions (does it mean, that phone support them ?) - ("Anykey answer", +"Rename this set"- it can be done via cable !), text with name of "full" +profiles - the same question (Meeting, Outdoor, Pager, General), texts +"Save to another memory?, Saved to phone memory,Saved to SIM Card"...
5160NSW-1
V3.47 15-07-99
5190NSB-1*#5190#010063
V3.41 07-02-98 +
V4.01 22-10-98 +
V5.01 02-11-98 +

V5.24 +

NetMonitor in Menu 11 (in +older firmware in Menu 10). +
Monitor sieci w Menu 11 +(w starszych wersjach w Menu 10). +

V5.51 15-04-99 +
V5.81 20-09-99 +

Downloadable operator logo and ringtone +

V6.11 28-04-00 +

V6.71 25-01-01 +

Added T9 dictionaries

5210NSM-5*#0000#
V5.12 17-01-02 +
V5.13 27-01-02
5510NPM-5*#0000#
V3.43 +
    +
  • +Silence or annoying beep is removed, when starting player for the first +time through menus. 
  • + +
  • +Improvement to headset connection timeout. (In some cases when recording +had started from FM radio and then headset was removed, recorder should +have stopped after three minutes, but it crashed). 
  • + +
  • +Language package M (Tagalog, Bahasa Indonesian, Bahasa Malaysian) added. 
  • +
+BUG: If you enter Menu 8 (music) and try to enter music-reader (Menu +8-1), without any music in memory, phone return an error message then +enter in stand-by, without remaining in Menu 8. The same if you +enter in menu "radio" without headset connected. +

V3.45 04-12-01 +

V3.47 +

    +
  • +Improvements in Calculator. Dot is now handled in proper way, when setting +exchange rates 
  • + +
  • +Line-in recording functionality has been improved 
  • + +
  • +Sometimes audio was not switched to phone's earpiece, if headset was removed +during a phone call 
  • + +
  • +Music player did not always restart after a call was initiated and then +ended 
  • + +
  • +Unplugging headset during a phone call turns now music player on Pause 
  • + +
  • +FDN now allows all calls to be made from FDN phonebook
  • + +
  • +Improvements in showing Cl@ss 0 SMS messages 
  • + +
  • +USSD with more than 30 digits is now possible 
  • + +
  • +STK "Refresh" command improved 
  • +
+V3.50 +
    +
  • +Chr table improvement in SIM ATK menu application. Now it is possible to +enter character behind Chr key in SIM ATK menu. 
  • + +
  • +Text improvements: 
  • + +
      +
    • +If there is no memory left, when saving a downloaded WAP picture to phone's +memory, an English error note "Memory full. Replace picture?" is split +into two lines. 
    • + +
    • +Russian text improvements 
    • +
    + +
  • +WAP and OTA improvement. Received OTA settings which data call with speed +14.4 kbps for WAP: data speed 14.4 kbps will be replaced with default value +9.6 kbps, because NPM-5 supports only 9.6 kbps as data call speed 
  • + +
  • +Dot/+ improvement in entering IP address and dial-up number (K language +package). In case English is activated from K language package (K package +includes Russian, Ukrainian and English), it is now possible to enter a +dot (.) into IP address and a plus (+) into dial-up number 
  • + +
  • +Operator list updated 
  • +
+
+Back to the top/Na pocz±tek +

+


+ + + + diff --git a/Docs/en_US/gsm/firmware/firm6_1.htm b/Docs/en_US/gsm/firmware/firm6_1.htm new file mode 100644 index 0000000..1680ff4 --- /dev/null +++ b/Docs/en_US/gsm/firmware/firm6_1.htm @@ -0,0 +1,668 @@ + + + + + + + + + + + Nokia identification & firmware/Identyfikacja i oprogramowanie telefonów Nokia + + + + + + +
+


Nokia identification & firmware/Identyfikacja +i oprogramowanie telefonów Nokia

+ +

+


+
    +
  1. +Ogólne b³êdy/General bugs
  2. + +
  3. +Ogólne informacje o IMEI/General info about +IMEI
  4. + +
  5. +Czy mogê wgraæ sobie oprogramowanie/Can I download +firmware to my phone ?
  6. + +
  7. +Czy to kosztuje ?/Does it cost ?
  8. + +
  9. +Gdzie tego dokonaæ ?/Where to make it ?
  10. + +
  11. +Jakie s± b³êdy/zmiany w kolejnych wersjach +?/What are bugs/changed things in next versions ?
  12. + +
  13. +Jak zmieniæ wersjê jêzykow±?/How to change +language in phone ?
  14. + +
  15. +U¿yte materia³y/Information sources
  16. +
+ +
+
+

Here is table describing firmware in various Nokia 60xx/61xx phones +
You can also see table for +
Nokia 1xxx/2xxx, Nokia +3xxx, Nokia 5xxx, Nokia +60xx/61xx, +
Nokia 62xx/63xx/65xx, Nokia +7xxx, Nokia 8xxx, Nokia +9xxx

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Phone (telefon)Model number (Oznaczenie)Firmware version code (kod do sprawdzania wersji oprogramowania)TAC in IMEI (TAC w IMEI)
6050NME-1
6080NME-2*#0000#
V5.14 03-03-97
6081NME-2E*#170602112302#
V5.14 03-03-97
6090NME-3
V5.00 30-11-99
6110NSE-3*#0000#490518, 490523, 490526, 490527, 490545
V3.11 14-11-97 +
V3.14 28-11-97 +

First shipping version of the software. +
Pierwsza wersja oprogramowania w sprzedawanych telefonach. +

V4.05 07-01-98 +
V4.06 16-01-98 +
V4.25 01-01-98 +
V4.33 11-03-98  (ROM3) +

Improves the reception quality. +
Poprawiona jako¶æ odbioru. +

SMS message alert volume now linked to ringing volume. +
G³o¶no¶æ sygna³u SMS po³±czona z g³o¶no¶ci± dzwonka. +

Minor changes in Profiles menu. +
Niewielkie zmiany w menu profili. +

'Long & Loud' SMS alert is now called 'Ascending' +
D¼wiêk dzwonka SMS 'Long & Loud' zmieniony na 'Ascending' +

'Warning Tones' is now 'Warning and Games Tones' +
'Warning Tones' zmienione na 'Warning and Games Tones' +

The 'No Service' areas between cells seem to have disappeared.When the +phone does go 'No Service', it will very quickly log onto a new cell, usually +within a few seconds. +
Telefon szybciej siê loguje do nowej komórki po odzyskaniu zasiêgu. +

The desktop charger now works correctly when the phone is inserted with +the battery connected. +
£adowarka biurkowa pracuje poprawnie, gdy pod³±czany jest do niej telefon +z w³o¿on± bateri±. +

BUG: Nokia Cellular Data Suite 1.2 (NCDS) infra red function has now +gone intermittent. This has been confirmed this by using a V3.14 phone +which works perfectly with the installed version of the NCDS. Basically +if I connect the phone using the RS232 cable the NCDS works fine. If you +then disconnect and re-connect using IR, also no problem. If you then disconnect +and re-connect a 2nd time using IR you get no connection. The IR symbol +on the phone flashes, then goes static, then flashes again. +
B£¡D: Po³±czenie przez podczerwieñ z NCDS 1.2 nie dzia³a dobrze (podczas +gdy w telefonem z oprogramowaniem 3.14 nie ma problemów), natomiast po³±czenie +kablem ci±gle funkcjonuje bez zarzutu. Je¿eli od³±czysz i po³±czysz ponownie +podczerwieñ, nie ma problemu. Je¿eli próbujesz natomiast jeszcze raz, problem +siê pojawia. Symbol podczerwieni w telefonie mruga, pó¼niej wy¶wietla siê +na sta³e i znów mruga. +

V4.51 26-03-98 (ROM3) +
V4.59 01-06-98 (ROM3) +
V4.73 22-04-98 (ROM3) +

(V4.06) Correct call counters (Received+Dialled calls=All calls) +
(V4.06) Poprawne liczenie d³ugo¶ci po³±czeñ (Odbierane+Wykonywane po³±czenia=Wszystkie) +

(V4.33) IR-Software improved +
(V4.33) Poprawnione oprogramowanie do obs³ugi IR +

(V4.33) Charger recognition improved. +
(V4.33) Poprawiono rozpoznawanie ³adowarek. +

(V4.33) Headset features improved. +
(V4.33) Poprawiono obs³ugê zestawu s³uchawkowego. +

(V4.33) Same standard SMS alert as 8110i. +
(V4.33) Niektóre d¼wiêki SMSów jak w Nokii 8110i. +

(V4.33) Better energy saving functions. +
(V4.33) Lepsze funkcje oszczêdzania energii. +

(V4.33) Better conference call features. +
(V4.33) Poprawiono obs³ugê po³±czeñ konferencyjnych. +

(V4.33) Better SMS status report. +
(V4.33) Lepsze raporty SMS. +

(V4.33) Display of saving status (phone or SIM). +
(V4.33) Wy¶wietlanie statusu zapisu (telefon albo karta SIM). +

(V4.33) HFU-2 improved. +
(V4.33) Poprawiona obs³uga zestawu samochodowego HFU-2. +

(V4.33) Better charging with standard, car charger and "cold" battery. +
(V4.33) Lepsze ³adowanie ze standardow± albo samochodow± ³adowark± +i zimn± bateri±. +

(V4.33) Faster network connection. +
(V4.33) Szybsze po³±czenie z sieci±. +

(V4.33) Safer network connection at a low signal strength. +
(V4.33) Bezpieczniejsze po³±czenia z sieci± na obszarach o s³abym sygnale. +

(V4.33) Longer single ringtone with vibra pack. +
(V4.33) D³u¿szy sygna³ d¼wiêkowy przy u¿ywaniu baterii wibracyjnej. +

(V4.33) Corrected the problem of the battery indicator bar flickering +between one and two bars with a Li-ion battery. +
(V4.33) Poprawiono problem ze wska¼nikiem poziomu na³adowania baterii +(wcze¶niej przy baterii Li-ion miga³ pomiêdzy jedn± i dwoma kreskami) +

(V4.33) No more changing Half Rate +settings via keypad. +
(V4.33) Nie dzia³aj± kody do aktywacji/deaktywacji kana³ów Half +Rate z klawiatury. +

(V4.33) Improved audio quality when using the EFR +Speech Codec. +
(V4.33) Lepsza jako¶æ d¼wiêku przy u¿ywaniu EFR. +

(V4.33) Reception of CCH blocks after cell reselection in weak field +has been improved. +
(V4.33) Poprawiono odbiór bloków CCH po powtórnym wyborze komórki na +obaszrach o s³abym sygnale. +

(V4.33) Improved the maintenance charging when using the ACP-7 charger. +
(V4.33) Poprawione ³adowanie podtrzymuj±ce z ³adowark± ACP-7. +

(V4.33) More frequent battery low warning beeps added during a call +made with a Li-ion battery. +
(V4.33) Czêstsze ostrze¿enia o wy³adowaniu baterii przy po³±czeniu +i baterii Li-ion. +

(V4.33) Improved SMS storage time handling. If the user has not selected +a storage time, the phone uses the maximum storage time set by the network. +
(V4.33) Je¿eli uzytkownik nie wybra³ czasu wa¿no¶ci SMSa (przy wysy³aniu), +telefon przyjmuje maksymaln± warto¶æ przyjmowan± przez sieæ. +

(V4.33) Improved recovery of SIM card in error situations. +

(V4.33) Fixed bug in SMS editing screen where the cursor is one character +to far right. +
(V4.33) Poprawiono b³±d przy edycji SMSów w sytuacji gdy kursor jest +odleg³y jeden znak od prawej strony. +

V5.00 28-05-98 (ROM3) +

An updated GSM operators' list. +
Uaktualniona lista operatorów. +

V5.22 18-08-98 (ROM3) +

An updated GSM operators' list. +
Uaktualniona lista operatorów. +

V5.24 19-09-98 (ROM3) +
V5.24 14-09-98 (ROM4)  +

Implemented code *#sim0clock# which shows whether the SIM card +inserted supports clock stopping. +
Dodano kod *#sim0clock# do sprawdzania, czy zegar karty SIM +mo¿e byæ zatrzymany. +

Headset detection improved. +
Poprawione wykrywanie zestawu s³uchawkowego. +

Performance in weak signal area improved. +
Poprawiono czu³o¶æ przy s³abym sygnale sieci. +

Improvements to short message handling. +

Tone levels tuned (distinct difference now between levels 5 and 4). +
Zmieniono poziomy dzwonków (wyczuwalna ró¿nica miêdzy poziomem 4 i +5). +

(V4.73) Different energy consumption in test +23 of NetMonitor. +
(V4.73) Inne zu¿ycie energii w te¶cie +23 monitora sieci. +

V5.30 23-12-98 (ROM3) +

An updated GSM operators' list. +
Uaktualniona lista operatorów. +

V5.31 19-02-99 (ROM3)  +
V5.31 18-02-99 (ROM4) +

Added Menu 4-3-6 ("Active line"), which allows to select active +line on SIM card (ALS function) +
Dodano Menu 4-3-6, które pozwala wybraæ numer na karcie SIM +(funkcja ALS) +

An updated GSM operators' list. +
Uaktualniona lista operatorów. +

V5.40 25-05-99 (ROM4) +

V5.47 01-07-99 (ROM3)  +
V5.47 30-06-99 (ROM4) +

(OLDER ?) Different meaning of Product Profile Settings - can't change +LCD Contrast +
(STARSZE ?) Inne znaczenie Product Profile Settings - nie mo¿na zmieniæ +kontrastu LCD +

Some phones with it (I don't know, if it's connected with firmware version +or ROM) doesn't have more than 19 menus in NetMonitor +and some first tests are cut - see more +

V5.48 08-09-99 (ROM3) +
V5.48 03-09-99 (ROM4) +

New ringing tones. +
Nowe dzwonki. +
+


+
Note: In very old firmware versions (3.x) you have test +18 in NetMonitor. In newer (4.x, +5.x) it was removed... +
Informacja: W bardzo starych wersjach firmware (3.x) dostêpny by³ test +18 w monitorze sieci. W nowszych +(4.x, 5.x) zosta³ on usuniêty... +

BUG: Some older/all (?) firmware had bug in Calendar in Birthday option: +it it was set to the last day of February on non-leap-years (for example +29.02.2000), calendar will inform about it 1'st March (1.03.2000). Must +use "Reminder" instead of "Birthday". +

BUG: Some older/all (?) firmware had bug: Phone goes crazy if you scroll +the received SMS with 160 dots. +
B£¡D: Niektóre starsze/wszystkie (?) wersje zawiera³y b³±d: Telefon +wariuje przy przewijaniu odebranego SMSa zawieraj±cego 160 kropek.

6120NSC-3*#6120#
V1.18 01-07-99
6130NSK-3*#9999#495502
V3.26 10-02-98 (ROM3) +
V3.27 18-02-99 (ROM3) +
V3.28 24-02-98 +
V3.32 03-04-98 (ROM3) +
V4.11 10-06-98 (ROM3) +
V5.00 08-09-98 +

(V4.11) NetMonitor in Menu 11 +(in +older firmware in Menu 10). +
(V4.11) Monitor sieci w Menu +11 (w starszych wersjach w Menu 10). +

V5.30 23-04-99 (ROM3) +
V5.30 23-04-99 (ROM4)  +
V5.60 14-10-99 (ROM3) +
V5.61 22-11-99 (ROM3) +
+


+
BUG: Some older/all (?) firmware had bug in Calendar in Birthday option: +it it was set to the last day of February on non-leap-years (for example +29.02.2000), calendar will inform about it 1'st March (1.03.2000). Must +use "Reminder" instead of "Birthday".
6138NSK-3
6150NSM-1*#0000#449208 (Finland), 493002, 493006 (Germany), 493009
V3.02 08-07-98 +
V3.06 10-08-98 +
V4.01 23-09-98 +
V4.02 01-10-98 +
V4.11 05-11-98 +
V4.12 02-12-98 +

Added corect recognizing phase 2+ SIM cards. +
Dodano poprawne rozpoznawania karty SIM fazy 2+ GSM. +

V4.13 16-12-98 +

BUG: Calling Menu 10-3 causes the phone to hang and you will +have to remove the battery. +
B£¡D: Wywo³anie Menu 10-3 zawiesza telefon (pomaga dopiero wypiêcie +baterii). +

V4.14 18-12-98 +
V5.02 02-02-99 +

(V4.13) Added Menu 4-4-6 ("Confirm SIM service actions") with +Menu +4-4-6-1 ("Asked") and 4-4-6-2 ("Not asked") options. +
(V4.13) Dodane Menu 4-4-6 ("Powiadomienia o zmianach") z Menu +4-4-6-1 ("Widaæ") i 4-4-6-2 ("Nie widaæ"). +

V5.10 14-06-99  +
V5.16 22-06-99 +

(V4.13) NetMonitor in Menu 12 +(in +older firmware in Menu 11) - you have SIM Services (SIM Application +Toolkit) in Menu 11. +

V5.17 01-07-99 +
V5.20 20-09-99 +

NetMonitor in Menu 13 (in +older firmware in Menu 12). Menu 12 seems to be used for +something called LifeChart or WellMate (it seems to be some service connected +somehow with health - some device connected to phone and measured some +health parameters ?) +

V5.22 10-11-99 +

(V4.13) Better support for some 16kB SIM card with SIM Application Toolkit +(example: SIM cards from Italian TIM) +

(NEVER TOO ?) BUG: When receiving an over the air ringing tone and selecting +playback directly, the first tone would be partially cut off during the +playback (only when the keypad tones were activated) +

Production Serial Number String added (*#7760# code) +
Dodano kod *#7760# do pokazywania numeru seryjnego. +

Calendar birthday reminder, related to the last day of February on non-leap-years, +will now be set to right day +
Notatki w kalendarzu dotycz±ce urodzin odnosz±ce siê ostatniego dnia +Lutego w latach nieprzestêpnych jest teraz ustawiany we w³a¶ciwym dniu. +

Improvement to character conversion. Earlier blank display was shown +when UCS2 type (e.g. Greek characters) of SMS was received. +
Poprawiono konwersjê znaków. Wcze¶niej pokazywany by³ pusty ekran, +gdy SMS typu UCS2 (np.ze znakami greckimi) zosta³ odebrany. +

Multiple multi-page Cell Broadcast reception improved. +
Poprawiono odbiór wielostronicowych po³±czonych komunikatów nadawanaia +komórkowego. +

An updated GSM operators' list. +
Uaktualniona lista operatorów. +

(V5.17)Different names ringtone: "Polska" instead of "Polka"... +

V5.23 20-03-00 (except NSM-1NY ORANGE, product code 0502581) +
V5.23 17-05-00 (ROM6?) +

(NEWER TOO ?) BUG:When edit long SMS (about 160 chars) and press Up/Down +key very long (until will scroll all SMS context - 160 chars) without releasing, +phone will restart after it - info from SkyBoy +
(NOWSZE TE¯ ?) B£¡D: Przy edycji d³ugiego SMSa (oko³o 160 znaków) po +naci¶niêciu klawisza Góra/Dó³ i przytrzymaniu (bez zwalniania), a¿ ca³y +SMS (160 znaków) zostanie przewiniêty, telefon zresetuje siê...  - +informacja od SkyBoy +

Jêzyk polski (wszystkie wersje ?): Niedok³adne t³umaczenie w trzech +miejscach (Spis tel./Opcje/Stan pamiêci, Spis tel./Wykasuj oraz Menu +1-6-2) i b³±d (albo rzadko u¿ywana forma) w pomocy do Menu 6 +(....Opcja dwóch graczy wymaga +dwu telefonów....) +

Partnership network search improved +

"Grande walse" renamed as "Nokia tune" +

(?) "Happy birthday" changed to "Auld lang syne" +

GSM Operator list updated: +

    +
  • +New Operators (new countries: LAO (457), MV(472), SZ (653), TN (605)):
  • + +
      +
    • +Operator name -> MNC/MCC
    • + +
    • +ERONET -> 218/03
    • + +
    • +Mobilis -> 624/02
    • + +
    • +WATANIYA -> 419/03
    • + +
    • +K`CELL -> 401/02
    • + +
    • +LAO GSM -> 457/01
    • + +
    • +EMTEL -> 617/10
    • + +
    • +DHIMOBILE -> 472/01
    • + +
    • +Celtel -> 650/10
    • + +
    • +JAWWAL -> 425/05
    • + +
    • +CELLTEL -> 413/03
    • + +
    • +Swazi-MTN -> 653/10
    • + +
    • +TT -> 605/02
    • + +
    • +ZANTEL -> 640/03
    • + +
    • +DIGITEL -> 734/02
    • + +
    • +ECONET -> 648/04
    • + +
    • +Vodafone -> 216/70
    • +
    + +
  • +Operator name changed
  • + +
      +
    • +Old name -> New name
    • + +
    • +D1-TELEKOM -> T-D1 (262/01)
    • + +
    • +D2 PRIVAT -> D2 (262/02)
    • + +
    • +MaxTouch -> Orange (404/20)
    • + +
    • +EMARTEL -> TMTTOUCH (502/13)
    • + +
    • +SENTELgsm -> SENTEL (608/02)
    • + +
    • +GT-BCS -> UA-GT (255/05)
    • + +
    • +HK TELECOM -> C&W HKT (454/00)
    • + +
    • +Blu S.p.A -> I BLU (222/98)
    • +
    +
+(V5.22): +
    +
  • +can't send group graphic via IrDa -> "Group graphic sending failed" message
  • + +
  • +all profiles displayed (including Car and Headset) in "Profiles" menu
  • +
+Info from users: in PL language "Mikrofon wy³±czon" and "Odg³usz" +

VP5.23, 25-09-00 +
with animated menus, picture messaging, T9 dictionary, new ringtones +and game (see http://www.nokia.de/mobile_phones/produkte/6150/6150_su.html). +

Problems with SIM Application Toolkit & netmonitor (tested with +Italian SIM cards). With: +

    +
  1. +16k SIM from Wind (called Hi-Wind and working on 1800 Mhz networks only) +- no services (no menu 10) and netmonitor on 11
  2. + +
  3. +SIM from Omnitel Pronto Italia (OPI) shows only 9 menus, the 9th being +Infrared, no netmonitor
  4. +
+ +
+
Some older firmware versions had problems with SMS from Quios +(Alphanumeric SMS, I quess): when user tried to read, phone hang and removing/inserting +battery was necessary. +

Older firmware/all (?) had bug: "Received+Dialled calls" were different +than "All calls"

6160/6162NSW-3*#9999#
V1.12 01-02-99 +
V3.01 09-07-99 +
V3.02 10-12-99
6185/6188NSD-3AX*#837#
V430SD3a2.nef 05-18-99 +
V440SD3a3.nef 10-26-99 +
V441SD3a3.nef 11-12-99 +
V542SD3d3.nef 08-02-00 +
+
+
BUG: The earpiecie volume isn't the same for different phones: +
    +
  • +For 435/441 firmware: If the phone is powered up with the volume set to +level 10, you end up with markedly lower maximum volume. If the phone is +powered up with the volume set at level 9 or lower, the maximum volume +is much louder
  • + +
  • +For 430: You needed to also power up the phone in Field Test Mode to get +the maximum volume.
  • +
+(?) Alpha Tag Menu (seen after *3001#12345# code) is not available ?
6190NSB-3*#6190#
V4.02 06-04-98  +
V4.22 01-07-98 +
V4.30 19-08-98  +
V5.03 09-11-98 +
V5.10 14-06-99  +
V5.24 +

NetMonitor in Menu 11 (in +older firmware in Menu 10). +
Monitor sieci w Menu 11 +(w starszych wersjach w Menu 10). +

V5.30 +

Support for caller groups logos. +
Wsparcie dla log grupy. +

V5.53 15-04-99 +

Custom ringtones and the Startup logo are all now uploadable to the +phone directly using a data cable. +
W³asne dzwonki i loga startowe mog± byæ teraz bezpo¶rednio wgrywane +do telefonu przez kabel. +

The max volume is slightler louder than previous +
Maksymalna g³o¶no¶æ jest teraz wiêksza. +

Added Menu 4-3-7 (Notifications on SIM update) +
Dodano Menu 4-3-7. +

V5.83 17-09-99 +

Added support for operator logo (uploading via cable or general support) +
Dodano obs³ugê loga operatora (mo¿liwo¶æ wgrywania przez kabel albo +ogóln± obs³ugê) +

V5.93 22-11-99 +
V6.13 28-04-00  +
V6.73 25-01-01

+Back to the top/Na pocz±tek +

+


+ + + + diff --git a/Docs/en_US/gsm/firmware/firm6_2.htm b/Docs/en_US/gsm/firmware/firm6_2.htm new file mode 100644 index 0000000..ac72c3f --- /dev/null +++ b/Docs/en_US/gsm/firmware/firm6_2.htm @@ -0,0 +1,1492 @@ + + + + + + + + + + + Nokia identification & firmware/Identyfikacja i oprogramowanie telefonów Nokia + + + + + + +
+


Nokia identification & firmware/Identyfikacja +i oprogramowanie telefonów Nokia

+ +

+


+
    +
  1. +Ogólne b³êdy/General bugs
  2. + +
  3. +Ogólne informacje o IMEI/General info about +IMEI
  4. + +
  5. +Czy mogê wgraæ sobie oprogramowanie/Can I download +firmware to my phone ?
  6. + +
  7. +Czy to kosztuje ?/Does it cost ?
  8. + +
  9. +Gdzie tego dokonaæ ?/Where to make it ?
  10. + +
  11. +Jakie s± b³êdy/zmiany w kolejnych wersjach +?/What are bugs/changed things in next versions ?
  12. + +
  13. +Jak zmieniæ wersjê jêzykow±?/How to change +language in phone ?
  14. + +
  15. +U¿yte materia³y/Information sources
  16. +
+ +
+
+

Here is table describing firmware in various Nokia 62xx/63xx/65xx phones +
You can also see table for +
Nokia 1xxx/2xxx, Nokia +3xxx, Nokia 5xxx, Nokia +60xx/61xx, +
Nokia 62xx/63xx/65xx, Nokia +7xxx, Nokia 8xxx, Nokia +9xxx

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Phone (telefon)Model number (Oznaczenie)Firmware version code (kod do sprawdzania wersji oprogramowania)TAC in IMEI (TAC w IMEI)
6210NPE-3*#0000#350138, 350147, 350612, 449333 (Germany), 449337, 449338
V2.95 16-02-00 +
V3.00 16-08-00  +
V3.01 21-08-00 +

BUGS (NEWER TOO ?): +

    +
  1. +Sporadic vibrating during SMS receiving or calling although the vibration +was switched off
  2. + +
  3. +Call waiting service (Menu 4-3-4) doesn't work correctly (it should +"Requests the network to send a beep during a call when another call is +coming"). When use profile Meeting (with Incoming call alert = Beep once), +during call can hear beep and phone is vibrating when another call is coming. +But with another setup of "Incoming call alert" there isn't beep. Only +on display another call is flashing.
  4. + +
    Temporary solution: Callers group have own icons. If you turn off showing +icons, auditible signaling is OK. Other solution is to put off number from +caller group +
  5. +When profile is switched to "Meeting" where is "Incoming call alert" switched +to "Beep once", don't hear beep during call when battery is low and double +beep when battery is empty. Phone turn off unawares.
  6. + +
  7. +When "Delivery reports (1-8-5)" is switched to "on" and phone receives +a delivery report, menu item "Games-Settings (6-4)" disappears. It is showed +again when turn off and turn on phone.
  8. + +
  9. +When keypad is locked and you put phone into carkit, keypad is active. +When take it from carkit then, it's sometimes locked again, sometimes not.
  10. + +
  11. +When phone is in the carkit, you can sometimes lock keypad
  12. + +
  13. +When you take from carkit phone with locked keypad, very often can't unlock +keypad and you have to restart phone
  14. + +
  15. +In Polish language in Menu 5 ("Call diverts") there two the same +submenus (3 and 5) "Divert when not answered" with different contenst
  16. + +
  17. +When for example you received a SMS, when you unlock the phone's keypad, +you must wait till you see "1 message received" before you can push 'read'. +Otherwise you'll go to the menu.
  18. + +
  19. +When you enable cell-info, you won't see any info anymore about which profile +you're in.
  20. + +
  21. +Sometimes, when receive SMS and starts to read it, you have info "menu +contains...." (help for Inbox menu)
  22. +
+ +
+
SOME OLDER VERSIONS HAD BUG: sometimes the phone couldn't show the +names of the person whose calling eventhough the person's name IS on the +phonebook. So instead of showing the caller's name the phone was only showing +"+62.... call"  +

BUG (all version ?): +

    +
  1. +Dropping the last character of the domain name when using relative URLs! +Example: A link like /cgi-bin/wap_news.pl on a page http://www.wapterror.de/wml/index.wml +sould be constructed as http://www.wapterror.de/cgi-bin/wap_news.pl. +Phone makes it http://www.wapterror.d/cgi-bin/wap_news.pl (missing +e on .de)
  2. + +
  3. +Can't delete templates of SMS and Picture Images
  4. + +
  5. +Sometimes, even when vibra is disabled in profile, it enables
  6. + +
  7. +DTMF doesn't work , when have enabled keypad tones
  8. + +
  9. +Phone sometimes doesn't want to connect to WAP (message "check settings")
  10. + +
  11. +If you assigned downloaded ringtone for caller group and deleted if (ringtone) +from phone, it stops ring and vibrate. Can't change ringtone from phone's +menu then (must use Logo Manager or different software)
  12. +
+ +
+
V3.04 (16-10-00 ????) +
    +
  • +Improved Half Rate audio quality
  • + +
  • +Updated operator list
  • +
+V3.08 +
    +
  • +(V3.04) Improvement to Arabic/Hebrew Memory status layouts
  • + +
  • +(V3.04) Improvements to Voicetags 
  • + +
  • +(V3.04) Improvements to SMS 
  • + +
  • +(V3.04) Only one indicator is at the end of Selection window when moving +to second candidate first time in the editing mode
  • + +
  • +(V3.04) Input method indicator in top left corner is disappeared in Rename +operation 
  • + +
  • +(V3.04) DLR-3 is detected as a headset after one headset call 
  • + +
  • +(V3.04) UNICODESIM: SDN only names of length less than 8 are shown 
  • + +
  • +(V3.04) Improvements to browser setup: \"Menu\" -> \"2\" -> \"Scroll\" +corrected
  • +
+V3.74 22-09-00 +
V4.04 06-10-00 +

BUG (NEWER TOO ?): Make these steps: +

    +
  1. +create new folder in Messages/My folders
  2. + +
  3. +create message and move to this folder
  4. + +
  5. +enter into this folder
  6. + +
  7. +edit this message
  8. + +
  9. +save it
  10. +
+You can't now enter to any folder. Must restart phone. Note, that bug exist +only, if this folder is first on the folders' list. For other it's OK. +

V4.08 25-10-00 +

V4.27 21-12-00 +

    +
  • +Turkish, Greek, Czech and Polish T9 added
  • + +
  • +Spanish language and T9 added
  • + +
  • +LCD temperature compensation
  • + +
  • +LCD reset after powerup
  • + +
  • +Spaces couldn't be put in front of text in Dealer Welcome Note (DWN)
  • + +
  • +PIN-code couldn't be entered on a SIM-locked phone
  • + +
  • +It wasn't possible to call a SS string beginning with a "*" (e.g. *#61# +etc.) stored on the FDN phonebook
  • + +
  • +Setup Menu command was not executed when already in SIM ATK menu
  • + +
  • +SIM ATK minimum polling interval increased from 5 to 10 sec
  • + +
  • +Improvements when trying to enter username in HTTP authentication
  • + +
  • +Dynamic text case handling improved
  • + +
  • +OPERATOR_NAME_MAX_LENGTH changed from 10 to 11
  • + +
  • +Timeout killer didn't work on *+-key in number queries
  • + +
  • +Games 'options' -menu disappeared when deleting delivery report in messages
  • + +
  • +Missing/strange menu items when sending SMS
  • + +
  • +Improvements to Arabic & Hebrew editor options
  • + +
  • +Letter insertion direction change in Arabic
  • + +
  • +Improvements to Arabic & Hebrew input (wrong ui-text was used for special +characters)
  • + +
  • +Improvements to calendar when using fetch service with birthday note
  • + +
  • +Improvements when selecting Multiple copies
  • + +
  • +In SMS: Improvements when storing more than 50 items in the Template folder
  • + +
  • +Improved functionality in Names-list
  • + +
  • +If T9 is active '#'-key toggles now between T9 and normal input in Arabic/Hebrew +and Chinese languages
  • + +
  • +Improved business card sending
  • + +
  • +No characters were received if Euro-sign was first character in a picture +message
  • + +
  • +Improvements to Voice tag
  • + +
  • +Correction of Arabic Name & Number view, RTL marker inserted
  • + +
  • +Correction of number length for Idle number input
  • + +
  • +Bottom margin changed in Arabic editor from '2' to '1'
  • +
+BUGS: +
    +
  • +PL specific: brak informacji o wolnej pamiêci telefonu (widaæ tylko "Wolne: +")
  • + +
  • +After enabling phone, entering PIN code (after "Enter PIN code" request) +and when you will see network indicator, press many times (very fast) phone's +keys (Red and Green key). You should see "Emergency calls only". It must +done so fast, that Stop sign doesn't blink. If you don't see startup logo: +phone doesn't give access to phone's menu and profiles, although it's logged +into network.
  • + +
  • +when keypad is locked and you will press any key, you will see "Press Menu +and then *". You can now press longer Power button and phone will disable +!
  • + +
  • +when you make something, somebody call to you and you will press left soft +key, phone hangs after receiving call...
  • + +
  • +sometimes after WAP session you can't lock keypad
  • + +
  • +after using Irda can't receive SMS
  • + +
  • +using BTS Test in netmonitor can +damage phone (CONTACT SERVICE, etc.) !
  • +
+V4.36 31-01-01 +
    +
  • +Handling of operator logo length improved
  • + +
  • +AT commands updated
  • + +
  • +Initialisation of Data SW when receiving/releasing the data switch
  • + +
  • +Fixed Dialling Numbers - View details shows wrong number if it is longer +than 12 digits. Although SSC-String for call forwarding is on FDN list, +call forwarding can not be performed either via menu or via string
  • + +
  • +Flashing panel when erasing a phonebook item
  • + +
  • +Impossible to call to SMS 'use number'
  • + +
  • +Delayed SMS
  • + +
  • +SMS Delivery reports
  • + +
  • +Wrong indication of max characters in SMS
  • + +
  • +Font size selection not working for received SMS
  • + +
  • +Error in DLR-3 usage in the middle of the IR usage
  • + +
  • +Modified AT commands for DHU functionality (TCH Loopback)
  • + +
  • +Automatic answer does not work in car profile
  • + +
  • +Some spelling in languages improved
  • + +
  • +Call without simcard, note "Emergency calls only" won't disappear
  • + +
  • +Freezes when faulty Business Card is received
  • + +
  • +Possible to switch phone off during keypad is locked
  • + +
  • +Updated MoU list (DUAL_operators) (Operator Cosmorom)
  • + +
  • +SIM ATK: submenus become trash
  • + +
  • +Cancel all CF's at once:
  • + +
  • +Performed on Line1: If CFU for Line2 is activated the sign is deleted too
  • + +
  • +Performed on Line2: CF's for Line1, data and fax are cancelled: Line2 not +affected
  • + +
  • +*#06# should show IMEI even when SIM card is not inserted
  • + +
  • +USSD short strings supported
  • + +
  • +STP support (e.g. used in Mercedes)
  • + +
  • +CLI logo over IR send/receive
  • + +
  • +Ringing tones over IR - receive
  • + +
  • +Shortcut on 'Send' for go to bookmark
  • +
+Bug: +
    +
  • +after ending Snake II game enter options and last view. When it will be +displayed, the light will be not off.
  • + +
  • +in German D2 Network problems with message receiving (after receiving one +no more are received).
  • +
+(?) Improvements in netmonitor +

V5.01 15-03-01 +

    +
  • +The first WAP call cometimes fails after answering/missing a MT PSTN call
  • + +
  • +When trying to delete a received picture message the phone sometimes freezes
  • + +
  • +When erasing unread SMS from phone by cable or IrDA, SMS icon stays on +display
  • + +
  • +Added function for UI to check, if Data cable is connected or not
  • +
+This version can cause following intermittent errors: +
    +
  • +Divert freezes the phone
  • + +
  • +SMS receive freezes the phone when reading
  • + +
  • +SMS editing freezes the phone
  • +
+V5.02 02-04-01 +

All changes from V4.36 +

    +
  • +(?) first three changes available in 5.01
  • + +
  • +Not possible to change the date of the calendar
  • + +
  • +DTMF tones stop working during call
  • + +
  • +Memory overwrite when using Russian text
  • + +
  • +When PC Suite changes the profile name it is not updated to phone UI before +restarting the phone
  • + +
  • +Strange behaviour when entering number and then <SEND> to PIN query +in start-up
  • + +
  • +By HSCSD data transfer is flow ctrl problems (data loss by upload and bi-directional)
  • + +
  • +The first WAP call sometimes fails after answering/missing a MT PSTN call
  • + +
  • +When trying to delete a received picture message the phone hangs
  • + +
  • +When erasing unread SMS from phone by cable or IrDA, SMS icon stays in +UI
  • + +
  • +Wrong font used for emergency call
  • + +
  • +Sometimes when phone is set to local mode (e.g. by WinTesla) the phonebook +server is not initialised. This makes it impossible to store CLI icons
  • + +
  • +Not possible to insert new words to the dictionary, if phone SW has been +updated to 4.27
  • + +
  • +Business card received over IR handled as a Ringing tone
  • + +
  • +Speed dial not updated, if a SIM card entry's number is edited to NULL
  • + +
  • +SMS Notifications are not routed to PC Suite
  • + +
  • +Bluetooth implemented (there is also special hardware "Nokia Connectivity +Pack" required for it !)
  • + +
  • +Added support in the IrDA subsystem for sending CLI logos to Nokia 6110
  • +
+Observations from users (V4.36): +
    +
  • +new parameter in test 8 in netmonitor
  • + +
  • +when create note in calendar, default year is 2001 (not 2000)
  • + +
  • +PL: zmieniona nazwa dla Menu 5-5. Wcze¶niej "kiedy nie odbieram", +teraz "kiedy niedostêpny"
  • + +
  • +BUG: when send SMS using phone memory (it should be empty), before receiving +report, you have strange chars inside...
  • + +
  • +"ERA GSM" changed to "PL ERA GSM"
  • +
+Note: The correction for line 2 icon (mainly seen in UK and Ireland), which +was implemented in 5.01, is not implemented in 5.02 +

V5.17 01-06-01 +
V5.17 05-07-01 (ROM6?) +

    +
  • +Added support for Package M - Telekom Jingle - Operator specific ringing +tone
  • + +
  • +Changed language name spelling of Ukrainian language menu select
  • + +
  • +Operators language files updated.
  • + +
  • +Use one sort order for all languages in Q and S pack. Still problem with +the letter "Q" in language pack Q!
  • + +
  • +Startup texts/graphics priority changed to: 1 User Welcome Note Text, 2 +Dealer Welcome Note Text, 3 User Welcome Note Graphics.
  • + +
  • +A "DDI Call Create" message on the Fbus (typically used in STP) cause 6210 +SW crash.
  • + +
  • +When a busy number was called twice the third CALL_CREATE_REQ is not responded +in any way
  • + +
  • +Resets with WAP browsing and bookmark operations
  • + +
  • +Strange behaviour when entering number +SEND to PIN query in startup
  • + +
  • +Wrong font used for DTMF numbers when call is accepted. Now corrected to +bold 8pt.
  • + +
  • +An unknown DTMF tone is sent at the pause when using carkit.
  • + +
  • +TWIN-BILL SIM Causes "SIM REJECTED" Error message when entering wrong PIN +code.
  • + +
  • +Heavy load of phone entries from AT command interface resets phone.
  • + +
  • +Incorrect sub_block length in PND_NAME_FIELD
  • + +
  • +Indications ordered from STP are not unsubscribed/cancelled when phone +is disconnected, causing garbage in data calls.
  • + +
  • +Wrong line 2 icon problem.
  • + +
  • +Car radio mute when voice dialling.
  • + +
  • +New features: WAP over USSD enabled.
  • +
+Note: To restore WAP Bookmarks, WinTesla version 311.06.00 or later must +be used! +

(V4.27) New netmonitor test +95 and 130 (for Bluetooth) +

Note (probably for ALL firmware versions): light sometimes doesn't turn +on, when keypad is locked and power button pressed (like in older models). +For me is NOT BUG. It's rather feature, which allows to save some energy. +It happens (light doesn't enable), when: +

    +
  1. +keypad is locked
  2. + +
  3. +any key is pressed and "Press unlock and then *" or "Now press *" message +will disappear
  4. + +
  5. +power key is pressed
  6. +
+Press notice, that light is always enabled after pressing power key then, +when message "Press unlock and then *" or "Now press *" is displayed. Because +of it I think, it's good feature, which saves energy after accidentaly +pressing this key (when press fast any key and power button or fast double +power button, light is enabled). +

BUG: +

    +
  • +when change caller group data and set incorrect (not existing in this model) +ID for ringtone, it's not possible to change it from phone's menu. Bug +existing for example, when upload backup data made in other model to it.
  • + +
  • +when have "Pending" delivery report, phone shows different contents (with +"Pending" you have many strange chars)
  • + +
  • +PL specific: niedok³adne t³umaczenie w pomocy do Menu 3 (wykrzystania) +and Menu 6 (opcja dla dwu graczy)
  • +
+V5.27 01-08-01 +
    +
  • +Improvements on key lock in combination with car kit. Keyboard will now +lock correctly when removing the phone from car kit
  • + +
  • +Improved functionality when enabling frequency hopping
  • + +
  • +Improved speed for network search after power on, in a country different +from the one where the phone was turned off
  • + +
  • +Improvement to IR after sending a business card to 9110
  • + +
  • +Dealer Welcome Note remains after the user has restored factory settings
  • + +
  • +Improvement to SMS: pressing * in SMS options insert template does not +any more stick the menu
  • + +
  • +Voicetags improved restoring from PC
  • + +
  • +Improved Data Download via SMS Cell Broadcast
  • + +
  • +Call Barring service string accepts now an empty password
  • + +
  • +SS requesting disabled, when a SIM has not been inserted
  • + +
  • +Operator list updated:
  • + +
      +
    • +New operators
    • + +
        +
      • +"SPACETEL" (417/02)
      • + +
      • +"VUT SMILE" (541/01)
      • + +
      • +"GH-MOBITEL" (620/03)
      • + +
      • +"ORENSOT" (250/11)
      • + +
      • +"VODAFONE" (276/02)
      • + +
      • +"TR AYCELL" (286/04)
      • + +
      • +"CU/C_COM" (368/01)
      • + +
      • +"U-CALL" (539/01)
      • + +
      • +"GAB TELECEL" (628/02)
      • + +
      • +"CELLCO" (630/05)
      • + +
      • +"Digicel" (706/02)
      • +
      + +
    • +Operator names changed
    • + +
        +
      • +Old New
      • + +
      • +"Dutchtone" "Orange NL" (204/20)
      • + +
      • +"ERA GSM" "Era" (260/02)
      • + +
      • +"TH WCS" "TH ORANGE" (520/10)
      • +
      + +
    • +New country name
    • + +
        +
      • +"VUT" (417)
      • +
      +
    +
+Note 1: When flashing 05.27 into a phone, that has never been in service +in normal network (e.g. a swap phone or other brand-new phone), flashing +might not terminate correctly. This can be avoid by letting the phone to +go into service before flashing or by using a normal SIM card (not test +SIM) in the phone during flashing. +

Note: To restore WAP Bookmarks, WinTesla version 311.06.00 or later +must be used! +

V5.36 +
When flashing 05.36 into a phone that has NEVER BEEN IN SERVICE ON +A LIVE NETWORK (e.g. a swap phone or other brand new phones) the flashing +might not terminate correctly. The problem only occurs when using WinTesla +for flashing. A work around for this problem is to make the phone go into +service before flashing or having a live SIM in the phone while flashing.  +

In order to restore WAP Bookmarks, the latest WinTesla version (311.06.00) +must be used!  +

    +
  • +Changes to operator and country names: 
  • + +
      +
    • +New operator: 
    • + +
        +
      • +XFERA (214/04)
      • + +
      • +TELE2 (246/03)
      • + +
      • +MCM (262/13) 
      • + +
      • +Quam (262/14) 
      • + +
      • +SI VEGA 070 (293/70) 
      • + +
      • +Telcell GSM (362/51) 
      • + +
      • +UTS (362/91) 
      • + +
      • +PK-UFONE (410/03) 
      • + +
      • +SyriaTel (417/93) 
      • + +
      • +DIGITEL (515/05) 
      • + +
      • +ORANGE (520/99) 
      • + +
      • +FSM Telecom (550/01) 
      • + +
      • +OTA NET (603/02) 
      • + +
      • +GAMCEL (607/01) 
      • + +
      • +ECONET NG (621/20) 
      • + +
      • +NG NITEL (621/40) 
      • + +
      • +COG LIBERTIS (629/10) 
      • + +
      • +MOBITEL - TZ (640/02) 
      • + +
      • +CELTEL TZ (640/05) 
      • + +
      • +Itineris RUN (647/00) 
      • + +
      • +F-OMT (647/02) 
      • + +
      • +Cell C (655/07) 
      • + +
      • +PORT-HABLE (722/35) 
      • +
      + +
    • +Name changed: 
    • + +
        +
      • +AIRTEL -> E VODAFONE (214/0 
      • + +
      • +Orange -> orange (228/03) 
      • + +
      • +TDK-MOBIL -> TDC MOBIL (238/01) 
      • + +
      • +mobilix -> Orange (238/30) 
      • + +
      • +Q GSM -> TELE2 (248/03) 
      • + +
      • +TELECEL -> P VODAFONE (268/01) 
      • + +
      • +AMERIS -> F-Orange (340/01) 
      • + +
      • +INA SPICE -> INA AIRTEL (404/31) 
      • + +
      • +M.PLUS -> BATELCO (426/01) 
      • + +
      • +DiGi 1800 -> DiGi (502/16) 
      • + +
      • +EXCELCOM -> proXL (510/11) 
      • + +
      • +ORANGE -> Orange (520/99) 
      • + +
      • +OMEGA -> LoneStar (618/01) 
      • + +
      • +CAMNET -> MTN CAM (624/01) 
      • + +
      • +CELLCO -> CELLCO GSM (630/04) 
      • + +
      • +Itineris RUN -> Orange re (647/00) 
      • +
      + +
    • +New country name: 
    • + +
        +
      • +NA (362) 
      • + +
      • +PK (410) 
      • + +
      • +FSM (550) 
      • + +
      • +GMB (607) 
      • + +
      • +ARG (722) 
      • + +
      • +BRA (724) 
      • +
      + +
    • +Country name changed: 
    • + +
        +
      • +NIG -> NG (255) 
      • + +
      • +NA -> ANT (362) 
      • + +
      • +F -> REU (647) 
      • +
      +
    + +
  • +Improper UI-disconnection of data cable causing IrDA to disconnect corrected. 
  • + +
  • +Locked UI while in call on Mobilkom Austria network using A1 Plus SIM corrected. 
  • + +
  • +Missing Chinese punctuation characters in WAP corrected. 
  • + +
  • +Problem with Phone Book reading via AT commands corrected. 
  • + +
  • +Problem with SMS indicator reading via AT commands corrected. 
  • + +
  • +Chinese sorting in Phone Book when using the letter Q improved. 
  • + +
  • +Wrong text in Call Cost Limit query corrected. 
  • + +
  • +Problem with making calls from Name&Number display in Arabic corrected.
  • +
+V5.44 29-11-01 +
  +
    +
  • +Possibility of acoustic feedback from keypad and warning tones in HFU-2 +reduced. Typically that feedback appeared when the car radio speakers were +used for phone audio 
  • + +
  • +Handling of long numbers in the Abbreviated Dialling 
  • + +
  • +Number list on SIM improved. The last digit of a very long number string +might have changed in some cases 
  • +
+V5.56 25-01-02 +
    +
  • +Improvement to Network Identity over the air in NITZ (Network Identity +and Time Zone)
  • +
+ +


+


+
Note: +
    +
  • +after changing SIM card memory type is set to "SIM card". Correct it manually +or set security level to "phone" (when SIM card was used earlier, memory +type won't be changed).
  • + +
  • +after calling WAP WAP access number is added to Called Numbers
  • +
+BUGS: +
    +
  • +Menu shortcuts problem: Menu 1-8-x (example Menu 1-8-7) directs +to Menu 1-8-1
  • + +
  • +Shortcut Menu 2-5-1-1-1 hangs phone !
  • +
+ +
+
According to some WWW sites phone seems to work with firmware from +Nokia 6250. (The only ?) known problem is weak 1800Mhz coverage (probably +calibration info is saved in different place). I don't have any other info, +do not ask me.
6250NHM-3*#0000#
V1C54 23-02-00 +
V3.00 15-09-00 +
V3.12 08-11-00  +
    +
  • +(V3.00) Improvement in weak field
  • + +
  • +(V3.00) Improvements to sound level meter and keyguard code
  • + +
  • +(V3.00) Service dialing numbers in SIM read correctly
  • +
+V4.00 06-12-00 +
    +
  • +Improvements to Task Journal:
  • + +
  • +Searching 'by customer' was shown 'by work'
  • + +
  • +Default value was missing when entering amount of materials
  • + +
  • +Flaw in information note when pausing a task
  • + +
  • +When entering the material id, last given id is being default
  • + +
  • +Shortcuts did not work
  • + +
  • +SMS sending did not work with special characters
  • + +
  • +Arabic SMS sending couldn't turn up and down the pages
  • + +
  • +Wrong number font in language packages R and S
  • + +
  • +Phone came from clock menu to Automatic keylock -menu with 'Back' button
  • + +
  • +When adding comment there was text 'OK' instead of 'Save' in left softkey
  • + +
  • +Speed dial names touched service/battery bar
  • + +
  • +Improvements to Automatic keylock:
  • + +
  • +Keypad was locked while in menu
  • + +
  • +Strange behaviour when simultaneous alarm and calendar remainder
  • + +
  • +In Stopwatch shortcuts did not work
  • + +
  • +Charger activated and deactivated the vibra
  • + +
  • +Keyguard not activated when timed profile & missed calls
  • + +
  • +Improvement to Arabic/Hebrew Memory status layouts
  • + +
  • +Improvements to Voicetags
  • + +
  • +Improvements to SMS
  • + +
  • +Only one indicator is at the end of Selection window when moving to second +candidate first time in the editing mode
  • + +
  • +Input method indicator in top left corner is disappeared in Rename operation
  • + +
  • +DLR-3 is detected as a headset after one headset call
  • + +
  • +UNICODESIM: SDN only names of length less than 8 are shown
  • + +
  • +Improvements to browser setup: - "Menu" -> "2" -> "Scroll" corrected
  • +
+V4.01 28-12-00 +
    +
  • +Timed profile now stays activated after power off/on
  • + +
  • +Impression to be able to same more than 250 names corrected
  • + +
  • +Wrong header text in stopwatch erasing in some languages ("Erase times") +corrected
  • +
+V4.04: +
    +
  • +Improvements in SMS: phonebook memory re-configuration
  • + +
  • +Improvements in Task Journal: "Task active on background" notification +now displayed also when exiting the Task Journal by pressing "Back"
  • + +
  • +Display contrast factory default value changed from 6 to 4
  • + +
  • +Improved Keylock code shortcut
  • + +
  • +Operator name list updated (Cosmorom / Romania)
  • +
+V4.05 +
    +
  • +Turkish, Greek, Czech and Polish T9 added
  • + +
  • +LCD temperature compensation
  • + +
  • +LCD reset after powerup
  • + +
  • +Spaces couldn't be put in front of text in Dealer Welcome Note (DWN)
  • + +
  • +PIN-code couldn't be entered on a SIM-locked phone
  • + +
  • +It wasn't possible to call a SS string beginning with a "*" (e.g. *#61# +etc.) stored on the FDN phonebook
  • + +
  • +Setup Menu command was not executed when already in SIM ATK menu
  • + +
  • +SIM ATK minimum polling interval increased from 5 to 10 sec
  • + +
  • +Improvements when trying to enter username in HTTP authentication
  • + +
  • +Dynamic text case handling improved
  • + +
  • +Timeout killer didn't work on *+-key in number queries
  • + +
  • +Games 'options' -menu disappeared when deleting delivery report in messages
  • + +
  • +Missing/strange menu items when sending SMS
  • + +
  • +In SMS: Improvements to calendar when using fetch service with birthday +note
  • + +
  • +In SMS: Improvements when selecting Multiple copies
  • + +
  • +In SMS: Improvements when storing more than 50 items in the Template folder
  • + +
  • +Improved functionality in Names-list
  • + +
  • +If T9 is active '#'-key toggles now between T9 and normal input in Arabic/Hebrew +and Chinese languages
  • + +
  • +Improved business card sending
  • + +
  • +No characters were received if Euro-sign was first character in a picture +message
  • + +
  • +Improvements to Voice tag
  • + +
  • +Correction of Arabic Name & Number view, RTL marker inserted
  • + +
  • +Correction of number length for Idle number input
  • + +
  • +Handling of operator logo length improved
  • + +
  • +AT commands updated
  • + +
  • +Initialisation of Data SW when receiving/releasing the data switch
  • + +
  • +Fixed Dialling Numbers - View details shows wrong number if it is longer +than 12 digits. Although SSC-String for call forwarding is on FDN list, +call forwarding can not be performed either via menu or via string
  • + +
  • +Flashing panel when erasing a phonebook item
  • + +
  • +Earlier it was impossible to call to SMS 'use number'
  • + +
  • +Improved SMS Delivery reports
  • + +
  • +Wrong indication of max characters in SMS
  • + +
  • +Font size selection not working for received SMS
  • + +
  • +Error in DLR-3 usage in the middle of the IR usage
  • + +
  • +Modified AT commands for DHU functionality (TCH Loopback)
  • + +
  • +Automatic answer does not work in car profile
  • + +
  • +Some spelling in languages improved
  • + +
  • +Call without simcard, note "Emergency calls only" won't disappear
  • + +
  • +Freezes when faulty Business Card is received
  • + +
  • +Possible to switch phone off during keypad is locked
  • + +
  • +Updated MoU list (DUAL_operators)
  • + +
  • +SIM ATK: submenus become trash
  • + +
  • +Cancel all CF's at once:
  • + +
      +
    • +Performed on Line1: If CFU for Line2 is activated the sign is deleted too
    • + +
    • +Performed on Line2: CF's for Line1, data and fax are cancelled: Line2 not +affected
    • +
    + +
  • +*#06# should show IMEI even when SIM card is not inserted
  • + +
  • +USSD short strings supported
  • + +
  • +STP support (e.g. used in Mercedes)
  • + +
  • +CLI logo over IR send/receive
  • + +
  • +Ringing tones over IR - receive
  • + +
  • +Shortcut on 'Send' for go to bookmark
  • + +
  • +In Task Journal: User data memory reconfiguration (now more space for user +data)
  • + +
  • +Reconfiguration to language packages:
  • + +
      +
    • +LP C: Turkish T9 added, Spanish menu and T9 removed
    • + +
    • +LP F: Greek T9 added, Spanish T9 removed
    • + +
    • +LP H: Czech T9 added, German T9 removed
    • + +
    • +LP I: Russian menu removed
    • + +
    • +LP J: Polish T9 added, German menu added
    • + +
    • +LP L: created for Spain and Portugal
    • +
    + +
  • +New text release 130301
  • +
+V5.00 10-07-01 (ROM6?) +
    +
  • +Mainly update to get GCF approva
  • + +
  • +Operator max. name lenght change 11 a 1
  • + +
  • +SIM Poll Interval chang
  • + +
  • +New text release 160301
  • + +
  • +Dual Operator list update
  • +
+V5.02 +
    +
  • +SMS sending improved (SMS sending jammed occasionally)
  • + +
  • +Light stayed on occasionally
  • + +
  • +Improvement to alternate speech-fax call
  • + +
  • +O- language package added
  • + +
  • +Operator list updated (#44)
  • +
+V5.03 06-12-01 +
+
+
Menu 14 (Netmonitor) doesn't have picture
6310NPE-4*#0000#
V1.23 19-03-01 +
V4.10 04-01-02 +

BUGS: +

    +
  • +the phone crashed when i recorded a second voice message after an older +one which is 1 minute of length. after i did that, i couldnt delete the +second recording, and the screen would turn black.. another [ok] and the +phone would restart.
  • + +
  • +It seems incompatible with 32k sim. (Nokia says 32k SIM are incompatible +with operator TIM and OMNITEL)
  • + +
  • +Some other bugs are related to use of car-kit (CARK-91), as strange "echo", +when navigating in menus sometimes the phone enable external speaker and +disable the "radio/stereo .."
  • +
+V4.15 +
    +
  • +RS232 Serial Cable connection improved (connection did not work properly +during startup) 
  • + +
  • +Wakeup graphics implemented (support for operator variants added) 
  • + +
  • +When voice dialled in a car, the radio did not mute 
  • + +
  • +Memory improvements 
  • + +
  • +Long pressing power button first turned phone off and then on. Now no matter +how long time the power button is pressed to turn off the phone, the phone +stays off. 
  • + +
  • +Support for Language package T (Australia and New Zealand) added 
  • + +
  • +Support for Arabic UI added 
  • + +
  • +Improvements to SMS
  • +
+BUGS: When send business card over SMS or infrared, name is changed.
6510NPM-9*#0000#350697
V3.22 10-01-02 +
V3.30 30-01-02 
+Back to the top/Na pocz±tek +

+


+ + + + diff --git a/Docs/en_US/gsm/firmware/firm7.htm b/Docs/en_US/gsm/firmware/firm7.htm new file mode 100644 index 0000000..6c00eb3 --- /dev/null +++ b/Docs/en_US/gsm/firmware/firm7.htm @@ -0,0 +1,1098 @@ + + + + + + + + + + + Nokia identification & firmware/Identyfikacja i oprogramowanie telefonów Nokia + + + + + + +
+


Nokia identification & firmware/Identyfikacja +i oprogramowanie telefonów Nokia

+ +

+


+
    +
  1. +Ogólne b³êdy/General bugs
  2. + +
  3. +Ogólne informacje o IMEI/General info about +IMEI
  4. + +
  5. +Czy mogê wgraæ sobie oprogramowanie/Can I download +firmware to my phone ?
  6. + +
  7. +Czy to kosztuje ?/Does it cost ?
  8. + +
  9. +Gdzie tego dokonaæ ?/Where to make it ?
  10. + +
  11. +Jakie s± b³êdy/zmiany w kolejnych wersjach +?/What are bugs/changed things in next versions ?
  12. + +
  13. +Jak zmieniæ wersjê jêzykow±?/How to change +language in phone ?
  14. + +
  15. +U¿yte materia³y/Information sources
  16. +
+ +
+
+

Here is table describing firmware in various Nokia 7xxx phones +
You can also see table for +
Nokia 1xxx/2xxx, Nokia +3xxx, Nokia 5xxx, Nokia +60xx/61xx, +
Nokia 62xx/63xx/65xx, Nokia +7xxx, Nokia 8xxx, Nokia +9xxx

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Phone (telefon)Model number (Oznaczenie)Firmware version code (kod do sprawdzania wersji oprogramowania)TAC in IMEI (TAC w IMEI)
7110NSE-5*#0000#448895
V4.07 20-10-99 +

Internal Nokia test version +
Wersja testowa Nokii +

V4.51 18-06-99 +
V4.58 14-07-99 +
V4.61 23-08-99 +
V4.62 24-08-99 +
V4.67 28-09-99 +

First shipping version of the software. +
Pierwsza wersja oprogramowania w sprzedawanych telefonach. +

V4.69 05-10-99 (not in German language) +

Improvements in WAP browser (with WML) +

V4.70 28-10-99 +

    +
  • +If you setup your phone in mode "silent", and you have an alarm set up, +the phone ring at preset time.
  • + +
  • +if you receive a call from a CLI ending with '0' (zero),  the phone +doesn't display the name of caller.
  • + +
  • +If you setup the "navy roller" to "last (AS: dialed ?) calls", some times +the display remain blanks, and you have to close/open the flip.
  • + +
  • +No 'R' (roaming indicator) in NetMonitor
  • +
+V4.72 10-11-99 (not in German language) +
V4.73 15-11-99 +

(V4.70) BUG REMOVED: Earlier: Max. 12 messages can be stored in self +created SMS-folders. +

V4.75 23-11-99 or 07-01-00 +

V5.11 16-12-99 +

Internal Nokia test version +
Wersja testowa Nokii +

V4.76 13-01-00 +

(V4.73) Improvement to Manual Network selection search +
(V4.73) Poprawiono wyszukiwanie sieci przy rêcznym ich wyborze +

(V4.73) Improvements to CLI Graphics: +
(V4.73) Poprawki nastêpuj±cych b³êdów: +

    +
  • +CLI group tone can't be changed
  • + +
    D¼wiêk nie mo¿e byæ zmieniony w grupach osób +
      +
  • +Can't make call by pressing "send" key in CLI member list
  • + +
    Nie mo¿na zadzwoniæ przez naci¶niêcie "wy¶lij" w menu grupy osób cz³onkowie +
      +
  • +"End" key doesn't work right in Caller Group General Note
  • + +
    Klawisz "Koniec" nie dzia³a poprawnie w ogólnych notatkach grupy osób +dzwoni±cych +
      +
  • +Phone reset when there are two or more active downloaded ringing tones +in Caller groups
  • + +
    Telefon siê resetuje, gdy s± dwa albo wiêcej wgranych przez u¿ytkownika +dzwonków w grupach osób dzwoni±cych +
      +
  • +CLI group tones list problems
  • + +
    Problemy z list± dzwonków grupy (pozycje s± przesuniête - po wybraniu +jakiego¶ telefon faktycznie ustawia kolejny na li¶cie)
+(V4.73) The Call Waiting functionality in the car kit is now improved concerning +radio mute +
(V4.73) Poprawiono funkcjê po³±czeñ oczekuj±cych w zestawie samochodowym +

(V4.73) Dialled numbers removed in Roller menu. +
(V4.73) Wybierane numery zosta³y usuniête z Roller menu. +

(V4.73) The user is now able to insert a phone number into a SMS message +by searching the phonebook for the number. +
(V4.73) U¿ytkownik mo¿e teraz wstawiæ numer telefonu do wiadomo¶ci +SMS przez znalezienie go w ksi±¿ce telefonicznej. +

(V4.73) Improvement of Calendar using am/pm clock +
(V4.73) Poprawki w kalendarzu przy u¿ywaniu 12-godzinnego formatu czasu +

(V4.73) Improvement of speed dial function when same name is assigned +to speed dial twice +
(V4.73) Poprawki w funkcji szybkiego dzwonienia, gdy ta sama pozycja +jest przypisana do dwóch klawiszy szybkiego wyboru. +

(V4.73) BUG REMOVED: Earlier: +

    +
  • +"?" (Euro) and "\" are converted to space characters when storing or sending +a SMS
  • + +
  • +when you write a SMS and select "insert number" from menu and select the +number from addressbook, phone displays
  • + +
    strange characters on soft keys and go locked for some minutes/sometimes +self-reset after 1-2 mins.To unlock, you should remove battery. To avoid +this bugs you should select "insert number", then select the name from +addressbook and then goto "options", "display details", select the "number" +then "select" it. +
  • +If you're activting IR-receive, yo'll get a error ""remove datacable"" +even it is not connected."
  • + +
  • +When deleting an entry from a call register list and closing the slide +while the deletion is in progress (after 'ok') the phone hangs up when +changing the menukey from 'Lock keys' to Menu'.
  • + +
  • +When deleting a space before a uppercase char with active T9-dictionary, +the char will be changed to lowercase
  • + +
  • +Clock: hour/minute separator "." instead of ":"
  • + +
  • +Sometimes when sending a SMS: SMS get sent (will be received, too), phone +is crashing. Remove battery, afterwards the SMS isn't in the outbox. Maybe +more often when sending sms to more receivers. At power-up alleged no PIN-request.
  • +
+BUG (ONLY THIS VERSION): Crash with deactivated PIN-request +

BUGS: +

    +
  • +keyboard is locked, when delete not answered calls or inside WAP services
  • + +
  • +phone is locked after first WAP session
  • +
+V4.77 25-01-00 +

BUG FIXED: "Clear operator logo" works now (from Operator Logo Uploader). +

BUG REMOVED: Earlier: Cell Broadcasts: Settings are cleared after power +cycling. +

BUGS: +

    +
  • +there is a problem with name of caller groups, i.e. you can change or add +the group name, but when you select it inside other menus, the phone doesn't +display the added group.
  • + +
  • +if you select "vibra-call", you cant ear the ring-tones until you select +a group without vibra-call.
  • +
+V4.80 23-02-00 +

Improvement of browsing after ending an incoming call. +

Wakeup Graphic is now maintained after 'Restore Factory Settings'  +

Changed ringing tones - Grande Valse renamed to Nokia tune  +

Phone alert for a future calendar note, which has been transferred during +flashing, is now improved. +

Improvement of birthday notes expiry when having birthday notes in the +past. In previous release two birthday notes were shown if having note +in the past and other note expires. +

OTA ringing tones is not playing continuously after being saved.  +

Tone loop with OTA tones. OTA tones are now being played in full length +when it is being tested in profiles.  +

Indication of incoming FAX call improved. +

Profile dependant indications is now corrected. e.g. Beep in Meeting +Profile. Earlier: If you setup your phone in mode "meeting" (with "Bip +x 1") and there is incoming call from a "group different" from the default, +the phone ring with the melody selected for that group. +

Ringing Tone Check in Profile setting is now also only played twice +as an example when the phone is 'charging' or another message is displayed.  +

BUG REMOVED: Earlier: +

    +
  • +In the profile "Conference" calls , that numbers are in a callergroup, +are ringing not "short", but normal. Looks like the previous used profile's +settings are used again.
  • + +
  • +In profile "Quiet": phone is ringing at calendar-appointments. Should be +quiet, too. "Conference" is ok (short tone)
  • + +
  • +In firmware 4.76 and 4.77 (4.73 and earlier were OK)  phone crashed +when received more (3) Vcards or calendar-appointments over IR
  • + +
  • +(V4.70) After removing the battery, the currency and unit-settings are +lost often.
  • +
+BUGS: +
    +
  • +if you reach pos 129 in PHONE MEMORY, the phone doesn't recognize numbers +and name and groups. if you activate the SIM, all is OK.
  • + +
  • +THIS bug is related to 4.80, not to 4.70:
  • + +
      +
    • +assign name X to a mem pos. Y and a phone number N
    • + +
    • +change the phone number of X to M
    • + +
    • +try to call X with speed dial Y
    • + +
    • +the phone call the number N
    • +
    +
+V4.84 07-04-00 +

Improvement to Advice of Charge. Charging on prepaid SIM cards is now +improved +

Improvements to Manual Network Selection +

Improvement to Operator Logo in display. The operator logo is now shown +when the service provider is read from SIM +

Call waiting tone can now be heard in silent mode +

Longer vibrating time. When phone is in "Beep once" mode and vibra is +on, the phone will now vibrate 250 times before stopping +

Animation in Services menu too fast. Changed timing from 125 to 160 +milliseconds +

Improvement to warranty transfer of WAP settings +

Car Radio Mute is now activated when continuing a handheld call in the +cradle (car kit) +

(NEWER TOO ?) BUG: Send a calendar note from Nokia 6110 via a SMS to +your 7110. The calendar in 7110 will stop showing calendar notes... +

Test for size of SMS memory (from http://www.vosper.prv.pl): +
SMS messages - 47 in different folders +
Templates - 10 +
Delivery reports - 36 +
Additional folders - 2 +
After 39 SMS phone deactivated function Move ! +
Full size of memory is 93 (including 10 templates)  +
------- +
Second test for SMS only: 84 SMS + 10 templates +

BUG REMOVED. Earlier: +

    +
  • +Vibration is running in the rhythm of the music, at very quiet or short +ringtones it is vibrating extrem short or not at all
  • + +
  • +(V4.70) After disconnecting battery (without power-off) the volume is often +set to standard.
  • +
+V4.85 +

Info from  http://www.linux.org.uk/diary/: +Seems firmware 4.7x randomly dies on some AT commands. With 4.85 wait for +'OK' then delay 1/10th second before sending a command. If you imediately +respond to OK with a reply the phone misses it. +

V4.88 19-06-00 or 16-06-00 or 02-06-00 +

(V4.84) User setting transfer improved (Permanent Memory Management +update). All data saved apart from wake-up graphics +

(V4.84) Test for size of SMS memory (from http://www.vosper.prv.pl): +
SMS messages - 62 in different folders +
Templates - 10 +
Delivery reports - 18 +
Additional folders - 2 +
After 49 SMS phone deactivated function Move ! +
Full size of memory is 90 (including 10 templates)  +
------- +
(V4.84) Second test for SMS only: 80 SMS + 10 templates +

BUG REMOVED: Earlier +

    +
  • +The phone freezes sometimes, when assigning rintones to callergroups. Maybe +depending somehow on the settings of callergroups and groupgraphics. Sometimes +continue after 1-2 mins. Maybe better results when using the power-key +than with Menu 3.
  • + +
  • +"Opposite: the levels are in wrong order (1-3-4-2; 2 is the most complicated +one)"
  • +
+ +


(V4.80) BUG REMOVED: Earlier: +

    +
  • +Names of loaded ringtones were shown as rectangles sometimes, i.e. after +a firmwareupgrade, when ringtones were deleted, but the callergroups still +pointed to them.
  • + +
  • +""Confirmations of SIM service actions"" is not working sometimes, although +enabled - phone is sending SMS without asking.
  • + +
  • +Reminder-alert rings loud even while doing a call.
  • +
+(V?.??) BUG REMOVED. Earlier: "No connections possible after a Wap-Call +(for approx. 15 min), although receiving-level is up. Alleged the phone +is still sending then (noticeable on the noise in a radio). If you have +a failed login attempt ('no response' or 'page cannot be displayed') only +?  +

Changed text while sending SMS +
from +
letter bar (shorter) +
Sending +
message +
to +
letter bar (longer) +
Sending message +

BUGS: +

    +
  • +it seems the a received call from a CELLULAR number ending with '0' (zero), +is not recognized from the phone, but if you received a call from a NON +CELLULAR number all is OK. Appears as if incoming call as CLI of 11 digits, +they arent't recognized.
  • + +
  • +if you are playing a game, and there is an incoming call, the phone reset +itself.
  • + +
  • +Rarely, when arrive an incaming call, the phone reject the call and lock +up the keyboard, if it wasn't already locked.
  • +
+V4.94 02-10-00 or 27-09-00 or 28-09-2000 +

Carkit Audio optimisation +

Text files in language packages updated (localised group names, ...) +

IRDA data transmission improved +

Correction to Viag Homezone +

Operator list updated +

Update of WAP browser: +

    +
  • +Handling of "No cache" and "Redirect" commands
  • + +
  • +Handling of WAP session after an incoming call
  • + +
  • +Handling of <onenterforward> command
  • + +
  • +Handling of long URLs
  • + +
  • +Handling of HTTP post size limitation
  • + +
  • +Handling of deep navigating
  • +
+Now max. 838 chars (earlier only 160) can be written into inputfields... +

Update of SIM handling SW, including SIM ATK corrections +

BUG: In WTLS mode sends an additional byte in the Client-KeyExchange +packet. Some WAP gateways seem to have a workaround for this bug (E-Plus +works, Debitel not). Netlife WAP-Server has a workaround too... +

Can render tables in WAP now. +

Jeden z u¿ytkowników na polskich grupach dyskusyjnych porówna³ j± ze +starszymi wersjami tak: +
One of 7110 compared it to the earlier firmware: +

    +
  • +WAP browser organised like in N6210
  • + +
    W³a¶ciwie przegl±darka WAP zorganizowana jest podobnie, a w³a¶ciwie +chyba tak samo jak przegladarka WAP w N6210. +
  • +added <CENTER> support
  • + +
    Dodano obs³ugê tagu <CENTER> +
  • +Added function "Go to the address" in menu
  • + +
    Dodano mo¿liwo¶æ wpisania adresu strony bezpo¶rednio z menu (wcze¶niej +trzeba by³o najpierw za³o¿yæ zak³adkê) - opcja "Id¼ do adresu" +
  • +You can NOT LOAD images - new Menu 10-3-2 (previous 10-3-2 +moved to 10-3-3) Appereance settings with Show Images +Yes/No
  • + +
    Dodano mo¿liwo¶æ NIEWCZYTYWANIA grafiki - opcja w nowym Menu 10-3-2 +
  • +Image can be link
  • + +
    Dodano obs³ugê grafiki jako linka +
  • +When phone read pages, you don't see "snake" and "Connecting with...", +but globe
  • + +
    Podczas wczytywania stron nie pojawia siê "wê¿yk" i napis "³±czy siê +z us³ugami" tylko w prawym górnym naro¿niku globusik +
  • +WAP connections are MORE STABLE
  • + +
    generalnie DU¯O STABILNIEJSZE po³±czenia WAP ni¿ dotychczas +
  • +Can send and receive bookmarks in WAP settings
  • + +
    mo¿liwo¶æ wysy³ania i odbierania zak³adek w ustawieniach WAP
+Test for size of SMS memory (from http://www.vosper.prv.pl): +
SMS messages - 128 in different folders +
Templates - 10 +
Delivery reports - 52 +
Additional folders - 3 +
Phone didn't deactivate function Move ! +
Full size of memory is 190 (including 10 templates)  +
------- +
Second test for SMS only: 142 SMS (or more - test wasn't end) + 10 +templates +

(V 4.88) BUG REPAIRED: In older versions more numbers for one name broke +call with Green button: +

    +
  1. +Add more numbers to one name (standard number other than type 'general').
  2. + +
  3. +Change "Type of view" to "Name and number".
  4. + +
  5. +Press Green button (Call) or the NaviRoller long with this number.
  6. + +
  7. +Phone "starts" to call, but instead of printing the number, it prints only +name and after few seconds it returns to name.
  8. + +
  9. +Go to "last calls" (or "Redial" and "Options - Edit Number").
  10. + +
    The called name has number starting with "/".
+Solution for it was: use the NaviRoller 2 times to get through the menu +

BUG REMOVED: Earlier: +

    +
  • +When made these steps: Receiving Vcard - show - break off by closing slide +-> the Vcard-name appeared in some menus, until power cycling (i.e. in +a SMS-folder, while the display is building up a SMS, in the top line, +instead of the SMS-title)
  • + +
  • +When a number, which was assiged to a speeddial, was deleted, the speeddial +remained and pointed to nothing. When called such a speeddial the phone +crashed sometimes (after the Error message "Number missing").
  • + +
  • +When deleting a phonebook-entry with a assigned speeddial (but let the +name itself stored), pressing the NaviRoller (set to speeddial), and closing +the slide while the "Number missing" Message is displayed, the display +gets empty when the slide is closed and the Text has changed from "Lock. +Keys" to "Menu". When someone calls, the display gets on again. Ok after +powercycling.
  • + +
  • +Assigning ringtones to callergroups after a firmwareupgrade: sometimes +some of the ringtones are deleted, but the callergroups and profiles still +pointing to them -> Phone crashes when trying to assign the tones.
  • + +
    Solution for it was: assign all profiles and callergroups to a standard-tone, +power cycle the phone, load the individual 5 tones new, and assign profiles +and groups new. +
  • +If you renamed group, the old (preset) name was still shown in menus (i.e. +"Alert for").
  • + +
  • +"?" (Euro) and "\" in the SMS listview are shown as rectangles.
  • + +
  • +When entering CAPTIALS with active T9-dictionary, and a word with the german +Umlaut ""ß"" is found, this letter is leaved noncaps.
  • + +
  • +After Wap access sometimes the display gets empty when the slide is open, +normal display only for a short time when it is closed. Ok after powercycling. +(i.e. when opening the 'suchmaschine' link at  <http://mopilot.com/wml/index.wml>)
  • + +
  • +Data-calls using IR breaks down after some Minutes (""IR connection lost""). +Alleged only when sending data, receiving works. Alleged ok, when using +a ir-speed of 9600 baud.
  • + +
  • +When security-level set to "Phone": you can't get the Memory Status (phone +answers with "protected memory"). When set to "Memory", it is possible. +Should be vice versa.
  • + +
  • +The call divertion icon is cleared after powercycling, or no service condition. +Appears again after status-check.
  • + +
  • +Autoanswer with the headset does not work if the keyboard is locked (altough +activated in the profile): in Menu 3-6-1-8, if you select YES, phone +DISABLE automatic answer, if you select NO, phone ENABLE automatic answer.
  • + +
  • +(was OK in V4.73 and earlier, not OK in 4.88) Closed user group: after +entering the groupnumber, the left OK-button doesn't work, only the NaviRoller.
  • + +
  • +(V4.80) german text wrong: "auf Netzant- wort <new line> warten" (english: +"Requesting")
  • + +
  • +if you disable the ringer and receive a SMS, the phone doesn't beep.
  • + +
  • +problems related to customs caller gruoup appears solved
  • + +
  • +"warning on incoming" call work ok also with "grouped" names.
  • +
+NaviRoller for Redialing (Menu 4-3-5) official not possible anymore since +FW v4.73 not possible again... +

Keyboard can only be locked after closing the slide with the Softkey +only, not anymore with the NaviRoller (like earlier). +

BUG (ONLY THIS VERSION): +

    +
  • +Changing a Speeddial-Entry with 'search' does not work (''selected memory +empty'). Deleting and assigning new works.
  • + +
  • +"WAP: Bug in relative URL's with leading ""/"": ""http://www.abc.com/""  +and the Link to ""/sub.wml"" targets to ""http://www.abc.co/sub.wml"""
  • + +
  • +Snake2: after playing, the cup is shown without the reached points.
  • + +
  • +Sending business cards: Option related to "full details" and "predefined +number" are inverted. (V04.88 doesn't have this bug)
  • +
+BUG (IN THIS AND NEWER VERSIONS): +
    +
  • +When receiving a SMS with locked keypad, unlock it, and immediately press +the left softkey, the phone shows the menu instead of the SMS. ('Menu' +instead of 'Show')
  • + +
  • +all (Infrared-) "Print" menu's are missing
  • + +
  • +If the keyboard is locked with "Menu *", it is not unlocked when opening +the slide.
  • + +
  • +SMS with more numbers - Options/Use number - Number is shown - Options/Add +to name: Namelist is empty and softkeys are not working
  • + +
  • +French language: reply text ""Sans/Avec"" in Jeux/Param?tres/Audio mixed +up (i.e. when selecting ""Sans"" the phone replys ""Avec Audio"") (Games/Settings/Sounds +On/Off)
  • + +
  • +Games: start-animation is not smooth
  • +
+V5.00 09-11-00 +

Improvements to Data/Fax call functionality +

Extended URL length +

Improved cache control (max age=0 functionality improved) +

Weak encryption (40 bit) now displayed correctly +

DTMF tones usable during emergency call +

Vibra settings adjusted (it doesn't enable/disable, when want) +

Improvements to the phonebook search function (use Search function and +press some key (phone will jump do the first entry starting with this char), +now use Delete function - cursor doesn't return to names starting on A) +

'PIN code request change to PUK code request after emergency call' corrected +

Games (two players): Text for winners/losers added +

Different alghoritms for games ? On the page http://www.vosper.prv.pl +you can find, how to win in Opposite in 4'th level in firmware 4.77, 4.84 +and 4.94. Author writes, that in 5.00 it doesn't work. +

(V4.88) Games: in Games menu have new setting, which can enable/disable +sounds (earlier you had to change it in settings of profiles) +

(V4.88): in WAP can enable wrapping long texts - new Text wrapping +On/Off option in Menu 10-3-2 +

(V4.88). BUG: when download correctly group logo to phone, right half +of first line to the bottom of the screen is clean.... +

(V4.88) if you receive SMS you CAN'T  type twice left function +key to get message, you HAVE to wait second between keystrokes. +

Test for size of SMS memory (from http://www.vosper.prv.pl): +
SMS messages - 112 in different folders +
Templates - 10 +
Delivery reports - 68 +
Additional folders - 2 +
Phone deactivated function Move after 171 SMS ! +
Full size of memory is 190 (including 10 templates)  +

(V4.88) Different menu: earlier in "Phonebook->Options" there was "Print" +function +

BUG REMOVED: Earlier: +

    +
  • +Vcard sent from 7110 to 61x0 with SMS is received as normal SMS instead +of a Vcard (mostly "not showable") Combinations 61x0 to 7110, 61x0 to 61x0 +and 7110 to 7110 worked OK in earlier versions.
  • + +
  • +When searching the phonebook, the displayed list should jump to the given +letters, but should not be filtered with them.(like on 2110 or 61x0). After +pressing 'options' and 'back', or waiting 30 seconds, the phone switches +into this mode. In this version the phone holds the position after clearing +the entry.
  • + +
  • +While playing games (ringtone and message alerts are beep once, light is +enabled), the lights turn off after few seconds when an SMS is received. +In this version game is interrupted...
  • + +
  • +(V4.88) If someone called you with CLIP active and you had no time to answer, +this call will be under Missed Calls, displayed with (no number). If you +try to erase it, over 50% chance will be that on display will be something +like (sequence of squares) and if you press Ok phone hangs. Only battery +removing helps.
  • + +
  • +(V4.88) in Norwegian language only: phonebook search with more than 1 char +will give a "No match" error-reply
  • +
+BUGS (which still exists): +
    +
  1. +It is not possible to add a pbx extention to a stored number.Only possibility: +call - hang up immediately - redial - options - edit number - correct - +dial
  2. + +
  3. +When editing names, after "Done" you're in the standby-mode, instead of +been put into the names-list. Very annoying when editing much names, one +after the other.
  4. + +
  5. +Vcard sent from 7110 to 61x0 with IR: german Umlauts incorrect (i.e. ä +-> =E4). Works with 61x0 to 7110, 61x0 to 61x0 and 7110 to 7110
  6. + +
  7. +Received Vcards are stored in the internal Phonememory, even when "SIM-Card" +is selected.
  8. + +
  9. +When keying in a character into a textbox (phonebook, WAP) using the num-keys, +and you want to key in the same character again, you'll have to wait until +the Cursor jumps to the next position, even when this 2nd input is done +using the naviroller. This must-wait is not necessary.
  10. + +
  11. +SMS-alert "Ascending" does not ascend, it is loud from the beginning, just +longer then standard.
  12. + +
  13. +Profile name is overwritten by the cell info (displayed in the same line, +although the display is big enough). On the 6150, 2 lines were used (as +long as the opeartor logo wasn't enabled).
  14. + +
  15. +Roller functions set to speeddial - select a name (Number is displayed) +- dial with pressing the NaviRoller twice shortly doesn't work (only with +green Key, or pressing the NaviRoller long).
  16. + +
  17. +Call waiting message is shown on the display, but the phone doesn't beep, +if number is assigned to caller group with caller logo. If caller group +logo is turned off, it works correctly.
  18. + +
  19. +(V4.94 and NEWER) Long names are clipped after the last visible blank space +since 4.94, if they are too long to display (i.e. in the quick-dial list). +Formerly the Names were simply clipped on the end of line. It's more 'pretty' +now, but longer names with same begin can't be told apart any more. Best +thing would be a automatic adjustion of the fontsize to the textlenght.
  20. + +
  21. +When the Phonebook is set to be viewed by "Name and Number", it's still +shown "Name only" when sending a SMS.
  22. + +
  23. +Press NaviRoller (set to "quick menu") 1x (Messages), press "Write", key +in something, press "Options" and "Send options" --> not working, you're +in writing mode again and only writing, deleting and red key are still +working
  24. + +
  25. +SMS: blank characters on the begin of a new line are not visible (i.e. +ASCII-Art SMS)
  26. + +
  27. +"SMS folders: lists are not sorted They are listed in the order, when the +SMS have been moved into the folder. But when some SMS have been deleted, +the 'gaps' are filled first."
  28. + +
  29. +"Moving and deleting of SMS templates doesn't work.When moving, a copy +is made. (""Delete"" should not be displayed, and instead of ""move"" ""copy +"")"
  30. + +
  31. +Cell Broadcasts: Settings are replacing the SIM-card
  32. + +
  33. +When the SMS-memory is full, and you try to store another SMS, you'll get +the errormessage "Sent, no space to copy" (although nothing was sent).
  34. + +
  35. +When Alarm is on, the phone does a short slight beep at midnight, if it +is switched off. After that, it can't powered on for about 20 seconds.
  36. + +
  37. +sending groupgraphics via IR should be possible according to the manual, +but the menu is missing (via SMS it's ok). Receiving via IR is also not +possible - only via SMS. With 61x0 sending and receiving via IR works.
  38. + +
  39. +WAP: In hidden password-inputfields (with *s, like yahoo's email page) +digits can only be keyed in by pressing the respective key several times, +and not (like anywhere else) by holding the key for a second.
  40. + +
  41. +security-level set to "Memory": when viewing the internal phonememory, +the securitycode should be requested.
  42. + +
  43. +"After sending DTMF-tones, you cant set the volume. (You'll have to clear +the digits first, otherwise it acts as Cursormovement, what is not useful +in DTMF)"
  44. + +
  45. +After power on, when turning the NaviRoller the first time, or opening +the slide (without pressing any other key before, so disable PIN), the +phone beeps shortly. Later, it never beeps when doing this.
  46. + +
  47. +(V4.88) When turning the NaviRoller while displaying a helpscreen, the +lights are flickering.
  48. + +
  49. +NaviRoller as "Quick Menu", on "Home" and "Bookmarks" the right Softkey +changes from "Exit" to "Back" (like in online-mode), but is without a function +then.
  50. + +
  51. +When replying to a SMS, and an other message profile than the standard +one is selected, the phone numer is not proposed anymore.
  52. + +
  53. +"Reminders" in te calendar have no alert, even not a time. Was ok on the +61x0.
  54. + +
  55. +Calendar-birthdays sent from 61x0 to 7110 with IR: year is not imported +to the 7110.
  56. + +
    Works with 8210 to 7110, 7110 to 7110, 61x0 to 61x0, and 7110 to 61x0. +
  57. +leap year bug: birthday i.e. on 3.3.2000, remind-date before 28.2. I.e. +15.2. Store and edit again -> remind-date has changed to 14.2., and with +every edit one additional day.
  58. + +
  59. +In Italian T9: "I'm" is always "I-am"
  60. +
+V5.01 08-12-00 +
V5.01 09-01-01 (ROM6?) +
    +
  • +Optimal Operator name length changed from 10 to 11 characters
  • + +
  • +Enabling of inserting space in subject when writing e-mail via WAP in Australia
  • + +
  • +Improved dual SIM handling
  • + +
  • +New UI Text release
  • + +
  • +Operator list updated
  • +
+BUGS V04.88 - V05.01 +
Problems with addressbook, +
After (and only after) using software linke 7110explorer or similar, +ther are problems with name and numbers. numbers are displayed instead +of names upon incoming calls. Phone restart to work correctly after a total +reset from wintesla or o NkProfile +
+
+
BUG: Test 45 in NetMonitor +doesn't work correctly. +
B£¡D: Test 45 w monitorze sieci +nie dzia³a poprawnie. +

There are/were also some other bugs. I can't tell, if they're corrected +or not. If have experiences with it, please report it to me: +

WAP: if you have call waiting enabled, use WAP and somebody will +call to you, he will heard busy signal +

Alarm Clock: If the alarm goes when the phone is switched off, +and the "Snooze" button is pressed, the phone will not turn back on until +the alarm resounds, or the phone is rebooted. +

Phone Book: +

    +
  1. +When someone calls only the number is displayed. This doesn't happen to +every name. It also doesn't matter if there are multiple or single entries +under the name or in which caller group it is. The number's aren't  +in the memory twice. 
  2. + +
  3. +If you use the roller for speed dialing, sometimes when you scroll to a +number other than the first one and press the green call key, the phone +automatically phones the number at position one.
  4. + +
  5. +When using the phonebook with the SIM card, sometimes when trying to select +a number to dial, the screen goes blank and the phone shuts down. The battery +needs to remove to get it to work again.
  6. + +
  7. +How to delete more names from phonebook (the same to roller => select name +=> Options => Delete => confirm):
  8. + +
      +
    1. +Names => Delete => One by one
    2. + +
    3. +First entry of phonebook is shown
    4. + +
    5. +Select name to delete by roller
    6. + +
    7. +Press Delete & confirm
    8. + +
    9. +Goes to 2. (first entry again!!!) instead of printing next name
    10. +
    +
+Back Light: The back light has been known to refuse to turn off, +until the battery is removes.  +

Answer Phone: If you get an answer phone message on line two, +the phone does not select the correct line as it pretends to, you have +to select the correct line before attempting to listen to your message. +

SMS: +

    +
  1. +If you write an SMS and then choose options, insert number you can happily +insert a number that you type, but if you select 'search' to allow you +to insert a number from the address book the address book is displayed +but with corrupt menu options and no screen border, the phone crashes and +requires a reboot. Occasionally it will either a) reboot itself or b) (if +the Network Monitor is active) perform a memory dump to the screen. The +phone works fine with the insert name option.
  2. + +
  3. +E-mail longer than 21 chars in cutted off (checked for 4.77, 4.80, 4.84)
  4. + +
      +
    1. +Add e-mail longer than 21 chars to some name.
    2. + +
    3. +Go to: Roller => select the name => Options => Send e-mail.
    4. + +
    5. +Only first 21 chars is pasted into SMS.
    6. + +
    7. +Go to: Roller => select the name => Roller => select e-mail entry => Roller +=> Send e-mail.
    8. + +
    9. +E-mail is pasted correctly.
    10. +
    + +
  5. +It's not possible to store logo, graphics or ringtone into SMS inbox, you +can only send it as SMS (function "Store-to-sms-inbox" is some programs +doesn't work). Checked for 4.73, 4.76, 4.77
  6. + +
  7. +When SMS beep (any mode - normal, ascending etc.) is enabled in Silent +profile, phone doesn't make any sound when the message is received. Checked +for 4.84
  8. +
+IRDA: +
    +
  • +After ending of data tranfer over IrDA, it's not possible to send SMS over +IrDA, you have to switch off & on the phone (Palm V on other side). +Checked for 4.73
  • + +
  • +When you send reminder to Nokia 6110 via IrDa, date of it 1.01.2050...
  • +
+Call Standby: When you are on the phone, and someone else tries +to phone you the phone beeps (Warning tones have to be on) there are three +ways to deal with this either send the incoming caller to your answer phone, +hang-up on the current call and take the new on or conference call both +together. However it has been known that when the current caller hangs +up, you lose both calls, or at least your can not activate the waiting +call. and if one person hangs up in conference calling, they all go!  +

Roller: Assign function "short menu" to roller, press roller, +go to "menu". There is no menu 11 (SIM toolkit, Paegas Info etc.). Checked +for 4.73, 4.77, 4.80, 4.84  +

Vibrating call alert: +

    +
  1. +If your battery is low, then there isn't enough power to use the Vibrate +mode so the phone switches it of automatically to save energy. Very Clever.
  2. + +
  3. +Vibrate ringing sometimes turn on or off even it's disabled/enabled in +profile. Checked for 4.70, 4.80, 4.84. Solution: enable vibra again, or +powercycle the phone.
  4. + +
  5. +No vibrating, although enabled, and even power-cycling doesn't help. Solution: +select an other ringtone in the profiles.
  6. + +
  7. +if you cusomize the "silent mode", when you select it the vibra-call is +deactivated. if the phone is turned off and then on the vibra-call is activated. +Checked for 4.84
  8. +
+Games: +
    +
  • +The back light turns off during a games of opposite or racket, even if +the option is set for the lights to be on (solution: open slider, then +play a game; not play a game, when open the slider)
  • + +
  • +Either the light doesn't turn on at all, or the light switches of in the +middle of the game.
  • +
+Groups: If you assigned downloaded ringtone for caller group and +deleted if (ringtone) from phone, it stops ring and vibrate. Can't change +ringtone from phone's menu then (must use Logo Manager or different software). +Checked for 4.94 +

Language specific: +

    +
  1. +When Czech is selected, y' is not in the "standard chars" list. It's in +"special chars". So you can't type it with pressing 9 & rolling to +y'. It's correct when Slovak language is selected. Checked for 4.70, 4.80, +4.84
  2. + +
  3. +When Czech is selected, it's not possible to look up name starting with +"Ch" in phone book by typing "ch" in list... Checked for 4.80, 4.84
  4. + +
  5. +Order of chars on key 3 in Composer is "d, d~, e, e', f, 3" and depends +on Language settings. Fixed for Czech from 4.76 (correct d, e, f, d~, e', +3), but Slovak is still broken... Checked for 4.70, 4.73, 4.76, 4.77, 4.80, +4.84
  6. +
+Ringtones: +
    +
  • +Change of ringtone for group Family returns from menu and it's not possible +to open this group till next power-on. Checked for 4.77, 4.80, 4.84. Use +Logomanager to alter the ringtone. this fixes the bug. After using Logomanager +you can then manually change it via the phone.
  • + +
  • +If you assign downloaded ringtone to group, you have active call waiting +function and somebody from this group will call to you, you don't have +info about it. Must assign one original ringtones and then is OK. Checked +for 4.84
  • +
+DLR-3 support and AT (all versions ?): +
    +
  • +you have to wait minimum 400 millisecs after DTR drop before you send an +AT command to the phone or it will hang.
  • + +
  • +earlier firmware versions were unable to return SMS from the phone memory +but returned the SIM ones.
  • +
+
7160NSW-5*#9999#
V1.05 22-11-00 +
V1.07 22-03-01
7190NSB-5 *#0000#
V3.30 06-11-00
+Back to the top/Na pocz±tek +

+


+ + + + diff --git a/Docs/en_US/gsm/firmware/firm8.htm b/Docs/en_US/gsm/firmware/firm8.htm new file mode 100644 index 0000000..4d53e14 --- /dev/null +++ b/Docs/en_US/gsm/firmware/firm8.htm @@ -0,0 +1,1921 @@ + + + + + + + + + + + Nokia identification & firmware/Identyfikacja i oprogramowanie telefonów Nokia + + + + + + +
+


Nokia identification & firmware/Identyfikacja +i oprogramowanie telefonów Nokia

+ +

+


+
    +
  1. +Ogólne b³êdy/General bugs
  2. + +
  3. +Ogólne informacje o IMEI/General info about +IMEI
  4. + +
  5. +Czy mogê wgraæ sobie oprogramowanie/Can I download +firmware to my phone ?
  6. + +
  7. +Czy to kosztuje ?/Does it cost ?
  8. + +
  9. +Gdzie tego dokonaæ ?/Where to make it ?
  10. + +
  11. +Jakie s± b³êdy/zmiany w kolejnych wersjach +?/What are bugs/changed things in next versions ?
  12. + +
  13. +Jak zmieniæ wersjê jêzykow±?/How to change +language in phone ?
  14. + +
  15. +U¿yte materia³y/Information sources
  16. +
+ +
+
+

Here is table describing firmware in various Nokia 8xxx phones +
You can also see table for +
Nokia 1xxx/2xxx, Nokia +3xxx, Nokia 5xxx, Nokia +60xx/61xx, +
Nokia 62xx/63xx/65xx, Nokia +7xxx, Nokia 8xxx, Nokia +9xxx

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Phone (telefon)Model number (Oznaczenie)Firmware version code (kod do sprawdzania wersji oprogramowania)TAC in IMEI (TAC w IMEI)
8110NHE-6, NHE-6BX*#8110#490137
V4.24 13-08-96 +
V4.25 09-09-96 +
V4.36 23-10-96 +
V5.31 06-01-96 +
V5.62 05-05-97 +
V6.01 27-02-98 +
V6.21 16-10-98
8110iNHE-6, NHE-6BM*#8110#490502
V24.03 16-07-97 +
    +
  • +First known version.
  • + +
  • +This version had some problems showing the service provider in the display. +Instead it showed some empty space. ??? 
  • +
+V24.04 08-08-97 +
    +
  • +An updated GSM operators' list.
  • + +
  • +Problem with missing service provider name in display solved.
  • +
+V24.11 09-09-97 +
    +
  • +An updated GSM operators' list.
  • +
+V24.23 21-10-97 +
    +
  • +An updated GSM operators' list.
  • +
+V25.00 12-02-98 +
    +
  • +An updated GSM operators' list.
  • + +
  • +Ringtone 10 was changed..
  • +
+V25.10 03-06-98 +
    +
  • +An updated GSM operators' list.
  • +
+V25.20 16-10-98
8146NHK-6*#170602112302#
V4.02 06-02-97 +
V5.00 13-03-98
8148NHK-6*#8110#
V4.02 06-02-97 +
V5.00 13-03-98
8148iNHK-6V*#8110#
V3.10 09-12-97
8210NSM-3*#0000#449306
V5.08 16-11-99 or 17-11-99 +
V5.11 09-12-99  +
V5.16 15-02-00 +

BUG: When you edit a large SMS, and you move the cursor for about 60-70 +characters, when you stop moving the cursor, and try to write in that place, +wrote appears 3 spaces in front of the cursor (as if cursor was there, +but it's not - it's 3 characters behind!). Info from jsp_m +

V5.20 17-04-00 +

BUGS AVAILABLE: +

    +
  1. +if someone call from a number that end with "88", you can't see the name +of caller even if there is a name in memory. Another user claims same problem +but with number ending with "98".
  2. + +
  3. +if you activate "silent mode", from power-on key, than receiving a call, +than come back to "Normal mode", the "ringer" will be to level 1 instead +of default of 4 or 5
  4. + +
  5. +Recharge time to much long (5 hours, manual says 2.30 hours) this not a +bug, really (you can see with netmonitor), during first 2.30 hours there +is the main recharge of battery (BLB2 Li-Ion 650 mA), and last 2.30 hours +is a maintenance charge. (this if powered-off phone).
  6. + +
    If you recharge with power-on phone, needed time will be 2.30 hours, +(charge indicators stop flashing) +
    If you recharge with power-off phone, needed time will be 5.00 hours, +(charge indicators stop flashing) +
  7. +voice tags: somethings, even if voice tags are on phone-memory, (instead +of SIM-memory), when you change SIM card, you miss all voice tags (deleted).
  8. + +
  9. +T9: if you should use a different language for menus and T9, every time +you change the SIM the T9 language are re-setted to menus language.
  10. +
+V5.21 03-05-00 or 25-04-00 +
    +
  • +Support for Intel ComboMemory
  • + +
  • +Fixed "buzzing" sound heard sometimes while establishing a call
  • +
+ +


BUG AVAILABLE: If you activate "silent mode", from power-on key, +than receiving a call, than come back to "Normal mode", the "ringer" will +be to level 1 instead of default of 4 or 5) +

V5.25 20-09-00 +

    +
  • +Tone "Orient" replaced with "Moon & Clouds"
  • + +
  • +Improved copying long phonebook entries from SIM to phone (increased speed)
  • + +
  • +Default ringing tone after menu reset was changed into "Ring ring" in every +PPM package 
  • + +
  • +No more than 5 ringing tones (and other OTA things) can be received in +a row without saving or discarding them 
  • + +
  • +Left softkey now activates IR link during incoming datacall
  • + +
  • +Improvement to printing from 7110 to 8210/8850 
  • + +
  • +Datacalls possible after using PC Suite without rebooting the PC 
  • + +
  • +Operator list updated 
  • +
+Info from users: in PL language "Mikrofon wy³±czon" and "Odg³usz" +

V5.26 19-10-00 +

    +
  • +Corrections to cases where the ringing tone/keypad tone stayed at lowest +level
  • + +
  • +COLP Note display increased 1.5 s to 30 s (help screens of menus apear +twice faster than before)
  • + +
  • +Improvements to emergency calls
  • + +
  • +Operator list updated
  • +
+ +


V5.27 16-02-01 +

    +
  • +Support for DSP code for ROM6 added
  • + +
  • +Earlier, when using PPH-1 in certain circumstances, a tapping sound could +be heard via loudspeaker
  • + +
  • +Operator name length changed from 10 to 12 characters
  • + +
  • +New text release in use (there was key-9 spelling mistake in Russian language)
  • + +
  • +Earlier in certain circumstances SMS editor was left in a wrong (Unicode) +mode
  • + +
  • +Operator list updated
  • + +
      +
    • +Operator name changed
    • + +
        +
      • +Old name   New name     MNC/MCC
      • + +
      • +Vodafone   Vodafone HU  216/70
      • + +
      • +GSM-MS1    GSM MS1      218/05
      • + +
      • +FEast      Far East     +250/12
      • + +
      • +ERA GSM    PL ERA GSM   260/02
      • + +
      • +DIGIFONE   IRL Digifone 272/02
      • + +
      • +Mobilkom   FL1          +295/05
      • + +
      • +MODICOM    INA SPICE    404/14
      • + +
      • +MobileNet  INA SPICE    404/31
      • + +
      • +EAE        KSA EAE      +420/07
      • + +
      • +C&W HKT    HK TELECOM   454/00
      • + +
      • +UNICOM     CHN-CUGSM    460/01
      • + +
      • +GTGSM      GH ONEtouch  620/02
      • + +
      • +Celtel     CELTEL GA    628/03
      • + +
      • +Celtel     CELTEL CD    630/02
      • + +
      • +ANTARIS    BUSAFA       +642/02
      • +
      + +
    • +New operator added
    • + +
        +
      • +Operator name MNC/MCC
      • + +
      • +ProMonte      220/02
      • + +
      • +YUG 03        220/03
      • + +
      • +MONET         220/04
      • + +
      • +FI AMT        244/14
      • + +
      • +RUS DTC       250/10
      • + +
      • +Primtel       250/92
      • + +
      • +TXXI          250/93
      • + +
      • +MD MOLDCELL   259/02
      • + +
      • +Viking        274/04
      • + +
      • +go mobile     278/21
      • + +
      • +GEO 03        282/03
      • + +
      • +TELE GRL      290/01
      • + +
      • +telecom FL    295/01
      • + +
      • +Montel        295/02
      • + +
      • +LI TANGO      295/77
      • + +
      • +JM DIGICEL    338/50
      • + +
      • +MPTGSM        414/01
      • + +
      • +JO MobCom     416/77
      • + +
      • +MN MobiCom    428/99
      • + +
      • +IR-TCI        432/11
      • + +
      • +IR KISH       432/14
      • + +
      • +BUZTEL        434/01
      • + +
      • +ISAT M3       510/21
      • + +
      • +MALITEL ML    610/01
      • + +
      • +CI CORA       612/01
      • + +
      • +BF CELTEL     613/02
      • + +
      • +BJ BENINCELL  616/03
      • + +
      • +TD CELTEL     622/01
      • + +
      • +TD LIBERTIS   622/02
      • + +
      • +CELTEL RC     629/01
      • + +
      • +CELTEL CD     630/02
      • + +
      • +CD OASIS      630/89
      • + +
      • +Safaricom     639/02
      • + +
      • +UTL_TELECEL   641/11
      • + +
      • +ZM ZAMCELL    645/01
      • + +
      • +MG Madacom    646/01
      • + +
      • +MG ANTARIS    646/02
      • + +
      • +MTC NAMIBIA   649/01
      • + +
      • +BW VISTA      652/02
      • +
      + +
    • +Country name changed
    • + +
        +
      • +Old name   New name   MCC
      • + +
      • +H          HU         +216
      • + +
      • +BA         BIH        +218
      • + +
      • +I          IT         +222
      • + +
      • +M          MT         +278
      • + +
      • +FIJ        FJ         +542
      • + +
      • +GO         GA         +628
      • +
      + +
    • +New countries added
    • + +
        +
      • +Country name MCC
      • + +
      • +JM 338
      • + +
      • +MM 414
      • + +
      • +MN 428
      • + +
      • +IR 432
      • + +
      • +ML 610
      • + +
      • +BF 613
      • + +
      • +BJ 616
      • + +
      • +TD 622
      • + +
      • +RC 629
      • + +
      • +CD 630
      • + +
      • +ZM 645
      • + +
      • +MG 646
      • + +
      • +NA 649
      • +
      + +
    • +Mobile Network Code changed
    • + +
        +
      • +Old code New code Operator
      • + +
      • +634/1    634/10   MobiTel
      • +
      +
    +
+Here are observations from jsp_m: +
    +
  • +new netmonitor test 140
  • + +
  • +no helps in netmonitor
  • + +
  • +net monitor tests cycle much faster now
  • + +
  • +(NEWER TOO ?) BUG:When edit long SMS (about 160 chars) and press Up/Down +key very long (until will scroll all SMS context - 160 chars) without releasing, +phone will restart after it - info from SkyBoy
  • + +
    (NOWSZE TE¯ ?) B£¡D: Przy edycji d³ugiego SMSa (oko³o 160 znaków) po +naci¶niêciu klawisza Góra/Dó³ i przytrzymaniu (bez zwalniania), a¿ ca³y +SMS (160 znaków) zostanie przewiniêty, telefon zresetuje siê...  - +informacja od SkyBoy
+V5.28 24-05-01 +
V5.28 27-06-2001 (ROM6?) +
    +
  • +'Sending picture message' note stays anymore on the screen after the picture +message has been sent, when there is an incoming call, while sending the +message
  • + +
  • +New text release: Slovakian key text's alphabet order same as Czech
  • + +
  • +Part of SMS-tone in Class 0 messages was missing. There were two simultaneous +tones at once (SMS message received and note tone) when Class 0 SMS was +received
  • + +
  • +In certain situations, when active call was on hold and business card was +received, the 'Business card received' disappeared too quickly
  • + +
  • +When business cards/calendar notes are sent via IR more characters are +now received
  • + +
  • +When sending Birthday notes over IR, the year was sometimes received incorrectly +if the year included 0 (zero)
  • + +
  • +Operator list updated
  • + +
      +
    • +Operator name changed
    • + +
        +
      • +Old name     New name     MNC/MCC
      • + +
      • +Macau SMC    SmarTone     455/00
      • + +
      • +ADAM         TIMECel      +502/17
      • + +
      • +Itineris     Orange F     208/01
      • + +
      • +PL ERA GSM   ERA GSM      260/02
      • + +
      • +B-COM        LV TELE2     +247/02
      • + +
      • +ALJAWWAL     ALJAWAL      +420/01
      • + +
      • +WP-1800      DTAC         +520/18
      • + +
      • +MG ANTARIS   ANTARIS      646/02
      • + +
      • +Ben-NL       Ben NL       +204/16
      • + +
      • +MOBILAND     STA-MOBILAND 213/03
      • + +
      • +WIND         I WIND       +222/88
      • + +
      • +Connex GSM   CONNEX       226/01
      • + +
      • +DiAx Swiss   sunrise      228/02
      • + +
      • +GLOBTEL      SVK GT       +231/01
      • + +
      • +One          ONE          +232/05
      • + +
      • +one2one      One 2 One    234/30
      • + +
      • +ZAO SMARTS   SMARTS       250/07
      • + +
      • +Kuban-GSM    KUGSM        +250/13
      • + +
      • +VODA M       VODAFONE MLA 278/01
      • + +
      • +AirTel       AIRTEL       +404/45
      • + +
      • +AirTel       AIRTEL       +404/49
      • + +
      • +HK TELECOM   CSL          +454/00
      • + +
      • +HK SMC       HK SMARTONE  454/06
      • + +
      • +KGT-ONLINE   KGT-Online   466/88
      • + +
      • +Hello        HELLO        +520/23
      • + +
      • +TT           TUNTEL       +605/02
      • + +
      • +Alize        ALIZE        +608/01
      • + +
      • +Omega        OMEGA        +618/01
      • + +
      • +Rwandacell   R-CELL       635/10
      • + +
      • +KenCell      KENCELL      +639/03
      • + +
      • +SFR RU       SFR REUNION  647/10
      • + +
      • +CelTel       CELTEL       +650/10
      • +
      + +
    • +New operator added
    • + +
        +
      • +Operator name MNC/MCC
      • + +
      • +ARIA          286/03
      • + +
      • +Macau SMC     455/00
      • + +
      • +HT Macau      455/03
      • + +
      • +NE CELTEL     614/02
      • + +
      • +FI 2G         244/12
      • + +
      • +NTC           250/16
      • + +
      • +FO FT-GSM     288/01
      • + +
      • +SPACETEL      421/02
      • + +
      • +LIPPO TEL     510/08
      • + +
      • +SGP-M1-3GSM   522/04
      • + +
      • +LIBERTIS      628/01
      • + +
      • +SPACETEL BI   642/01
      • +
      + +
    • +Country name changed
    • + +
        +
      • +Old name New name MCC
      • + +
      • +UKR      UA       +255
      • + +
      • +FR       FO       +288
      • + +
      • +MDG      BI       +642
      • +
      + +
    • +New countries added
    • + +
        +
      • +Country name MCC
      • + +
      • +NE           614
      • + +
      • +YE           421
      • +
      + +
    • +Mobile Network Code changed
    • + +
        +
      • +Old code New code Operator
      • + +
      • +338/50   338/05   JM DIGICELL
      • +
      +
    +
+Here are observations from jsp_m: +
    +
  • +no helps in netmonitor
  • + +
  • +no more "Pending" delivery reports (?)
  • +
+V5.29 18-09-01 +
    +
  • +Improved network scanning (Earlier when the phone was out of network coverage +and keys were pressed too fast, in some cases the phone made a reset, because +each key press caused a network search. Now key presses cause a new network +search only once a minute) 
  • + +
  • +Operator list updated
  • + +
      +
    • +Operator name changed
    • + +
        +
      • +Old name  New name MNC/MCC
      • + +
      • +ONE      one      232/05
      • + +
      • +ERA GSM     era    260/02
      • + +
      • +TH WCS    TH ORANGE   520/10
      • + +
      • +Dutchtone  Orange NL    204/20
      • + +
      • +TDK-MOBIL   DK TDC   238/01
      • + +
      • +M.PLUS    BATELCO    426/01
      • + +
      • +CAMNET    MTN CAM    624/01
      • + +
      • +CELLCO      CELLCO GSM  630/04
      • +
      + +
    • +New operators added
    • + +
        +
      • +Operator name    MNC/MCC
      • + +
      • +ORENSOT        250/11
      • + +
      • +VODAFONE    276/02
      • + +
      • +TR AYCELL    286/04
      • + +
      • +CU/C_COM     368/01
      • + +
      • +U-CALL     539/01
      • + +
      • +GAB TELECEL    628/02
      • + +
      • +CELLCO     630/05
      • + +
      • +Digicel     706/02
      • + +
      • +SPACETEL     417/02
      • + +
      • +VUT SMILE    541/01
      • + +
      • +GH-MOBITEL    620/03
      • + +
      • +DIGITEL  515/05
      • + +
      • +ORANGE   520/99
      • + +
      • +ECONET NG    621/20
      • + +
      • +COG LIBERTIS    629/10
      • + +
      • +MOBITEL - TZ    640/02
      • + +
      • +CELTEL TZ   640/05
      • + +
      • +Itineris RUN 647/00
      • + +
      • +F-OMT   647/02
      • + +
      • +Cell C    655/07
      • +
      + +
    • +Country name changed
    • + +
        +
      • +Old name    New name   MCC
      • + +
      • +NIG    NG    255
      • + +
      • +F     REU     647
      • +
      + +
    • +New countries added
    • + +
        +
      • +Country name     MCC
      • + +
      • +CU      368
      • + +
      • +VUT     417
      • +
      + +
    • +Mobile Network Code changed
    • + +
        +
      • +Old code    New code    Operator
      • + +
      • +621/00     621/30     MTN NG
      • + +
      • +634/10    634/01   MobiTel
      • +
      +
    +
+V5.30 +
    +
  • +Improvement to eliminate horizontal black line across the display when +the phone is switched off 
  • + +
  • +Operator list updated 
  • +
+ +
+
In netmonitor (all versions ?) in test +55 you have small type (one 's' too much in last line) in help and +info displayed in first line only +

On some V 5.11 and 5.16 once you have missed the signal, the phone make +difficult to re-sync it, and you must turn off and then on to re-sync. +This is no a bug of this firmware, because there are many 8210 v5.11 and +5.16 that works much-fine +

Another bug (feature ? ;-)): when save Name entry to phonebook in phone's +memory, you see "Saved to phone" display. It has icon from older Nokia +phones (unchanged) - phone with the antenna drawn... +

Bug (all versions ? - tested for 5.25): when send too long ringtone +for phone, in "preview" menu it's cut and played, after saving to location +playes only one note... +
+


+
According to some WWW sites phone seems to work with firmware from +Nokia 8850. I don't have any other info, do not ask me.
8250NMS-3D*#0000#
V3.12 19-01-01 +
V3.08 13-12-00 +

V3.12 +

Improvements in Irda and activating voice dial via on/off button in +HDC-5... +

V3.18 03-04-01 +

Improvements in Irda, SIM Toolkit, OTA calendar notes... +

V3.20 29-05-01 +

Better support for Nokia PC Suite over IrDA +

V5.00 16-09-01

8290NSB-7*#0000#
V5.07 08-08-00 +
V5.06 19-06-00 +
V5.15 30-01-01
8310NHM-7*#0000#
V2.90 08-09-01 +
V3.05 23-09-01 +

BUGS: +

    +
  • +If you select "warning of call" = "Bip x 1" and select "caller groups" +from phonebook menu and try to customize group, the vibra-call activate +itself. You must turn off the phone to stop it.
  • + +
  • +after renaming caller group "family" as "personal", adding the members +of group and customizing the ringtone. Now, the first time that select +"personal", the phone return to initial state, and the second time reset +itself.
  • + +
  • +low voice recoder quality
  • +
+V3.07 +
    +
  • +Improvements in voice recorder stability (quality ?)
  • + +
  • +Improvements in SIM card reading stability 
  • + +
  • +Improvements in SIM Application toolkit dynamic menu 
  • + +
  • +Improvements in SEND USSD 
  • + +
  • +Changes to meet some test cases 
  • +
+BUG (also existing in V3.05): +
    +
  • +when you are (near) losting signal, the phone reset itself, also, in that +case, is much difficult re-sync the signal. Partial solution is to select +"Manual Operator" instead of "Automatic"
  • + +
  • +if you turn on the phone with headset plugged in, the phone reset itself +continously.
  • +
+BUG: After customizing a ringtone (with logomanager) and entering "caller +groups", the phone reset itself. Possible reason: incorrect ringtone ID. +

V4.04 +

    +
  • +Call and network management: 
  • + +
      +
    • +Operator name not shown if service provider name has the priority 
    • + +
    • +UCS2 support for service provider name added 
    • + +
    • +CPHS feature: operator name reading from SIM support added 
    • + +
    • +Exception handling for Operator name showing improved 
    • + +
    • +Minor improvements to multi call handling 
    • +
    + +
  • +GPRS: 
  • + +
      +
    • +Handling of GPRS indicators improved 
    • + +
    • +Block Check Sum error while using CS2. Values of the spare bit field are +changed to mach all network implementations 
    • + +
    • +Cell re-selection in case of lost of service 
    • + +
    • +Occasional service drop while Extended BCCH blocks used 
    • + +
    • +MT call failures, while Extended Paging used 
    • + +
    • +Old TLLI deleted too early, causing breaks in data transmission 
    • +
    + +
  • +Phonebook: 
  • + +
      +
    • +Improvements to search functionality 
    • + +
    • +Improvements to caller group logo sending and receiving 
    • + +
    • +Improvements to Service Dialling Numbers 
    • + +
    • +Minor improvements to phone number showing (caller identification)
    • + +
    • + correction of displaying icons for numbers "WORK" and "CELLULAR"
    • +
    + +
  • +Messages: 
  • + +
      +
    • +Stability improvements to message erasing and picture message handling 
    • + +
    • +Voice mailbox improvements 
    • +
    + +
  • +Call Register:
  • + +
      +
    • +Lists cleaned if new SIM card used 
    • + +
    • +AoC Currency showing and default limits showing improved (displaying "remaining +credits" with SIM that has "cash display" in their menus)
    • +
    + +
  • +Profiles and settings: 
  • + +
      +
    • +Ringing tone order changed 
    • + +
    • +Improvements to OTA ringing tone handling 
    • + +
    • +Louder alarm tone 
    • + +
    • +Fixed dialling number stability improvements 
    • + +
    • +Help text for fixed dialling numbers added 
    • + +
    • +Hands free indicator didn't disappear in some cases 
    • + +
    • +Minor improvements to Automatic language selection 
    • +
    + +
  • +Games and calculator: 
  • + +
      +
    • +Snowboard game added 
    • + +
    • +Game tones follow only the games tone setting 
    • + +
    • +Exception handling in high score sending improved 
    • + +
    • +Improvements to lights handling and some text modifications 
    • + +
    • +Minor calculator look&feel improvements 
    • +
    + +
  • +To-do list and calendar: 
  • + +
      +
    • +Minor look&feel To-do-list improvements 
    • + +
    • +Some text and look&feel improvements e.g. current date highlighting 
    • +
    + +
  • +Radio and extras: 
  • + +
      +
    • +Exception handling of radio improved 
    • + +
    • +Font modifications in Countdown timer 
    • + +
    • +Indexing in Voice recordings list improved 
    • + +
    • +Stability improvements to voice recorder alarm support 
    • + +
    • +Voice recognition can be activated only when in idle mode 
    • + +
    • +Exception handling in voice commands and voice recorder improved 
    • +
    + +
  • +Services and SIM toolkit: 
  • + +
      +
    • +Header lines added to services 
    • + +
    • +Improvements to Send USSD functionality 
    • + +
    • +SIM ATK CB download support added 
    • +
    + +
  • +WAP push: 
  • + +
      +
    • +16-bit characters in title corrected and some denial of service vulnerabilities +corrected 
    • + +
    • +Manual login mode Now possible also with GPRS 
    • + +
    • +Screen backlight turned on when username/p@ss word prompt displayed 
    • +
    + +
  • +WAP bookmarks and cookies: 
  • + +
      +
    • +Some denial of service vulnerabilities corrected 
    • + +
    • +Problems with maximum length of bookmark URL's corrected 
    • + +
    • +In certain WAP pages Cookies were causing problems 
    • + +
    • +Over the air (OTA) set-up: Mal formatted set-up messages were causing problems +while viewing the set-up content 
    • + +
    • +WTAI public library: 
    • + +
    • +GPRS PDP Context unnecessarily closed after mobile originated voice call 
    • + +
    • +Voice call establishment from WAP bookmarks corrected 
    • +
    + +
  • +Error messages: 
  • + +
      +
    • +"Unknown abort" messages correctly mapped to descriptive error notes 
    • + +
    • +Two separate error messages displayed next to each other 
    • + +
    • +Viewing business card through WAP: 
    • + +
    • +Icons corrected for WORK and CELL numbers 
    • +
    + +
  • +WML Scripting: 
  • + +
      +
    • +Problems with pressing End key while script were running corrected 
    • + +
    • +WML variables now updated correctly while WML script is running 
    • +
    + +
  • +Other changes: 
  • + +
      +
    • +Support for new languages / market areas added 
    • + +
    • +5 Volt SIM cards blocked by 8310, ref. GSM 11.12 section 4.5. 'SIM card +not supported' text displayed 
    • + +
    • +CPHS support improved 
    • + +
    • +Plug-in HF Car Kit PPH-1 recognition improved 
    • + +
    • +Showing of battery low warning note improved 
    • + +
    • +Several text, font and other minor look&feel improvements
    • + +
    • +Several minor stability improvements 
    • +
    +
+Last (?) version with this bug: when using 32k sim, sometimes the phone +display "SIM not ready". Problem exist only, when PIN code was disabled. +Enabling access with PIN code solved this type of problem +

BUGS:  +

    +
  • +The problem related to losting signal is still present (but in lower way), +sometimes turning off and on the phone is needed to resync the signal.
  • + +
  • +it's necessary to press key '5' to confirm selection of players in Snowboard, +then all is OK in this game
  • + +
  • +problems after closing GPRS (you must reset phone):
  • + +
      +
    • +phone displays "SIM rejected"
    • + +
    • +phone can't send SMS
    • + +
    • +phone can't make or receive calls
    • +
    + +
  • +problems when you use both SIM and phone memory. Use only one memory - +suggested PHONE memory
  • +
+V4.53 +
    +
  • +Call and network management: 
  • + +
      +
    • +Private in Conference call improvement 
    • + +
    • +Speed dial number recognition improvement 
    • + +
    • +AoC (cash display system) improvements
    • + +
    • +Field strength signal bar configuration changed 
    • + +
    • +"SIM card registration failed" text added in the case when IMSI not found +in HLR 
    • +
    + +
  • +GPRS: 
  • + +
      +
    • +Improvements in inter-SGSN RAU/unexpected N-PDU functionality 
    • + +
    • +Continuous timing advance improvement 
    • + +
    • +Improvements in handling of Extended BCCH 
    • + +
    • +Improvements in combined attach in network mode I 
    • + +
    • +Always online functionality changed: When Always online is selected from +WAP settings and the phone is powered up only GPRS attach is performed +PDF context is made when the user makes WAP over GPRS connection and context +is deactivated when user exists the WAP browser 
    • + +
    • +Recommended PBCCH/PCCCH feature set activated, Nokia has tested the Recommended +PCCCH Feature Set functionality against basic configurations available +in IOT laboratories
    • +
    + +
  • +WAP: 
  • + +
      +
    • +Improvement to OTA bookmarks  (over SMS?)
    • + +
    • +Bookmark sending fails when SMS center number is not given in advance 
    • + +
    • +Problems when entering maximum length bookmarks 
    • + +
    • +Improvement to bitmap downloading 
    • + +
    • +WAP over GPRS with manual login improvement 
    • + +
    • +WAP Push 
    • + +
    • +Unicode support added to WAP Push Messages 
    • + +
    • +Push message reception by default ON 
    • + +
    • +GPRS related corrections (example: better ending)
    • + +
    • +Corrections to end-key functionality when having voice call during WAP +browsing 
    • + +
    • +Support for WTAI-call from bookmarks 
    • +
    + +
  • +DATA: 
  • + +
      +
    • +Improvements to AT-command interpreter: ATZ, AT&F, +CGDCONT, +CGQMIN +and +CGQREQ, ATE, AT+CREG, AT*99#, AT&V 
    • + +
    • +Change in handling of GPRS dial-up when CSD dial-up is active 
    • + +
    • +Correction to WAP connection over CSD 
    • + +
    • +Improvement in resetting of CID values 
    • + +
    • +Improvement in V.120 data call 
    • +
    + +
  • +Phonebook: 
  • + +
      +
    • +Improvements when copying entries 
    • + +
    • +Improvements in Pop-up search (mainly in APAC languages) 
    • + +
    • +Improvements when browsing phonebook memory
    • + +
    • +Hungarian and Slovak alpha order improvements 
    • +
    + +
  • +Games: 
  • + +
      +
    • +Menu shortcuts added to games 
    • + +
    • +Score Sending removed from Snowboard 
    • + +
    • +Minor game functionality improvements 
    • +
    + +
  • +Messages: 
  • + +
      +
    • +Message waiting indicators improvements (CPHS) 
    • + +
    • +Voice mailbox number saving to SIM (CPHS) 
    • + +
    • +Corrections in languages with Unicode characters 
    • + +
    • +Stability and look improvements in SMS editor 
    • + +
    • +Cell broadcast improvement with GPRS Always online 
    • +
    + +
  • +Other changes: 
  • + +
      +
    • +Opening and closing parenthesis correction in Hebrew 
    • + +
    • +Improvements in SIM ATK 
    • + +
    • +Improvements in handling line 2 (ALS) 
    • + +
    • +Voice volume control corrections 
    • + +
    • +Caller Group Ringing Tone correction 
    • + +
    • +Improvements to operator name display 
    • + +
    • +NITZ improvements 
    • +
    +
+BUGS: It seems solved problem of resync signal, but still present are "resets"
8810NSE-6*#0000#
V3.01 08-07-98 +
V4.03 10-08-98 +
V4.05 26-11-98 +
V5.00 29-09-99 +
V6.02 31-03-00 +
    +
  • +improvements in displaying CB
  • + +
  • +improvements in calendar - non lap year
  • + +
  • +....
  • +
+ +
+
BUG: Some older/all (?) firmware had bug in Calendar in Birthday option: +it it was set to the last day of February on non-leap-years (for example +29.02.2000), calendar will inform about it 1'st March (1.03.2000). Must +use "Reminder" instead of "Birthday".
8850NSM-2*#0000#448901
Look to the info for Nokia 8210 - they +have almost identical firmware (with some details) +

BUG in V.5.26 (19-10-00): If you activate the IrDA connection (Menu +9) twice in a row (while the phone queries for an IrDA connection -that +is) the IrDA icon will go static (blink stops!) until each IrDA activation +times-out. During the static IrDA icon, the phone will still function properly.

8890NSB-6*#0000#
V11.01 14-02-00 +
V12.05 22-05-00  +
V12.07 08-08-00 +
V12.15 21-02-01 +
    +
  • +Improvements to USSD
  • + +
  • +RELEASE COMPLETE message is sent to network to end the USSD dialogue, when +a NULL USSD string is received from UI
  • + +
  • +Releasing USSD dialogue with 'Back' softkey fixed
  • + +
  • +Cell selection improved (Sometimes it took long time for the phone to acquire +the network when the phone was out of coverage for long time)
  • + +
  • +Improvements to IrDA (IrPhonet fixed)
  • + +
  • +Improvements to SIM Application toolkit (handling of Provide Local Information +improved, handling of Setup Call Redial improved)
  • + +
  • +Handling of downloaded ringtone improved
  • + +
  • +Strange characters are not displayed (when the special character screen +was not full, highlighting the last characters caused strange characters +displayed on the screen)
  • + +
  • +Improvement to handling of IR (Left softkey didn't activate IR-link while +incoming data call)
  • + +
  • +Calling Name Presentation (CNAP) supplementary service support added
  • + +
  • +Caller group list feature added
  • + +
  • +Czech and Russian removed from PPM package D
  • + +
  • +New PPM package G created with languages English, German, Czech and Russian
  • +
+V12.20 +
    +
  • +Plug-in HF Car Kit PPH-1 
  • + +
      +
    • +Audio tasks changed. There was incorrect handling of the case when accessory +was off 
    • +
    + +
  • +SIM card 
  • + +
      +
    • +Sometimes there was an 'insert SIM card' error, if connection to SIM were +lost for more than approximately 30 seconds e.g. because of movement of +the battery. Now if last indication from SIM to phone is "SIM removed", +then the phone does not care about the SIM init failed indication 
    • +
    + +
  • +HPLMN 
  • + +
      +
    • +Phone lost service after HPLMN search, because it did not notice the situation, +where only forbidden location areas were found in periodic HPLMN search. +Checking has been modified, when HPLMN is on the list. 
    • +
    + +
  • +Phone reset 
  • + +
      +
    • +When phone was out-of-coverage, excessive searching caused reset. Now searching +mechanism has been modified 
    • +
    + +
  • +Emergency call 
  • + +
      +
    • +Changes in Current country indication. It was not possible to make an emergency +call to a special emergency call number (e.g. 999), after phone was switched +on in a new country, before current country was told to the phone. 
    • +
    + +
  • +Multiparty call 
  • + +
      +
    • +During call clearing multiparty connections were checked. Now if only one +connection in multiparty is found, its multiparty status is cleared 
    • +
    + +
  • +SMS 
  • + +
      +
    • +There was wrong time in SMS report. Pending status has been now changed 
    • + +
    • +Part of SMS-tone in cl@ss 0 message was not heard, because there were two +simultaneous tones at once (SMS message received and note tones). The message +received information note has been changed now into a note without tone 
    • +
    + +
  • +Picture message 
  • + +
      +
    • +Sending picture message note stayed on screen after sending. Sending control +has been changed now 
    • +
    + +
  • +Phonebook 
  • + +
      +
    • +Phone number comparison has been decreased from 10 digits to 7 digits 
    • +
    + +
  • +Calendar 
  • + +
      +
    • +Calendar Item sending via SMS/IR did not work correctly (characters were +lost). The definition of note length has been changed now 
    • +
    + +
  • +Calendar/IR 
  • + +
      +
    • +Year of birth was miscalculated when it was sent via IR, when the year +contained zeroes (e.g. 1970, 2000 etc). Decoding variables has been changed +now 
    • +
    + +
  • +Voice dialling 
  • + +
      +
    • +Voice dialling did not work when headset was connected and the phone was +in sleep mode. Now polling of voice tapping is removed, when headset is +connected 
    • +
    + +
  • +Operator names and wake-up graphics has been updated 
  • + +
  • +Email over SMS -feature added 
  • + +
      +
    • +Possibility to add an email address to up to 50 phone book entries 
    • + +
    • +When you want to send an email, scroll through the phone book to the names +with the @ symbol. This is network dependent service
    • +
    + +
  • +Service menu 
  • + +
      +
    • +Service (TTML browser) main menu removed 
    • +
    +
+
+Back to the top/Na pocz±tek +

+


+ + + + diff --git a/Docs/en_US/gsm/firmware/firm9.htm b/Docs/en_US/gsm/firmware/firm9.htm new file mode 100644 index 0000000..826470c --- /dev/null +++ b/Docs/en_US/gsm/firmware/firm9.htm @@ -0,0 +1,512 @@ + + + + + + + + + + + Nokia identification & firmware/Identyfikacja i oprogramowanie telefonów Nokia + + + + + + +
+


Nokia identification & firmware/Identyfikacja +i oprogramowanie telefonów Nokia

+ +

+


+
    +
  1. +Ogólne b³êdy/General bugs
  2. + +
  3. +Ogólne informacje o IMEI/General info about +IMEI
  4. + +
  5. +Czy mogê wgraæ sobie oprogramowanie/Can I download +firmware to my phone ?
  6. + +
  7. +Czy to kosztuje ?/Does it cost ?
  8. + +
  9. +Gdzie tego dokonaæ ?/Where to make it ?
  10. + +
  11. +Jakie s± b³êdy/zmiany w kolejnych wersjach +?/What are bugs/changed things in next versions ?
  12. + +
  13. +Jak zmieniæ wersjê jêzykow±?/How to change +language in phone ?
  14. + +
  15. +U¿yte materia³y/Information sources
  16. +
+ +
+
+

Here is table describing firmware in various Nokia 9xxx phones +
You can also see table for +
Nokia 1xxx/2xxx, Nokia +3xxx, Nokia 5xxx, Nokia +60xx/61xx, +
Nokia 62xx/63xx/65xx, Nokia +7xxx, Nokia 8xxx, Nokia +9xxx

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Phone (telefon)Model number (Oznaczenie)Firmware version code (kod do sprawdzania wersji oprogramowania)TAC in IMEI (TAC w IMEI)
Communicator 9000RAE-1*#682371158412125#490169
V4.01 15-09-97 +
V4.55 04-02-97 +
+
+
Some older firmware had BUG: When phone received SMS, it didn't display +correctly its' date, if it was after 1.1.2000 +

Some older/all (?) firmware had BUG: in sleep mode after 28.02 change +date change always to 1.03 (not to 29.02 in non-leap-years). Date must +be set manually then.

Communicator 9000iRAE-4*#682371158412125#490169
V6.34 16-09-97 +
V6.51 02-02-98 +
V6.70 15-07-98  +
+
+
Some older/all (?) firmware had BUG: in sleep mode after 28.02 change +date change always to 1.03 (not to 29.02 in non-leap-years). Date must +be set manually then.
Communicator 9000ilGE-9*#682371158412125#010024
V6.34 16-09-97 +
+
+
Some older/all (?) firmware had BUG: in sleep mode after 28.02 change +date change always to 1.03 (not to 29.02 in non-leap-years). Date must +be set manually then.
Communicator 9110RAE-2*#0000#490143, 490543
V3.07 17-01-99 +
V4.01 02-02-99  +
(???)V4.05 19-03-99 +

V4.15: +

(V4.02) In clock application, home contry 'United Kingdom' is shown +completely.  +
(V4.02) Careline numbers updated.  +
(V4.02) Apostrofe to Finnish keyboard.  +
(V4.02) Numbers in French keyboard.  +
(V4.02) Home country list changed.  +
(V4.02) Internet access improvements in some IAPs.  +
(V4.02) Print settings improvements in image printing.  +
(V4.02) Composed tunes can be sent via SMS also if contact selected +from SIM.  +
(V4.02) WWW performance improvements.  +
(V4.02) Keyboard scanning times adjusted.  +
(V4.02) BIOS v2.22  +

V5.01 08-06-99 +

    +
  • +Improvements for audio in car kit use. 
  • + +
  • +Backlight is deactivated when locked device is removed from cradle. 
  • + +
  • +Empty list situation, in list of own numbers-application, now handled correctly. 
  • +
+V5.02 28-08-99 +
V5.06 09-12-99 +
V5.10 06-10-00 +
+
+
After receiving some Smart Messaging SMS in older/all (?) firmware +versions the communicator-side changes to mail-application WITHOUT ANY +SIGN of a received SMS. 
Communicator 9210RAE-3*#0000#   (?)350149 (Finland)
V2.91P 12-03-01 +
V2.97 02-04-01 +
V3.03 25-04-01 +
V3.18 05-06-01 +
V3.54 05-07-01 +
    +
  • +Perbaikan untuk membuka email yang sudah didelete secara lokal
  • + +
  • +Call masuk tidak berbunyi di PDA setelah reboot
  • + +
  • +Perbaikan di bagian contact sehingga bisa menampung banyak nomor telephone, +sebelumnya bisa jadi hang
  • + +
  • +PDA bisa dikunci tanpa password
  • + +
  • +Autolock UNtuk interval "1 minute" and "2 minutes" tidak bekerja
  • + +
  • +PIN di SIM hanya ditanyakan pada telephone di bagian luar tidak di PDA
  • + +
  • +PIN Code diminta 2 kali
  • + +
  • +Aplikasi SMS langsung ditutup setelah mengirim SMS sebagai reply
  • + +
  • +Layar tidak menjadi blank ketika autolock aktif
  • + +
  • +Call masuk tanpa nomor ringtone yang dimainkan hanya Nokia Tune
  • + +
  • +Proses restore berhenti ketika ada call masuk.
  • +
+V3.62: +
    +
  • +Device reset improved (In some cases device did not restart when battery +was removed)
  • + +
  • +Network tone routing improved (When PDA cover was open, all network tones +were not routed correctly to Hands Free Speaker)
  • + +
  • +The User Busy (Engaged) Tone playtime changed (When a call is made to busy +number User Busy Tone playtime is longer)
  • + +
  • +Java Telephone API tests improved
  • + +
  • +SMS alphanumeric address improvement (SMS message sender name is shown +correctly also when name is used as sender instead of number)
  • + +
  • +PDA Telephone displays call even phone is idle (PDA display was sometimes +showing call active even though call ended from phone side)
  • + +
  • +Timer improved (Ocassionally jamming in games reduced by improved timers)
  • +
+V4.13 +
    +
  • +General stability improvements 
  • + +
  • +SIM card detection improvement 
  • + +
  • +Call costs management improvement 
  • + +
  • +PIN code request handling improvement 
  • + +
  • +Volume control was not working in CMT if you got "missed calls" when answering +a call 
  • + +
  • +Call register (recent calls) functionality improved and lists length reduced 
  • + +
  • +Device lock functionality improvement 
  • + +
  • +When Clock alarm was deactivated on PDA side, CMT light was not switched +off 
  • + +
  • +Deactivation of keypad lock produces squares to screen
  • + +
  • +Receiving and saving cl@ss 0 messages improvement
  • + +
  • +Messages were able to sent to number in Tel field (not only Tel GSM) 
  • + +
  • +Memory management improvement 
  • + +
  • +Clock Time management improvement 
  • + +
  • +Keypad lock functionality improvement 
  • + +
  • +Power reset management improvement 
  • + +
  • +Speed dialling functionality improvement 
  • + +
  • +Call divert indicator behaviour improvement 
  • + +
  • +Ringing tone functionality improvement 
  • + +
  • +Charging functionality improvement 
  • + +
  • +SIM lock functionality improvement 
  • + +
  • +Formatting + application installation behaviour improvement 
  • + +
  • +ALS: Activating/Deactivating call waiting for Line2 correction 
  • + +
  • +Backup restore functionality to/from memory card improvement 
  • + +
  • +World clock time zones updated 
  • + +
  • +FDN location numbers modified 
  • + +
  • +Spanish version: Event entries can now be cleared from log 
  • + +
  • +Now all stored numbers on SIM card are displayed 
  • + +
  • +UI texts (incl. Notes and error messages and help texts) updated 
  • + +
  • +Incoming SMS with sender number is now displayed correctly 
  • + +
  • +Voice mailbox list functionality improvement 
  • + +
  • +Line Selection functionality improvement 
  • + +
  • +Turkish special character conversion in Mail sending improvement 
  • + +
  • +Copy message centre number from SIM improvement 
  • + +
  • +Self made profile functionality improvement (in some situations you were +not able to activate or delete self made profile) 
  • + +
  • +Nokia Tune is not played in Meeting profile anymore 
  • + +
  • +'Conference commands' button not anymore dimmed when calling to busy number 
  • + +
  • +Phone number max length set now correctly when response is received from +SIM 
  • + +
  • +WAP: Image loading improvement 
  • + +
  • +WWW: default value for "Empty history on exit" changed to "Yes" 
  • + +
  • +WAP Browser accepts now also source port 66 
  • + +
  • +Printing: Page setup improvement 
  • + +
  • +Functionality of short message with alphanumeric address in From field +improvement 
  • + +
  • +WAP mail functionality improvement 
  • + +
  • +SMS functionality improved (includes several minor improvements e.g. Reading +SIM messages, deleting concatenated SMS handled better, SMS sending from +outbox etc.) 
  • + +
  • +Web: In some situations the file download was done twice, now it is done +only once 
  • + +
  • +WAP OTA message settings can now be saved 
  • + +
  • +WAP: Prefix "https://" URL handling improvement 
  • + +
  • +Calendar booking functionality improved 
  • + +
  • +Character conversion between GSM alphabet and Unicode improvement 
  • + +
  • +Email: Move and copy & some other functionality in IMAP remote mailbox +improvement 
  • + +
  • +PPP call-back idle timeout is increased 
  • + +
  • +Word Processor does not save unnecessary extra empty document anymore 
  • + +
  • +Memory handling improvement 
  • + +
  • +WAP OTA Setting Home page is now using the correct access point 
  • + +
  • +Creating folders in remote IMAP4 inbox is now possible 
  • + +
  • +The maximum size per message field is not applicable, when "Get mail" is +defined to fetch "message titles and stay online". The option is now dimmed +in this situation 
  • + +
  • +WAP: Scandinavian character support in WAP mail sending improvement 
  • + +
  • +WEB/PPP: Authentication to PPP-servers improved
  • + +
  • +Mail: .html attachment handling improvement 
  • + +
  • +Calendar: Alarms adjusted now correctly when changing from set time "No" +to set time "Yes" 
  • + +
  • +Ending of data call handling improvement 
  • +
+Language variants are supported according to following table: Europe NA +English, Europe NB German, Europe NS Finnish, Europe NO Orange, Europe +NX Scandinavian ( English ), Europe NH German ALS, Europe NC French, Europe +NF Spanish, Europe NR Italian, Europe NE Swedish, Europe NM Danish, Europe +NN Norwegian, Europe NG Portuguese, Europe NT Turkish, Europe NP Dutch, +Europe NV Hungarian, Europe NQ Czech, Europe NJ Polish, Europe NVF Vodafone, +Europe NK Movistar, Europe ND TIM, APAC NU English  +

This release requires also that the memory card application software +be updated, before using the 9210 with the new MCU software upgrade.  +

You should not use older sw version applications (3.18, 3.54 or 3.62) +from the sales package CD-ROM.  +

These old application versions will not work correctly with this new +4.13 SW version and you should delete any old backup that you might have +in your PC, and not restore to the updated 9210 as this will effectively +"downgrade" the memory card applications.  +

You should also make a new backup of the upgraded 9210 device, and upgraded +memory card to the PC.  +

All_memory_card_data.SIS file and the new version of PC Suite V1.20 +is also available from Forum Nokia web page http://www.forum.nokia.com

Card Phone 1.0RPE-1
Card Phone 2.0RPM-1449144
+Back to the top/Na pocz±tek +

+


+ + + + diff --git a/Docs/en_US/gsm/firmware/firmware.htm b/Docs/en_US/gsm/firmware/firmware.htm new file mode 100644 index 0000000..e65944a --- /dev/null +++ b/Docs/en_US/gsm/firmware/firmware.htm @@ -0,0 +1,706 @@ + + + + + + + + + + + Nokia identification & firmware/Identyfikacja i oprogramowanie telefonów Nokia + + + + + + +
+


Nokia identification & firmware/Identyfikacja +i oprogramowanie telefonów Nokia

+ +

+


+
    +
  1. +Ogólne b³êdy/General bugs
  2. + +
  3. +Ogólne informacje o IMEI/General info about IMEI
  4. + +
  5. +Czy mogê wgraæ sobie oprogramowanie/Can I download firmware +to my phone ?
  6. + +
  7. +Czy to kosztuje ?/Does it cost ?
  8. + +
  9. +Gdzie tego dokonaæ ?/Where to make it ?
  10. + +
  11. +Jakie s± b³êdy/zmiany w kolejnych wersjach ?/What are bugs/changed +things in next versions ?
  12. + +
  13. +Jak zmieniæ wersjê jêzykow±?/How to change language in +phone ?
  14. + +
  15. +U¿yte materia³y/Information sources
  16. +
+ +
+
First: what is firmware ? It's program (like in computer - in fact +phone is small computer) saved somewhere inside phone. +

Na pocz±tku: co to jest firmware ? Jest to program  (jak w komputerze +- w³a¶ciwie telefon to taki ma³y komputer) zapisany gdzie¶ w ¶rodku telefonu. +

On this page you can find information about: +

    +
  • +model numbers for Nokia phones
  • + +
  • +codes to see their firmware versions
  • + +
  • +different firmware revisions and changes among them (I think, it will help +to answer, if firmware upgrade for your phone will give you something and +correct some bugs).
  • + +
  • +description for IMEI. For example TAC numbers (first 6 digits of IMEI) +given for various Nokia phones (if I will have them, I will be able to +tell you your phone model from its IMEI).
  • +
+Na tej stronie znajdziesz informacje o: +
    +
  • +oznaczeniach Nokii
  • + +
  • +kodach pozwalaj±cych sprawdziæ ich wersje oprogramowania
  • + +
  • +jakie s± wersje ich oprogramowania i czym siê ró¿ni± (mam nadziejê, ¿e +pomo¿e to odpowiedzieæ, czy upgrade oprogramowania w Twoim telefonie da +co¶ i czy np. poprawi jakie¶ dokuczliwe b³êdy)
  • + +
  • +informacje o IMEI telefonu.. Przyk³adowo numery TAC (pierwsze 6 cyfr IMEI) +nadawane ró¿nym modelom (je¿eli je bêdê mia³, bêdê móg³ podaæ model telefonu +wy³±cznie na podstawie jego IMEI).
  • +
+If you want to add or correct something to this list, please write +me (for example: +
    +
  1. +when you changed firmware in your phone and noticed some changes, inform +me about them and write, what is phone model, old and new firmware version
  2. + +
  3. +if you have access to two phones with different firmware and notice any +differences, inform me about them and write, what is phone models, and +their firmware versions).
  4. +
+Je¿eli masz co¶ dodania do tej listy albo znalaz³e¶(a¶) na niej b³êdy, +proszê do mnie napisaæ w tej +sprawie (przyk³adowo: +
    +
  1. +je¿eli wymieni³e¶ oprogramowanie w swoim telefonie i zauwa¿y³e¶ jakie¶ +zmiany, napisz mi o nich podaj±c równie¿ model telefonu, star± i now± wersjê +oprogramowania
  2. + +
  3. +je¿eli masz dostêp do dwóch telefonów z ró¿nym oprogramowaniem i zauwa¿y³e¶ +ró¿nice, napisz mi o nich podaj±c równie¿ model telefonów, ich wersjê oprogramowania).
  4. +
+Informacja dla polskich czytelników tej strony: mia³a ona byæ w za³o¿eniu +i po polsku i po angielsku. Niestety, od którego¶ momentu nie by³em w stanie +tworzyæ lepszego czy gorszego jej t³umaczenia i w obecnej chwili czê¶æ +przet³umaczon± pozostawi³em, a reszta jest wstawiana TYLKO po angielsku. +

I want also to thank Tomasz Stêpski +(admin of newsgroup server news://212.160.228.194) +for special help in creating this page...and some other people too (Martin +F. Schlögl, jsp_m, +marOOn, +etc.) :-))) +

Back to the top/Na pocz±tek +

1. Ogólne +b³êdy/General bugs +
+


+

Here are some bugs (or features), which can exist in (almost) ALL new +models: +

    +
  • +DIVERTS: "Call divert  if not available" (Menu 5-5): "Check +status" is missing. It's not bug. It's because it's combined diverting +(N6210, 7110...)
  • + +
  • +some SMS saved on SIM can look different, when read them from phone's menu +(checked for N5110, 6150). Example (mygnokii can be download from my www): +try to use "mygnokii --savesms "test" --bug < file" and read +saved SMS
  • + +
  • +char 0x00, 0x00 in Unicode SMS hides SMS contents, when try to read it +from phone's menu (feature ?)
  • + +
  • +char 0x00, 0x01 in Unicode SMS enables/disables blinking of chars in SMS, +when try to read it from phone's menu (feature ?). Confirmed for N51xx, +61xx, 8210, 3210. Doesn't blink in N7110 (4.77), but can edit them there.
  • + +
  • +after receiving some SMS phone enables light/vibra (like after receiving +SMS), but doesn't display anything. Example (mygnokii can be download from +my www): try to use "mygnokii --savesms "test" --voidsms < file" +and forward it to phone.
  • + +
  • +SMS delivery reports are received twice: first ""... at work"", later a +second ""... transmitted"
  • + +
    Solution: the SMS-center number used for sending should be the same +than the one, that is sending back the delivery reports. +
  • +When have unreaded messages (let's say 4 SMS and one delivery report) and +you will receive next one, you will see "6 messages received", not "1 message +received". Changed for last models like 6210, ...
  • + +
  • +PL: s³owa "Og³usz" (w modelach z zielon± i czerwon± s³uchawk±) i komunikat +"Mikrofon wy³±czon". Wystêpuje nawet w 3310 wersja 4.45 i 8210 wersja 5.25 +(sprawdzone przez Artura Heise)
  • + +
  • +After deactivating netmonitor using 241 code, you have sometimes to reset +phone. In other case Up and Down arrows don't work...
  • + +
  • +When you set such ID for ringtone in caller group, which doesn't exist +in phone, you can't set it (ringtone) from phone's menu... Checked for +6210 (5.17) and 8210 (info from jsp_m).
  • + +
  • +Try few times, because sometimes doesn't work:
  • + +
      +
    1. +unlock keypad
    2. + +
    3. +press Power button (should go to the Profiles menu)
    4. + +
    5. +press Power button double
    6. + +
    7. +scroll menu to "Switch off" (or similiar) using Down key
    8. + +
    9. +wait second or longer
    10. + +
    11. +when press Power button now, phone will jump always to "Switch off" (not +go into next position)
    12. +
    +
+And some other tips: +
    +
  • +when want to delete SMS Centre Number (you don't want to see it from phone's +menu), +write "*" inside. Tested for N5110, 3310
  • + +
  • +when you put "#" char as SMS Centre Number, phone will replace it by "3". +Tested for N5110, 3310
  • + +
  • +(in models with two functions keys, for example 6110): when you see network +name/logo, press "Menu" key longer (about 2 secs.) - you will enter to +menu available during calls
  • + +
  • +when you will see list of phonebook entries and press "#" key, will see +number displayed with large font (tested for N5110, 3310, 6150).
  • + +
  • +when you're in phone's menu and press "C" key (go higher level), when press +fast "#" key, keypad will be blocked, as if you pressed "Menu" and "#" +combination (tested for N5110, 3310)
  • + +
  • +(in phones with Navi key, for example N5110, 3310): when edit SMS and don't +want to lost it/don't want to send or save, press "Options" (you will see +available options), then "C" for longer time. Contents of SMS will be in +memory (to the moment, when you disable phone) and you will be able to +return to it.
  • + +
  • +when send to phone DMTF sequence (tested for N5110) via cable and sequence +starts from "w" (wait), phone doesn't display it (first "w" in sequence), +but display menu for sending the rest of sequence in the phone. In N6150 +waits a moments before sending sequence...
  • +
+I kilka interesuj±cych rzeczy: +
    +
  • +W nowych modelach, kiedy ustawisz sygna³ wiadomo¶ci SMS na "Narastaj±cy", +telefon bêdzie wygrywa³ komunikat "Connecting people" alfabetem Morse'a. +Przy sygnale "Specjalny" jest to "SMS"
  • +
+And some interesting things: +
    +
  • +.In new models, when you set SMS message tone to "Ascending" ('Long & +Loud' with older firmware), phone plays "Connecting people" with Morse +alphabet. When select "Special", "SMS" is played.
  • +
+Back to the top/Na pocz±tek +

2. Ogólne +informacje o IMEI/General info about IMEI +


+

IMEI is written as: +

XXXXXX/XX/XXXXXX/X +
TAC/FAC/SNR/SP +

where: +

TAC (Type Approval Code): +
first two digits of are for Nokia: 35, 44, 49 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
last four digitsmodel
8890,9206,9314,93403210
05205110
92105130
05236110
30026150
9214, 9337, 95976210
8904, 88957110
8902, 93068210
05258810
89018850
00038890
+ +

FAC (Final Assembly Code) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
FACCountry
07, 08, 20Germany
10, 70Finland
19, 40UK
30Korea
67USA
80China
+ +

Back to the top/Na pocz±tek +

3. Czy mogê wgraæ +sobie oprogramowanie/Can I download firmware to my phone ? +
+


+

Firmware is saved in flash memory, not in EEPROM, like many people think. +In EEPROM you have configuration for phone (in almost all phones) - downloadable +logos, ringtones, etc. and generally it's very small - 8, 16, 32 kB. Flash +memory is rather big (for example, 8 MB). You have full firmware there +and (in some models) part of configuration. +

From long time there is available on the Dejan's +page flasher (soft + schematics for interface) and it allows to change +flash memory. This flasher will allow to: +

    +
  1. +change part of flash (for example, used for such modyifing firmware, that +phone doesn't read status of simlock and can work with each SIM card)
  2. + +
  3. +repairing some CONTACT SERVICES
  4. + +
  5. +uploading new flash (firmware version) to phone
  6. +
+After uploading new flash phone will not log into network. You have to +find and use loggers...I don't know more and don't ask me about it. +

Remember, that using this software can be illegal... +

Back to the top/Na pocz±tek +

4. Czy to kosztuje +?/Does it cost ? +
+


+

When you have quarantie for your phone, it should be done for free by +Nokia service. Some services want additionaly info from you about found +bugs (generally: explaining, why you want to make it) - look into my page +and you will know everything ;-) +

After quarantie you must pay for it...or (only in some services) if +will be done by free, if you will show them bug... +

Back to the top/Na pocz±tek +

5. Gdzie tego dokonaæ +?/Where to make it ? +
+


+

Ask your operator... +

Back to the top/Na pocz±tek +

6. What are +bugs/changed things in next versions ?/Jakie s± b³êdy/zmiany w kolejnych +wersjach ? +
+


+

Some info about my description, which is available on subpages: +

    +
  • +when I write firmware version before text (for example "(V 3.41)") - something +is changed, when compare to this firmware version (here 3.41)
  • + +
  • +when I write "(OLDER ?)" before text - this bug/info, etc. can be connected +with older firmware versions, here is confirmed
  • + +
  • +when I write "(NEWER TOO ?)" before text - this bug/info, etc. wasn't checked +in newer versions
  • +
+Kilka s³ów o opisie dostêpnym na podstronach: +
    +
  • +je¿eli piszê wersjê oprogramowania przed tekstem (np. "(V 3.41)") - co¶ +zosta³o zmienione w stosunku do podanej wersji oprogramowania.
  • + +
  • +je¿eli piszê "(STARSZE ?)" przed tekstem - informacja, b³±d, itp. mo¿e +byæ równie¿ w starszych wersjach, tutaj za¶ jest potwierdzona
  • + +
  • +je¿eli piszê "(NOWSZE TE¯ ?)" przed tekstem - informacja, b³±d, itp. nie +by³a sprawdzona w nowszych wersjach
  • +
+Please also notice, that changes between the same firmware versions in +different models are not the same. +

Please find your model and click to see everything: +

+Back to the top/Na pocz±tek +

7. Jak zmieniæ wersjê jêzykow±?/How to +change language in phone ? +
+


+

You have to change in phone part of firmware... From some time it's +possible to do it with Dejan flasher. +

Back to the top/Na pocz±tek +

8. U¿yte materia³y/Information +sources +
+


+

Niektóre u¿yte materia³y pochodz± ze stron: +
Some used materials are from WWW pages: +

    +
  1. +http://www.webit.com/tw/nokia.shtml
  2. + +
  3. +http://vzone.virgin.net/neil.hobbs/Nokia/Phone.htm
  4. + +
  5. +http://www.worldofcellularsecrets.com/free.htm
  6. + +
  7. +http://www.telephone.ru/faq/nokia6100/
  8. + +
  9. +http://gsm.erc.bc.ca/553software.html
  10. + +
  11. +http://www.users.bigpond.com/Scotth/
  12. + +
  13. +http://www.yaws.dk/communicator/faq/imei/home.html
  14. + +
  15. +http://www.yaws.dk/communicator/faq/versions/phone.html
  16. + +
  17. +http://www.nokiainfo.f2s.com/software_versions.html +(12-07-2001)
  18. + +
  19. +www.vosper.prv.pl
  20. + +
  21. +http://www.unofficial7110.co.uk/bugs/bugs.htm
  22. + +
  23. +http://slashdot.org/articles/00/09/03/1515202.shtml
  24. + +
  25. +http://www.arcx.com/sites/6190Tips.htm
  26. + +
  27. +http://www.wapterror.de/index.shtml
  28. + +
  29. +http://www.wapterror.de/6210.html
  30. + +
  31. +http://bugzilla.punknet.cz/long_list.cgi
  32. + +
  33. +http://www.artie.force9.co.uk/8850/about.htm
  34. + +
  35. +http://www.fponticelli.com/bug8210.html
  36. + +
  37. +http://members.aon.at/mfs/ (14-01-2002)
  38. + +
  39. +http://www.2thumbswap.com/products/secrets/nokia_8110.htm
  40. + +
  41. +http://www.nokia4u.cz/Nokia/firmware/fw-zmeny.htm +(12-07-2001)
  42. + +
  43. +http://www.indocell.net/id37.htm
  44. + +
  45. +http://www.ponticellinks.com/bug_sw.html +(02-02)
  46. + +
  47. +http://www.flash.net.ph/cgi-bin/ikonboard/forums.cgi?forum=4&show=30 +(03-02)
  48. + +
  49. +http://www.xinfo.net
  50. +
+Back to the top/Na pocz±tek +

+


+
Marcin +Wi±cek (WWW) +
Ostatnia aktualizacja: 10 marca 2002/ Last modification: +10 March 2002
+ + + diff --git a/Docs/en_US/gsm/irda/irda.htm b/Docs/en_US/gsm/irda/irda.htm new file mode 100644 index 0000000..ebd343f --- /dev/null +++ b/Docs/en_US/gsm/irda/irda.htm @@ -0,0 +1,25 @@ + + + + + IrDA FAQ + + + + + +

Main page

+
IRDA FAQ
+ +


+ +

How to make iRda port for computer... + +

How to configure gnokii for IrDa connection ?
+


+ +

See file describing configuration of gnokii + + + + diff --git a/Docs/en_US/gsm/logos/logos.htm b/Docs/en_US/gsm/logos/logos.htm new file mode 100644 index 0000000..5e29c4f --- /dev/null +++ b/Docs/en_US/gsm/logos/logos.htm @@ -0,0 +1,38 @@ + + + + + Logos FAQ + + + + + +

Main page

+
Logos FAQ
+ +


+ +

Types of logos
+


+ +

Nokia phones can support: +

+

    +
  • startup logo - picture displayed, when phone is enabled. +In some models (3210 5.27 and newer and 3310) it's animated. You can +disable it (and download your own static), but I don't know, if it's possible +to return to animated... +
  • +
  • operator logo - picture displayed instead of operator name. +Logo can be assigned ONLY to one operator (when you will change it, +it will disappear; when return to this network, you will see it again)
  • +
  • caller logo - you can assign names from phonebook to something called +caller group. When someboday for this group will call to you, you can +see picture (caller logo) and name...
  • +
  • Picture Image - image, which in newer phones (3310, ...) can be +displayed in idle mode (Nokia calls it screen saver)
  • +
+ + + diff --git a/Docs/en_US/gsm/netmon/3210_09.gif b/Docs/en_US/gsm/netmon/3210_09.gif new file mode 100644 index 0000000..afa7db0 Binary files /dev/null and b/Docs/en_US/gsm/netmon/3210_09.gif differ diff --git a/Docs/en_US/gsm/netmon/3210_092.gif b/Docs/en_US/gsm/netmon/3210_092.gif new file mode 100644 index 0000000..b7c8fa5 Binary files /dev/null and b/Docs/en_US/gsm/netmon/3210_092.gif differ diff --git a/Docs/en_US/gsm/netmon/3210_10.gif b/Docs/en_US/gsm/netmon/3210_10.gif new file mode 100644 index 0000000..5cf7fe5 Binary files /dev/null and b/Docs/en_US/gsm/netmon/3210_10.gif differ diff --git a/Docs/en_US/gsm/netmon/faq_net0.htm b/Docs/en_US/gsm/netmon/faq_net0.htm new file mode 100644 index 0000000..6cc7368 --- /dev/null +++ b/Docs/en_US/gsm/netmon/faq_net0.htm @@ -0,0 +1,697 @@ + + + + + + + + + + NetMonitor in Nokia phones (1/7) + + + + + +

Main page

+
+
NetMonitor in Nokia phones (1/7) + +

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] + +

+ +
+ +

I’d like to write, that I’m not professionally connected with any +cellular network or phone company. This NetMonitor guide is based on many +different materials and exists thanks to the support of many different people (see +Information sources). This is a guide made by user. It may lack description +to some functions or contain errors and mistakes (resulting from wrong translation or my ignorance) and some strange +expressions. Many questions remain unanswered. Furthermore, this page is still "under construction". Encouraging, isn’t it? +But that’s the (sad) true: Nokia doesn’t make appropriate materials available... +I can only assure you, that I do my best to make this NetMonitor description as reliable and complete as possible. + +

In this moment on my homepage you can also find Polish version of this FAQ. +English language version was created with help of Michal Jerz - author of +excellent page Nokia 9110 World: http://n9k.ats.pl. + +

+I’ll be very thankful for any help in creating and maintaining this guide - please +send +me any information (or URLs where I can find it), suggestions and remarks. My FAQ currently concerns +Nokia 2110i, 2120, 2140, 2160, 3110, 3210, 3310, 5110, 5130, 5160, 5190, 6110, 6130, 6150, 6160, 6185/6188, 6210, 6250, 7110, 8210, 8810, +9110 and 9210 series of phones. If you have NetMonitor enabled in any other model +(for example in 2110i, 6090, 8xxx, 9000), please contact me +(to let me know about the differences and possible new tests). + + +

+Herewith I inform, that I don’t bear any responsibility for any damages and other consequences caused by applying following +information (you use it on your own responsibility) ! + + +


+ + + +
    +
  1. What is it ?
  2. +
  3. Do I need it ?
  4. +
  5. Does my phone use more power with NetMonitor enabled ?
  6. +
  7. How to activate it ?
  8. +
  9. Which NetMonitor version can be activated in my phone ?
  10. +
  11. Does NetMonitor activation void warranty ?
  12. +
  13. NetMonitor menu in my phone has different number than 10. Is it normal ?
  14. +
  15. NetMonitor menu in my phone has 11 number, hovewer previous position has 9 number. Is it normal ?
  16. +
  17. How to use it ?
  18. +
  19. Can I damage my phone ?
  20. +
  21. Glossary
  22. +
  23. Description of the individual tests
  24. +
  25. You can also use a program...
  26. +
  27. Can I use NetMonitor without SIM card inserted, without PIN number entered or when SIM card is not active ?
  28. +
  29. How can I disable NetMonitor ?
  30. +
  31. Do I need to disable NetMonitor before sending my phone to the service ?
  32. +
  33. Is it possible to re-activate NetMonitor after disabling it ?
  34. +
  35. Is NetMonitor available in analog Nokia phones ?
  36. +
  37. Does NetMonitor allow to use phone like broadcast station ?
  38. +
  39. I don't have all described tests in my phone. Why ? Can I increase their number ?
  40. +
  41. Does NetMonitor allow to identify place, where is my interlocutor ?
  42. +
  43. Does NetMonitor allow to identify place, where am I ?
  44. +
  45. What are NetMonitor codes ?
  46. +
  47. Is it the truth, that in phones with additional hardware changing frequency band NetMonitor doesn't work correct ?
  48. +
  49. Where can I find description of FBUS/MBUS protocol and commands connected with NetMonitor ?
  50. +
  51. I have non existing networks on the list of forbidden networks...
  52. +
  53. How to check frequency band (900 or 1800 Mhz), where phone work in this moment ?
  54. +
  55. Can I use DLR-2/DLR-3 cables for activating netmonitor ?
  56. +
  57. Can I activate netmonitor using Init File Editor (Nokia 9110) ?
  58. +
  59. Can I force phone to use one frequency band (900 or 1800 Mhz) only ?
  60. +
  61. How to change settings in tests ?
  62. +
  63. My phone has very short snandby time - it is possible to see the reason of it ?
  64. +
  65. Is netmonitor available in English version only ?
  66. +
  67. Information sources
  68. +
  69. Additional information
  70. +
  71. Does using/activating netmonitor cost anything ?
  72. +
  73. Does using netmonitor is legall ?
  74. +
  75. Which entries on SIM card are used in netmonitor tests ?
  76. +
  77. Can I activate netmonitor in 3310 using soft working with 3210 ?
  78. +
  79. After activating netmonitor/BTS TEST my phone can't find network...
  80. +
  81. Netmonitor shows different battery capacity than info on it...
  82. +
  83. NetMonitor in Nokia 6310, 8310,...
  84. +
+
+
+ +

1. What is it ?
+


+ +

Net Monitor is just a special mode, which – when activated – shows different information about the network and about +phone modules, SIM card, etc. After activation your phone will usually display a new, additional menu containing +strange and constantly changing letters and digits. There are no standards here – each phone shows different data +and there are different methods of activation (my description concerns NetMonitor mode in Nokia phones – if you have some +other phone, you have to go somewhere else). I can even say, that NetMonitor (in some form) can be found in practically +each present mobile phone (because it is unprofitable for the producers to make two separate software versions – +with and without NetMonitor). Here you can find some URLs to the pages describing activation and/or individual +NetMonitor menus in other phones: + +

+

+ +

Other types: try searching on the links page +www.mobilserver.com/Phone_info/. + + +

Back to the top + + +

2. Do I need it ?
+


+ +

"Normal" users surely don’t need any NetMonitor, because simply most of the data included there can be of +any interest and use only for specialists (who can find out almost everything about the network). You also can: + +

+

    +
  • feel better and be able to brag that your phone has such a BBIIIIIGGGGGG choice of different options
  • +
  • observe different network and phone parameters (I tried to explain their meaning in my description) and find out +how cellular network works
  • +
  • affect some functions in your phone and sometimes make your life easier (using these new options) – +I did my best to point at many useful NetMonitor applications
  • +
+ +

If you still think, that you don’t need it, read other pages concerning Nokia phones. + + +

Back to the top + + +

3. Does my phone use more power with NetMonitor enabled ?
+


+ +

I’d say: NO. Each phone monitors the network even when there is no NetMonitor menu active. + +

But why some users say, that they have to charge their batteries more often after enabling NetMonitor? It is easy to explain: +they frequently switch from one test to another (some people cannot stop ;-) and do it habitually) and the phone after each +key press (by default) turns on the light (and uses much power - see test 23). +This can be partially cured by using test 18. Additionally, +some tests (for example +test 17 or test 19) can put +your phone in a state of constant network searching (which drains the battery). + +

To recap, NetMonitor activation itself doesn’t affect power consumption. It can be only changed by some conscious +user operations... + + +

Back to the top + + +

4. How to activate it ?
+


+ +

You can do it in three ways: + +

+

    +
  1. by connecting your phone to the computer with a cable (in 3210 it has to be connected inside the casing) and using +appropriate software (RECOMMENDED !) working in: + +

    +

    + +

    All above programs work with majority of Nokia phones with letter "S" in middle of codename +(for example, 5110, 5130, 5190, 6110, 6130, 6150, 3210 series). With Nokia 7110 (NSE-5) over DAU-9P cable +(from Nokia 5xxx/6xxx series phones) +worked Pc-Locals and Logo Manager only. +In Nokia 9110 (RAE-2) NetMonitor can be enabled +with all above programs working with MBUS cable - Logo Manager, Pc-Locals or +Nokia Wrench. + +

    + + + + + + +
    When you want to check codename of your phone, try to use one of these codes: +*#0000#, *#9999#, *#3110#, *#3810#, *#5190#, +*#6190#, *#8110#, *#837#, *#170602112302# or +*#682371158412125# (for more information about phone identification click +here). +If phone will display something, codename will be written in 3'rd line of screen (it will be something like NSE-1).
    +

    + +

  2. by direct changing the contents of EEPROM +(Electrically Erasable and Programmable Read-Only Memory). +This method requires opening your phone and leaves visible traces inside it. +I DON’T RECOMMEND THIS METHOD! +But if you want to do it: + +

    +

    +

    +

  3. + +
  4. +using special menu, which allow to programm NAM code (in some analog phones only +- like Nokia 2160, 2120, 5160, 6160, 6185 and 6188): +

    +

      +
    • use *3001#12345# code (sometimes pressing additionaly Menu is required; +some sources write, that you have to write security code instead of 12345) +to enter this menu
    • +
    • set "Field Test Mode" to "On"/"Enable"
    • +
    • restart your phone
    • +
    +

    +

  5. + +
  6. entering Menu 3 3 (according to http://www.ras.ru/~sashka/nokia/550/ +in Nokia 550) and setting it to "ext. test". Later you should restart phone (?)
  7. + +
+ +

You can also: + +

+

    +
  • ask people from GSM newsgroups to do it for you
  • +
  • commission it to some specialized company
  • +
+ +

I don’t know details about NetMonitor activation in 1610, 2110, 3110, 8110i, 8810 and 9000 series. +I don’t know exactly which programs to use (I heard only, that probably version 0.6 of PC-Locals allows to make it in older models) +or how to modify EEPROM memory (if you know anything about that, please +contact me). +In this moment I can send you to: + +

+ +

only. + +

I also heard, that in some copies of Nokia 6110 and 5110 phones it is possible to activate NetMonitor by a key combination +(by pressing Menu key and typing 10 – this should work even when NetMonitor menu is not visible). + +

+ + + + + + +
+If you don’t know how to activate NetMonitor, you better ask some more experienced person to do it for you +(you can damage your phone during this operation) ! +!
+ +

I’d like to draw your attention to one detail - in Nokia phones you just activate the monitor and not upload it (it is always +in your phone – described methods just reveal it as an additional menu). + + +

Back to the top + + +

5. Which NetMonitor version can be activated in my phone ?
+


+ +

Each program described in previous point allows you to activate one of two NetMonitor versions: + +

+

    +
  1. limited, including tests from 1 to 19 (concerning cellular network only). This version is usually called +"Field Test" or "Operator field tests" (or you have to enter 242 code to activate it)
  2. + +
  3. +full, also including phone (and sometimes SIM card) tests. It is called "Engineering" (or "R&D field tests") and its activation +code is 243.
  4. +
+ +

+ + + + + + +
+I recommend you enable full version of NetMonitor – you can always replace it with a limited version +(by choosing test 242 in your phone). It doesn’t work in reverse direction (you cannot activate full menu from +within the phone – it doesn’t accept test 243 when limited version is active; of course you can still use +methods described in previous point). +
+ + +

Back to the top + + +

6. Does NetMonitor activation void warranty ?
+


+ +

The method of re-programming EEPROM memory is connected with opening the casing and making modifications in your +phone (which leaves many traces, scratches etc. and voids warranty). + +

However, these problems don’t appear (you don't have to be affraid) when using one of the described programs +or code (but I can be wrong . there are opinions that this method leaves a trace in phone.s memory, too)... + +

Of course, before getting phone to service, is better to +deactivate NetMonitor. +Sometimes, for example, when phone's energy system is damaged, it could be impossible - +you can have some problems then (some of people working in service can think, that +you broke warranty - it depends on concrete people).. + + +

Back to the top + + +

7. NetMonitor menu in my phone has different number than 10. Is it normal ?
+


+ +

+ + +
+
+NetMonitor menu in Nokia 3210 +NetMonitor menu in Nokia 3310 +NetMonitor menu in Nokia 5110 +NetMonitor menu in Nokia 6150 +NetMonitor menu in Nokia 6190 +NetMonitor menu in Nokia 8210/8250 +NetMonitor menu in Nokia 8310 +NetMonitor menu in Nokia 9110 +NetMonitor menu in Nokia 9210 +
+
+ +

+ + +
+NetMonitor menu in Nokia 7110 +
NetMonitor menu in Nokia 6210 +
NetMonitor menu in Nokia 6310 +
+Of course, Number of NetMonitor menu (called "Net monitor" or "Field Test") +is different (depends on firmware version and phone series) in different Nokia phones. + +

It can be: +Menu 7 (Nokia 3110 and 9110), Menu 10 (Nokia 5110, 5130, 6110, 6130), +Menu 11 (Nokia 5190 and 3210) or Menu 12 (Nokia 8210 or some 6150). +Nokia 3210 also has a completely different icon for this menu, 6250 doesn't have any icon. So, it's normal and don't be affraid. + +

There is also interesting thing connected with it: in Nokia 8210 icon of phone +in netmonitor's menu is DIFFERENT from icons of phones in other menus in this model, but +THE SAME to icon in Nokia 8250... + +

+ + +

Back to the top + + +

8. NetMonitor menu in my phone has 11 number, hovewer previous position has 9 number. Is it normal ?
+


+ +Menu 9 in Nokia 3210 +Menu 10 in Nokia 3210 +Menu 11 in Nokia 3210 +YES - It's normal. We have such situation in Nokia 3210. "Lost" Menu 10 +is reserved for SIM application toolkit and you will see it, when you will have access to them +(when your SIM card will have this feature built in - you CAN'T activate it different way). + + +

Back to the top + + +

9. How to use it ?
+


+ +

GSM/DCS/PCS phones: + +

+ + +
+NetMonitor menu in Nokia 5110 +NetMonitor menu in Nokia 5110 + +After activation you gain access to the new position (called "Net monitor" +or "Field Test") in main phone menu. +
+ +

NetMonitor menu in Nokia 5110 +When you enter this menu, you can type number of the test, which should be displayed +(1 to 19 in limited version, higher numbers in full version - Caution! Entering +number 241 removes NetMonitor menu and +242 switches it to the limited version – you’ll have to use one of the +methods described in How to activate it ? to regain access to the full version !). +Before number of test you can add "+". Unfortunately, in Nokia 6210/7110 there +is one wrong thing here: before entering number of new test you must delete old number +using right function key (in other models you can enter it without it). + +

NetMonitor menu in Nokia 5110 +After pressing OK the chosen test appears on screen (and its number is shown on the top) in place of your network +name/operator logo (BTW: in some phones (like Nokia 3310), when you will enable clock, alarm clock, stopwatch, countdown timer, second line (ALS function), +test in netmonitor and lock keypad, time will disappear :-)). If you enter incorrect test number, NO TEST appears on screen and the phone returns to the last +correctly displayed test. If entered number is greater than 256, 512 or 768, then 256 (or its multiple) is subtracted and +resulting menu number is displayed (for example numbers 300 and 556 run test 44). Some test when accessed this way +(by typing its number and pressing OK to enter them directly) modify its contents (details are described later, I call this +"DIRECT" menu access’ - for example, see test 18). + +

NetMonitor menu in Nokia 5110 +You can look at different tests by scrolling them using up/down arrows (don’t worry – this method doesn’t change +any settings in tests) – each key press moves you to the next/previous available test. In some models +(for example in 5110) these keys have different functions (like displaying last dialed numbers, opening +and scrolling phonebook or changing the volume) – unfortunately they don’t work while NetMonitor is on screen:-(. +However, you can still adjust volume during a call in Nokia 5xxx/3210/3310/6188/6185/6160/6120 – by pressing and holding +(longer than normally - about a second) one of the arrow keys. + +

NetMonitor menu in Nokia 5110 +Help (description) to the current test can be displayed by pressing and holding * key +(repeat this to return to test values). However, this shortcut works only in some phones +(my explanation to this fact can be found in +Description of the individual tests). That's why I've added these help +screens using a bold font in most of the tests... If they are currently displayed, +entering menu directly doesn't change its settings. + +

+ + +
+NetMonitor menu in Nokia 5110 +NetMonitor menu in Nokia 5110 +NetMonitor menu in Nokia 5110 + +You can return to the main screen with name/logo of your network by entering 0 in this menu. +
+ +

+ + + + + + +
If you enter 0 as a test number and then add a number of a non-existing test +(for example 52), your phone will act as when NetMonitor is active (for example up/down arrows +can be used to change test number – you can check this in Menu 10). Unfortunately, in this case counters +from test 82 don’t work. Tests chosen this way appear right +after switching the phone on. You can use this feature to: + +
    +
  • temporarily "damage" your phone (to cheat your friend?)
  • +
  • block access to your phonebook (Nokia 5xxx and 6xxx)
  • +
  • prevent viewing your last dialed numbers list on the main screen with network logo/name (Nokia 5xxx)
  • +
  • make it difficult to change volume during a call (Nokia 5xxx) – the arrow keys must be pressed and hold longer than normally
  • +
  • make it impossible to change volume (Nokia 3110)
  • +
+ +
+ +

With any test on screen (in phones other than Nokia 3110), +your phone doesn’t display some of the messages (for example. "...calling") +and there is no calling party identification recognition (the only exception to the rule is a message: +'Note: you have active diverts'). When you type a phone number the test screen disappears +(it will come back after you get connected or when you cancel this number from your display). + +

Remember: your phone is like computer. If you won't disable it and enable +(only then it saves all values in EEPROM), +it can lost values from tests (for example, info about number of sent/received SMS from +test 64, when you will use tips above... + +

There is one firmware bug connected with using helps (descriptions) to the tests +(in this moment, it's confirmed for Nokia 5110, 3210, 3310). +If you want to see it: + +

+ + +
+Menu monitora w Nokii 5110 +Menu monitora w Nokii 5110 +Menu monitora w Nokii 5110 +Menu monitora w Nokii 5110 +Menu monitora w Nokii 5110 + +
    +
  • Press and keep * key. In a moment, when * desappear from the screen +(but before moment, when test values will be replaced with help or help with test values), +let * key.
  • +
  • Now you must do everything fast - * can't be written on the screen and +text below NaviKey can't change: instantly press * for a moment and let it. +You can repeat this point - effects will depend on repeat numbers. For example, +with firmware 5.07 (or 5.11) +and 0 repeats you will have access to first "hidden menu", with 1 repeat +you phone hangs and turn off (see test 36 +- it can be interesting), with 2 repeats it changes language ;-)), with 3 +you can enter to another "hidden menu", sometimes (I don't know exactly, when) +you can see "CONTACT SERVICE" message (restart you phone and everything will +be OK). With firmware 5.24 result are different: +with 0 repeats you can enter second "hidden menu", with 1 or 2 repeats +desappear NaviKey description, with 3 its description changes to "Send". +
  • +
  • wait longer moment
  • +
  • press for a moment and let one of the keys: *, 0 to 9 or #
  • +
+
+ +

+You can restart your Nokia 5110, if it has older firmware (it doesn't work with 5.24, +but with 5.07 and 5.11 works): + +

+

    +
  • Press and keep * key. In a moment, when * desappear from the screen +(but before moment, when test values will be replaced with help or help with test values), +let * key.
  • + +
  • Now you must do everything fast - * can't be written on the screen and +text below NaviKey can't change: instantly press * for a moment and let it, instantly press +* for longer time (2 sec. or longer) and let, instantly press * for a moment and let it
  • +
+ +

The reason of it is stack overflow (see test 35 +and test 57). If it doesn't work with your phone +and you have Nokia 6110, you can also use another trick to reboot phone: + +

    +
  1. Go to the Calendar (Menu-8)
  2. +
  3. Make a note or reminder.
  4. +
  5. Enter some text into the edit box.
  6. +
  7. Hold "Clear" until the whole text is cleared, then press "Back".
  8. +
  9. Press "0". The main screen will now be showing but a space appears on the screen. (you can't see it)
  10. +
  11. Enter 4 digits (e.g. 1234).
  12. +
  13. Use the down arrow to move the cursor to the left side of the numbers and the space (Down arrow twice).
  14. +
  15. Now enter 6 digits and press the call button.
  16. +
+ +

TDMA 800/TDMA 1900 phones: + +

After activation you gain access to the new position (called "Field Test") in main phone menu. + +

When you enter this menu, you can type number of the test, which should be displayed (1-7 in +Nokia 6160) or enter 0 to disable it. + +

You can look at different tests by scrolling them using up/down arrows. During voice calls, depending on how +NetMonitor was entered, the arrow keys may switch tests (you can't change volume then) or adjust volume. + +

If the keypad is locked while a NetMonitor tests are active, pressing +0-9, *, or # will toggle the screen back to the User Interface Display. +Pressing Talk, End, the arrow keys, or the soft menu keys will return the test. + +

In Nokia 2120 or 2160 you can also display description (help) to displayed +tests by pressing and holding "ABC" key. + + +

Back to the top + + +

10. Can I damage my phone ?
+


+ +

Probably only during NetMonitor activation +(especially in phones with NAM programming menu) or in Nokia 6210 or 3210 +(more in description for test 17). + +

I’ve never heard of such accident +(my own strange and hard attempts :-) failed, too) during using it in different phones. +But of course you should be careful - netmonitor is "unofficial" part of +phone's firmware. + +

If something doesn't work correctly, switch the phone off and then back on +- all tests, you can set (excluding test 17), +should be set to their default values... + + +

Back to the top

+ +

+

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] +

+
+
+ +

Marcin Wiacek (WWW) +
Last modification: 10 March 2002
+ + + diff --git a/Docs/en_US/gsm/netmon/faq_net1.htm b/Docs/en_US/gsm/netmon/faq_net1.htm new file mode 100644 index 0000000..4995103 --- /dev/null +++ b/Docs/en_US/gsm/netmon/faq_net1.htm @@ -0,0 +1,504 @@ + + + + + + + + + + NetMonitor in Nokia phones (2/7) + + + + + +

Main page

+ +
NetMonitor in Nokia phones (2/7) + +

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] + +

+ +
+ + + +
    +
  1. What is it ?
  2. +
  3. Do I need it ?
  4. +
  5. Does my phone use more power with NetMonitor enabled ?
  6. +
  7. How to activate it ?
  8. +
  9. Which NetMonitor version can be activated in my phone ?
  10. +
  11. Does NetMonitor activation void warranty ?
  12. +
  13. NetMonitor menu in my phone has different number than 10. Is it normal ?
  14. +
  15. NetMonitor menu in my phone has 11 number, hovewer previous position has 9 number. Is it normal ?
  16. +
  17. How to use it ?
  18. +
  19. Can I damage my phone ?
  20. +
  21. Glossary
  22. +
  23. Description of the individual tests
  24. +
  25. You can also use a program...
  26. +
  27. Can I use NetMonitor without SIM card inserted, without PIN number entered or when SIM card is not active ?
  28. +
  29. How can I disable NetMonitor ?
  30. +
  31. Do I need to disable NetMonitor before sending my phone to the service ?
  32. +
  33. Is it possible to re-activate NetMonitor after disabling it ?
  34. +
  35. Is NetMonitor available in analog Nokia phones ?
  36. +
  37. Does NetMonitor allow to use phone like broadcast station ?
  38. +
  39. I don't have all described tests in my phone. Why ? Can I increase their number ?
  40. +
  41. Does NetMonitor allow to identify place, where is my interlocutor ?
  42. +
  43. Does NetMonitor allow to identify place, where am I ?
  44. +
  45. What are NetMonitor codes ?
  46. +
  47. Is it the truth, that in phones with additional hardware changing frequency band NetMonitor doesn't work correct ?
  48. +
  49. Where can I find description of FBUS/MBUS protocol and commands connected with NetMonitor ?
  50. +
  51. I have non existing networks on the list of forbidden networks...
  52. +
  53. How to check frequency band (900 or 1800 Mhz), where phone work in this moment ?
  54. +
  55. Can I use DLR-2/DLR-3 cables for activating netmonitor ?
  56. +
  57. Can I activate netmonitor using Init File Editor (Nokia 9110) ?
  58. +
  59. Can I force phone to use one frequency band (900 or 1800 Mhz) only ?
  60. +
  61. How to change settings in tests ?
  62. +
  63. My phone has very short snandby time - it is possible to see the reason of it ?
  64. +
  65. Is netmonitor available in English version only ?
  66. +
  67. Information sources
  68. +
  69. Additional information
  70. +
  71. Does using/activating netmonitor cost anything ?
  72. +
  73. Does using netmonitor is legall ?
  74. +
  75. Which entries on SIM card are used in netmonitor tests ?
  76. +
  77. Can I activate netmonitor in 3310 using soft working with 3210 ?
  78. +
  79. After activating netmonitor/BTS TEST my phone can't find network...
  80. +
  81. Netmonitor shows different battery capacity than info on it...
  82. +
  83. NetMonitor in Nokia 6310, 8310,...
  84. +
+
+
+ +

11. Glossary
+


+ +

Here you can find explanation to some terms, which can be found in this FAQ: + +

ACCH (Analog Control Channel) +(TDMA 800/TDMA 1900) + +

AMPS (Advanced Mobile Phone Service) +
Analogue cellular system working in 800 Mhz used, for example, in North America. + +

ASIC (Application Specific Integrated Circuit) +
Electronic chips designed for some concrete purposes + (for example, in phone it controlls communication between MCU and DSP) +They're designed and produced by the companies which use them. + +

AVCH (Analog Voice Channel) +(TDMA 800/TDMA 1900) + +

BCC (Base-station Color Code) +(GSM/DCS/PCS) +
3-bit number (from 0-7 range) used to distinguish neighbor cells of the same operator, +transmitting using BCCH in the same +FDMA channel. Such distinguish is not needed when the cells belong to different operators +(they use different channels and their BCCH are in different FDMA channels). +It is given in BSIC of each BTS (you can check it for example in +test 2). + +

BSC (Base Station Controller) +(GSM/DCS/PCS) +
It controls and supervises one or more BTSes. + +

BSIC (Base Station Identity Code +or Base transceiver Station Identity Code) +(GSM/DCS/PCS) +
Unique ID number of each BTS. If we code this value binary, first three digits (in decimal format) +are BCC and next three are NCC. These values range from 0 - 63. +BSIC values can be found among others in test 2. + +

BTS (Base Transceiver Station) +(GSM/DCS/PCS) +
This device allows communication between phones and cellular network +(many parameters, like current communication channel, distance to BTS and signal quality can be found, for example, +in test 1). + +

And here are another classes with maximum power of BTS: + +

+ + + + + +
GSM 900
GSM 1800
+
320 W (55 dBm)
+160 W (52 dBm)
+80 W (49 dBm)
+40 W (46 dBm)
+
+
-
+-
+-
+-
+
+
20 W (43 dBm)
+10 W (40 dBm)
+5 W (37 dBm)
+2,5 W (34 dBm)
+
+ +

In Polish version of this FAQ I give many links to WWW pages with BTS lists, their descriptions, pictures (in Poland). + +

From English pages I recommend www.geckobeach.com/cellular/cellpixs/cellid.htm +site - it's about networks and BTSes in North America. + +

Another links connected with it: + +

+ + +

C1 (path loss-criterium) +(GSM/DCS/PCS) +
This is a parameter (ranging from -99 to 99 dBm) calculated by the phone to decide which cells to use +(it uses the cell only if its C1 is positive). This value is based on: + +

+

    +
  • RX +
    Strength of signal received in BCCH channel. If it is equal or less than +RxLevAm, the phone searches for next +BCCH channel. It is shown in +test 1 (for current channel) +and also in test 3, test 4 +and test 5 +(for neighbor channels). The amount of measurements of the quality of transmission with BCCH channels +in neighbor cells is given in test 62
  • + +
  • RxLevAm (Rx Level Access minimum) +
    Min. level of the received signal (usually from -100 dBm to -110 dBm) needed by the phone to use particular cell.
  • + +
  • MSTxPwr +
    Max power, which can be transmitted by phone to get access to +RACH channel (i.e. max power allowed by current cell). +Actually, it is lower in towns (where cells are small) and higher outside them. +
  • + +
  • MSMaxTxPwr +
    Max permissible transmission power of the phone (its classes are described in +TX description).
+ +

It is calculated using following formula: +C1 = (RX - RxLevAm - MAX ( ( MSTxPwr +- MSMaxTxPwr ), 0) ) , where MAX(x,y) is obviously a mathematical +function giving the bigger one of the discussed numbers. +The phone shows C1 value in test 1 (for current channel) and in +test 3, test 4 +and test 5 +(for neighbor channels). + +

C2 (cell-reselection criterion) +(GSM/DCS/PCS) +
This parameter (-99 to 99 dBm) is calculated with following formula: +C2 = C1 + Cell reselect +offset - Temporary offset +* H (Penalty time - T). +If this value for some other cell (C2 for +neighbor channels can be found in test 3, +test 4 and +test 5) is higher than this value for current cell +(shown in test 1 and test 3) +for a period of time longer than 5 seconds, the phone switches cells. There are two exceptions to the rule: + +

+

    +
  • if the new cell is located on different ‘Location Area (this parameter for current cell can be checked in +test 11), C2 for this cell must be (during more than 5 seconds) +higher than C2+CELL_RESELECT_HYSTERESIS for old cell (where CELL_RESELECT_HYSTERESIS is a +special parameter sent in BCCH channel).
  • + +
  • if the phone switched cells during last 15 seconds, C2 for a new cell must be higher at least 5 dBm from +C2 value of the old cell. +
  • +
+ +

H(x) function for currently not used cells is 0 (if x<0) or 1 (if x>=0). For current cell H(x) is always equal 0. +
By a skillful manipulation of this parameter (through CELL_RESELECT_HYSTERESIS), operators can direct +connections to specific cells (thus lightening load of the network). + +

CDMA (Code Division Multiple Access; also known as IS-95) +
One of the newer digital technologies in 800 or 1900 Mhz. Used in North America, Australia and some southeastern Asian countries +(e.g. Hong Kong and South Korea). It doesn't divide the radio frequency +spectrum into separate user channels by frequency slices or time slots, but +separates users by assigning them digital codes within the same broad spectrum. + +

DCCH (Digital Control Channel) +(TDMA 800/TDMA 1900) + +

DCS (Digital Cellular System) +
Cellular communication system working in 1800 MHz frequency band +(currently more often called GSM 1800) – a changed version of GSM (900 MHz) system. +Its new features allowed to increase network capacity (that’s why this system is used in urban areas with huge number +of subscribers) at the cost of thick net of the base stations (BTSes) +and to provide roaming within one country. GSM 1800 has different channel numbers +(see test 17), different phone +(see RX description) and BTSes +transmission power and also different max speed of the user, at which he can use his phone +(250 km/h in GSM and 130 km/h in DCS). + +

DSP (Digital Signal Processor) +
Signal processor (digital signals processing chip - controls radio interface and speech coding/decoding). +Its version can be checked in test 88. + +

DTCH (Digital Traffic Channel) +(TDMA 800/TDMA 1900) + +

DTX (Discontinous Transmission Exchange) +
Some phones and networks "care" ;-) about battery life using so called discontinuous transmission (DTX), +which turns off phone’s transmitter when we don’t talk (but – for example - listen to the calling party). +During that period the phone generates a so called comfortable :-) noise, because if our interlocutor heard the silence, +he could think that the connection was broken. + +

(GSM/DCS/PCS): +
DTX must be supported by the phone (Nokia does - see +test 78) and BTS - you can check and +(sometimes) change this in test 12 and +test 13. + +

FDMA (Frequency Division Multiple Access) +(GSM/DCS/PCS) +
This name means multiaccess on frequency field: transmission proceeds on different frequencies at the same time +(this is a "full duplex" connection): there is a “down-link” from BTS to the phone and +“up-link” - from the phone to BTS (this is called "up" and "down" because BTS +antennas are usually higher than phone ones, so the signal from BTS to the phone +really must go down (and vice versa)). + +

Frequency hopping (channel hopping) +(GSM/DCS/PCS) +
During connection your phone can continuously change used frequency (used channel) in communication with cell. +It's used, when some channel is still troubled - without channel hopping +communication with phone could not be possible, with it it's - only this +part of transmition, which is made on this frequency, is lost (so, if gives less number of +signal loss, but doesn't change sound quality - methods of coding it are always +the same). You can check (during a call) if your phone uses this function in +test 1. test 12 informs +if it is allowed by the cell (these values are updated only during a call). Channel hopping requires +Hopping Sequence Number (frenquencies are changed according to known for phone and network sequence) +- see test 2. + +

GSM (Global System for Mobile Communication) +
Cellular telecommunication system working at 900 MHz. It also has a 1800 MHz (DCS) and +1900 MHz (PCS) version. + +

HLR (Home Location Register) +(GSM/DCS/PCS) +
Network register containing information about subscribers (i.e. about their subscribed services, +tariff, last network they were logged in, etc.). + +

IMEI (International Mobile Equipment Identification code) +(GSM/DCS/PCS) +
Unique 15-digit identification number of every GSM phone on the world. It can be checked using *#06# code +(all phones) or in service menu (Nokia), which can be activated by typing a code *#WAR0ANTY# or +*#WARRANTY# (Nokia 6130). In Nokia 3110 after entering service menu (*#WAR0ANTY#) +you have to additionally enter a code 9268. IMEI contains information about the manufacturer, +place of production and serial number (check www.tele-servizi.com/janus/texts/imei.txt +for such list for Motorola phones, +here is my list for Nokia phones). +Operators can restrict network access for particular phones – for example the stolen ones +(identified using IMEI number). Different operators can exchange such lists too. + +

IMSI (International Mobile Subscriber Identify) +(GSM/DCS/PCS) +
Unique (max 15-digit) number given to the phone: + +

+

    +
  • first three digits are MCC
  • +
  • next three digits are MNC
  • +
  • the rest is a unique number
  • +
+ +

IMSI attach +(GSM/DCS/PCS) +
It is a procedure executed after each power on. The phone informs network that it is active (and is ready for communication +- receiving waiting SMS, etc.) and then it receives the IMSI number. +The counter connected with IMSI attach is located in test 64, +test 7 informs whether this is allowed by the current cell. + +

IMSI detach +(GSM/DCS/PCS) +
The phone informs network that it is going to switch off and the communication won’t be possible +(its IMSI expires). The counter connected with IMSI detach is located in +test 64. test 7 +informs whether this is allowed by the current cell. + +

Location Update +(GSM/DCS/PCS) +
Every GSM phone periodically informs network about its current location. +This function is called Location Update. It is executed after changing Location Area (phone makes +it "intelligent" - when it's moved out of network coverage and the logs again to the network, makes Location Update +only when current BTS has different LAC than previous one – before losing the signal) or +PLMN (after leaving the range of one network and trying to log in to another). +Then information about Location Update is transferred to a new MSC/VLR, +which in turn passes this information to HLR. When the phone works in new +MSC/VLR, HLR doesn’t identify the user by +the number received from old MSC/VLR anymore. Location Update +has a couple of varieties: PLU, IMSI attach and IMSI detach +(they're distinquished in test 64). Current Location Area code can be checked in +test 11. + +

MCU (Master Control Unit processor) +
Main processor in phone. + +

MSC (Mobile Switching Center) +(GSM/DCS/PCS) +
Part of the system responsible for communication between subscribers and other users (also from other networks). + +

NCC (National Color Code or Network Color Code) +(GSM/DCS/PCS) +
3-bit number (from 0-7 range) used to differentiate cells of the operators from different countries +(for example near the border, where the phone is in range of several different networks) transmitting using +BCCH in the same FDMA channel. This number is constant +within PLMN. It is given in BSIC of every BTS +(you can check it in test 2). + +

PLMN (Public Land Mobile Network) +(GSM/DCS/PCS) +
Area covered by one operator (one network). After changing this area, the phone executes +Location Update. + +

+

+ +

PLU (Periodic Location Update) +(GSM/DCS/PCS) +
The phone informs network, on which country area (in the range of which cells) it is located. +This procedure is executed periodically (depending on the network, for example in polish +Era GSM and +Plus GSM networks every 3rd hour, in +Idea every 2th hour) +- this can be checked in test 10. This period is counted from the +last „contact” with network (the counter doesn’t stop even if the phone loses network signal!) – from the last call, sending/receiving +SMS, requesting some services (for example enabling call diverting), because the network is then informed about phone’s +location (but this is not registered in test 64). +The counter connected with PLU is in test 64. + +

TCH (Traffic Channels) +(GSM/DCS/PCS) +
Two way user data (computer data or digitized voice) channels. They can be divided to: + +

    +
  • +HR (Half Rate Traffic): max data transfer rate is 6.5 kbit/sec (introduced in +GSM phase 2). HR channels offer worse sound quality but also longer phone standby time (even up to 30%), +because the phone using HR uses less power. The main advantage of this kind of channels is that they +enable the network to double its capacity (the number of subscribers able to make a call at the same time – see +TS parameter description for more details) or to double the max range of the +BTS. Using these channels must be allowed and supported by the network (this can be +checked in test 7) and the phone. Activation code is +*HRC0#, deactivation code is #HRC0#. Unfortunately, not all Nokia phones accept these codes +(the phone should reset itself after entering them) – in older models they're not supported, in never they're deactivated, when +the phone is directed to countries with networks, which doesn't support it. +Interesting fact is that in Nokia 6110 (firmware 5.24) you can decide whether the phone can use this channel or not by modifying +following EEPROM memory cells values: + + + + + + + + + + + + + +
    enablingdisabling
    cell 0070 value for 78 +
    cell 011F value for 84
    cell 0070 value for 70 +
    cell 011F value for 7C
    +
  • + +
  • +FR (Full Rate Traffic):transmission at 13 kbit/sec, coding using +LPC-RPE (Linear Prediction Coding with Regular Pulse Excitation) algorithm
  • + +
  • +EFR (Enhanced Full Rate): +13 kbit/sek, coding algorithm different than in FR (ASELP (AlgebraicCode Excitation Linear Prediction) +created by Nokia and Sherbrooke University; recognized as an industrial standard for +GSM). EFR provides better sound quality at the same data transmission rate (and up to 5% +faster battery drain compared to FR). This mode can be enabled using +*EFR0# code (the phone then tries to use TCH channels in following order: EFR, FR, +(HR)) and disabled with #EFR0# (order: FR, (HR)). These codes may be not recognized +by some models (for example 6110 with some firmware versions) - +if your phone accepts them, it should reset itself right after typing them +(if this doesn’t happen, you won’t be able to enable/disable EFR using a keyboard code). +This channel is not supported in all older models (for example, 2110). +The type of channel used by your phone can be checked only during connection. +
  • +
+ +

When you network doesn't support one of these channel and phone recognizes its activation code, you may see +"Not ready" message. + +

You can check this in test 1. +The sequence of TCH channels can be freely set using some of the service programs +(for example WinTesla – in Software/Product Profile menu) - it can be only possibility to enable HR channel in phone. + +

TDMA (Time Division Multiple Access) +(GSM/DCS/PCS) +
This means multiaccess in time: several phones can transmit signal (either digitized voice or computer data) in the +same time on the same channel (its number can be checked in test 1) – +actually, this period of time is divided into very small parts (see TS description), +invisible for us, so we can assume it happens simultaneously). + +

TMSI (Temporary Mobile Subscriber Identity): +(GSM/DCS/PCS) +
During signalization procedures encrypted on radio channel +(for example, during location update) this number is assigned by +MSC to phone. In the moment, when network wants to contact +with concrete phone and transmission on radio channel is not encrypted, it's send +instead of IMSI and allows phone to indentify, that concrete +call concern on it. It doesn't have global meaning +and it's structure is definited by network administrator. Actual TMSI +you can check in test 10. + +

TS (Time Slot) +
Each radio channel used in communication between phone and +BTS is divided into 8 parts (called TS - time slots). If in all BTSes +(available for your phone) all time slots are in use, you won't be able to make/receive a call and you'll get a 'Network busy' +message (information about reason of connection failure is given among others in +test 39). Unfortunately, each type of connection has the same priority in +networks not supporting GSM Phase 2+ (it isn't available in older GSM Phases) - so if you want to dial emergency number 112 +and the network is busy, no other call will be interrupted and you won't get connected. This problem can also be solved by +adding more BTSes (for example in dual GSM 900/1800 MHz network) or by modifying +current stations to allow the use of HR channels (FR +and EFR transmission uses whole assigned time slot, while HR +(defined in GSM Phase 2) only half of it). Max data transmission speed using one TS is 9.6 kbit/sec (or 14.4 kbit/sec, +but only in some additional conditions). There are new systems allowing higher transmission speeds +(for example GPRS (Generic Packet Radio Services) or HSCSD +(High Speed Circuit Switched Data), but they achieve this using several time slots +at the same time (which decreases network capacity). Actual used TS can be checked +in test 1, in phones with HSCSD (like Nokia 6210) +use also test 8 for it... + +

VLR (Visitor Location Register) +(GSM/DCS/PCS) +
This register contains the same data as HLR, but for roaming guests +(their data are taken from their home network HLR). + + +

Back to the top
+ +

+

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] +

+
+
+ +

Marcin Wiacek (WWW) +
Last modification: 10 March 2002
+ + + diff --git a/Docs/en_US/gsm/netmon/faq_net2.htm b/Docs/en_US/gsm/netmon/faq_net2.htm new file mode 100644 index 0000000..4977a97 --- /dev/null +++ b/Docs/en_US/gsm/netmon/faq_net2.htm @@ -0,0 +1,2408 @@ + + + + + + + + + + NetMonitor in Nokia phones (3/7) + + + + + +

Main page

+ +
NetMonitor in Nokia phones (3/7) + +

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] + +

+ +
+ + + +
    +
  1. What is it ?
  2. +
  3. Do I need it ?
  4. +
  5. Does my phone use more power with NetMonitor enabled ?
  6. +
  7. How to activate it ?
  8. +
  9. Which NetMonitor version can be activated in my phone ?
  10. +
  11. Does NetMonitor activation void warranty ?
  12. +
  13. NetMonitor menu in my phone has different number than 10. Is it normal ?
  14. +
  15. NetMonitor menu in my phone has 11 number, hovewer previous position has 9 number. Is it normal ?
  16. +
  17. How to use it ?
  18. +
  19. Can I damage my phone ?
  20. +
  21. Glossary
  22. +
  23. Description of the individual tests
  24. +
  25. You can also use a program...
  26. +
  27. Can I use NetMonitor without SIM card inserted, without PIN number entered or when SIM card is not active ?
  28. +
  29. How can I disable NetMonitor ?
  30. +
  31. Do I need to disable NetMonitor before sending my phone to the service ?
  32. +
  33. Is it possible to re-activate NetMonitor after disabling it ?
  34. +
  35. Is NetMonitor available in analog Nokia phones ?
  36. +
  37. Does NetMonitor allow to use phone like broadcast station ?
  38. +
  39. I don't have all described tests in my phone. Why ? Can I increase their number ?
  40. +
  41. Does NetMonitor allow to identify place, where is my interlocutor ?
  42. +
  43. Does NetMonitor allow to identify place, where am I ?
  44. +
  45. What are NetMonitor codes ?
  46. +
  47. Is it the truth, that in phones with additional hardware changing frequency band NetMonitor doesn't work correct ?
  48. +
  49. Where can I find description of FBUS/MBUS protocol and commands connected with NetMonitor ?
  50. +
  51. I have non existing networks on the list of forbidden networks...
  52. +
  53. How to check frequency band (900 or 1800 Mhz), where phone work in this moment ?
  54. +
  55. Can I use DLR-2/DLR-3 cables for activating netmonitor ?
  56. +
  57. Can I activate netmonitor using Init File Editor (Nokia 9110) ?
  58. +
  59. Can I force phone to use one frequency band (900 or 1800 Mhz) only ?
  60. +
  61. How to change settings in tests ?
  62. +
  63. My phone has very short snandby time - it is possible to see the reason of it ?
  64. +
  65. Is netmonitor available in English version only ?
  66. +
  67. Information sources
  68. +
  69. Additional information
  70. +
  71. Does using/activating netmonitor cost anything ?
  72. +
  73. Does using netmonitor is legall ?
  74. +
  75. Which entries on SIM card are used in netmonitor tests ?
  76. +
  77. Can I activate netmonitor in 3310 using soft working with 3210 ?
  78. +
  79. After activating netmonitor/BTS TEST my phone can't find network...
  80. +
  81. Netmonitor shows different battery capacity than info on it...
  82. +
  83. NetMonitor in Nokia 6310, 8310,...
  84. +
+
+
+ +

12. Description of the individual tests
+


+ +

Existence of the individual test in your phone depends on: + +

+

    +
  • phone model: generally, never and more complicated models (with more functions and options) have more tests (for example, +Nokia 9110 has more tests than 5110, 7110 more than 9110). There is one (only ?) exception: less complicated Nokia 5110 +has bigger NetMonitor than 6110 (and that’s why I think that this model is better, even though it doesn’t have some functions).
  • + +
  • software version - usually the newer version, the more options it has (software can be upgraded in service and its +version can be checked in most models with *#0000# code, in Nokia 6130 with *#9999# and in +3110 with *#3110#) – for instance in Nokia 5110 in test 89 bbbbbb +parameter is shown only from firmware 5.07. Firmware upgrade has also additional advantage: newer versions don’t +contain some bugs (also in NetMonitor).
  • + +
  • who uploaded firmware to the phone: it is usually written in C (and then translated (compiled) to the code of phone’s +microprocessor). According to my own private theory existence (and running) of an individual tests depends on some +constants set (or not) in the source code (programmers :-) surely understand, what I’m trying to write). The best example +for this can be test 38: according to the some English documentation +it doesn't exist in phones to be sold, because DEV_FT_MEMORY_DUMP_IN_USE constant in file ftd_conf.h +(one of the firmware source code files) wasn't set before compiling. I think, that the same applies to the help screens – +their presence doesn’t depend on firmware version but on where the phone was purchased (where it comes from – +where was its firmware uploaded). How to solve this problem? Unfortunatelly, you can only download firmware again (compiled +from source with set constants). + +

    Aha, I’m also not quite sure, whether DSP tests +(test 70, 10-73, +10-74, +10-76 (except for ab parameter), 10-77, +10-78 +and 10-79) don’t have to be enabled this way (or whether their existence +(or not) depends on the network). +

  • +
+ +

Help screens for tests are written with bold font, +concrete (example) values in tests with italic (I put them there, where I didn't have more details about test). + +

+

+ + +

Back to the top + + +

Test 1 +
Information about communication with cell + +

+ + + + + + +
+ + + + +
abbb ccc ddd
+ e ff g mmmm
+ nnn     ppp
+    oooo
+
+ + + + +
CH RxL TxPwr
+TS TA RQ RLT
+ C1     C2
+    CHT
+
+ +

+

    +
  • +a - contains H, if frequency hopping is enabled (otherwise empty). This information +can also be found in test 11 +and test 12.
  • + +
  • +bbb - CH (channel): number of the channel used in communication with cell (decimal). If +frequency hopping is enabled, this number changes when the display gets refreshed. +This parameter determines frequencies used in communication with BTS: + +

    + + + + + + + + + + + + + + + + + + + + +
    carrier (middle) frequency +of the transmission channel (MHz) +
    GSM 900
    GSM 1800
    transmission phone-BTS
    890 + CH * 0,2
    1710 + (CH - 511) * 0,2
    transmission BTS-phone
    935 + CH * 0,2
    1805 + (CH - 511) * 0,2
    + +

    +and informs, whether phone use cell working in GSM 900 or 1800 MHz +(I write more about channel numbers in test 17). + +

    + +

  • + +
  • +

    ccc - RX: +minus is not show if <=-100. This parameter affects following functions: + +

    +

      +
    • +if all channels’ signal is weaker than -110 dBm, the phone doesn’t monitor channels.
    • + +
    • +if the phone loses signal of your home network, it tries to monitor next available networks and if you don't have access to them, +you’ll see a network presence symbol and no signal strength bars (but you can make emergency calls) +
    • + +
    • + if some other network has a very strong signal (say -85 dBm) and your home network is very weak on that area (for example, +-100 dBm), your phone can have big problems with logging into it (you will have to use +test 17 to manually force the phone to use proper channel). +
    • + +
    • +RXLev parameter value: + +

      + + + + + + + + +
      RX (from)RX (up to)RXLev
      less than-110 dBm0
      -110 dBm-109 dBm1
      -109 dBm-108 dBm2
      .........
      -49 dBm-48 dBm62
      -48 dBmmorej63
      +

      +

    • + +
    • +signal strength indicator value on the left side of the display (approximately): + +

      + + + + + + + +
      RX (from - to)amount of bars
      from -105 to -100 dBm0
      from -100 to -95 dBm1
      from -95 to -90 dBm2
      from -90 to -85 dBm3
      more than -85 dBm4
      +

      +

    +
  • + + +
  • +

    ddd - TX: level of the transmitted signal (only during connection). If the phone’s transmitter is active, +there is an * (asterisk) before the value. The lower value, the higher power level (also the one received by your head!) and +energy consumption. + +

    + + + + + +
    TX (GSM 900)161514131211109
    TX (GSM 1800)98765432
    dBm11121314151617181920212223242526
    Watts0,0120,0160,020,0250,0320,040,050,0630,0790,10,1250,1580,20,2510,3160,398
    + +

    and continue... + +

    + + + + + +
    TX (GSM 900)8765432-0
    TX (GSM 1800)10313029
    dBm2728293031323334353637383940414243
    Watts0,5010,6310,79411,261,5822,513,163,9856,318101215,820
    + +

    +Watt = 10(dBm/10)*0,001 +
    dBm = 10*log(Watt/0,001) + +

    There are following classes describing max phone transmission power: + +

    + + + + + + + + +
    GSM 900
    GSM 1800
    +
    20 W (not in use) +
    8 W (car/mobile phone) +
    5 W (car/mobile phone) +
    2 W (hand phone) +
    0,8 (hand phone)
    +
    +
    1 W (hand phone) +
    0,25 W (hand phone)
    +
    + +

    Min. phone transmission power in GSM 900 is 0,02 W and in GSM 1800 is 0,0025 W (4 dBm). + +

    Max BTS power level can be found in their description. + +

  • + +
  • +

    e - This TS indicator shows number of the used time slot +(0..7 for FR (EFR) or 0..15 for HR). +For phones with HSCSD (like Nokia 6210) use also test 8 for it. +

  • + +
  • +

    ff - TA (Timing Advance): BTS informs the phone, +when it should start transmission (so that it reaches BTS in time). This information is shown +by this indicator. It lets us calculate approximate distance between phone and BTS, which is +a value between TA*550 m and (TA+1)*550 m (remember, that sometimes signal is refracted and +distance evaluated with this parameter can be wrong). +This parameter is updated during communication with network (sending/receiving +SMSes, calling, requesting services), for example when using SDCC and TFR +channels. It ranges from 0 to 63 (up to 35 km) with FR and +EFR channels. HR channels offer theoretically (for example +with a car antenna (higher transmitting power) and a flat terrain) twice this range (up to 70 km) and TA contains value up to 128 +(English descriptions which I use don’t say a word about it - so, it's possible, +that for values bigger than 64 phone (?) decreases 64 from it and displays such value in this menu). + +

    Tip: you can use ALS (Alternative Line Service) function or +try to call for "*" number, when you want to refresh it...

    + +

  • + +
  • +

    g - RXQUAL_SUB (rate of transmission errors with DTX active +(DTX state can be checked in test 12)): +it determines, how many errors during connection have to be corrected by the phone for the call to be possible. Range 0 - 7 +(0 – means no errors; more than 5 – connection may be interrupted). The higher it is, the worse quality you have... + +

    + + + +
    RQ value01234567
    Max error amount<0,2%<0,4%<0,8%<1,6%<3,2%<6,4%<12,8%>12,8%
    +

    +

  • + +
  • +

    mmmm - RLT (Radio Link Timeout): if it is negative, 0 is shown. Max value of this parameter is 64. +If the phone uses a channel different than TCH or SDCC, xx is +displayed +

  • + +
  • nnn - C1 parameter

  • + +
  • +

    ppp - C2 parameter. If network supports only GSM Phase 1, +C1 value is displayed here. +

  • + +
  • +

    oooo - type of channel currently used by the phone (visit +www.pins.co.uk/upages/stratfordc/ +to find C programs containing algorithms used to encode different channels). +With HR channels phone even show, if first or second +part of TS is used (subchannel 0 or 1 is written): + +

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    AGCH(Access Grant Channel) - a channel used by +BTS to inform the phone about what channel it should use (it is a +BTS answer to RACH) – it assigns the phone to +SDCCH
    BCCH(Broadcast Control Channel) +- a channel in direction BTS-phone, containing precise information about network +(needed for identification and access) – for example + +
      +
    • how often the phone should inform network about its location (T3212 counter value – more detailed description in +test 10)
    • +
    • whether frequency hopping is supported by the network
    • +
    • CELL_RESELECT_HYSTERESIS parameter (see C2 parameter description)
    • +
    • CELL_BARRED parameter (which informs, whether this cell is in test phase or is available for public use – but the phone +can ignore this and use test cells too - see test 19)
    • +
    +
    THR0TCH HR subchannel 0
    THR1TCH HR subchannel 1
    TFRTCH FR
    TEFRTCH EFR
    F144TCH FR - data transmission, speed 14.4 kbit/sec.
    F96TCH FR - data transmission, speed 9.6 kbit/sec.
    F72TCH FR - data transmission, speed 7.2 kbit/sec.
    F48TCH FR - data transmission, speed 4.8 kbit/sec.
    F24TCH FR - data transmission, speed 2.4 kbit/sec.
    H480TCH HR - data transmission, speed 4.8 kbit/sec., subchannel 0
    H481TCH HR - data transmission, speed 4.8 kbit/sec., subchannel 1
    H240TCH HR - data transmission, speed 2.4 kbit/sec., subchannel 0
    H241TCH HR - data transmission, speed 2.4 kbit/sec., subchannel 1
    FATCH FR - used only for quick signalization, for example in case of +handovers +
    (FACCH - Fast Associated Control Channel)
    FAH0TCH HR -used only for quick signalization, for example in case of +handovers +
    (FACCH - Fast Associated ControlChannel), subchannel 0
    FAH1TCH HR - used only for quick signalization, for example in case of +handovers +
    (FACCH - Fast Associated Control Channel), subchannel 1
    SDCCSDCCH (Stand-alone Dedicated Control +Channel) +- used for system signalization of: +
      +
    • establishing connection
    • +
    • user verification
    • +
    • Location Update executing
    • +
    • assigning to TCH
    • +
    • sending SMSes
    • +
    +
    CCCH(Common Control Channel ?) - used, when the phone is in standby mode (it doesn’t transmit not receive data)
    CBCH(Cell Broadcast Channel) - +a channel in BTS-phone direction used for cell broadcast (for example in Nokia 5110 it can +be enabled in Menu 2-5 and Menu 4-2-2, in Nokia 6110 in Menu 1-5 and Menu 4-4-2) +
    CCHRCCCH and CBCH joined in one
    SEARthe phone is searching for network
    NSPS(No Serve Power Save) +- the phone is not in range of any network, energy saving has been activated (information, whether your SIM card can stop its +clock in energy saving mode, can be found in test 51)
    +

  • +
+ +

Interesting thing: In firmware in Nokia 3210 and 3310 there are strings +which shows info about data transmission state +("officialy" these phones don't have this function)... + +

In Nokia 3110 this test looks similiar: + +

+ + + + + + +
+ + + + +
abbb cccc ddd
+ e ff g qqrr
+s Bttuu mmmm
+w ppp oonnn z
+
+ + + + +
 CH RxL TxPwr
+TS TA QPM RAR
+Ro BsiCLK RLT
+S C2 CHT C1 B
+
+ +

+

    +
  • cccc - in this phone minus is always shown
  • +
  • ooo - hex values
  • +
  • qq - paging mode (see test 2)
  • +
  • rr - RAR (description in test 2)
  • +
  • s - roaming indicator (description in test 2)
  • +
  • tt - BSIC for current cell (see test 2)
  • +
+ +

Level of received signal (RX) is connected with phone transmission power +(TX): the weaker the former, the stronger the latter (take a look at example indications of 6110 +using SDCC and TFR channels): + +

+ + + + + + +
RXTX
from -38 to -49 dBm19
from -68 to -75 dBm9-14 (0,032 - 0,316 Watt)
from -79 to -85 dBm7-9 (0,794 - 0,032 Watt)
from -85 to -93 dBm5-7 (2 - 0,794 Watt)
+ +

For curious people: some of these data can also be found in Nokia service programs (for example in WinTesla in +"Testing" / "RF Information" menu). + +

+ + + + + +
Using CCCH or CBCH channel by the phone +(if the cell doesn’t support cell broadcast – you can check this in test 7) depends +on its firmware version and whether cell broadcasting has been enabled (or not) by the user. For example: Nokia 5110 v 5.04 +uses CBCH channel, if you enable this feature in Menu 2-5 or Menu 4-2-2 +(and CCCH channel, if you disable it). I think, that cell broadcast should be disabled when it is not +supported by the network – probably you can save some battery power. It has been corrected in version 5.07 (when CB is +not supported by the network, the phone uses CCCH regardless of "Info service" and +"Cell info display" settings). + +

Additionally, ccc (RX) parameter can be used to set the direction of your antenna +(especially directional one) much more precisely than when using the indicator on the left side of phone’s display ! +I also have a piece of advice for you: never touch the antenna (in any case, you can check how it affects level of received +signal just by holding it with your fingers) ! + +

TA parameter can be also used (apart from calculating the distance to BTS) +to measure speed (for example of the care you’re driving). I’m serious! But this can be done only when: + +

    +
  • the road is straight (no bends)
  • +
  • the phone uses only one BTS
  • +
  • BTS must be located near the road
  • +
+ +

A little bit of mathematics: +
+
From Pitagoras’ theorem: + +

a2 = c2 + e2 +
b2 = c2 + f2 + +

So: +
e = +
f = + +

Now d = e - f =- + +

If you know: + +

+

    +
  1. +the way traveled by the car (on the drawing: length of "d" segment; it can be calculated form the lengths of "a" and "b" +segments (multiples of 513 m (for simplification) read from TA) and c (described later)) +
  2. + +
  3. +time, in which TA has changed (measured by a stopwatch) +
  4. +
+ +

you can measure your speed. +
Inaccuracy of this measure depends on: + +

+

    +
  • +distance between BTS and road (segment "c") +
  • + +
  • +velocity itself +
  • + +
  • +distance between car and BTS +(with longer distance inaccuracy depends less from "c" segment) +
  • +
+ +

And here is a concrete example: +
The original value of TA was 2 and after 15 seconds it has changed to 1. You will get following results: + +

+

    +
  • 123,120 km/h (BTS 0 m from road)
  • +
  • 124,320 km/h (100 m from road)
  • +
  • 128,160 km/h (200 m)
  • +
  • 135,600 km/h (300 m)
  • +
+ +

You can assume, that "c" segment is 100 m (or 0 if you count in memory - then d = e - f) and the inaccuracy of the measured +velocity is 5 km/h. +

+ +

In Nokia 2110i/2140 this test looks like follows: + +

+ + + + + + +
+When transmitter works - call or Location Update + + + + +
+ +CH  C1 RXl
+Pwr TS  Ql
+TA RLT  RA +
+
+During standby + + + + +
+ +CH  C1 Rxl
+Pwr TS  Ql
+TAXXXXX RA +
+
+ +

+

    +
  • CH - channel number
  • +
  • C1 - value of C1
  • +
  • Rxl - RX level (in dBm)
  • +
  • Pwr - TX level or "*" (enabled transmitter) or "S" (SDCCH) or "T" (TCH)
  • +
  • TS - Time Slot
  • +
  • Ql - quality or received signal
  • +
  • TA - Timing Advance
  • +
  • RLT - Radio Link Timeout
  • +
  • RA - maximal number of Random Access retransmission
  • +
  • XXXXX - type of actual channel +
      +
    • ACCESS
    • +
    • CCCH
    • +
    • BCCH
    • +
    • SEARCH
    • +
    • NSPS
    • +
    +
  • +
+ +

In Nokia 2120 this test looks as follows: + +

+ + + + + + +
+Digital mode + + + + +
+ +rssi DVC d
+chan  l  a
+S   BB  TT
+
+Analog mode + + + + +
+rssi  s  d
+chan  l  a
+CS-state
+
+ +

and in Nokia 2160 is different: + +

+ + + + + + + + + + + + +
+DCCH mode + + + + +
+rssi DVC S
+chan  Pw A
+CS-state
+

+

+DTCH mode + + + + +
+rssi   s d
+chan   l a
+CS-state
+

+

+ACCH mode + + + + +
+rssi   D d
+chan  Pw A
+CS-state
+
+AVCH mode + + + + +
+rssi DVC S
+chan   l a
+CS-state
+
+ +

for Nokia 6160 it looks like follows: + +

+ + + + + + + + + + + + +
+DCCH mode + + + + +
+rssi DVC S
+Bchan Pw A
+CS-state
 
+

+

+DTCH mode + + + + +
+rssi DVC s
+Bchan Be l
+CS-state
 
+

+

+ACCH mode + + + + +
+rssi D d
+Bchan Pw A
+CS-state
 
+
+AVCH mode + + + + +
+rssi s d
+Bchan l a 
+CS-state
 
+
+ +

+

    +
  • B = current network/frequency

    +

      +
    • a = a-side 800mhz cellular
    • +
    • b = b-side 800mhz cellular
    • +
    • A = A-block (30 mhz) 1900mhz PCS
    • +
    • B = B-block (30 mhz) 1900mhz PCS
    • +
    • C = C-block (30 mhz) 1900mhz PCS
    • +
    • D = D-block (10 mhz) narrowband 1900mhz PCS
    • +
    • E = E-block (10 mhz) narrowband 1900mhz PCS
    • +
    • F = F-block (10 mhz) narrowband 1900mhz PCS
    • +
    +

    +

  • + +
  • Be = Bit Error rate in % (0-16)
  • +
  • TT = last received time alignment value (0-31)
  • +
  • rssi = received signal strength (dBm) (min= -113dBm, max= -51dBm, 2dB steps)
  • +
  • DVC = Digital Verification Color code (1-255, - = not locked)
  • +
  • D = DCC (Digital Color Code) on ACCH (0-3, - = not locked)
  • +
  • s = SAT color (0-2, - = not locked)
  • + +
  • d = data receiving status +

    +

      +
    1. no sync/no data
    2. +
    3. sync/not able to read
    4. +
    5. reading correcting
    6. +
    7. reading no correction
    8. +
    +

    +

  • + +
  • S = slot (1-3)
  • +
  • chan = channel number (0001-1023)
  • + +
  • Pw = Max access power +

    +

      +
    • DCCH: MS-ACC-PWR (0-10, - = not locked)
    • +
    • ACCH: CMAC (0-7, - = not locked)
    • +
    +

    +

  • + +
  • l = Tx level (0-10, - = TxOff)
  • +
  • a = audio state (0=off, 1=on)
  • + +
  • CS-state = Cellular State +

    +

      +
    • DCCH: SCAN-LOCK : Scanning and locking of DCCH
    • +
    • DCCH: DCCH-SEL  : DCCH selection
    • +
    • DCCH: CAMPING   : Camping
    • +
    • DCCH: REGISTR   : Registration proceeding
    • +
    • DCCH: WAIT-ORDER: Waiting for order
    • +
    • DCCH: ORIGINAT  : Origination proceeding
    • +
    • DCCH: RSELECT   : Reselection
    • +
    • DCCH: ORIG-SMS  : Sending SMS proceeding
    • +
    • DCCH: TERM-SMS  : Receiving SMS proceeding
    • +
    • DTCH: TCH       : Confirm traffic channel
    • +
    • ATCH or DTCH: CONVERSAT : Conversation
    • +
    • ACCH: OOR       : Out of range
    • +
    • ACCH: SCAN-PDCH : Scan primary dedicated control channels
    • +
    • ACCH: SCAN-SDCH : Scan secondary dedicated control channels
    • +
    • ACCH: SCAN-PCH  : Scan paging channels
    • +
    • ACCH: IDLE      : Idle
    • +
    • ACCH: ACCESS    : Access
    • +
    • ACCH: VCH      : Confirm voice channel
    • +
    +
  • +
+ +

This test in Nokia 6185/6188 is, of course ;-), different: + +

+ + + + + + + + + + + + + + + + + + + +
+CDMA control + + + + +
+ +CSST CHAN SP
+PPN EC/SO XF
+LOS XHO FR B
+-Rxx-Txx FER +
+

+

+CDMA traffic + + + + +
+ +CONV 0450 NP
+8000 2
+000 0D9 00 0
+-093+006 000
+
+

+

+AMPS control + + + + +
+ +RSSI S D
+CHAN P A
+CSST SID E
+XTBY MINMAX  +
+
+AMPS traffic + + + + +
+ + +-095 2 3
+0273 0 0
+CONV 16427 0
+Y +
+
CDMAAMPS
+
    +
  • CSST - Cellular State: IDLE, CONVE, PLIOS, TIME, SYNC, RELE, PAGE, TRFIN, W_OR
  • +
  • Chan - Channel
  • +
  • NP, NC, SC, SP - xC for 800 MHz CDMA, xP for 1900 MHz CDMA.
  • +
  • PPN - PseudoNoise offset
  • +
  • EC/SO - Energy per chip per noise
  • +
  • B - Current network/frequency. a,b are A and B 800 MHz AMPS (analog). A-F indicate the digital block in use
  • +
  • Rxx - Receive power in dB
  • +
  • Txx - Transmit power in dB
  • +
  • FER - Frame Error Rate
  • +
  • In CDMA traffic screen you have current used codec too (one from these below): +

      +
    • 8000 - 13 kbit/sec
    • +
    • 0001 - 8 kbit/sec
    • +
    • 0003 - EVRC
    • +
    + +
+
    +
  • RSSI - Received signal strength
  • +
  • S - Slot (1-3)
  • +
  • D - Digital Colour Code on analog control channel (0-3 or - for not locked)
  • +
  • CHAN - Channel
  • +
  • CSST - Cellular State: IDLE, CONVE, PLIOS, TIME, SYNC, RELE, PAGE, TRFIN, W_OR
  • +
  • SID - System ID (Cantel = odd number)
  • +
  • MINMAX: Minimum and Maximum RSSI over last time period ?
  • +
+
+ +

Test 2 +
More information about used cell + +

+ + + + + + +
+ + + + +
 aa b c Bdd 
+ ee f 
+ ggg hh iii
+ H=j mm nn
+
+ + + + +
PM RAR Ro BC
+RelR QLF
+CRO TO PenT
+H MAIO HSN
+
+ +

+

    +
  • aa - paging mode: + +

    +

      +
    • NO : normal
    • +
    • EX : extended
    • +
    • RO lub SB : paging reorganization
    • +
    +

    +

  • + +
  • +b - RAR (Random Access Retransmission): max amount of transmissions using +RACH channel (Random Access Channel - a phone-BTS +channel used to send a network access request – for example during logging in) +
  • + +
  • +c - if your phone is in roaming, R is displayed (otherwise empty). This information is also shown on the top of the display. +
  • + +
  • +dd - BSIC value for current cell
  • + +
  • +ee - reason of last connection end (this parameter is also present in +test 63 and test 39 +(you will find explanation there – see description of the first parameter)) +
  • + +
  • +f - RXQUAL_FULL (error rate in transmission with DTX disabled +(DTX state can be checked in test 12)): +it determines, how many errors have to be corrected by the phone, for the connection to be possible. Range 0 - 7 (0 – means none, +more than 5 – connection may be interrupted). + +

    + + + +
    RQ value01234567
    Max amount of errors<0,2%<0,4%<0,8%<1,6%<3,2%<6,4%<12,8%>12,8%
    +

    +

  • + +
  • +

    ggg - Cell reselect offset: range 0 - 63 (this value should be multiplied by 2 dB), 'xxx' +when transmitting. Needed to calculate C2.

  • + +
  • +

    hh - Temporary offset: range 0 - 7 (this value should be multiplied by 10 dB, 70 dB +means infinitely long time), 'xx' when transmitting. Needed to calculate C2.

  • + +
  • +

    iii - Penalty time: range 0 - 31 (it should be multiplied by 20 s), 'xxx' when transmitting. +Needed to calculate C2.

  • + +
  • +

    j - information about frequency hopping: + +

    +

      +
    • 0 - not used (single frequency used – so called RF (Radio Frequency))
    • +
    • 1 - used (different RF (Radio Frequencies) used)
    • +
    +

    +

  • + +
  • +

    mm - MAIO (Mobile Allocation Index Offset). +Range 0 - 63, 'xx' when j=0 (when frequency hopping is disabled – you can check +this in test 12)

  • + +
  • +

    nn - HSN (Hopping Sequence Number).Range 0 - 63, 'xx' when j=0 (when +frequency hopping is disabled – you can check +this in test 12) +

  • +
+ +

In some phones (for example, Nokia 8810 or Nokia 5110 with older firmware) +you will see parameters in two first lines only... + +

In Nokia 3110 this test looks as follows: + +

+ + + + + + +
+ + + + +
aaabbbccccddd
+aaabbbccccddd
+aaabbbccccddd
+w           z
+
+ + + + +
S CH C1 rx C2
+1 CH C1 rx C2
+2 CH C1 rx C2
+S    1N 2N  B
+
+ +

Description of the parameters can be found in menu test 3 +(in this model cccc parameters are always preceded by minus). + +

This test looks similiar in Nokia 2110i/2140 (description is also in +test 3): + +

+ + + + + + +
+ + + + +
+aaabbbcccc
+aaabbbcccc
+aaabbbcccc +
+
+ + + + +
+Serv cell 
+1. neighb
+2. neighb +
+
+ +

In Nokia 2120 this test looks as follows: + +

+ + + + + +
+ + + + +
+ENCR  CIPH
+DTX  XSTBY
+CS-state
+
+ +

+

    +
  • ENCR = when message encryption is on
  • +
  • CIPH = when Ciphering is on
  • +
  • DTX = when DTX is on
  • +
  • XSTBY= when enabled standby is on
  • +
  • CS-state = see previous parameter for details
  • + +
+ +

and in Nokia 2160 is different: + +

+ + + + + + + + + + + + +
+DCCH mode + + + + +
+mode   DTX
+ENCR  CIPH
+d    Be TA
+

+

+DTCH mode + + + + +
+ +mode   DTX
+ENCR  CIPH
+d    Be TA +
+

+

+ACCH mode + + + + +
+ +mode
+XSTBY
+       SID +
+
+AVCH mode + + + + +
+mode
 
+       SAT +
+
+
+ +

and here is for Nokia 6160: + +

+ + + + + + + + + + + + +
+DCCH mode + + + + +
+mode M C
+FB E SP pc
+net SID..
  +
+

+

+DTCH mode + + + + +
+mode DTX
+ENCR CIPR 
+d a TA S
+CODEC... +
+

+

+ACCH mode + + + + +
+mode
+XSTBY
+ SID      
  +
+
+AVCH mode + + + + +
+mode
 
+ SAT      
  +
+
+
+ +

+

    +
  • mode = DCCH, DTCH, ACCH, AVCH
  • +
  • SID = system ID [0-32767, - = not locked]
  • + +
  • DCCH mode +

    +

      +
    • M = maximum paging frame class supported by network (1-8)
    • +
    • C = current PFC (Paging Frame Class) (1-8)
    • +
    • FB = number of F-BCCH slots
    • +
    • E = number of E-BCCH slots
    • +
    • SP = number of SPACH slots
    • +
    • pc = PCH subchannel
    • +
    • net = supported network types, bit map (1=suported, 0=not, C=current): +first bit for Public, second for Private, third for Residential
    • +
    +

    +

  • + +
  • DTCH mode +

    +

      +
    • DTX = shown when DTX is on
    • +
    • ENCR = shown when message encryption is on
    • +
    • CIPH or CIPR = shown when voice ciphering is on
    • +
    • d = data receiving status (0=no sync, 1=sync)
    • +
    • Be = Bit Error rate in % (0-16)
    • +
    • TA = current time alignment (0-30)
    • +
    • a = audio state (0=off, 1=on)
    • +
    • CODEC... = current codec:

      +

        +
      • -EFR- = IS-136A ACELP coder
      • +
      + +
    +

    +

  • + +
  • ACCH mode +

    +

      +
    • XSTBY = shown when extended standby is on
    • +
    +

    +

  • + +
  • AVCH mode +

    +

      +
    • SAT = SAT validity as measured by DSP (0-32767)
    • +
    +

    +

  • + +
+ +

and for Nokia 6185/6188: + +

+ + + + + + + + + + + + + +
+CDMA control + + + + +
+ +PN1
+ECK         

  +

+

+

+CDMA traffic + + + + +
+ +PN1 PN3 PN5 
+ECK ECK ECK
+PN2 PN4 PN6
+ECK ECK ECK +
+

+

+AMPS control + + + + +
+ +X F S N N C
+SLEEP EMC
+SCC STC M
+RSSCPLCC CAL +
+
+AMPS traffic + + + + +
+ +2 2 1 0 4 1
+00015F927B13
+0029B 0A0 2
+140 372 0000
+
+
CDMA +

+

    +
  • PNx: CDMA PN offsets handoff canidate listing. Shows only the current offset while idling. +Shows 1 to 6 additional choices during traffic.
  • +
+
+ +

Test 3 +
Information about current and neighbor cells + +

+ + + + + + +
+ + + + +
aaabbbcccddd
+aaabbbcccddd
+aaabbbcccddd
+   ef gh
+
+ + + + +
SCH C1 rx C2
+1CH C1 rx C2
+2CH C1 rx C2
+    1N 2N
+
+ +

Meaning of these lines: + +

+

    +
  1. information about current cell
  2. +
  3. 1st neighbor cell
  4. +
  5. 2nd neighbor cell
  6. +
  7. e,f concern 1st neighbor cell, g,h concern 2nd neighbor cell
  8. +
+ +

+

    +
  • +aaa - CH (channel): number of channel used for communication with cell (decimal)
  • + +
  • +bbb - C1 values displayed only in standby mode. In active mode (ie. during connection) +letter B and BSIC for current cell are displayed. +
  • + +
  • ccc - RX: +minus is not shown if <=-100. Lets us calculate RXLev parameter value: + +

    + + + + + + + +
    RX (from)RX (up to)RXLev
    less than-110 dBm0
    -110 dBm-109 dBm1
    -109 dBm-108 dBm2
    ......... +
    -49 dBm-48 dBm62
    -48 dBmmore63
    +

    +

  • + +
  • +ddd - C2 parameter
  • + +
  • +e,g - contains F, if current cell is located on a restricted area (otherwise empty)
  • + +
  • +f,h: + +

    +

      +
    • +B means a cell in test phase (your phone can use barred cells – this can be enabled in +test 19)
    • +
    • N - a cell given for normal use
    • +
    • L - means low level
    • +
    • otherwise empty
    • +
    +

    +

  • + +
+ + + + + + + +
If you want to see, if actual used cell is barred or not, see on +test 19 (it depends on setting in that test)
+ +

Sometimes phone shows, that both C1 and +C2 for channel are equal -99 +- it means probably, that it wouldn't be able to log into it... + +

In Nokia 3110 this test looks like test 4. + +

It looks similiar in Nokia 2110i/2140 (desciption is in +test 4 too): + +

+ + + + + + +
+ + + + +
+aaabbbcccc
+aaabbbcccc
+aaabbbcccc +
+
+ + + + +
+3. neighb 
+4. neighb
+5. neighb +
+
+ +

In Nokia 2120 this test looks like test 4 in Nokia 2160. + +

In Nokia 2160 this test looks different (is displayed +in DCCH mode only): + +

+ + + +
+ + + + +
+RS SS SI b
+NA ND
  +
+
+ +

and here is for Nokia 6160: + +

+ + + +
+ + + + +
+RS SS SI b
+NA ND
+MA MD MO
  +
+
+ +

+

    +
  • RS = minimum Received signal Strength required to access cell (0-31, where 0=-113 dBm and 31=-51 dBm)
  • +
  • SS = minimum signal Strength Sufficient for candidate of reselection (0-31, where 0=-113 dBm and 31=-51 dBm)
  • +
  • SI = Scan Interval between consecutive strength measurements in hyperframes (1-16)
  • +
  • b = access burst size (0=normal, 1=abbreviated RACH)
  • +
  • NA = Number of Analog neighbors (0-24)
  • +
  • ND = Number of Digital neighbors (0-24)
  • +
+ +

and for Nokia 6185/6188: + +

+ + + + +
+OWNNUMBER
+ESN-00000000
+ESN-HEX
+SL P MD PC +
+ +

    +
  • OWNNUMBER - phone number
  • +
  • ESN - Electronic Serial Number
  • +
  • ESN-HEX - hexadecimal ESN
  • +
  • MD - [AD] changes to [DI] at 800 CDMA
  • +
+ +

Test 4 +
Information about neighbor cells + +

+ + + + + + +
+ + + + +
aaabbbcccddd
+aaabbbcccddd
+aaabbbcccddd
+  ef gh ij
+
+ + + + +
3CH C1 rx C2
+4CH C1 rx C2
+5CH C1 rx C2
+  3N 4N 5N
+
+ +

Meaning of the lines: +

    +
  1. 3rd neighbor cell
  2. +
  3. 4th neighbor cell
  4. +
  5. 5th neighbor cell
  6. +
  7. e,f concern 3rd neighbor cell, g,h 4th neighbor cell, i,j 5th neighbor cell
  8. +
+ +

Meaning of the letters is the same as in test 3 (i is the same as e, j is the same as f) + +

Sometimes phone shows, that both C1 and +C2 for channel are equal -99 +- it means probably, that it wouldn't be able to log into it... + +

In Nokia 3110 this test looks like test 5. + +

It looks similiar in Nokia 2110i/2140 (description is in +test 5 too): + +

+ + + + + + +
+ + + + +
+aaabbbcccc
+aaabbbcccc
+aaabbbcccc +
+
+ + + + +
+6. neighb 
+7. neighb
+8. neighb +
+
+ +

In Nokia 2160 this test looks different: + +

+ + + + +
+ + + + +
+bVo mod bs
+Tbat1 Tb2
+Wpwm FCmAh
+
+
+ +

+

    +
  • bVo = battery voltage
  • +
  • mod = charging mode + +

    +

      +
    • FAS = Fast charging
    • +
    • COL = Cold battery charging
    • +
    • MAI = Maintenance charging
    • +
    • ERR = wrong charger or battery not OK
    • +
    • LIC = LiION battery charging
    • +
    • TXO = charging, transmitter active (connection in progress)
    • +
    • *** = charger disconnected
    • +
    +

    +

  • + +
  • bs = battery is full or reason for fast charge termination + +

    +

      +
    • TI = max. charge Time elapsed
    • +
    • DV = dV/peak value detected (full)
    • +
    • BV = Battery voltage max limit
    • +
    • BT = Battery temp max limit (overheat)
    • +
    • ** = battery is not full
    • +
    +

    +

  • + +
  • Tbat1 = battery temp. a/d reading (subtracted from 1023)
  • +
  • Tb2 = battery temp. in C (not implemented)
  • +
  • Wpwm = PWM charge control output (000-250)
  • +
  • FCmAh = mAh rating of charge given to the battery
  • +
+ + +

In Nokia 2120 this test looks like follows + +

+ + + + +
+ + + + +
+ChargV:NNN
+ST hex des
+B:LLLL KKK
+
+ +

but it was not implemented. + +

In Nokia 6160 this test looks like follows + +

+ + + + +
+ + + + +
+SID #####
+NN NT NR
+Alphatag  
  +
+
+ +

+

    +
  • SID = System Identification Number (0 to 32767, odd for 'A' carriers, even for 'B' carriers, - = not locked)
  • +
  • Alphatag.. = textual end-user display of current system
  • +
+ +

and for Nokia 6185/6188: + +

+ + + + +
+CSST CHAN
+A B
+SID
+SD IT TM CAP +
+ +

    +
  • CSST - Cellular state: IDLE, CONVE, PLIOS, TIME, SYNC, RELE, PAGE, TRFIN, W_OR
  • +
  • CHAN - Channel
  • +
  • B - Network Band and Frequency (lowercase a,b = 800 MHz band; uppercase A,B = 1900 MHz band)
  • +
  • SID - System ID:

    +

      +
    • [17500] - Clearnet PCS
    • +
    • [16422] - BC Tel Mobility
    • +
    • [16xxx odd number] - Cantel AT&T
    • +
    +

  • +
+ +

Test 5 +
Information about neighbor cells + +

+ + + + + + +
+ + + + +
aaabbbcccddd
+aaabbbcccddd
+aaabbbcccddd
+  ef gh ij
+
+ + + + +
6CH C1 rx C2
+7CH C1 rx C2
+8CH C1 rx C2
+  6N 7N 8N
+
+ +

Meaning of the lines: +

    +
  1. 6th neighbor cell
  2. +
  3. 7th neighbor cell
  4. +
  5. 8th neighbor cell
  6. +
  7. e,f concern 6th neighbor cell, g,h 7th neighbor cell, i,j 8th neighbor cell
  8. +
+ +

Meaning of the letters is the same as in test 3 (i is the same as e, j is the same as f) + +

Sometimes phone shows, that both C1 and +C2 for channel are equal -99 +- it means probably, that it wouldn't be able to log into it... + +

In Nokia 3110 this test looks like test 6. + +

This test allows you to recognize, how many neighbor cells can "observe" phone +in the same time. Examples: in Nokia 6150 you can see info in all rows (8 cells), +in Nokia 5110/3310/6210 only in first row (6 cells). + +

In Nokia 3310/6210 parameters "ef" are never displayed (you can see "xx" only)... +These models during standby mode can see only 6 cells, during call 8... + +

In Nokia 2160 this test looks different: + +

+ + + +
+ + + + +
+ROM SW
+EPROM SW
+Prod type 
+
+ +

+

    +
  • ROM SW = ROM software version, e.g. V 65.08
  • +
  • EPROM SW = EPROM (flash) version, e.g. V 1.45
  • +
  • Prod type = product type, e.g. NHC-4NE
  • +
+ +

And here is for Nokia 6160: + +

+ + + +
+ + + + +
+S bandorde
+NC NP IRC
+RSCO RSLO
  +
+
+ +

+

    +
  • S = system indicator:

    +

      +
    • H = hometype system
    • +
    • P = partner roam
    • +
    • F = preffered roam
    • +
    • N = normal roam
    • +
    • X = no service
    • +
    • a, b, A, B, C, D, E, F = current band while scanning for a control channel +(see next parameter for details)
    • +
    +

  • + +
  • bandorde = network search order:

    +

      +
    • a = a-side 800mhz cellular
    • +
    • b = b-side 800mhz cellular
    • +
    • A = A-block (30 mhz) 1900mhz PCS
    • +
    • B = B-block (30 mhz) 1900mhz PCS
    • +
    • C = C-block (30 mhz) 1900mhz PCS
    • +
    • D = D-block (10 mhz) narrowband 1900mhz PCS
    • +
    • E = E-block (10 mhz) narrowband 1900mhz PCS
    • +
    • F = F-block (10 mhz) narrowband 1900mhz PCS
    • +
    +

  • + +
  • NC = Number of Cellular = number of probability blocks to scan in cellular bands
  • +
  • NP = Number of PCS - number of sub blocks to scan in PCS bands
  • +
  • IRC = IR Control:

    +

      +
    • 1 = only systems with home SID or SOC are accepted
    • +
    • 0 = any system not listed as forbidden is accepted
    • +

  • + +
  • RSCO = Rescan Count - rescan time in hyperframes
  • +
  • RSLO = Rescan Loop - defines when all the bands in bandorder are to be scanned
  • + +
+ +

and for Nokia 6185/6188: + +

+ + + + +
+1YNC_OK_097B
+SYNC_FAI4CC1
+FOCC_WOR587C
+WORD_OK_3E65
+
+ +

Test 6 +
Information about preferred and restricted networks of the inserted SIM card. + +

+ + + + + + + +
+ + + + +
aaabb  aaabb
+aaabb  aaabb
+aaabb  aaabb
+aaabb  aaabb
+
+ + + + +
LReg   1_For
+1_Pre  2_For
+2_Pre  3_For
+3_Pre  4_For
+ +

In Nokia 6250: + +

+ + + + +
LReg   1?For
+1?Pre  2?For
+2?Pre  3?For
+3?Pre  4?For
+ +

+ +

Meaning of the individual lines: + +

+ + + + + +
last registered network1st forbidden network
1st preferred network2nd forbidden network
2nd preferred network3rd forbidden network
3rd preferred network4rd forbidden network
+ +

+

    +
  • +last registered network - you used it last time. When you're in home country, it can be your home network +(you pay them for your calls - if it is, after choosing it manually (in Nokia 5110 - Menu 4-2-4) phone displays +"Home network selected"). 00000, when phone wasn't registered in any network +after enabling.
  • + +
  • +preferred network - network, to which your SIM card was logged (when it was in its range) – for example in roaming. +
  • + +
  • +forbidden network – your SIM card was in range of that network, but wasn’t allowed to log in... +
  • +
+ +
    +
  • +

    aaa - MCC (Mobile Country Code) +- code of the network home country (260 for Poland). Decimal value. +

  • + +
  • +

    bb - MNC (Mobile Network Code) +- network code (different for networks with the same MCC). + +

    Generally values here are decimal. Sometimes are exceptions (when and why ?) +and you can find hexadecimal value here: if you will convert it into +decimal and result treat as hexadecimal value (convert it into decimal value +again), you will have decimal value of this parameter (for example, +3F hex=63 dec; 63 hex=99 dec). More about it in the question 23. + +

    When you use phone working in PCS 1900 +system (for example, Nokia 6190), this number can be 3-digit long. It's decimal (always ?). +If it consist of two digits, you will see "F" instead of last (for example, +you will see "30237F" for 302-37 network)

  • + + +
+ +

What are these lists stored on SIM card for? Because: + +

+

    +
  1. +the phone doesn’t have to waste its power while trying to log to the network, which is forbidden for SIM card +(it is checked only once and then stored, so the phone doesn’t have to repeat this procedure anymore) +
  2. + +
  3. +when you have automatic network selection enabled, your phone in first turn searches for networks it was +previously using ("preferred"). +
  4. +
+ +

+The list of "preferred" and "forbidden" networks is written by the phone +(Nokia saves last chosen networks). Preffered networks can be also edited – for example in Motorola and Alcatel phones (not in Nokia). +Sometimes it is done by +the operator (he writes preferred and forbidden networks to the SIM card before selling it (it's known, that you cannot +log to competitive network – it can be stored in card programming phase). Both these lists can be changed using a +Czech program called SIMedit (www.compelson.cz/simedit.htm)... + +

URL http://kbs.cs.tu-berlin.de/~jutta/gsm/gsm-list.html +contains list of the MCC and MNC parameters for different networks. + +

+ + + + + + +
Using this menu you can check (probably – NOT ALWAYS!), where SIM card was used lately (in your country, abroad) +and where its owner was traveling +
+ +

In Nokia 2160 use this test, when you want to "disable" NetMonitor tests. + +

And here is for Nokia 6160: + +

+ + + +
+ + + + +
+PSC PSD   
+FSC FSD
+XSC XSD
  +
+
+ +

Intelligent Roaming Database (IRDB) statistics: + +

This lists the total count of SOCs and SIDs in each category. +The database has a total memory limit of 82 entries, +which may be distributed amongst these categories: + +

+PSC = number of Partner SOCs
+PSD = number of Partner SIDs
+FSC = number of Preffered SOCs
+FSD = number of Preffered SIDs
+XSC = number of Forbidden SOCs
+XSD = number of Forbidden SIDs
+ +

Partner SOC/SID = treated like the home system by the phone +
Preffered SOC/SID = preferred over neutral (undefined) systems when available +
Forbidden SOC/SID = rejected by the phone as service providers + +

and for Nokia 6185/6188: + +

+ + + +
CDMA
+ + + + +
+SID NID
+BASE ID
+P_REV
+MIN_P_REV    +
+
AMPS
+ + + + +
+0ORD_COR0CE3
+WORD_FAI0E76
+CTRL_FIL787D
+SAT_V_OK0004
+
+

CDMA

+

    +
  • SID - System ID:

    +

      +
    • [17500] - Clearnet PCS
    • +
    • [16422] - BCTel Mobility
    • +
    • [16xxx odd number] - Cantel AT&T
    • +
    • [00000]: Second SID assignment
    • +
    +
+

Are lines 3,4 CDMA specs ? [ANSI] for 1900 MHz, [TSB74] for 800 MHz CDMA +

+ +

Test 7 +
Information about current (recently monitored) cell + +

+ + + + + + +
+ + + + +
E A H C I BR
+a b c d e fg
+ECSC 2Ter MB
+h    i    j
+
+ + + + +
Serving Cell
+system info
+bits
+
+ +

+

    +
  • a - 1, if emergency calls (112) are possible
  • +
  • b - 1, if IMSI attach and IMSI detach are possible
  • +
  • c - 1, if the cell supports HR channels
  • +
  • d - 1, if C2 values are broadcasted
  • +
  • e - 1, system information 7 and 8 are broadcasted
  • +
  • f - 1, if the cell supports cell broadcasting (CBCH channel)
  • +
  • g - 1, if cell re-establishment is possible
  • +
+ +

Last two lines are present only in dual phones (GSM 900/1800 – for example Nokia 6150 and 3210): + +

+

    +
  • +h - 1 in standby mode, if ECSC (Early Classmark) sending is supported. During a call "x" is displayed. +
  • + +
  • +i - 1 in standby mode, if 2-Ter messages are supported. During call "x" is displayed +
  • + +
  • +j - information (if supported) which cells from both frequencies bands (900 and 1800 MHz) are shown +(MULTIBAND_REPORTING parameter value). Description from +Phase2+ ETSI GSM 05.08 version 5.4.0, section 8.4.3 "Additional cell reporting requirements for multi band MS" specification: + +

    +

      +
    • +0 - 6 strongest cells (with known and allowed NCC from +BSIC), regardless their frequency band (900 or 1800 MHz)
    • + +
    • +1 - strongest cell (with known and allowed +NCC from BSIC) in each frequency band on +BA list, except for frequency band of the current cell. Remaining positions should be used to show cells in frequency band +of the current cell. If there are free positions left, further strongest and recognized cells from other bands are shown (their +frequencies bands are not important). +
    • + +
    • +2 - like in 1, but two strongest cells are shown first (with known and allowed NCC from +BSIC) in each band... +
    • + +
    • +3 - three strongest cells are shown first...
    • +
    +
  • + +
+ +

If your phone wasn’t logged to any network, some default values are shown. + +

In Nokia 6160 this test is different: + +

+ + + + +
+User
+interface 
+display
  +
+ +

and here is for Nokia 6185/6188: + +

+ + + +
CDMA
+ + + + +
+CSST         
+DATE
+TIME
  +
+
AMPS
+ + + + +
+1AT_V_FA0000
+FVC_S_FA0000
+WFLG_INT7046
+NORMALRXFE25
+
+

CDMA

+

    +
  • CSST - Cellular state: [IDLE], [CONVE], [PLIOS], [TIME], [SYNC], [RELE], [PAGE], [TRFIN], [W_OR]
  • +
  • DATE - CDMA Network date
  • +
  • TIME - CDMA Network time
  • +
+
+ + +
Back to the top
+ +

+

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] +

+
+
+ +

Marcin Wiacek (WWW) +
Last modification: 10 March 2002
+ + + diff --git a/Docs/en_US/gsm/netmon/faq_net3.htm b/Docs/en_US/gsm/netmon/faq_net3.htm new file mode 100644 index 0000000..44c407a --- /dev/null +++ b/Docs/en_US/gsm/netmon/faq_net3.htm @@ -0,0 +1,2573 @@ + + + + + + + + + + NetMonitor in Nokia phones (4/7) + + + + + +

Main page

+
NetMonitor in Nokia phones (4/7) +

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] +

+ +
+ +
    +
  1. What is it ?
  2. +
  3. Do I need it ?
  4. +
  5. Does my phone use more power with NetMonitor enabled ?
  6. +
  7. How to activate it ?
  8. +
  9. Which NetMonitor version can be activated in my phone ?
  10. +
  11. Does NetMonitor activation void warranty ?
  12. +
  13. NetMonitor menu in my phone has different number than 10. Is it normal ?
  14. +
  15. NetMonitor menu in my phone has 11 number, hovewer previous position has 9 number. Is it normal ?
  16. +
  17. How to use it ?
  18. +
  19. Can I damage my phone ?
  20. +
  21. Glossary
  22. +
  23. Description of the individual tests
  24. +
  25. You can also use a program...
  26. +
  27. Can I use NetMonitor without SIM card inserted, without PIN number entered or when SIM card is not active ?
  28. +
  29. How can I disable NetMonitor ?
  30. +
  31. Do I need to disable NetMonitor before sending my phone to the service ?
  32. +
  33. Is it possible to re-activate NetMonitor after disabling it ?
  34. +
  35. Is NetMonitor available in analog Nokia phones ?
  36. +
  37. Does NetMonitor allow to use phone like broadcast station ?
  38. +
  39. I don't have all described tests in my phone. Why ? Can I increase their number ?
  40. +
  41. Does NetMonitor allow to identify place, where is my interlocutor ?
  42. +
  43. Does NetMonitor allow to identify place, where am I ?
  44. +
  45. What are NetMonitor codes ?
  46. +
  47. Is it the truth, that in phones with additional hardware changing frequency band NetMonitor doesn't work correct ?
  48. +
  49. Where can I find description of FBUS/MBUS protocol and commands connected with NetMonitor ?
  50. +
  51. I have non existing networks on the list of forbidden networks...
  52. +
  53. How to check frequency band (900 or 1800 Mhz), where phone work in this moment ?
  54. +
  55. Can I use DLR-2/DLR-3 cables for activating netmonitor ?
  56. +
  57. Can I activate netmonitor using Init File Editor (Nokia 9110) ?
  58. +
  59. Can I force phone to use one frequency band (900 or 1800 Mhz) only ?
  60. +
  61. How to change settings in tests ?
  62. +
  63. My phone has very short snandby time - it is possible to see the reason of it ?
  64. +
  65. Is netmonitor available in English version only ?
  66. +
  67. Information sources
  68. +
  69. Additional information
  70. +
  71. Does using/activating netmonitor cost anything ?
  72. +
  73. Does using netmonitor is legall ?
  74. +
  75. Which entries on SIM card are used in netmonitor tests ?
  76. +
  77. Can I activate netmonitor in 3310 using soft working with 3210 ?
  78. +
  79. After activating netmonitor/BTS TEST my phone can't find network...
  80. +
  81. Netmonitor shows different battery capacity than info on it...
  82. +
  83. NetMonitor in Nokia 6310, 8310,...
  84. +
+ +
+ +

Test 8 + +

In Nokia 6185/6188 it looks like follows: + +

+ + + +
CDMA
+ + + + +
+TADD TDROP
+TCOMP TTDROP
+WW1 WW2 WW3
  +
+
AMPS
+ + + + +
+1STBY_RX7244
+XNRML_RX006C
+X_N_RX_O004C
+X_N_RX_F0020
+
+

CDMA

+

    +
  • TADD - threshold to add a new active PN (raw value ex: 28 = Ec/Io at -14 dB), [TDROP] : threshold to drop an active PN (raw value ex: 32 = Ec/Io at -16 dB)
  • +
  • TCOMP - an other threshold to add an active PN when a candidate PN becomes stronger than an active PN
  • +
  • TTROP - timer to drop a PN when power of this PN goes below TDROP
  • +
  • WW1 - value of the seach window for the active PN
  • +
  • WW2 - value of the seach window for the neighbour PN
  • +
  • WW3 - value of the seach window for the remaining PN.
  • +
+
+ +
In Nokia 6210: + +

+ + + + + + + + +
+ + + + +
+CCCH
+Ts  01234567
+Rx  xxxxxxxx
+Tx  xxxxxxxx
+mCh x mPw xx +
+
+ + + + +
+9600/14000

+TS for Rx
+TS for Tx
+MainCh/PwrLv +
+
+ +

it is connected with data transmission. +In line with Rx and Tx you see, which Time Slots are used for it +(for receiving and transmiting). + +

When phone doesn't use HSCSD (High Speed Circuit Switched Data), +only one time slot is used both for transmiting and receiving +(it's visible also in test 1 then). + +

When use HSCSD, only this test gives full information about it... +You can check here, what can be maximal theoretical speed for downloading +and uploading data (number_of_used_slots * 9600 or number_of_used_slots * 14000)... + +
mCh seems to be "main" time slot among them used for transmission +(one that seems to be always used for both ways - probably can be viewed as the slot +that would be used if no HSCSD were used, and all other slots are "extra" slots to +increase number of sent/received data). It seems to be displayed in +test 1 too... + +
mPw seems to be the power level for the "main" time slot +(it seems to be displayed in test 1 too - units +are the same).... +The power levels for all 8 individual slots can be found in +test 9. + +

First line shows channel displayed in test 1 too. +It's available in new firmware only (5.02). + +

In Nokia 9210: + +

+ + + + + + + + +
+ + + + +
+Ts  01234567
+Rx  xxxxxxxx
+Tx  xxxxxxxx
+mCh x mPw xx +
+
+ + + + +
+HSCSD call
+Rx timeslots
+Tx timeslots
+MainCh TS Pw +
+
+ +

Test 9 + +

In Nokia 6185/6188 it looks like follows: + +

+ + + +
CDMA
+ + + + +
+006 330 270
+047 062 062
+342 102 030
+062 062 062
+
+
AMPS
+ + + + +
+1PT_1_OK724E
+RPT_1_FA0042
+TIME__2_0000
+MER2HIGH0002
+
+

CDMA

+Tracked PN Offsets (lines 1,3) and EC/SO (Energy per chip per noise). +An EC/SO of 062 likely means not really usable? lower numbers are better +strengths). See test 2 for PN offset information. +

+ +
In Nokia 6210: + +

+ + + + + + + + +
+ + + + +
+mCh x mPw xx
+ xx xx xx xx
+ xx xx xx xx
  +
+
+ + + + +
+MainCh/PwrLv
+PwrLv TS 0-3
+PwrLv TS 4-7
+  +
+
+ +

and is connected with HSCSD (High Speed Circuit Switched Data) +and shows power levels for each time slot +used in data transmission +(more info about data transmission in Nokia 6210 is visible also in +Test 8). Units here seems to be the same to units +in test 1 (power level used for "main" +time slot in transmission is displayed also there). + +

In Nokia 9210 test looks like in 6210, help is different: + +

+ + + + +
+MainCh Tw Pw
+TS1  2  3  4
+  5  6  7  8
+HSCSD PW Lev +
+ +

Test 10 +
Network information (concern current or recently monitored network) + +

+ + + + + + +
+ + + + +
TMSIaaaaaaaa
+T321:bbb/ccc
+PRP:d  ee ff
+ ggggg  hhh 
+
+ + + + +
TMSI(hex)
+T3212ctr/tim
+PaRP DSF AGC
+  AFC   Ch
+
+ +

+

    +
  • +aaaaaaaa - TMSI: +a number assigned to each phone logged to the network (it can be done, for +example, after power on, a call, sending/receiving SMS, requesting some services, +PLU). Value from the SIM card +(each new number is written there) in hexadecimal format. If assigning this +number fails (for example because transmitter was turned off in +test 45 or SIM card is not active), +'xxxxxxxx' is shown here and the phone displays 'No network coverage' message (when you try +to make a call). +
  • + +
  • +bbb - value of the so called T3212 counter: the phone periodically informs +the network about its location +(makes a PLU). 'bbb' counter means time from +last update and can be a value from 1 to 'ccc' (where 1 means 6 minutes, 2 - +2 * 6 min = 12 min, etc.). This counter is also cleared after each connection, +sending/receiving SMS or requesting a network services - for example call +diverting (but the counters from test 64 +don't change). The value doesn't change (it's always equal 0) with not active +SIM card.
  • + +
  • +ccc - max T3212 counter value: period of time, after which the phone sends +information about its location - makes a PLU +(range from 1 to 240, where 1 means 6 min between updates and 240 means +24 hours (240*6min)). This value is received from the network (if it is 0, +the network doesn't require information about phone location). For Polish +networks Era GSM and +Plus GSM it's equal 30 (3h), for +Idea 2h. Displayed normally +even, when SIM card is not active. +
  • + +
  • +d - Paging Repeat Period, sometimes called DRX (Dincontinuous Receive): +period of time, after which the phone turns its receiver on to check whether +someone is calling us (range from 2 to 9 - the higher, the longer time between +these checks so the phone uses less power: +PRP=2 means about 0.95 s, a PRP=9 equal 4.25 s.). +Interesting thing is that max standby times are usually calculated by the manufacturers +for this parameter equal 9. +
  • + +
  • +ee - DSF (Downlink Signalling Failure). If it is negative, +0 is shown. Max value of this parameter is 45. When the phone uses +TCH channel, xx is displayed. +
  • + +
  • +ff - AGC (Automatic Gain Control) - automatic gain control +of the phone receiver. The stronger the signal from BTS, +the lower this value. It is displayed correctly only when the phone uses +TCH/SDCCH channel +(for example: during a call) and can be a value from 0 to 96 (dB ?). +
  • + +
  • +ggggg - in some English descriptions it's "VCTCXO AFC DAC control" - a value +between -1024 and 1023. In help it's described as AFC +(Automatic Frequency Control) - automatic adjusting phone's +receiver to the frequency of the signal transmitted by BTS. +The more this value differs from 0, the more frequency corrections have to be +made by the receiver (it depends on the channel used in communication with +BTS - see test 1) +to "match" the BTS. +
  • + +
  • +hhh - CH (channel): number of channel used in communication with cell (decimal) +
  • +
+ +

In Nokia 2110i/2140: + +

+ + + + + + +
+ + + + +
+Pagrepp. d
+T:aaaaaaaa
+T3212: bbb +
+
+ + + + +
+PagRepPer.
+TMSI
+T3212 +
+
+ +

In Nokia 3110 this test looks like follows: + +

+ + + + + + +
+ + + + +
TMSI:aaaaaaaa
+T3212:bbb/ccc
+PRP:d  ee ff
+w gggg  hhh z
+
+ + + + +
TMSI(hex)
+T3212 ctr/tim
+PagRP DSF AGC
+S AFC   CH  B
+
+ +

If the phone after power on wasn't logged to any network, +some default values are displayed here (except for TMSI). + +

Some of these values can be also found in Nokia service programs +(for example in WinTesla - in menu "Testing" / "RF Information"). + +

+ + + + + + +
In test 64 you can check, +how many times your phone has sent an information about its location. +If you have sent an SMS, you can check (exact to 6 min), when you did it +(if it wasn't earlier than value 'ccc' for your network) - check 'bbb' parameter value. +
+ +

And here is this test for Nokia 6185/6188: + +

+ + + +
CDMA
+ + + + +
+414 084 222
+062 060 062
+420 366 252
+062 062 062 +
+
+
AMPS
+ + + + +
+1X_XSTBY000D
+SYNC_LOS0031
+DEC_SAME0000
+VOTED_BT0000
+
+

CDMA

+Tracked PN Offsets (lines 1,3) and signal strengths. +

+ +

Test 11 +
Identification of the currently used (last monitored) network + +

+ + + + + + +
+ + + + +
CC:aaa NCbbb
+  LAC:ccccc
+  CH : deee
+  CID:fffff
+
+ + + + +
 MCC    MNC
+LocAreaCode 
+ServChannel
+   CellId
+
+ +

+

    +
  • +aaa - MCC (Mobile Country Code): code of the network home +country (260 for Poland) - decimal. +
  • + +
  • +bbb - MNC (Mobile Network Code): network code +(different for networks with the same MCC - for example, in Poland: +01 for Plus GSM, 02 for Era GSM and +03 for Idea). + +

    Generally values here are decimal. Sometimes are exceptions (when and why ?) +and you can find hexadecimal value here: if you will convert it into +decimal and result treat as hexadecimal value (convert it into decimal value +again), you will have decimal value of this parameter (for example, +3F hex=63 dec; 63 hex=99 dec). + +

    When you use phone working in PCS 1900 +system (for example, Nokia 6190), this number can be 3-digit long. It's decimal (always ?). +If it consist of two digits, you will see "?" instead of last (for example, +you will see "37?" for "37")

    +

  • + +
  • +ccccc - LAC (Location Area Code): code of the current +cell area (decimal or hexadecimal). The size of this area (with the same LAC) +depends on the network. After changing LAC, the phone makes +Location Update.
  • + +
  • +d - H, if frequency hopping is enabled (otherwise empty). This information +can be also found in test 1 and +test 12.
  • + +
  • +eee - CH (channel): number of channel used in communication with cell (decimal) +
  • + +
  • +fffff - CID (Cell Identifier): number of the current cell +(each cell in given area has its own unique ID number) - shown decimal or hexadecimal. +
  • +
+ +

LAC and CID format (if they're displayed decimal or hexadecimal) depends +on your phone's model and its software version (for instance: Nokia 3210 +and Nokia 5110 with newer software display decimal values, while Nokia 5110 +with 4.59 (and older) firmware and some previous models (like Nokia 3110) +use hexadecimal format). + +

GSM phones recognize the network using MCC and MNC codes +(list of these codes can be found at +http://kbs.cs.tu-berlin.de/~jutta/gsm/gsm-list.html). +Network names shown on phone's display (like 'ERA GSM', +'Plus GSM' or 'Idea') +are stored in phone's memory (they're set by the producer - cellular network doesn't +send any name, just these two numbers). In order to correctly recognize a +new network, you must upgrade the firmware of the phone (or it won't display +network name). Some older phones, like Nokia 2110i (or newer models +without firmware upgrade) display names like PL-03 (they recognize that +MCC=260 is Poland (which has international code PL), but they don't know +the network name - only its MNC). One (?) text name can also be changed +using appropriate programs: + +

+ +

In Polish version of this manual the description of BTSes contains +URLs of pages with BTSes lists - with their locations, LAC and CID +(for Polish networks). + +

If the phone after power on wasn't logged to any network, some default values are displayed here. + +

In Nokia 2110i/2140: + +

+ + + + + + +
+ + + + +
+aaa eee bb
+LAC:  cccc
+CellI:ffff +
+
+ + + + +
+MCC CH MNC
+LocAreaCod
+CELL IDent +
+
+ +

In Nokia 3110 this menu looks like follows: + +

+ + + + + + +
+ + + + +
CC:aaa NC:bbb
+  LAC:cccc
+  CH :deee
+w CID:ffff  z
+
+ + + + +
 MCC     MNC
+ LocAreaCode
+ ServChannel
+S CellId    B
+
+ +

And here is for Nokia 6185/6188: + +

+ + + +
CDMA
+ + + + +
+162 054    
+062 062
+186 084
+062 051 +
+
+
AMPS
+ + + + +
+11_BETTR0000
+SYNC_SAM0000
+MSG__BTR0000
+SFLG_BTR0000
+
+

CDMA

+Tracked PN Offsets (lines 1,3) and signal strengths (only, when phone is in CONV state) +

+ +

Test 12 +
Parameters of currently used (last monitored) network + +

+ + + + + + +
+ + + + +
CIPHER :aaa 
+HOPPING:bbb
+DTX    :ccc
+IMSI   :ddd
+
+ + + + +
CipherValue
+HoppingValue
+DTXValue
+IMSIAttach
+
+ +

+

    +
  • +aaa: + +

    +

      +
    • +OFF: phone doesn't transmit
    • + +
    • +A51: phone transmits, data are coded using A5/1 algorithm (more complicated version)
    • + +
    • +A52: phone transmits, data are coded using A5/2 algorithm (a version designed +for use in some "doubtful" countries - potential future enemies (like Iraq)). It's easier to +decode and crack, but still secure (not cracked) - but I can be wrong ! +
    • +
    +

    +

  • + +
  • +bbb - informs, whether frequency hopping is enabled (ON) or disabled (OFF) +
  • + +
  • +ccc - informs, whether DTX is used (ON) or not (OFF) by phone +
  • + +
  • +ddd - informs, whether IMSI attach is allowed (ON) +
  • +
+ +

All the values in this menu are updated only when the phone uses TCH +channel. + +

If the phone after power on wasn't logged to any network, some default values are displayed here. + +

More information about A5/1 and A5/2 algorithms can be found at www.scard.org/gsm/. + +

In Nokia 2110i/2140: + +

+ + + + + + +
+ + + + +
+CIPHER aaa
+HOPPIN bbb
+DTX    ccc +
+
+ + + + +
+CIPHERING
+HOPPING
+DTX ON/OFF +
+
+ +

In Nokia 3110 this test looks as follows: + +

+ + + + + + +
+ + + + +
CIPHER :aaa
+HOPPING:bbb
+DTX    :ccc
+w IMSI :ddd z
+
+ + + + +
CipheringValu
+HoppingValue
+DTXValue
+S IMSIAttachB
+
+ +

In Nokia 6185/6188 in AMPS it looks different: + +

+ + + + +
+1IN_FAIL0044
+DYN_FAIL01C7
+MIN2_FAI0045
+DYN2_FAI01CB
+
+ +

Test 13 +
Information about DTX in currently used (last monitored) network + +

+ + + + + + +
+ + + + +
aaaaaaaaaa 
+DTX(DEF):bbb
+DTX(BS) :ccc
+
+ + + + +
DTXMode
+DefaulDTXSta
+DTXValFromBS
+
+ +

+

    +
  • +aaaaaaaaaaaa: information, whether the phone uses DTX: + +

    +

      +
    • DTX:ON - yes, it uses
    • +
    • DTX:OFF - no, it doesn't use
    • +
    • DTX:DEF - yes or not (depends on default setting - bbb parameter)
    • +
    • NOTALLOWED - the phone cannot independently decide to use DTX or not (BTS doesn't allow this)
    • +
    +

    +

  • + +
  • bbb - default DTX setting: ON or OFF.
  • + +
  • +ccc - DTX value from BTS +(on uplink - a channel used in communication in direction phone-BTS): + +

    +

      +
    • MAY - BTS lets the phone "decide", whether to use DTX or not
    • +
    • USE - BTS forces DTX usage
    • +
    • NOT - BTS doesn't allow to use DTX
    • +
    +

    +

  • + +
+ +

If the phone after power on wasn't logged to any network, some default values are displayed here. + +

In Nokia 2110i/2140: + +

+ + + + + + +
+ + + + +
+cccccccccc
+MS DEF:bbb
+dddddddddd +
+
+ + + + +
+DTX STATUS
+DEF STATE
+BS PARAM +
+
+ +

+

    +
  • cccccccccc - the same to aaaaaaaaaa. Values: "DTX  ON", "DTX OFF", "DTX DEF" lub "NOTALLOWED"
  • +
  • dddddddddd - the same to ccc. Values "MS MAY USE", "SHALL USE" or "SHALL NOT"
  • +
+ +

+ + + + + + +
If BTS allows this (if the last parameter's +value is MAY), you can decide whether to use DTX +or not by entering this menu in a direct mode. +
+ +

Test 14 +
By entering this menu in direct mode, you can change aa parameter value from 01 (default) to 00 (or vice versa). + +

+ + + + + + +
+ + + + +
 SCREENING  
+ INDICATOR
+   IS aa
+
+ + + + +
Use menu to 
+  change
+ Screening
+ indicator
+
+ +

In Nokia 2110i/2140: + +

+ + + + + + +
+ + + + +
+SCREEN IND
+SET TO  aa
  +
+
+ + + + +
+CHANGE
+SCREENING 
+INDICATOR +
+
+ +

Test 15 + +

In Nokia 5190/6190: + +

+ + + + + + +
+ + + + +
+aaa bbb cccc
+ddd eee f
+gg hh ii
+jjjjjjjjjj +
+
+ + + + +
+CH RxL TxPwr
+MdSt SAT DCC
+ST   TxA RxA
+  CS STATE +
+
+ +

When you don't have additional module +(it's between "main" phone and battery), you will see "AMPS display not available" +here. After connecting it you will see values connected +AMPS: + +

+

    +
  • aaa - channel used for communication with cell (0 during standby)
  • +
  • bbb - level of received signal in dB
  • +
  • ccc - level of the transmitted signal (0 during standby)
  • +
  • eee - SAT, x during standby
  • +
  • f - DCC (Digital Color Code) on the +ACCH channel (0-3, - = not locked), x during standby
  • +
  • jjjjjjjjjj - cellular state: +

    +

      +
    • IDLE - standby
    • +
    • CALL GOING - exchange of data required to make call
    • +
    • IN CALL - during call
    • +
    • PCH INIT - scanning available paging channels ? (for example, after call)
    • +
    • CCH INIT - scanning control channels ?
    • +
    • ACCESS - accesing network ?
    • +
    +
  • +
+ +

and 6210: + +

+ + + + + + + + +
+ + + + +
+  Tx27178506
+ReTx42645758
+  Rx27178505
+RTRq27178504 +
+
+ + + + +
+Sent frames
+Re-transmis.
+Rec. frames
+Re-send reqs +
+
+ +

In Nokia 6250 help is the same to help from 6210, but screen with values is EMPTY. + +

In Nokia 2110i/2140: + +

+ + + + + + +
+ + + + +
+xxx SIM yy
+LAC:  zzzz
+wwwwwwwwww +
+
+ + + + +
+MCC    MNC
+LocAreaCod
+Upd status +
+
+ +

Values here can be different from these in test 11. +They're taken from file Location information (6F7E) on SIM card. + +

+

    +
  • xxx - MCC
  • +
  • yy - MNC
  • +
  • zzzz - LAC (hexadecimal)
  • +
  • wwww - state of Location Update +
      +
    • +Updated - value from SIM (bits b3 - b1) 0 0 0, meaning: done Location Update in Location Area, +which is shown on the screen +
    • +
    • NotUpdated - value 0 0 1, meaning: Location Update not done or didn't end with success
    • +
    • PLMN Not A - value 0 1 0, meaning: LPLMN not allowed
    • +
    • LA Not All - value 0 1 1, meaning: Location Area not allowed
    • +
    • Reserved - value 1 1 1, reserved for future use
    • +
    • Undefined0 - value 1 0 0, undefined value
    • +
    • Undefined1 - value 1 0 1, undefined value
    • +
    • Undefined2 - value 1 1 0, undefined value
    • +
    • LA NotRead - file wasn't read from SIM
    • +
    +
  • +
+ +

Test 17 + +

+USERS OF NOKIA 6210 HAVE TO READ FIRST NOTES WRITTEN ON THE END OF DESCRIPTION +FOR THIS TEST. IN OTHER CASE THEY CAN DAMAGE THEIR PHONES. + + +

This menu lets the phone test one concrete channel used in communication +with cell (the phone doesn't seek channel with the strongest signal, but uses +the channel chosen by you: you can use channels 1-124 for GSM 900 +and 512-885 for GSM 1800). Each GSM network has its own assigned channels +from these ranges (which means that each two networks in one country can't +use the same channels - for example, in Poland Plus GSM +cannot use Era GSM channels and vice versa). + +

+

+ + + + + + + + + +
GSM 900 (1-124)
GSM 1800 (512-885)
TIM (222-01)
8-64 (16 most important cities) or 8-50 (outside them)
736-760
Omnitel (222-10)
66-118 (16 most important cities) or 77-118 (outside them)
861-885
Wind (222-88)
52-75 (outside 16 most important cities)
761-810
Blu (222-??)
-
811-860
Plus GSM (260-01)
1-14 and 37-67 (37 and 67 for testing)
749 - 760, 850 - 884 ?
Era GSM (260-02)
15-36 and 68-90 (15 and 36 for testing)
736 - 748, 811 - 847 ?
Idea (260-03)
91-114, 115-124 from January 2004
733, 763 - 810
+
+ +

You can enter numbers of channels belonging to any network (if you enter +a channel of forbidden network, you will see all network parameters, +but obviously you won't be able to establish connection (except for +emergency calls)). After enabling this test your phone won't be able to make +handovers. + +

To enable this test, proceed as follows (sometimes this procedure doesn't +work - but turning the phone off and then on often helps; I don't know why): + +

+

    +
  • +save (change) desired channel number on position number 33 of the SIM card's +phone book in decimal format (not in phone's memory!) - +if you save '0' there, this test will be inactive! +However, this step is not necessary, if this number was stored there earlier - +you can check this with 33# code). Remember, that phone checks used format. Here are +some examples of correct entries: "1", "700".
  • + +
  • go to test 17
  • + +
  • once again enter test 17 directly
  • + +
  • switch your phone off and then back on
  • +
+ +

To disable this test: + +

+

    +
  • enter test 17 directly
  • + +
  • switch the phone off and back on (sometimes it isn't needed - +phone should disable test, when loose signal on this channel; +but it's better to do that to avoid potential problems) +
  • +
+ +

Some interesting results can be achieved, when (guess why ?): + +

+

    +
  • you enable this test
  • + +
  • then you switch test 19 to REVERSE
  • + +
  • turn off the test, but not the phone (by entering test 17 one time in a direct mode)
  • +
+ +

In this case the phone "jumps" from one channel to another and monitors +channels of different networks - you can see LAC and CID codes of the cells. +Furthermore, the phone cannot log to its home network (though it displays +parameters of its channels). Several times I got "Insert SIM card" or +"SIM card rejected" messages - it may be some bug in firmware. After turning +the phone off and then on everything works fine. + +

+ + + + + + +
The above tip can be used for fast battery discharging (however your phone +won't be accesible in the network). + +

If you want to check some informations about different than your network, you +can use different tip too: + +

    +
  1. select the test, where will be displayed interesting for you information +about this network
  2. +
  3. go to the manual network selection (for example, Menu 4-2-4-2 in Nokia +5110)
  4. +
  5. select interesting for you network
  6. +
  7. wait few seconds (some time is required to start logging into this network) +and press "Quit" (NOT (c) key) or wait, until phone will display any message +(for example, that logging wasn't successfull)
  8. +
  9. press fast (c) key to leave phone's menu
  10. +
+ +

Information about interesting for you network will be displayed during few seconds... + +

+ +

I heard about some cases, when this test turned itself spontaneously on +after loosing the signal by the phone. I didn't experience this, but if this +has ever happened to you, just save 0 on 33rd position of the SIM card's phone +book. + +

+ + + + + + +
Since Nokia 51xx/61xx phones don't allow choosing the position for the phonebook entry, +I want to suggest: + +
    +
  1. check whether you already have some number stored on this position +(using 33# code)
  2. + +
  3. +if the phone displays 'Invalid location', you have to add new entries to the +phonebook until you hit this position and the phone doesn't display this +message (repeating 1st step after each new entry) +
  4. + +
  5. +after displaying the number, you have to find out who's number is this. +You can do it in two ways: + +

    +

      +
    1. +just recall (or check the whole phonebook) +
    2. + +
    3. +turn off the transmitter in +test 45 and call this number +(the name assigned to this number will be show on screen - you will also find +it on the 'Last dialed' list) +
    4. +
    +

    +

  6. + +
  7. +edit the phone book (this position) - you can change the name or the (channel) number +
  8. + +
  9. +if the phone asks you, whether to replace the old number or to save it on new location, choose the former option +
  10. +
+ +

+To store number on chosen location you can also use other Nokia phone +(for example 2110), other cellular phones or appropriate software. +For example: in Nokia Cellular Data Suite you can export list of phone numbers +to file, open it in editor, change and upload to phone. It's simple, isn't it ? +

+ +

+

+ + + + + +
+ + + + +
+
  BTS TEST  
+    aaa
+
+ + + + +
Use menu to 
+toggle BTS
+test ON/OFF
+
+ +

+

    +
  • +aaa - can be set to "ON" or "OFF"
  • +
+ +

+ + + + + + +
This test can be very usefull when: + +

+

    +
  • +you want to use some particular cell (for example to test whether it is +possible to use a cell located 20 km away) +
  • + +
  • +you'd like to avoid roaming (which is much more expensive) - for example +when you are close to the border (and the phone constantly logs to the network +of the neighbor country, because it has a stronger signal) - you just switch +your phone to the channel used by your network... +
  • + +
  • +other available network has very strong signal (for example -85 dBm) and the +signal of your home network is very weak (-100 dBm) - your phone can have +serious problems with logging to your network until you use this test +
  • + +
  • +you want to monitor the state of some very weak channel - I received some mails, that +the lowest measured with this method signal strength was -118 dBm +
  • +
+
+ +

In Nokia 2110i/2140: + +

+

+ + + + + +
+ + + + +
+ +BTSTESTaaa +

  +

+
+ + + + +
+Tells if
+BTS test
+is ON/OFF  +
+
+ +

Number of channel must be saved in 98 position of B memory. + +

Many users of Nokia 3210 say, that in this model there are problems with enabling +and disabling this test - part of firmware connected with it has probably some bug(s)... +I read even in one newsgroup such post (here is in translation): + +

+Few people after enabling test 17 made reclamations in service, that phone +doesn't work. The most interesting is (I'm sure, that in one case) reclamation +was taken into consideration !!!! - phone was exchanged !!! + + +

In new models (Nokia 3310, 6210, 6250, 8210) it's a little different: + +

+

+ + + + +
+ + + + +
+BTS TEST
+   aaa

+CH :  bbbb   +
+
+ +

...but you can use it very similiar (to enable): + +

+ +

    + +
  • enter it directly. You should see: + +

    + + + + +
    +BTS TEST
    +REQUESTED

    +CH :  bbbb   +
    + +

    where instead of "bbbb" parameter you should see value read from position 33 +from phonebook from SIM card (or "xxxx", when value there was wrong, SIM card +was not ready, etc. - of course, you will not enable this test then). +

  • +
  • restart phone - "aaa" parameter should change to "ON"
  • +
+ +

To disable this test you should: +

    +
  • enter directly into it
  • +
  • restart phone - "aaa" parameter should change to "OFF"
  • +
+ +

BE CAREFULL IN MODEL 6210 WITH THIS TEST +In firmware 4.27 (older probably too, I don't know, if it's corrected in newer) +phone can display CONTACT SERVICE after using it or +there could be different problems with it. Here are three known examples: + +

    +
  • after enabling test everything was correct. After writting number 0 +and resetting phone (it was one method for disabling this test in older models) +CONTACT SERVICE was displayed. User put SIM card into another phone, changed +33 position in phonebook to CORRECT channel number +(1-124, 512-885), put SIM back to 6210 and normally used it (second +6210 with the same symptoms wasn't repaired after making it). +
  • +
  • in this concrete example Nokia 6210 displayed info about finding channel 79. +User written its' number in phonebook on 33'th position. After third reset +of phone CONTACT SERVICE was displayed. SIM card was put into Nokia 5110 and +channel number was changed to 76 (this channel was visible in this phone). +When SIM card was put back into Nokia 6210 phone, it was possible to enable +it. In this test phone displayed 'BTS TEST ON CH:79' (channel 79 was also visible +in test 3).
  • +
  • after enabling this test phone was restarted. After entering PIN it hanged, +"Code accepted" was displayed and it squeaked. And the same problem +was visible after each reset. User disabled netmonitor via cable. +After it phone phone very often wasn't able to find network and user had +to disable it. Solution was disconnecting battery for about 1 hour. +Problems with finding +network were visible during about next 2 weeks.
  • +
+ +

In Nokia 9210 help looks like follows: + +

+ + + + +
+  BTS TEST
+    mode

  +carrier no.

+ +

Test 18 + +

+ + + + + + +
This menu allows you to turn on constant backlight of the screen and keyboard +(LIGHTS ON). This can be used for very fast battery discharging. We can also +use it as a flashlight - for example to check a schedule, your location on a +map, to be visible on the road :-), etc. But there is one condition: +any of the NetMonitor tests must be visible on the screen. + +

If you turn this test on and then back off, the light will go out +(it won't react on key presses) for several minutes (good for games - +saves battery)... + +

The light can be also constantly enabled, if you connect a car kit +(or simulate it - check test 75) +and "Light" setting (Menu 2-5 in Nokia 5110) will be set to "All". +This will work without NetMonitor (and any of its test) enabled! +

+ +

Changes to this menu can be made by entering it directly. + +

+

+ + + + + +
+ + + + +
+
   LIGHTS   
+    aaa
+
+ + + + +
Use menu to 
+  toggle
+  lights
+  ON/OFF
+
+ +

+

    +
  • +aaa - can be set to either "ON" or "OFF" (default)
  • +
+ +

In Nokia 2110i/2140: + +

+

+ + + + + +
+ + + + +
+ +LIGHTS aaa

  +

+
+ + + + +
+Control   
+Lights
Status +
+
+ +

Test 19 + +

+ + + + + + +
Each operator before giving a new or repaired base station +(BTS) for normal use, tests its cells. +GSM phones read this information and avoid using these cells. However, using +this menu, you can set your phone to use such cells, too +(DISCARD option) - sometimes it allows you to "improve" the coverage and range of your +network . + +

If you want your phone to use only such barred cells, just set this menu to +REVERSE (but you won't be able to make or receive calls if there are no tested +cells in your neighborhood - good phone lock ?). + +

ACCEPTED means that your phone uses only normal cells, which are allowed for use +(it works like any other phone). +

+ +

Information about cell status is broadcasted on BCCH +channel as a CELL_BARRED parameter value. The settings of this menu can be +changed by entering it directly (but if you have previously enabled test in +test 17, current cell may have other status +than the chosen here (for example: you chosen barred cells only, but the phone +uses a normal one)). + +

New settings are applied during next signal quality measurements (you can +advance this by making a call, forcing the phone to search for a network or +by holding the antenna with fingers for certain amount of time). + +

Sometimes your phone may not be able to find cells with particular status +- it will show parameters of the cells with such status belonging to other +network (once I've set this menu to REVERSE and the phone started displaying +data of barred cells in forbidden for my SIM card network, because there were +no tested my home network cells in my neighborhood). Information about cell +status can be found in test 1 to +test 5. + +

+

+ + + + + + + + + +
+ + + + +
+
  CELL BARR 
+  ACCEPTED
+ +

The phone works as any other GSM phone (default) - only normal cells +

+ + + + +
+
  CELL BARR 
+  REVERSE
+ +

The phone uses only tested cells

+ + + + +
+
  CELL BARR 
+  DISCARD
+ +

The phone uses all existing cells (both normal and barred ones)

+ + + + +
Use menu to 
+toggle cell
+barr status
+DIS/ACC/REV
+
+ +

In Nokia 2110i/2140: + +

+

+ + + + + + + + + +
+ + + + +
+CELL
+BARRING
+ACCEPTED   +
+ +
+ + + + +
+CELL
BARRING
+REVERSED  
+ +
+ + + + +
+CELL
BARRING
+DISCARDED 
+ +
+ + + + +
+ DISCARD  
+ CELL
+ BARRING +
+
+ +

Test 20 +
Information about battery and phone charger mode + +

+ + + + + + +
+ + + + +
 aaa   bbbbb
+Tccc     ddd
+Ceee    Wfff
+gggg    hhhh
+
+ + + + +
BatVol ChMod
+BTemp ChTime
+ChrgVol Pwm
+ BTyp  BFDC
+
+ +

+

    +
  • +aaa - battery voltage (V/100 - for instance 7.19V is displayed as 719). +Range 0.00 - 9.99 V. When value decreases, your battery is more discharged +- you have less standby/speech time to next charging... +
  • + +
  • +bbbbb - information about battery charging: + +

    +

      +
    • xxxxx - charger not connected or charging disabled
    • +
    • BatCk - checking battery charge level (after each +TCH channel usage (a call) when charging NiMH battery)
    • +
    • BSIFa - charging interrupted (battery BSI +(Battery Size Indicator: one of battery connectors connected +with ground (BGND) to resistor inside battery - phone measure its +opór and can read battery type)) +measurement failed) +
    • +
    • CelBr - charging interrupted (one or more cells broken inside battery)
    • +
    • ChaCk - EM checks charger
    • +
    • Charg - charging
    • +
    • ColdC - charging a cold battery
    • +
    • ColdM - battery is cold, maintenance charging
    • +
    • CurFa - charging interrupted (charger current measurement failed)
    • +
    • DisCh - discharging
    • +
    • Faile - error
    • +
    • FastC - fast charging
    • +
    • FullM - battery full, maintenance charging
    • +
    • F_Che - checking fast charging process
    • +
    • HotM  - battery is hot, maintenance charging
    • +
    • I_Che - initialization of charging parameters test (then the phone displays 'Charging')
    • +
    • InitC - charging process initialization
    • +
    • L_Che - checking parameters of LiIon battery charging
    • +
    • LiAFu - fff parameter (Pwm) level is higher than max limit for a full battery
    • +
    • LiDCH - DCH charging (some kind of maintenance charging ?) of LiION battery
    • +
    • LiFul - fff (Pwm) parameter exceeded the max limit for a full battery during given period of time
    • +
    • LiHot - charging hot (warm) LiION battery
    • +
    • LithC - charging LiION battery
    • +
    • LiTxO - charging LiION battery, transmitter active (connection in progress)
    • +
    • LNFTx - charging LiION battery (but the phone uses as much power, as it receives from charger), transmitter active (connection in progress)
    • +
    • M_Che - maintenance charging process test
    • +
    • MaBFD - maintenance charging (BFD)
    • +
    • Maint - maintenance charging
    • +
    • TmpFa - charging interrupted (phone's wasn't able to read natê¿enie +of resistor NTC inside battery connected to BTEMP and BGND battery connectors +and wasn't able to calculate battery temperature)
    • +
    • TxNoF - charging NiMH battery (but the phone uses as much power, as it receives from charger), transmitter active (connection in progress)
    • +
    • TxOnC - charging NiMH battery, transmitter active (connection in progress)
    • +
    • VolFa - charging interrupted (error checking voltage from charger)
    • +
    +

    +

  • + +
  • +ccc - battery temperature (for example T+27 means +27 degrees centigrade). +Sometimes (when the phone was turned off and not used for a long time +(no connections, low power consumption), this parameter can match outdoor +temperature (so you will have a thermometer). If you need a temperature in +Fahrenheit degrees, you can use following formula: F = 32 + 9C/5 +(where F and C are Fahrenheit and Celsius degrees). The temperature of LiION +battery is also given in test 23.
  • + +
  • +ddd - charging time in hours (first digit) and minutes (2 last digits). +This counter is cleared when charging process begins (but not always - +it doesn't happen if: + +

    +

      +
    • +previous charging process wasn't complete +
    • + +
    • +mains parameters don't meet some requirements +
    • +
    + +

    I have also experienced that Nokia 6110 doesn't clear this counter after +changing the battery (for example from LiION to NiMH). It continues after +connecting the charger and stops when the battery is full or when you +disconnect the charger. +

  • + +
  • +eee - charging voltage (V/100). The battery isn't charged with a direct +current, but with a pulse current (this indicator constantly changes). +Range 0.0 - 18.7 V. When charging is complete, maintenance charging begins. +
  • + +
  • +fff - Charge control output (decimal - range 000 - 255)
  • + +
  • +ggg - capacity of the battery in mAh (some English descriptions and +NetMonitor help in Nokia 3110 write, that it's BSI battery multiplied by 4): +in case of LiION battery you will find here the same value as on battery casing +in NiMH batteries this value can differ even by 200 mAh and change depending +on the temperature (it it connected with battery's memory effect ?). +Unfortunately, it doesn't change always immedietaly after changing battery... +See also question +Netmonitor shows different battery capacity than info on it... +
  • + +
  • +hhhh - this counter lets us calculate remaining charging time: when charging +current is less than predefined limit, this timer will be started. +If timer reaches 0, charging will be stopped (it should be according to +some English descriptions, but I observed it very rarely). +
  • +
+ +

In Nokia 3110 this menu looks as follows: + +

+ + + + + + +
+ + + + +
  aaa  bbbbb
+ Tccc   ddd
+ Ceee  Wfff
+w gggg hhhh z
+
+ + + + +
BatVol ChMode
+BTemp ChrTime
+ChrgVol  Pwm
+S 4BSI BFDC B
+
+ +

+

    +
  • +bbbbb - in N3110 this field can additionally contain NOTCH (no charging)
  • +
+ +

In Nokia 9110 this menu looks as follows: + +

+ + + + + + +
+ + + + +
aaa   bbbbbb
+Tccc    ddd
+i Ceee  Wfff
+ gggg   hhhh
+
+ + + + +
BatVol  ChMod
+BTemp   ChTime
+ChrgVol Pwm
+BTyp    BFDC
+
+ +

+

    +
  • +i - information, whether travel charger is connected (1) or not (0)
  • +
+ +

Fast charging (FastC in NetMonitor) means charging with bigger current +and with clever charger it doesn't damage your battery. + +

When battery charging is ended, maintenance charging starts +(it's normal, that phone uses some energy and battery's discharging process +starts; still connected charger can complete energy losses). + +

In Polish version of this manual you can also find links to some pages +in Polish language explaining some topics connected with charging and batteries. + +

For curious people: some of the data, which are displayed here, can also be +found in Nokia service programs (like WinTesla - menu "Testing" / "ADC Readings..."). + +

+ + + + + + +
This test allows us to check the charger. You can also verify some of the battery parameters like: +
    +
  • +capacity
  • + +
  • +efficiency (of the battery cells)
  • + +
  • +voltage (if you are - say - on a trip, here you can check whether battery voltage is suitable for your flashlight)
  • +
+
+ +

Test 21 +
Charging parameters (I noticed, that these values are correct only after +making a call while charging - they change only then (after ending call display +last registred values)) + +

+ + + + + + +
+ + + + +
 aaaa  bbbb 
+  ccc   ddd
+  eee   fff
+
+ + + + +
MTDif MPDif
+BUpV  BDownV
+AverV SumMF
+
+ +

+

    +
  • +aaaa - difference between measured and required charging voltage
  • + +
  • +bbbb - difference between measured voltage and the result of the +previous measurement, fraction is not displayed
  • + +
  • +ccc - the highest measured voltage in battery (with charging battery and +using it in the same time it can change) +
  • + +
  • +ddd - the lowest measured voltage in battery
  • + +
  • +eee - average voltage
  • + +
  • +fff - the sum of the parameters from test 22 +(range 0.00 - 9.99, for example 1.53 is displayed as 153) - my own observations +show, that DerivCount (Eaaa) parameter is not counted here. If this counter +reaches 1.00 or 0.99, 'Battery full' message is displayed and bar indicator +on the right side of the display stops. +
  • +
+ +

In Nokia 9210 help looks like follows: + +

+ + + + +
MTDif MPDif
+BUpV  BDownV
+AverV SumMF
+Charger type
+ +

Last line has such values like "NoChrgr" (no connected charger), +"ACP-9" (ACP-9E charger) + +

Test 22 +
Charging parameters and indicators + +

+ + + + + + +
+ + + + +
 Eaaa  Cbbb 
+ Dccc  Rddd 
+ Ieee  Afff 
+ Tggg  Vhhh
+
+ + + + +
DeriC ChAm
+ VDif VDrop 
+ VDTi AvDif
+ Temp Volt
+
+ +

+

    +
  • aaa - DerivCount
  • +
  • bbb - ChargeAmount
  • +
  • ccc - VolDiffToMax
  • +
  • ddd - VolDropCnt
  • +
  • eee - VolDiffTime
  • +
  • fff - AverDiff
  • +
  • ggg - temperature
  • +
  • hhh - voltage
  • +
+ +

Here you can find several charging parameters and indicators. +All these fields (except for DerivCount) range is from 0.00 to 1.00 +(dot is not shown - for example 0.23 is displayed as 023). After disconnecting +the charger these fields can contain various values. Letters E, C, D, R, I, +A, T and V are displayed when the number is shorter than four digits. + +

I received info, that in some (all ?) Nokia 6150 phones with firmware 4.13 +(LiION battery) there are ALWAYS displayed these values (is it bug in this +version of firmware ?): + +

+ + + + +
+ E251  C254 
+ 6399  6896
+ I255  A256
+ 1024  8447
+
+ +

In Nokia 9210: + +

+ + + + + + +
+ + + + +
+   15   00  
+    0   0
+    0   0
+        0
+
+
+ + + + +
+SlPer  SysSt
+ N/A  N/A
+ N/A  N/A
+RtcError +
+
+ +

Test 23 +
Information about the battery + +

+ + + + + + +
+ + + + +
 aaaa  bbbb
+ cccc  dddd
+eee fff gggg
+hhh iiiijjjj
+
+ + + + +
TxOn   TxOff
+ChCur  Stdby
+Age CAP Curr
+Tmp CmAhTarg
+
+ +

+

    +
  • +aaaa - voltage from the battery when transmitter is active (a.aaa mV)
  • + +
  • +bbbb - voltage from the battery when transmitter is inactive (b.bbb mV)
  • + +
  • +cccc - charging current (c.ccc mA). If the charger is not connected, 0 is shown. +In Nokia 3210 ALWAYS equal 0 (I think, that firmware in this model has some bug).
  • + +
  • +dddd - expected voltage from the battery in standby mode (d.ddd mV). You can +check whether your SIM card 's clock can be stopped in +test 51.
  • + +
  • +eee - estimate battery age (0 - new, 100 - old) for LiION batteries (the +value of this counter is probably based on measurements of work/discharging +time of the battery and its capacity (shown in test 20); +this is only a reference!) or 33 for NiMH batteries.
  • + +
  • +fff - battery charge level in percent (in older phones, like Nokia 5110, +25 - 1 bar, 50 - 2 bars, 75 - 3, 100 - 4 bars on +the right side of the screen; in never, like Nokia 6210 - 100 - 6 bars, +80 - 4 bars, 60 - 3 bars, 40 - 2 bars, 20 - 1 bar). +This indicator (and parameter) is very +inaccurate during charging process (it reaches 100 almost immediately) - +better use ii and jjj parameters then. +
  • + +
  • +gggg - temporary power consumption indicated by PSM (according to some +English descriptions in decimal parts of mA; I think that this field shows +values in mA - see on calculation of approximate battery work time below) +
  • + +
  • +hhh - LiION battery temperature (also shown in test 20 +- sometimes both these indicators are different) or 0 (for NiMH battery) +
  • + +
  • +iiii - how many mAh were "loaded" to the battery until now. If it is approximately +equal to jjj, the latter parameter raises (or charging is complete). This parameter +is cleared after each use of TCH channel +(for example: after a call) while charging (with NiMH battery) - you can use +this tip to extend charging time almost ad infinitum. I noticed it with Nokia 6110 +and LiION battery (when I turned off and on phone during charging process) too. +This value is updated every 14 seconds (Nokia 5110 with standard charger). +
  • + +
  • +jjjj - battery capacity value (in mAh) by which next charging stage is complete +(see description of the previous parameter). I noticed, that it's cleared +during LiION battery charging (when I turned off and on phone during charging +process) in Nokia 6110. +
  • +
+ +

For curious: some of the data, which are displayed here, can also be found +in Nokia service programs (like WinTesla - menu "Testing" / "ADC Readings..."). + +

+ + + + + + +
Here you can check your battery type (LiION or NiMH). +
+ +

Approximate power consumption (this can be changed and modified by many other factors) while using individual channels +(Nokia 5xxx and 6xxx): + +

+

    +
  • +during transmission (TX parameter value - phone transmission power - can be +checked in test 1) - using +SDCC and TFR channels (Nokia 6110): + +

    + + + + + + + + + + + + + + +
    TXpower consumption (gg parameter)
    over 1992
    16-1899
    14-15105
    13114
    12123
    11136
    10151
    9173
    8198
    7232
    6269
    5300
    + +

    Conclusion: battery work time depends in a very high degree on the network +parameters (most advertising materials contain standby time measured for the +phone transmitting with lowest power (highest TX)). +

  • + +
  • +AGCH: 310 mA in Nokia 5110 and 6110
  • + +
  • +CCCH i CBCH: +Nokia 6110 phones with older software (like 4.73) show 20 and 34 accordingly. +I don't know whether this is caused by some bug in their firmware (these values +are most probably given in mA/10) or the power consumption is really that high +(because Nokia 5130 shows 34 too). +Anyway, I checked, that Nokia 5110 (and 6110 v5.31) phones display 3 mA while +using CCCH channel. I think that turning off +"cell broadcasting" (if it is not supported by your network) can be very +"profitable" for your phone (longer standby time etc.) - look +here). When the phone collects +BTS identification data +(for BTS, which will be now used - has stronger +signal than previous - see C2 description +for details), this value changes to 220 mA (but only for a short while). +
  • + +
  • +NSPS: 55 in both Nokia 5110 and 6110 (is this value +in mA or in mA/10 ?) +
  • +
+ +

Turning on backlight takes 90 mA more, and while charging another 17 mA should be added. + +

In Nokia 3210 these data are different for different person (does it depend on firmware version, +frequency ?) + + + + + + +
standbyreading BTS identification dataturning on backlight
52 mA90 mA+155 mA
8 or 9 mA?+159 or +160 mA
53, sometimes (rarely, during short time) 8 mA93 mA+158 or +159 mA
8 mA?+154 mA
+ +

+ + + + + + +
If you know the power consumption, you can calculate approximate battery work time: +
    +
  • +900 mAh / 225 mA = 4 hours of talk time (on average)
  • + +
    Please note, that when using SDCC channel +the phone initially uses full power and the gradually reduces it. + +
  • +900 mAh / 5,45 mA = 165 hours of standby time (on average)
  • + +
    Remember, that the phone makes PLU even in standby mode. +
+
+ +

Power consumption in Nokia 6185/6188: + +

+digital, idle, backlight off = 0011;
+digital, idle, backlight = 0093;
+analog, idle, backlight off = 0103;
+analog, idle, backlight on = 0187;
+searching, backlight off = 0160-0200;
+analog (fringe), talk = 0933;
+digital, talk, backlight on = 0275 + +

In Nokia 9210: + +

+ + + + + + +
+ + + + +
+ 640  3775  
+   0  3775
+ 8  49   0
+46   0   0 +
+
+ + + + +
+CmAh   Vbatt
+ChCur  Stdby
+Tle CAP Warn
+CMT PDA Tot +
+
+ +

Test 24 + +

+ + + + + + +
+ + + + +
+3476    3481
+BSI:     551
+ET:        9
+  111      1
+
+ + + + +
V_inst V_avg
+BSI value
+Elapsed time
+RST_m  RST_h
+
+ +

This is probably meaning of these parameters: + +

+

    +
  • bbbb - (Voltage average ?) average value of voltage from battery ?
  • +
  • ccc - (Battery Size Indicator) info connected with battery
  • +
  • dddd - how many minutes phone work from enabling ? (minutes)
  • +
  • eeee - (Rest Standby Time minutes ?) +does phone estimate here, how long phone can be in standby up to +next charging ? (minutes)
  • +
  • ffff - (Rest Standby Time hours ?) +does phone estimate here, how long phone can be in standby up to +next charging ? (hours)
  • +
+ +

Test 25 + +

+ + + + + + +
+ + + + +
+    0      1
+10059
+ 5664    641
+    1      0 +
+
+ + + + +
+Chrgtp #Bars
+alpha
+zeta     phi
+noblw  nobcr +
+
+ +
+Back to the top
+ +

+

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] +

+
+ +

Marcin Wiacek (WWW) +
Last modification: 10 March 2002
+ + + diff --git a/Docs/en_US/gsm/netmon/faq_net4.htm b/Docs/en_US/gsm/netmon/faq_net4.htm new file mode 100644 index 0000000..4651d04 --- /dev/null +++ b/Docs/en_US/gsm/netmon/faq_net4.htm @@ -0,0 +1,2325 @@ + + + + + + + + + + NetMonitor in Nokia phones (5/7) + + + + + +

Main page

+ +
NetMonitor in Nokia phones (5/7) + +

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] + +

+ +
+ + + +
    +
  1. What is it ?
  2. +
  3. Do I need it ?
  4. +
  5. Does my phone use more power with NetMonitor enabled ?
  6. +
  7. How to activate it ?
  8. +
  9. Which NetMonitor version can be activated in my phone ?
  10. +
  11. Does NetMonitor activation void warranty ?
  12. +
  13. NetMonitor menu in my phone has different number than 10. Is it normal ?
  14. +
  15. NetMonitor menu in my phone has 11 number, hovewer previous position has 9 number. Is it normal ?
  16. +
  17. How to use it ?
  18. +
  19. Can I damage my phone ?
  20. +
  21. Glossary
  22. +
  23. Description of the individual tests
  24. +
  25. You can also use a program...
  26. +
  27. Can I use NetMonitor without SIM card inserted, without PIN number entered or when SIM card is not active ?
  28. +
  29. How can I disable NetMonitor ?
  30. +
  31. Do I need to disable NetMonitor before sending my phone to the service ?
  32. +
  33. Is it possible to re-activate NetMonitor after disabling it ?
  34. +
  35. Is NetMonitor available in analog Nokia phones ?
  36. +
  37. Does NetMonitor allow to use phone like broadcast station ?
  38. +
  39. I don't have all described tests in my phone. Why ? Can I increase their number ?
  40. +
  41. Does NetMonitor allow to identify place, where is my interlocutor ?
  42. +
  43. Does NetMonitor allow to identify place, where am I ?
  44. +
  45. What are NetMonitor codes ?
  46. +
  47. Is it the truth, that in phones with additional hardware changing frequency band NetMonitor doesn't work correct ?
  48. +
  49. Where can I find description of FBUS/MBUS protocol and commands connected with NetMonitor ?
  50. +
  51. I have non existing networks on the list of forbidden networks...
  52. +
  53. How to check frequency band (900 or 1800 Mhz), where phone work in this moment ?
  54. +
  55. Can I use DLR-2/DLR-3 cables for activating netmonitor ?
  56. +
  57. Can I activate netmonitor using Init File Editor (Nokia 9110) ?
  58. +
  59. Can I force phone to use one frequency band (900 or 1800 Mhz) only ?
  60. +
  61. How to change settings in tests ?
  62. +
  63. My phone has very short snandby time - it is possible to see the reason of it ?
  64. +
  65. Is netmonitor available in English version only ?
  66. +
  67. Information sources
  68. +
  69. Additional information
  70. +
  71. Does using/activating netmonitor cost anything ?
  72. +
  73. Does using netmonitor is legall ?
  74. +
  75. Which entries on SIM card are used in netmonitor tests ?
  76. +
  77. Can I activate netmonitor in 3310 using soft working with 3210 ?
  78. +
  79. After activating netmonitor/BTS TEST my phone can't find network...
  80. +
  81. Netmonitor shows different battery capacity than info on it...
  82. +
  83. NetMonitor in Nokia 6310, 8310,...
  84. +
+
+
+ +

Test 30 +
Audio API register display + +

+ + + + + + +
+ + + + +
 aaaa bbbb
+ cccc dddd
+ eeee ffff
+ gggg hhhh  
+
+ + + + +
A1Cnf  A2Cnf
+  ST   AU3
+1Tone  2Tone
+ Conf  HFVol
+
+ +

+

    +
  • aaaa - API_AUD1_CTRL
  • +
  • bbbb - API_AUD2_CTRL
  • +
  • cccc - API_SIDETONE
  • +
  • dddd - API_AU3
  • +
  • eeee and ffff - API_1_TONE and API_2_TONE (see description below)
  • + +
  • +gggg - API_CONFIG: connected with sound setting from +test 71 and 72: +you will see here number (hexadecimal), +which was displayed there below AUDIO ENHANCEMENT (in last selected menu). +Here are some examples: + +

    + + + + + + + + + + +
    normally (for example during standby)wybieranie numerucall
    5148 (cracks) - 20808 decimal51495140
    851A - 34074 decimal851B8512
    C6A4 (cracks) - 50852 decimalC6ADC6A4
    DB34 (cracks) - 56116 decimalDB3DDB34
    DF29 (after enabling phone) - 57129 decimalDF29DF20
    F436 - 62518 decimalF43FF436
    F437 - 62519 decimalF43FF436
    +

    +

  • + +
  • +

    hhhh - API_HF_VOL: volume during call - you will count it from +the "110 - hhhh" formula (subtract value of this parameter from 110). +It's displayed too (during call only) in +test 76. +When you connect headset, values here change - volume can be count +from "510 - hhhh" formula then (for car kit use "2210 - hhhh"). +Type of connected audio accesories can be checked in +test 75 too. +Phone remembers volume for each audio accesory separately. +

  • +
+ +

When you press any key, phone generates sound, which consist of two tones. +Parameters eeee and ffff change then. First tone is short, second is emited +all time, when you press key. When you press C, NaviKey, Up or Down +keys, change parameter eeee only (value 0E10 - 3600 decimal) - +sound consist of one tone only. And now the most important thing: +you will divide displayed in these parameters values by 4, +you will have frequencies in Hz conncected with pressing adequate keys in +DTMF (Dual Tone Multi Frequency) system. +I think, you use DTMF very often - it's used in tone system in all +modern phones during calling number. Adequate values are in table (decimal) +- parameter eeee is connected with vertical values, ffff with horizontal: + +

+ + + + + + +
1209 Hz1336 Hz1477 Hz
697 Hz123
770 Hz456
852 Hz789
941 Hz#0*
+ +

Test 31 + +

+ + + + + + + + +
+ + + + +

Serial port  +
   mode
 
+
+
+ + + + +

   FBUS      +
   mode
 
+
+
+ + + + +
+Use menu to
+ activate
+ FBUS mode
+for tracking +
+
+ +

Test 32 + +

Test from Nokia 6250 (no help): + +

+ + + + +
+     0      
+0002922
+3000
+0205714 +
+ +

In 4'th line there is clock. Example: +0205714 means 20 hours 57 minutes 14 seconds of the day ... + +

Test 34 +
Information about FBUS connection between phone and computer. + +

+ + + + + + +
+ + + + +
aa bb cc dd
+eee fff ggg
+hhh iii jjj 
+k
+
+ + + + +
CM LD LM NM 
+PEC FEC OEC
+ACC RXS TXS 
+Mod
+
+ +

+

    +
  • aa - current fbus media in hex
  • +
  • bb - last sender dev in hex
  • +
  • cc - last sender media in hex
  • +
  • dd - next media to be connected. Same as aa if the connection is not pending
  • +
  • eee - fbus parity error counter
  • +
  • fff - fbus framing error counter
  • +
  • ggg - fbus overrun error counter
  • +
  • hhh - fbus alive check counter
  • +
  • iii - received sequence number
  • +
  • jjj - sent sequence number
  • +
  • k - phone mode: S=slave, H=host
  • +
+ +

Description above is from some English documents. As you can see in some phones +(like Nokia 5110) values in this test looks rather different, but help is the same. +But, when you make connection with FBUS cable and make transmission, first line of values +in this test changes to "1E0C1E -". When you will look into some +FBUS protocol descriptions, +you will see, that: + +

    +
  • "1E" could mean datas send with FBUS protocol over cable
  • +
  • "0C" could mean, that FBUS cable is connected to phone
  • +
+ +

and it's the truth. So, it means, that this description is real (even, that +test looks a little different). + +

Observation from Nokia 6150: + +

+ + + + +
+aabbccdd    
+eeffgghh i j
+kk
+l-m
+ +

+

    +
  • aabbcc: +
      +
    • 000000 - no transmission after enabling phone
    • +
    • 1E0C1E - there was FBUS transmission
    • +
    • 140000 - there was infrared connection using NBS (business card, calendar entry, etc.)
    • +
    • 1C7F1C - there was 2-players snake game (host)
    • +
    • 1C001C - there was 2-players snake game (slave)
    • +
    +
  • +
  • hh: 0 - no infrared transmission in this moment
  • +
  • i: increases for example after each sending data using infrared and NBS or ending +transmission
  • +
  • j: P - infrared enabled, searching next device (blinking indicator in phone)
  • +
  • l: H - host in infrared transmission; S - slave in infrared transmission
  • +
  • m: T - infrared enabled, connection terminated (blinking indicator in phone)
  • +
+ +

In Nokia 9110 this menu looks different: + +

+ + + + + + +
+ + + + +
ll mm nn oo 
+ee ff gg
+p  q
+r s tt
+
+ + + + +
PA RS DR PR 
+PE FE OE
+Rx Tx
+D U DC
+
+ +

+

    +
  • +p and q are probably iii and jjj
  • +
+ +

Links to pages with FBUS (MBUS) protocol are in the question 25. + +

+ + + + + + +
If values in this test changed after enabling phone, it means, that +it was connected to computer and datas were transmitted with +FBUS protocol (not MBUS).
+ +

In Nokia 9210: + +

+ + + + + + +
+ + + + +
+00 00 00
+000 000 000 
+- - 00
+H - - +
+
+ + + + +
CM LD LM    
+PEC FEC OEC
+RS TS RESND
+Mode TXB RXB
+
+ +

Test 35 +
Reason of last reboting internal firmware of phone. + +

+ + + + + + +
+ + + + +
 aaaaa      
+ bbbbbbbb

+
+ + + + +
Reset reason
+Task name

+
+ +

+

    +
  • aa - reason: + +

    +

      +
    • NORM: probably normal power up
    • +
    • UNKNO: default value, reset reason is unknown
    • +
    • SWSIM: SIM contact failure reset. Shown, when phone has simlock and wrong mastercode was entered.
    • +
    • STACK: task stack overflow
    • +
    • SWIDL: idle task not running reset
    • +
    • HW lub WD: ASIC watchdog timeout. SW WD in Nokia 3310 ?
    • +
    • SWDSP: restart DSP recovery reset
    • +
    +

    +

  • + +
  • +bbbbbbbb - name of running task before reset (for example, +"AUD TASK", +"CC TASK" (confirmed), +"DDI TASK", +"DEV IO" (confirmed), +"EM TASK", +"FBUSTASK" (confirmed - after errors in cable transmission), +"L1 CONTR", +"L1 MEAS", +"L1 SYSPA" (confirmed), +"L2 TASK", +"LOCAL" (confirmed - shown, for example, when phone had to restart because of error in firmware), +"MDI RECE" (confirmed), +"MDI SEND" (confirmed), +"MM TASK" (confirmed), +"OS IDLE" (confirmed), +"PN TASK" (confirmed), +"RR TASK" (confirmed), +"RM TASK", +"SIM L2" (confirmed), +"SIM UPL" (confirmed), +"SMS TASK" (confirmed), +"TONETASK", +"UI TASK" (confirmed) +"PND TASK" (for example Nokia 6210), +"WMLSTASK" (for example Nokia 6210), +"IRDATASK" (for example Nokia 6210), +"IRDA MGR" (for example Nokia 6210), +"PH TASK" (for example Nokia 6210), +"DGC TASK" (for example Nokia 6210), +"DGNTB TA" (for example Nokia 6210), +"DGFAX TA" (for example Nokia 6210), +"SCKT SRV" (for example Nokia 6210), +"PMM CLUP" (for example Nokia 6210), +"PMM WRBA" (for example Nokia 6210), +"ND TASK" (for example Nokia 6210), +"PPC TASK" (for example Nokia 6210), +"No task!" (for example Nokia 6210), +"START UP" (for example Nokia 9210) +or "UNKNOWN" (confirmed - after normal phone enabling)). We can notice, that tasks names are similiar to +names in help to tests 84-86.
  • +
+ +

Test 36 +
Reasons of last reboting internal firmware of phone (you will +find here information, how many times phone made restarts because of reasons +from previous test). + +

+ + + + + + +
+ + + + +
 aa  bb  cc 
+ dd  ee  ff

+
+ + + + +
 UN  WD DSP 
+SIM IDL STK

+
+ +

+

    +
  • aa - unknown resets
  • + +
  • bb - ASIC watchdog timeout resets (in some +you can simulate it - see question 9 for details)
  • + +
  • cc - DSP recovery resets. In Nokia 3310 displayed also +in test 130.
  • + +
  • +dd - some English descriptions say, that it's connected with +SIM contact failure reset (in some phones you can force reset because of this reason +- see question 9). I noticed too, that this counter +increases when to try to enter mastercode connected with simlock level 1 +using #pw+2222222222+1# code (where mastercode is instead of 2222222222), when +your phone has simlock. +
  • + +
  • ee - idle task not running resets
  • + +
  • ff - task stack overflow resets
  • +
+ +

Counters are stored to EEPROM. + +

In Nokia 3310 some counters (DSP only ?) are displayed from end (for example, 01 is displayed as 10, +02 as 20, etc.) + +

+ + + + + + +
You can reset counters from this menu using some Nokia service programs +- for example, in Pc-Locals 1.3 enter to menu 8 ("Event Trace"), +menu 5 ("Permanent Counter Table...") and press F6 key ("Clear Counters"). +Unfortunatelly :(, "real" counters connected with mastercode entering attempts +(Counter for example in WinTesla and WinLock) don't reset then... +
+ +

In Nokia 9210 help is different: + +

+ + + + +
+ UN  WD DSP 
+SIM IDL STK
+   Reset
+  counters +
+ +

Test 37 +
Reset (Nokia 9210) + +

+ + + + + + +
+ + + + +
+   Causes a  
+  divide by
+    zero
+    reset +
+
+ + + + +
+  Use menu  
+  to cause
+  div by 0
  +
+
+ +

You can restart your system by direct enter + +

Test 38 +
Memory dump + +

+ + + + + + +
+ + + + +
aaaaaaaaaaaa
+aaaaaaaaaaaa
+aaaaaaaaaaaa
+aaaaaaaaaaaa
+
+ + + + +
Memory dump 

+
+ +

+

    +
  • aaaa.... - hex dump of 24 successive memory locations
  • +
+ +

The start address of the dump is entered as 6 digit address value +into location 30 into phonebook on SIM card (information, how to make it, +are in test 17). +An example: for address 0x0C89AB enter 0C2089AB value there... +Dump address is changed only when you directly enter to this menu. + +

This display rather is not included in offcial firmware (I found only one +phone with it). It can be switched on by defining flag DEV_FT_MEMORY_DUMP_IN_USE in ftd_conf.h. + +

In Nokia 9210: + +

+ + + + + + +
+ + + + +
+  Causes a  
+ data abort
+   reset
  +
+
+ + + + +
+  Use menu  
+  to cause
+  data abort
+  reset +
+
+ +

You can restart system by direct enter + +

Test 39 +
Reason of last connection end (asterisk means, that the diagnosis won't be sent to the +network - it'll be only shown in phone) and making +Location Update: + +

+ + + + + + +
+ + + + +
 CC:   aaa  
+ MM:   bbb
+ RR:   ccc
+
+ + + + +
CC CauseValu
+MM CauseValu
+RR CauseValu
+
+ +

+

    +
  • +reason from the CallControl-Layer - it's displayed in +test 2 and +test 63 too: + +

    +

      +
    1. +from the GSM specifications (section 10.5.4.11/GSM 04.08): + +

      +

        +
      • + 1: unassigned (unallocated) number
      • + +
      • + 3: no route to destination
      • + +
      • + 8: operator determined barring
      • + +
      • +16: normal end of call (you were speaking or you heard some +text - that dialled number was busy or something similiar) +
      • + +
      • +17: user busy + +

        +

          +
        • +if it was outgoing call, dialled number was busy (phone even displayed +'Number busy')
        • + +
        • +if it was incoming call, a man, who dialled to you, heard busy signal +- you were speaking or you rejected it (in Nokia 5110 or 5130 to make +it you have to press C key, in Nokia 6110, 6130 or 6150 red receiver) +
        • +
        +

        +

      • + +
      • +18: no user responding
      • + +
      • +19: user alerting (from specification - I had it +with normal connection too (phone displayed +'No answer' ('Nie odpowiada')) or when incoming call was diverted to +voice mailbox), no answer +
      • + +
      • +21: call rejected + +

        +

          +
        • +phone wasn't in network coverage (message 'No coverage network'), when you +tried to make call +
        • + +
        • +you tried to call to non existing phone number or you heard busy signal +
        • +
        +

        +

      • + +
      • +22: number changed
      • + +
      • +27: destination out of order
      • + +
      • +28: invalid number format/number incomplete. Phone displayed +'Invalid phone number'
      • + +
      • +31: unspecidied. It seems, that with this error connection +is end by network (for example, when it's overcharged). +Shown sometimes too, when you call for not supported for some tariffs numbers. +
      • + +
      • +34: no circuit/channel available to make call. Phone displayed +'Network busy'. I noticed too, that in my network RR value changed to +1 with this error. More about situations, when network is busy, I write +in TS description.
      • + +
      • +38: network out of order
      • + +
      • +41: temporary failure
      • + +
      • +42: switching equipment congestion +(message "Network busy") +
      • + +
      • +44: requested channel not available
      • + +
      • +47: ressource unavailable. I had it, when connection was "brutal" broken. +Concrete: during call phone of my interlocutor disabled because of empty battery. +My phone displayed 'Error in connection'
      • + +
      • +50: requested facility not subscribed +(you must subscribe it to use it) +In some networks shown too, when you set not supported by network function +(for example, "Own number sending" in Era-GSM network). +Message "Check operator services". +
      • + +
      • +65: bearer service not implemented
      • + +
      • +68: ACM equal to or greater than ACMmax
      • + +
      • +69: requested facility not implemented
      • + +
      • +88: incompatible destination
      • + +
      +

      +

    2. + +
    3. +from mine (and not only) experiences: + +

      +

        + +
      •  28: I had it, when phone number was too long
      • + +
      •  57: no asynchronous data transmission allowed (concrete: +phone wasn't able to connect to WAP from this concrete SIM card)
      • + +
      •  63: "Poza zasiêgiem sieci"
      • + +
      • +79: error with message 'Check operator services'. +You have it, when you enable ALS (Alternative Line Service) function, +don't have second number on SIM card, select it and try to make call +
      • + +
      • +111:'Error in connection'
      • + +
      +

      +

    +
  • + + +
  • +reason from the MobilityManagement-Layer +- it's shown in test 64 too. +It's from GSM specification (section 10.5.3.6/GSM 04.08): + +

    +

      +
    • + 2: IMSI unknown in HLR +(SIM card not active in network)
    • + +
    • + 3: illegal phone
    • + +
    • + 4: IMSI unknown in VLR
    • + +
    • + 5: phone's IMEI was not accepted
    • + +
    • + 6: illegal ME
    • + +
    • +11: PLMN not allowed (you tried to log into +network, which doesn't have roaming convention with your home network - your phone +displays 'No access', when you try to select it manually; I don't know only, if +this code is displayed only, when this network is saved on forbidden list on SIM +card (see test 6)
    • + +
    • +12: Location Area not allowed. You can check it in test 11.
    • + +
    • +13: roaming not allowed in this Location Area
    • + +
    • +17: network failure
    • + +
    • +22: network congestion
    • + +
    • +32: service option not supported
    • + +
    • +33: service option not subscribed
    • + +
    • +34: service temporarily out of order
    • + +
    • +38: call cannot be identified (call RE)

    • + +
    + +
  • +reason from RadioRessourceManagement-Layer) +- see GSM specifications: section 10.5.2.31/GSM 04.08: + +

    +

      +
    • +  0: normal release
    • + +
    • +  1: unspecified
    • + +
    • +  2: channel unacceptable
    • + +
    • +  3: timer expired
    • + +
    • +  4: no activity on the radio path
    • + +
    • +  5: Pre-emptive release
    • + +
    • +  8: handover impossible, +TA out of range
    • + +
    • +  9: channel mode unacceptable
    • + +
    • + 10: frequency not implemented
    • + +
    • + 65: call already cleared
    • + +
    • + 97: message type not compatible with protocol state
    • + +
    • +101: no cell allocation available
    • + +
    • +111: protocol error unspecified
    • +
    +
  • +
+ +

When you will see "*" before third parameter from this test, it means +(the most often), that call is in progress. Sometimes phone displays different +values - I don't know their meaning :-(. + +

Values of counters are not saved in EEPROM. When phone makes another measure, +doesn't reset them (changes only these values during next measure, which are connected +with it; doesn't change the rest of them). + +

+ + + + + + +
This test allows to find, why exactly your phone doesn't want to work +- doesn't want to make calls.
+ +

Test 40 +
Resets handover counters (by direct enter)... + +

+ + + + + + +
+ + + + +
   RESET
+  HANDOVER  
+  COUNTERS
+
+ + + + +
  Use menu  
+  to reset
+  handover
+  counters
+
+ +

Test 41 +
Information about handover + +

Handover - it's transfer of radio connection +(between phone and cell) from one cell to another (without breaking call). +It's made, when: + +

+

    +
  1. +new radio connecting will give better quality (it's parameters are all the time +checked by phone and base station) +
  2. + +
  3. +when phone is between few cells and can use "new" cells for him +(it frees some place for phones, which can use "old" cell only) +
  4. +
+ +

When they're problems with transmission, decision about handover is made +by phone (otherwise it's made by BSC). +If you enabled using one channel by phone (test 17), +handovers are not made. + +

There are 4 types of handovers: + +

+

    +
  • +Intra cell - Intra BSC +handover (called handoff too): it's the smallest handover +inside one cell. Receiver is "thrown over" from one channel to another +(gennerally to another frequency inside one cell). Decision, if it should +be done, is made by BSC.
  • + +
  • +Inter cell - Intra BSC handover: +receiver is moved from one cell to another. Decision about it +is made by BSC. Connection with first cell +is broken after moment, when connection with another is made (displacement +between two BTSes inside one +BSC).
  • + +
  • +Inter cell - Inter BSC handover: +displacement of connection between two cells, which are not served by +the same BSC. In this case handover is moved +by MSC, but decision about it made +by first BSC. Connection with first +BSC (and BTS) +is broken before moment, when connection with another BSC +(and BTS) is made. +
  • + +
  • +Inter MSC handover: receiver moves from +cell served by MSC/VLR +to another controlled by another MSC/VLR. +It's more complicated situation. We can notice, that +MSC is connected to GSMc over PSTN. +In this case is visible, that another MSC +can't receive information from first normally. + +

    What will happen, when connection will be moved to target +MSC/VLR ? + +

    Because both MSC belongs to the same network, +connection is kept. To move it from one to another MSC +special number HON (HON=CC+NDC+SN, CC - country code, NDC - network code, +SN - subscriber's number) must be generated. It's similiar to roaming number +(it's connection between two MSC too). During +handover between two MSC connection can't be +broken (phone connection realised by network's subscriber). +

+ +

+ + + + + + +
+ + + + +
HandOOk: aaa
+PrevCh : bbb
+HONotOK: ccc
+HOIntra: ddd
+
+ + + + +
HandOvOKCntr
+PrevChanCntr
+HandOvNOKCnt
+HOIntraOKCnt
+
+ +

+

    +
  • +aaa - counter for successful handovers
  • + +
  • +bbb - counter for successful back to previous channel attempts +(number of actual used channel is displayed, for example, in +test 1)
  • + +
  • +ccc - counter for failed handovers
  • + +
  • ddd - counter for successful Intra cell - Intra BSC handovers +or assignments
  • +
+ +

Counters will stop when they reach their maximum (999). To initialize them +to zero, use test 40 (or +test 60). + +

In dual phones (like Nokia 6150 or 3210) test 41 looks +different and is connected with Inter cell - Intra BSC, +Inter cell - Inter BSC and Inter MSC handovers: + +

+ + + + + + +
+ + + + +
 aaaa  bbbb
+ cccc  dddd
+eeefffggghhh
+iiijjjkkklll
+
+ + + + +
G>G InterD>D
+G>D  OK  D>G
+InterHoFail
+BackToPrev
+
+ +

+

    +
  • aaa - counter of successful handovers from GSM 900 to GSM 900
  • +
  • bbb -counter of successful handovers from GSM 1800 to GSM 1800
  • +
  • ccc - counter of successful handovers from GSM 900 to GSM 1800
  • +
  • ddd - counter of successful handovers from GSM 1800 to GSM 900
  • +
  • eee - counter of failed handovers from GSM 900 to GSM 900
  • +
  • fff - counter of failed handovers from GSM 1800 to GSM 1800
  • +
  • ggg -counter of failed handovers from GSM 900 to GSM 1800
  • +
  • hhh - counter of failed handovers from GSM 1800 to GSM900
  • + +
  • +iii - counter of successful back to previous channel attempts +(number of actual used channel is displayed, for example, in +test 1) +from GSM 900 to GSM 900
  • + +
  • jjj - counter of successful back to previous channel attempts from GSM 1800 to GSM 1800
  • + +
  • kkk - counter of successful back to previous channel attempts from GSM 900 to GSM 1800
  • + +
  • lll - counter of successful back to previous channel attempts from GSM 1800 to GSM 900
  • +
+ +

Counters will stop when they reach their maximum (9999 dla dwóch pierwszych +linii, 999 dla dwóch ostatnich). To initialize them to zero, use test 40 +(or test 60). + +

In Nokia 3310 sum of all handovers is also +displayed in test 131 (?). + +

In Nokia 3110 this test looks like follows: + +

+ + + + + + +
+ + + + +
HandOOk: aaa 
+PrevCh : bbb 
+HONotOK: ccc 
+T200: eeee
+
+ + + + +
HandOvOKCntr 
+PrevChanCntr 
+HandOvNOKCnt 
+T200Cntr
+
+ +

+

    +
  • +eeee - I write about T200 counter in test 43
  • +
+ +

and here's for Nokia 6185/6188: + +

+ + + + +
+BSI 01000
+VBAT 388
+BTEMP 018
+BATT 2 CHG 0
+
+ +

    +
  • BSI - Battery capacity. Example: +'1600' for 1500 mAh; '984' for 900 mAh, and '1000' for 880 mAh
  • +
  • VBAT - battery voltage (/100V).
  • +
  • BTEMP - battery temperature in C
  • +
  • BATT - type of battery: 1500 mAh=2; 900 mAh=1; 880 mAh=5
  • +
  • CHG - battery charge status: 2 - charging with desktop charger, +1 - charging with fast charger, 0 - not charging
  • +
+ +

Test 42 +
This test is in dual phones (for example, Nokia 6150 or 3210) only +and is connected with first kind of handovers +(Intra cell - Intra BSC): + +

+ + + + + + +
+ + + + +
 aaaa  bbbb
+ cccc  dddd
+eeefffggghhh
+iiijjjkkklll
+
+ + + + +
G>G IntraD>D
+G>D  OK  D>G
+IntraHoFail
+BackToPrev
+
+ +

+

+ +

Counters will stop when they reach their maximum (9999 for two first lines, +999 for two last). To initialize them +to zero, use test 40 +(or test 60). + +

In Nokia 6185/6188 this test looks like test 20. + +

Test 43 + +

Some English descriptions write about this test: + +

+ + + + + + +
+ + + + +
T200MS: aaaa
+T200BS: bbbb
+T200MS: cccc
+T200BS: dddd
+
+ + + + +
T200 MS GSM 
+T200 BS GSM
+T200 MS DCS
+T200 BS DCS
+
+ +

+

    +
  • +aaaa - for GSM 900: counts how many times T200 in phone has expired and +therefore L2 transmission has been repeated.
  • + +
  • +bbbb - for GSM 900: counts how many times T200 in BTS (network) has expired +and therefore L2 transmission has been repeated. +
  • + +
  • +cccc - for GSM 1800 called earlier DCS (in dual phones only): counts how many times T200 in phone +has expired and therefore L2 transmission has been repeated. +
  • + +
  • +dddd - for GSM 1800 (in dual phone only): counts how many times T200 in BTSie +(network) has expired and therefore L2 transmission has been repeated.
  • +
+ +

Counters will stop when they reach their maximum (9999 for two first lines, +999 for two last). To initialize them to zero, use test +40 (or test 60). + +

I noticed, that some things are a little different: in all 900, 1800, 900/1800 MHz +phones, I saw, info is displayed ONLY in two first lines. Help is a little different too: + +

+ + + + + + + + + + + + + +
+ + + + +
+T200 MS     
+T200 BS

+  +

+
+or: + + + + + +
+T200Cntr MS
+T200Cntr Net

+  +

+
+or: + + + + + +
+T200Cutr MS
+T200Cutr Net

+  +

+
+ +

In Nokia 6185/6188 this test looks like test 21. + +

Test 44 +
You change value from 01 (default) to 00 (or vice versa) by direct enter to this test. + +

+ + + + + + +
+ + + + +
+
 REVISION
+LEVEL IS aa 
+
+ + + + +
Use menu to 
+   change
+  Revision
+   Level
+
+ +

In Nokia 6185/6188 this test looks like test 22. + +

Test 45 +
This test allows to simulate situations. when phone can normally +receive network signal (but network can't receive any information from phone). +It's very realistic (even in test +1 in ddd parameter an asterisk (*) is displayed, when +you try to make connection), but not always (in +test 10 you will see +'xxxxxxxx' instead of TMSI, when T3212 counter in first +parameter will be expired). + +

You can change it by direct enter. + +

+

+ + + + + + + +
+ + + + +
+
TRANSMITTER 
+  ENABLED
+ +

(default setting)

+ + + + +
+
TRANSMITTER 
+  DISABLED
+
+ + + + +
Use menu to 
+ enable or
+  disable
+transmitter
+
+ +

+ + + + + + +
When you enable it, phone won't be able, for example, to update +location (see test 64) and +make calls. It will allow to: + +
    +
  • "blockade" phone to the moment of another enabling it (for example, +when you want to observe network parameters, but you don't want to be +accessible for others - when somebody will call to you, for network +your phone will be outside range) +
  • + +
  • +fast remind you of number written to phonebook (it's written on leaf, +but you don't remember name of person assigned to): simple call it. +When phone will choose number, it will display this name; it will be written +on list odf last dialed numbers too. +
  • +
+
+ +

This test DOESN'T WORK CORRECTLY in Nokia 3210, 3310 and 7110 (you change setting, +but it doesn't give described above results). + +

In Nokia 6185/6188 this test looks like test 23. + +

Test 46 + +

+ + + + +
+BAND CLASS a
+CS SUBSTATE
+EM STATEnnn
+TX POWER DB
+
+ +

    +
  • BAND - used cellular system: C= 800MHz CDMA, P=1.9GHz CDMA, A=800MHz AMPS
  • +
  • CS SUBSTATE - cellular state: IDLE, CONVE, PAGE, PILOS, TIME_, SYNC_, RELE, etc
  • +
  • EM STATE - emiter state: SLOT 1, SCANNING, RATE 1 (8k codec), RATE 2 (13k codec) or EVRC.
  • +
  • TX POWER DB - TX power: usually between -75dB and +4dB
  • +
+ +

Test 48 +
In Nokia 3110 this test looks like test 7. + +

Test 51 +
Information about SIM card + +

+ + + + + + +
+ + + + +
aaa bbb ccc 
+ dddddddd
+ e f  gg hh
+  i   jjjj
+
+ + + + +
VSel Bau SAl
+SCond  CStop
+PIN12  PUK12
+ ATR  FE/PE
+
+ +

+

    +
  • +aa - SIM voltage selection type (3, 3/5 or 5)
  • + +
  • +bbb - division coefficient, which define speed of communication phone with +SIM card (372, 64, 32 or 0) saved in ATR (first sequence send by SIM card +after reset - Answer To Reset). +When you will divide clock frequency (maximal 3,25 MHz = 3 250 000 Hz) +by it, you will have speed of transmission +(for example, 3 250 000 Hz / 372 = 8736,5 bods) +WARNING ! YOU CAN'T CHANGE SPEED OF COMMUNICATION PHONE WITH SIM CARD +AND VALUE OF THIS PARAMETER ! +
  • + +
  • +ccc - information, whether SIM clock stop is allowed (it saves energy) +during standby (YES or NOT - possible or not). This information is displayed +(in Nokia phones and not only) using *#SIM0CLOCK# code +- when you will see "SIM clock stop allowed", SIM card allows to make it. +Some Nokia 6110 phones (it depeneds on their firmware) can not support +correctly this code - they display, for example, "Result unknown". +Phone disables SIM card clock automatically - you can't make it manually ! +
  • + +
  • +dddd - information about clock stop condition: + +

    +

      +
    • UP
    • +
    • DOWN
    • +
    • DOWN(UP) - in tested by me SIM cards
    • +
    • UP(DOWN)
    • +
    • xxxxxxxx
    • +
    +

    +

  • + +
  • +e - number of left PIN1 code entering attempts. When it's bigger than 9, +you will see only last digit of it (for example, I found some prepaid cards +with 10 value). Maximal number of entering code attempts depends on concrete +SIM card (it can be set to any value), but the most often it's equal 3. In some SIM cards +you can disable answering for this code (for example, you can select it in +Menu 4-3-1 in Nokia 5110). When it's equal 0, phone shows +"Sim card blocked" and asks for PUK1. If it was entered correctly, this counter +is reset to maximal value. Disabling and enabling phone doesn't reset it ! +
  • + +
  • +f - number of left PIN2 code entering attempts (when SIM card doesn't support +PIN2 functions, you will see "x" here). You can check, if these functions are supported, +using call cost function too (if they're not, phone displays "Not allowed"). +If you wanted to use them and your card doesn't support them (you will see "x" +here), you (or your operator ;-) rather) have to change it. +Maximal number of entering code attempts depends on concrete +SIM card (it can be set to any value), but the most often it's equal 3. When this counter +is equal 0, phone asks for PUK2. When this code was entered correctly, counter +is reset to maximal value. Of course, even when it's equal 0, you can normally +use SIM card (PIN2/PUK2 are independent of PIN1/PUK1), when you know PIN1. +Disabling and enabling phone doesn't reset it ! +If SIM card has blocked PIN2/PUK2 codes, you can enter to the menus contains supported +by these codes functions (but after changing next settings you will see error). +
  • + +
  • +gg - number of left PUK1 code entering attempts. +Maximal number of entering code attempts depends on concrete +SIM card (it can be set to any value), but the most often it's equal 10. +Phone asks for it, when counter of left PIN1 code entering attempts is equal 0 +(phone shows "Sim card blocked"). When this counter is equal 0 too, SIM card +can be blocked (phone shows "Sim card rejected") or (it depends on card) +asks for PUK2. When this code was entered correctly, counters of left PIN1 and +PUK1 codes entering attempts are reset to maximal values. +Disabling and enabling phone doesn't reset it ! +
  • + +
  • +hh - number of left PUK2 code entering attempts (when SIM card doesn't support +PIN2 functions, you will see "x" here). +Maximal number of entering code attempts depends on concrete +SIM card (it can be set to any value), but the most often it's equal 10. +When it's equal 0, using PIN2 functions can be impossible on this SIM card (ask operator for help). +Additionaly, when you were asked for PUK2, when counters of left PIN1 and +PUK1 codes entering attempts were equal 0 and now left PUK2 code entering attempts +is equal 0 too, using this SIM card can be impossible (you have to replace it to new). +When it was entered correctly, counters for this code and PIN2 (when you entered +PUK2, because PIN2 was blocked) are reset to maximal values or counters for this, +PIN1 and PUK1 are reset (when you entered PUK2, because PIN1 and PUK1 were blocked). +Disabling and enabling phone doesn't reset it ! +
  • + +
  • +i - ATR repeat counter (ATR is first sequence sent by SIM card in answet to reset - +Answer To Reset) (0-9)
  • + +
  • +jjjj - number of retransmissions/parity errors in transmission with SIM card +(when the happen, two first chars are equals FE (Frame Error) or +PE (Parity Error), two last number of retransmission/errors)
  • +
+ +

If you don't have SIM card in the phone, you will see "ERROR1" in this test. + +

If phone has problems with communication with SIM card, this test can look like +follows (i and jjjj parameters are described above): + +

+ + + + + +
+ + + + +
ERROR1 5  55
+55
+  i   jjjj
+  +
+
+ +

CStop parameter (information, if SIM card clock is disabled in this moment) +is displayed in help only. Why ? Probably somebody didn't remember about it... + +

Here are some observations for SIM voltage selection type (first parameter) +Nokia 5110 and tested SIM cards: + +

After enabling phone reads some information from SIM card (for example, +number saved on it SMS messages, numbers from phonebook) - when you try to read +something, what is written there (for example, phonebook), +"SIM card not ready" message is displayed then (and first parameter shows 3). +I noticed, that phone can't display names assigned to numbers in phonebook too +(for example, when you call somebody) and shows, that "Inbox" and "Outbox" +are empty (even, when some messages are saved there). + +

Later value of parameter changes to 3/5 - I suppose, SIM card clock is +enabled then. + +

Phone disables it (in test value 3), when communicates with network +(requesting services, sending or receiving SMS messages) because of saving +energy (the same in NSPS state). + +

When you call to number assigned to name in phonebook (or phone +recognizes incoming number), value to the end of call is equal 3/5 +(otherwise it changes to 3). After end of call is always equal 3. Logical +conclusion: after enabling phone saves in own memory checksum for +all numbers from phonebook (it's enought to make for 7 last digits - they're +used to identify number in Nokia phones). If this checksum is the same to +checksum for number, you're calling (or incoming number), phone reads name +from phonebook... + +

And the last observation: without connection (see above) value of first +parameter is equal 3/5 (is some energy loose ? Probably yes... But why counter from +test 20 doesn't show any change in their +consumption ?) + +

When you try to open "Outbox" or "Inbox", phone doesn't enable clock, +when they're empty (that's why I think, that phone saves into own memory +number of saved SMS messages too). + +

Many information about SIM card are displayed by +SIMedit (unfortunatelly, in Czech language only :-( )... +Parameters like ATR you can study using SIM Scan (it's on the www.net.yu/~dejan +or http://members.tripod.com/~dejank/ pages). They both work with +SIM card readers only... + +

+ + + + + + +
+If you want to see "Insert SIM card" and (sometimes) "SIM card rejected" +messaeges, try to make such activities (checked for Nokia 5110): + +

Press very delicately the locking catch of the battery and start to slide the battery +downwards very slowly (stop, when you will hear silently crack). + +

In this moment you should see first message and phone will start to inform +about problems with communication with SIM card (you will see "ERROR1" here)... +

+ +

In Nokia 9210 help looks like follows: + +

+ + + + +
VSel Bau SAl
+SCond(CStop)
+PIN12  PUK12
+ ATR  FE/PE
+ +

In Nokia 6185/6188 this test looks like follows: + +

+ + + + +
+TASK0 0134  
+TASK1 015C
+TASK2 0138
+TASK3 0170
+
+ +

Test 52 +
Reads datafield from SIM card + +

+ + + + + + +
+ + + + +
+Read SIM-
+data field  
+to SIM-SCM
+
+ + + + +
+Use menu to 
+read SIM-
+data field
+to SIM-SCM
+
+ +

This display reads a binary datafield from SIM card to SIM SCM memory +(SCM = Short Code Memory and it means phonebook on SIM card). + +

Prior using this display the identifier of datafield has to be stored as an +alpha-identifier of SCM location number 34 of SIM memory. The datafield +must be written in hexadecimal notation. The identifiers can be found from +the GSM 11.11. + +

The contents of datafield is stored as a data-identifier of SCM location +number 35 of SIM memory. The contents are displayed in hexadecimal notation. +The maximum length of the datafield is 10 bytes, but the length depends on +the name length of the SIM memory. In case the datafield cannot be read the +alpha-identifier of SCM location is NOT DONE. + +

The information of how the read succeeded can be read from the SCM location +36 of SIM memory and on the display for a short period. + +

The following results are possible: + +

+ + + + + + + + + +
OKdatafield was read correctly
NOT BINARYdatafield is either formatted or cyclic
NOT FOUNDdatafield was not found from SIM card
CARD ERRORsomething weird happened, card did not respond as expected
NO RIGHTSnot enough rights to read the datafield (PIN2,adm..)
NOT STOREDcould not store into the result memory place
NO ADDRESScould not read the address from the SCM-location
UNKNOWNunidentified error
+ +

For the time being following binary datafields exist in SIM. In future +there could be more. All of these are not necessarily on all SIM cards. + +

+ + + + + + + + + + + + + + + + + + + + + + + +
2FE2ICC identification(10 bytes)
6F05Language preference(variable length)
6F07IMSI(9 bytes)
6F20Ciphering key Kc (it's read from card after entering PIN)(9 bytes)
6F30PLMN selector(variable length)
6F31HPLMN (home network ?) search period(1 byte)
6F37ACM maximum value(3 bytes)
6F38SIM service table(2-4 bytes)
6F41Price per unit and currency table(5 bytes)
6F45Cell broadcast message identifier selection(variable length)
6F74Broadcast control channels(16 bytes)
6F78Access control class(2 bytes)
6F7BForbidden PLMNs (see test 7)(12 bytes)
6F7ELocation information +(TMSI, +Local Area Information (consist of MCC, MNC & LAC - +see test 11 for them), +last Location Update status)(11 bytes)
6FADAdministrative data(variable length)
6FAEPhase identification(1 byte)
6F43SMS status(variable length)
 

Next two binary datafields are phase 2+ features which are not currently in use

 

6F3EGroup Identifier Level 1(variable length)
6F3FGroup Identifier Level 2(variable length)
+ +

In Nokia 6185/6188 this test looks like follows: + +

+ + + + +
+TASK4 0134  
+TASK5 015C
+TASK6 0138
+TASK7 0170
+
+ +

Test 53 +
Writes datafield into SIM card + +

+ + + + + + +
+ + + + +
+    Write
+ data field
+from SIM-SCM
+  to SIM
+
+ + + + +
+Use menu to
+write data
+field to SIM
+  +
+
+ +

This display writes data for a binary datafield in SIM card by using data +in SCM memory of SIM card. + +

Prior using this display the identifier of datafield has to be stored as an +alpha-identifier of SCM location number 34 of SIM memory. The datafield +must be written in hexadecimal notation. The identifiers can be found from +the GSM 11.11. In addition the data to be stored into SIM card has to be +entered as an alpha-identifier of SCM location number 35 of SIM memory. +The data has to be stored in hexadecimal notation. + +

The result of write operation can be seen from the alpha-identifier of +SCM-location 36 of SIM-memory and on the display for a short period. + +

The following results are possible: + +

+ + + + + + + + + + +
OKdatafield was read correctly
NOT BINARYdatafield is either formatted or cyclic
NOT FOUNDdatafield was not found from SIM card
CARD ERRORsomething weird happened, card did not respond as expected
NO RIGHTSnot enough rights to read the datafield (PIN2,adm..)
DATA ERRORthe data contents in SCM location is coded wrongly
NOT STOREDcould not store into the result memory place
NO ADDRESScould not read the address from the SCM location
UNKNOWNunidentified error
+ +

If you want to see changes, often you have to restart your phone. + +

In Nokia 6185/6188 this test looks like follows: + +

+ + + + +
+TASK8 0134  
+TASK9 015C
+TASK10 0138
+TASK11 0170
+
+ +

Test 54 +
Information about memory blocks + +

+ + + + + + +
+ + + + +
aa bb  aa bb
+aa bb  aa bb
+aa bb  aa bb
+aa bb  aa bb
+
+ + + + +
ResF1  ResF2
+ResF3  ResF4
+ResF5  ResF6
+ResF7  ResF8
+
+ +

Meaning of the individual lines (information about another blocks): + +

+

    +
  1. 1, 2
  2. +
  3. 3, 4
  4. +
  5. 5, 6
  6. +
  7. 7, 8
  8. +
+ +

+

    +
  • aa - number of reserved blocks
  • +
  • bb - number of free blocks in worst case
  • +
+ +

In Nokia 6185/6188 this test looks like follows: + +

+ + + + +
+TASK12 0134 
+TASK13 015C
+TASK14 0138
+TASK15 0170
+
+ +

Test 55 +
Information about memory blocks (some phones don't have this test - +they don't have such big memory) + +

+ + + + + + +
+ + + + +
aa bb  aa bb
+aa bb  aa bb
+aa bb  aa bb
+aa bb  aa bb
+
+ + + + +
ResF9 ResF10
+ResF11ResF12
+ResF13ResF14
+ResF15ResF16
+
+ +

Meaning of the individual lines (information about another blocks): + +

+

    +
  1. 9, 10
  2. +
  3. 11, 12
  4. +
  5. 13, 14
  6. +
  7. 15, 16
  8. +
+ +

+

    +
  • aa - number of reserved blocks
  • +
  • bb - number of free blocks in worst case
  • +
+ +

In Nokia 7110 counters end on ResF11, in 6210/6250 on ResF15. + +

In Nokia 3110 this test looks like test 56. + +

In Nokia 8210/3310 help to this test is a little +different (another firmware "bug" ? ;-))): + +

+

+ + + +
+ + + + +
+ +ResF9 ResF10
+ResF11ResF12
+ResF13ResF14
+ResSF15ResF1
+
+
+
+ +

and values are displayed in first line only... + +

Test 56 +
Block display + +

+ + + + + + +
+ + + + +
 aaaaaa bbb 
+ cccccccc

+
+ + + + +
 Ptr   Cntr 
+ Task

+
+ +

+

    +
  • +aaaaaa - pointer to memory where double deallocation was called, in hex +format.
  • + +
  • +bbb - counter for failed deallocations.
  • + +
  • +cccccccc - name of task which last tried to double deallocate a block +(you can find their list in test 35 description). + + + +
  • +
+ +

This test has correct values only, when counter bbb is different from 0. + +

In Nokia 3110 it looks like test 57. + +

Test 57 +
Memory status before reset + +

+ + + + + + +
+ + + + +
aaaaaaaaaaaa
+aaaaa...
+bbbbbbbb
+
+ + + + +
 Status of
+ stacks
+ Block sets 
+
+ +

+

    +
  • +aaaaaa... - Status of each stack before reset. First position contains +the status of stack 0, second position the status of +stack 1 and so on. The last position contains the status +of System stack. Number of stacks depends on the current +configuration of software. Possible values for each stack are: + +

    +

      +
    • 0: status OK, no overflow - it's normally !
    • +
    • 1: status not OK, stack overflow
    • +
    +

    +

  • + +
  • +bbbbbbb - status of each block set before reset. First position +contains the status of block set 1, second position the +status of block set 2 and so on. Possible values for each +block set are: + +

    +

      +
    • 0: status OK
    • +
    • 1: block set full - it's normally !
    • +
    • 2: (de)allocation error or total memory corruption
    • +
    +
  • + +
+ +

This display is only valid when a unknown or +a stack overflow interrupt has occured. In some phones you can make +restart connected with stack overflow (see question 9) +and see this test in "action"... + +

In Nokia 6210 this test is bigger and displayed on full screen... + +

In Nokia 6185/6188 this test is different: + +

+ + + + +
+ +16:3A 32:26
+64:18 128:21
+168:14
+264:0E +
+
+ + +
Back to the top
+ +

+

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] +

+
+
+ +

Marcin Wiacek (WWW) +
Last modifcation: 10 March 2002
+ + + diff --git a/Docs/en_US/gsm/netmon/faq_net5.htm b/Docs/en_US/gsm/netmon/faq_net5.htm new file mode 100644 index 0000000..cd28c8d --- /dev/null +++ b/Docs/en_US/gsm/netmon/faq_net5.htm @@ -0,0 +1,2499 @@ + + + + + + + + + + NetMonitor in Nokia phones (6/7) + + + + + +

Main page

+ +
NetMonitor in Nokia phones (6/7) + +

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] + +

+ +
+ + + +
    +
  1. What is it ?
  2. +
  3. Do I need it ?
  4. +
  5. Does my phone use more power with NetMonitor enabled ?
  6. +
  7. How to activate it ?
  8. +
  9. Which NetMonitor version can be activated in my phone ?
  10. +
  11. Does NetMonitor activation void warranty ?
  12. +
  13. NetMonitor menu in my phone has different number than 10. Is it normal ?
  14. +
  15. NetMonitor menu in my phone has 11 number, hovewer previous position has 9 number. Is it normal ?
  16. +
  17. How to use it ?
  18. +
  19. Can I damage my phone ?
  20. +
  21. Glossary
  22. +
  23. Description of the individual tests
  24. +
  25. You can also use a program...
  26. +
  27. Can I use NetMonitor without SIM card inserted, without PIN number entered or when SIM card is not active ?
  28. +
  29. How can I disable NetMonitor ?
  30. +
  31. Do I need to disable NetMonitor before sending my phone to the service ?
  32. +
  33. Is it possible to re-activate NetMonitor after disabling it ?
  34. +
  35. Is NetMonitor available in analog Nokia phones ?
  36. +
  37. Does NetMonitor allow to use phone like broadcast station ?
  38. +
  39. I don't have all described tests in my phone. Why ? Can I increase their number ?
  40. +
  41. Does NetMonitor allow to identify place, where is my interlocutor ?
  42. +
  43. Does NetMonitor allow to identify place, where am I ?
  44. +
  45. What are NetMonitor codes ?
  46. +
  47. Is it the truth, that in phones with additional hardware changing frequency band NetMonitor doesn't work correct ?
  48. +
  49. Where can I find description of FBUS/MBUS protocol and commands connected with NetMonitor ?
  50. +
  51. I have non existing networks on the list of forbidden networks...
  52. +
  53. How to check frequency band (900 or 1800 Mhz), where phone work in this moment ?
  54. +
  55. Can I use DLR-2/DLR-3 cables for activating netmonitor ?
  56. +
  57. Can I activate netmonitor using Init File Editor (Nokia 9110) ?
  58. +
  59. Can I force phone to use one frequency band (900 or 1800 Mhz) only ?
  60. +
  61. How to change settings in tests ?
  62. +
  63. My phone has very short snandby time - it is possible to see the reason of it ?
  64. +
  65. Is netmonitor available in English version only ?
  66. +
  67. Information sources
  68. +
  69. Additional information
  70. +
  71. Does using/activating netmonitor cost anything ?
  72. +
  73. Does using netmonitor is legall ?
  74. +
  75. Which entries on SIM card are used in netmonitor tests ?
  76. +
  77. Can I activate netmonitor in 3310 using soft working with 3210 ?
  78. +
  79. After activating netmonitor/BTS TEST my phone can't find network...
  80. +
  81. Netmonitor shows different battery capacity than info on it...
  82. +
  83. NetMonitor in Nokia 6310, 8310,...
  84. +
+
+
+ +

Test 58 + +

+ + + + +
+384:02      
+512:02
+752:02
 
+
+ +

Test 59 + +

+ + + + +
+ +0087
+00 00 00 00 

  + +

+ +

Test 60 + +

+ + + + + + +
+ + + + +
 FIELD TEST 
+  DISPLAY 
+ COUNTERS 
+   RESET
+
+ + + + +
Use menu to
+reset field
+test display
+counters
+
+ +

By direct enter to this test you can reset counters from +test 41 to test 43 and from +test 61 to test 66. + +

+ + + + + + +
If you reset these counters at the beginning of each month, you can compare +the number of sent SMSes (test 65) +and made calls (test 63) with your billing. +Additionaly (in some prepaid cards - for example, in Polish Tak-Tak) +you pay to your operator for few SMS messages (in this example 10), when you +send first of them. When you will clear these counters in start of this period +(before first SMS), you will know, when another money will be taken from your account... +
+ +

Test 61 + +

+ + + + + + +
+ + + + +
NOPSW  :aaaa
+SYNCR  :bbbb
+RESELEC:cccc
+
+ + + + +
PSWMesgCntr
+SyncMeasCntr
+CellReselCtr
+
+ +

+

    +
  • +aaaa - hexadecimal counter of MDI_NO_PSW_FOUND messages from +DSP
  • + +
  • +bbbb - decimal counter for synchronization measurement attempts. +If value is over 9999 then four x are shown +
  • + +
  • +cccc - hexadecimal counter for cell reselections
  • +
+ +

Counters values are saved in EEPROM memory, when phone is disabled. +You can reset them using test 60. They're reset too, when +they exceed their maximal values. + +

In dual phones you will have such test 61: + +

+ + + + + + +
+ + + + +
aaaaa  bbbbb
+ccccc  ddddd
+eeeee  fffff
+ggggg  hhhhh
+
+ + + + +
NOPswGSM DCS
+Sync GSM DCS
+reselG>G D>D
+reselG>D D>G
+
+ +

+

    +
  • +aaaaa - for GSM 900: counter (decimal) for MDI_NO_PSW_FOUND messages +from DSP
  • + +
  • +bbbb - for GSM 1800: counter (decimal) for MDI_NO_PSW_FOUND +from DSP
  • + +
  • +ccccc - for GSM 900: counter (decimal) for +synchronization measurement attempts. +If this value is over 99999, then five x are shown.
  • + +
  • +ddddd - for GSM 1800: counter (decimal) for +synchronization measurement attempts. +If this value is over 99999, then five x are shown. +
  • + +
  • +eeeee - counter (decimal) for cell reselections GSM 900 - GSM 900
  • + +
  • +fffff - counter (decimal) for cell reselections GSM 1800 - GSM 1800
  • + +
  • +ggggg - counter (decimal) for cell reselections GSM 900 - GSM 1800
  • + +
  • +hhhhh - counter (decimal) for cell reselections GSM 1800 - GSM 900
  • +
+ +

Counters values are saved in EEPROM memory, when phone is disabled. +You can reset them using test 60. +They're reset too, when they exceed their maximal values. + +

In Nokia 6210/8210: + +

+ + + + + + +
+ + + + +
+NOPSW: 008A
+SYNCR: 766
+RESELEC:872D
+RmMonTO:0000 +
+
+ + + + +
+PSWMesgCntr
+SyncMeasCntr
+CellReselCtr
+RM Mon TOuts +
+
+ +

In Nokia 3310 help is like in models 6210/8210, but displayed values are different: + +

+ + + + +
+  17
+ 135        
+5112
+  +
+ +

In Nokia 6185/6188 it's different: + +

+ + + + +
+V
+aaaaaaaaaaaa
+bbbbbbbbbb
+ccccccc +
+ +

    +
  • aaaaaaaaaaaa - version of phone's firmware
  • +
  • bbbbbbbbbb - date of phone firmware
  • +
  • ccccccc - phone's codename (NSD-3AX)
  • +
+ +

+ + + + + + +
This phone displays this info too, when you enter *#837# code. For more +information about firmware in Nokia phones (including 6185/6188 models) click here.
+ +

Test 62 + +

+ + + + + + +
+ + + + +
 PSW  :aaaa 
+ SYNCR:bbbb
+ BCCH :cccc 
+ BCCHE:dddd
+
+ + + + +
NeghbrPSWCtr
+SyncMeasCntr
+BCCHMeasAtmp
+BCCHExtMeAtm
+
+ +

+

    +
  • +aaaa - counter for neighbour PSW measurement attempts
  • + +
  • +bbbb - counter for neighbour synchronization measurement attempts
  • + +
  • +cccc - counter for neighbour cells BCCH +(quality of trasmission with them) measurement attempts +(see description C1)
  • + +
  • +dddd - counter for extended neighbour cells BCCH +(quality of trasmission with them) measurement attempts +(see description C1)
  • +
+ +

Counters values are saved in EEPROM memory, when phone is disabled. +You can reset them using test 60. +They're reset too, when they exceed their maximal values. + +

In Nokia 3310 each counter is 5-digit number. Values are also aligned to right. + +

In Nokia 6185/6188 this test looks different: + +

+ + + + +
+DSP ROM 2   
+VERS 430
+BETA 0014
 
+
+ +

Test 63 + +

+ + + + + + +
+ + + + +
  aa    bb
+  ccc   ddd 
+  eee   fff
+
+ + + + +
CalRel RelDi
+MOCAtmp MOOK
+AllMT   MTOK
+
+ +

+

    +
  • +aa - you will find reason of last call release here (it's displayed in +test 2 +and test 39 too (in this +last test you will find more explanations - see description of first +parameter)) +
  • + +
  • +bb - another information about end of last call: + +

    +

      +
    • +UN: unknown (for example: you didn't make any calls after enabling phone) +
    • + +
    • +IN: internal reason (for example: you enabled in +test 17 BTS test, +phone didn't find network on given channel and you tried to make call) +
    • + +
    • +MT: broken by network
    • + +
    • +MO: disconnection (ending call) from one of the phones
    • +
    +

    +

  • + +
  • +ccc - how many times you tried to make outgoing call from your phone +
  • + +
  • +ddd - number of succesfull outgoing calls (how many times calls were really +realised)
  • + +
  • +eee - number of all incoming calls (missed too)
  • + +
  • +fff - number of received incoming calls
  • +
+ +

When counters exceed their maximal values, they're reset (you can make it +using test 60 too). Their values (it's +about ccc and next counters only) are written to EEPRM, when phone is disabled. + +

In Nokia 3310 parameters are a little different located on the screen (when compare to info above). + +

In Nokia 6185/6188 this test looks different: + +

+ + + + +
+ +C1M 00      
+C1L 00
+C2M 00
+C2L 03 +
+
+ +

Test 64 +
It contains, for example, information, how many times you phone +informed network about position (see description of +test 10 too) + +

+ + + + + + +
+ + + + +
 aa bbb ccc 
+ dd eee fff 

+
+ + + + +
Nfai NL NLOK
+PFai PL PLOK
+ Loc update
+  counters
+
+ +

+

    +
  • +aaa - error code (reset after enabling phone) of last incorrect +Location Update +(it changes only then, when some error happened during it). +It can be found in test 39 too +- it's value of MM parameter (there are code values with their description too) +
  • + +
  • +bbb - how many times phone tried to make +Location Update
  • + +
  • +ccc - how many times attempts of making +Location Update +were successfull
  • + +
  • +ddd - error during last PLU or IMSI Attach +(17 means probably network busy) +
  • + +
  • +eee - how many times phone tried to make PLU +or IMSI Attach
  • + +
  • +fff - how many times attemps of making PLU +or IMSI Attach were successfull
  • +
+ +

Values of these counters (excluding error codes) are stored in EEPROM, +when phone is disabled. You can reset them using +test 60 (it's made too, +when they exceed their maximal values). + +

In Nokia 3310 parameters are a little different located on the screen (when compare to info above). + +

+ + + + + + +
If you don't disable your phone and all time you are in +your network time range, in this menu you will find information (in +approximation), how long it's enabled (check in +test 10, how often +is reset T3212 counter (ccc parameter) and multiply that time by +eee parameter from this menu). You can use to make it counter from +test 82 too (it's more precise, but require +enabling some test) or service menu (in phones like Nokia 6130 or 3210). +
+ +

In Nokia 6185/6188 this test looks different: + +

+ + + + +
+ +C3M 00      
+C3L 00
+C4M 00
+C4L 03 +
+
+ +

Test 65 +
Test connected with SMS messages (without reports) + +

+ + + + + + +
+ + + + +
 aa bbb ccc 
+ dd eee fff
+ gggg
+
+ + + + +
SFai MO MOOK
+RFai MT MTOK
+Sched Msgs
+SMS counters
+
+ +

+

    +
  • +aaa - error code during sending last SMS message (reset after enabling phone): + +

    +

      +
    • +  1: 'Number not in use'
    • + +
    • + 21: 'Message not sent this time'. This error happens, when +you try to send messages from prepaid card without this possibility, +when you send message for incorrect number (SMSC is correct), SMSC is blocked +on your network or when you send SMS with alphanumeric number over SMSC, which +doesn't support it. +
    • + +
    • + 28: 'Number not in use'
    • + +
    • + 38: 'Message not sent this time'. Error with sending message during SMSC blocked on your network. +
    • + +
    • + 42: probably phone shows this error, when used SMSC +is overworked (too many sent messages in the same time) and can't send +your message in this moment +
    • + +
    • + 50: 'Check operator services'. Error displayed after sending +SMS from some prepaid cards without this possibility.
    • + +
    • + 96: 'Nieudane wys³anie wiadomo¶ci' ('Message sending failed'). +The reason is wrong number of SMSC (+1). +
    • + +
    • +111: 'Message sending failed'. +The reason is wrong target number or wrong number of SMSC +
    • + +
    • +166: 'Message sending failed'. +Displayed when SMSC number was wrong or SMSC is blocked for your network. +
    • + +
    • +169: 'Message sending failed'. +No money on prepaid account.
    • + +
    • +178: 'Message sending failed'. Error displayed after sending +SMS from some prepaid cards without this possibility.
    • + +
    • +252: 'Message sending failed'. Displayed, when phone's transmitter +was disabled in test 45 or +phone can't find network (when BTS test +in test 17 was enabled on channel +without network)
    • + +
    • +253: 'Message sending failed'. Displayed, when SMSC number was wrong.
    • +
    +

    +

  • + +
  • +bbb - number of SMS sending attempts. +You should remember, that report about waiting for delivering SMS (pending) +isn't sent from your phone and is not taken into consederation in this parameter +(but information about success/defeat in its' delivering is taken - see description +for eee and fff parameters). For example: you enabled in phone's menu function +connected with SMS raports. You send SMS message now - phone increases this parameter. +If it showed, that sending of message was successfull, increases value of ccc +parameter too and phone saves report waiting for delivering sent SMS. +If SMSC delivered it (or not) and sents about it report (Failed or Delivered), +value of eee parameter increases too. If receiving or report was successfull, +increases value of fff parameter too (phone checks all saved reports now. +In majority of Nokia phones: if in some report with "pending" text SMSC and number, +where SMS was sent, is the same to SMSC and number from received report, +phone deletes "pending" report and saves received report into this place). +
  • + +
  • +ccc - number of succesfull sent SMS messages (which were accepted by used +SMSC and you will pay for them). For more info see description of previous +parameter. +
  • + +
  • +ddd - code of error during receiving last SMS message (reset, when phone is +enabled): + +

    +

      +
    • +22: full memory for SMS messages (phone tried to receive message +- increased value of eee counter, fff value didn't change). Information about +it is on the top of phone's screen too (blinking envelope) and phone showed +'No space for new messages' message. When you save messages on SIM card, +their sum in 'Outbox' and 'Inbox' depends on it (card). The most often, different +networks gives SIM card with different space for SMS messages (for example, +for Polish Plus GSM it's 10, for +Era GSM +15 and for Idea 30). When you don't have +space for messages, you can't add new (message 'Message memory full'). +You have to delete one of saved messages there - when you won't make it, +you can loose some incoming (remember, that sender of SMS message can set time, +when network will try to delivery it; after it it will be deleted and you won't +be able to receive it !). +
    • +
    +

    +

  • + +
  • +eee - number of SMS messages receiving attempts. For more info see description of next +parameter.
  • + +
  • +fff - number of correctly received SMS messages. Of course, all raports +about success/defeat in SMS delivering, logos, ringtones, business cards and +picture messages are sent in this form too (like adequate coded SMS) and are +taken into consideration in this parameter (but each picture message sent, for example, +from Nokia 3210 is written in 3 SMS messages !) +
  • + +
  • +gggg - number of received cell broadcast messages (if they're supported by actual +used BTS, you can check in test 7): +how many times your phone received cell-info (in Nokia 5110 it can be enabled in Menu 4-2-2) +and cell-broadcast (Menu 2-5 in Nokia 5110) messages
  • +
+ +

Values of these counters (excluding error codes) are written to EEPROM, +when phone is disabled. You can reset them using test 60 +(it's made too, when they exceed their maximal values). + +

I received info, that in some (all ?) Nokia 6150 phones +with 4.13 firmware doesn't change value of gggg counter instead that they receive +cellinfo messages (is it bug in this firmware version ?) + +

In Nokia 3310 parameters are a little different located on the screen (when compare to info above). + +

In Nokia 9210 parameters are 4 digits long... + +

If you want to know a little more about sending SMS messages +(or find SMSC of different operators), visit +www.vdheyden.demon.nl/sms/index1.htm +site. + +

+ + + + + + +
Majority of computer programs don't write to their users, if SMS message +sending was successfull - this test will be only way to check it. +
+ +

In Nokia 3110 this test looks like test 64. + +

In Nokia 6185/6188 this test looks different: + +

+ + + + +
+ +C5M 00      
+C5L 00
+C6M 00
+C6L 03 +
+
+ +

Test 66 +
Timeout counters connected with SMS messages (as you know, when you send them, +you can set, how long network will try to delivery them - I suppose, that these +counters are connected with it). + +

+ + + + + + +
+ + + + +
 aaa bbb cc 
+ ddd eee ff

+
+ + + + +
TR1 TR2 TRA 
+TC1 TC2 SCH 
+SMS timeout
+  counters
+
+ +

+

    +
  • aaa - timeout counter for TR1M
  • +
  • bbb - timeout counter for TR2M
  • +
  • cc - timeout counter for TRAM
  • +
  • ddd - timeout counter for TC1M
  • +
  • eee - timeout counter for TC2M
  • +
  • ff - timeout counter for cell broadcast
  • +
+ +

Values of these counters are written to EEPROM, when phone is disabled. +You can reset them using test 60 +(it's made too, when they exceed their maximal values). + +

In Nokia 6185/6188 this test looks different: + +

+ + + + +
+ +CT1 82      
+CT2 00
+RF 23
  +
+
+ +

Test 67 + +

+ + + + +
+ +REC 00
+SEND 00     
+CTR 4C
+STA 68 +
+
+ +

Test 68 + +

+ + + + +
+ +CNT 00      
+ACK 00

+M1M B3 +
+
+ +

Test 70 +
Temporary counters of DSP (contents of API memory locations +r_dsp2ftd+0, r_dsp2ftd+1, r_dsp2ftd+2, etc. in hex format) + +

+ + + + + + +
+ + + + +
aaaaa  bbbbb
+ccccc  ddddd
+eeeee  fffff
+ggggg  hhhhh
+
+ + + + +
 Temporary
+DSP counters
+ R DSP2FTD
+
+ +

The display is to be used by special debugging DSP +software which can put some useful information to the memory locations on +API RAM. When this display is selected then MCU +copies the contents of those memory locations into display with format specified above. + +

In Nokia 3110 this test looks like test 80. + +

Test 71, 72 +
Both tests allow to set DSP settings. + +

When you will directly enter to one of them, in both of them number below AUDIO +ENHANCEMENT change - values depends on SIM card. You can now enter to one of them +using arrows - sound emited by phone will change then (you can hear +horrible noises and cracks). You can set values below AUDIO ENHANCEMENT too +- save them (in decimal - maximal value is 65536) in 31 or 32 position +in phonebook on SIM card (how to do it ? see description in +test 17). +Conf parameter from test 30 +shows, what value was choosen here. You can back to normal sound, when +you will disable and enable phone. Connecting headset or cat kit don't change +sound effects with concrete values set here. + +

+ + + + + + +
+ + + + +
    AUDIO
+ ENHANCEMENT
+    aaaaa
+
+ + + + +
Use menu to
+control DSP
+   audio
+enhancements
+
+ +

In Nokia 9210 these tests look like follows: + +

+ + + + + + +
+ + + + +
AUDIO
+ENHANCEMENT 
+DISPLAY 1
+    aaaaa
+
+ + + + +
Display 1
+DSP audio
+enhancements
 
+
+ +

In Nokia 3110 test 71 looks like test 81. + +

Test 73 +
Generic display for DSP Audio Enhancements + +

+ + + + + + +
+ + + + +
 aaa bb  aaa
+cccc bb cccc
+cccc bb cccc
+ cccc cccc
+
+ + + + +
DB1  B1  DB2
+HEX1 B2 HEX2
+HEX3 B3 HEX4
+  HEX5 HEX6
+
+ +

+

    +
  • +aaa - general dB value, e.g. signal level in dB. decimal point and sign is not shown, ie. -10.5 is show 105.
  • + +
  • bb - general byte value, used for combined flags. Value is in hex format.
  • + +
  • cccc - general hex value.
  • +
+ +

Some English sources write about this test: +
"The display is reset and restarted when call is taken (if NetMonitor display +counters are enabled). When call is terminated the display is frozen to +show last values. Display values will not be saved to the EEPROM." + +

...but I haven't seen it my phone and they were equal 0 all the time (is something additionaly required to enable this test ?) + +

In Nokia 3110 this test looks like test 82. + +

Test 74 +
DSP audio enhancements 1 (DRC) + +

+ + + + + + +
+ + + + +
  aaa  bbb  
+       ccc
+  dd    ee
+
+ + + + +
DSigL USigL
+      NseLvl
+ DTbl  UTbl
+
+ +

+

    +
  • aaa - downlink (received by your phone) signal level.
  • +
  • bbb - uplink (sent by your phone) signal level
  • +
  • ccc - background noise (see description of DTX) signal level.
  • +
  • dd - downlink (received by your phone) DRC table value, shown in decimal integer, two digits.
  • +
  • ee - uplink (sent by your phone) DRC table value, decimal integer, two digits.
  • +
+ +

Three first parameters are in dB calculated using DRC level +measuring block. Decimal point and sign is not shown, +ie. -10.5 is show 105. + +

Some English sources write about this test: +
"The display is reset and restarted when call is taken (if NetMonitor display +counters are enabled). When call is terminated the display is frozen to +show last values. Display values will not be saved to the EEPROM." + +

...but I haven't seen it my phone and they were equal 0 all the time (is something additionaly required to enable this test ?) + +

In Nokia 3110 this test looks like test 72. + +

Test 75 +
Audio path status + +

+ + + + + + +
+ + + + +
Mod:aaaaaaa
+AudReq: bbbb
+AccMod: cccc
+H2Path: dddd
+
+ + + + +
ExtAudStatus
+AudioRequest
+AccAudMode
+
+ +

+

    +
  • +aaaaa - external audio status (for some phones possible values are: HP, HF, HEADSET, EXT and HP_OFFHO) + +

    With Nokia 5110 these values vere observed: + +

    + + + + + + + + + + + +
    value
    normal state (nothing connected, cable MBUS/FBUS or changer connected)HP
    headset (phone displays Headset) +
    You can simulate it +
    connecting pins 1-2 on the connector on the bottom of the phone +
    (when you see from the left side, when phone's screen is on the top) +
    In Nokia 9110 you can use to make it +test 92 too.
    HD (shortcut from HeaDset)
    car kit (phone displays Car) +
    You can simulate it +
    connecting pins 2-3 on the connector on the bottom of the phone +
    (when you see from the left side, when phone's screen is on the top) +
    HFU 1 (shortcut from Hands Free Unit 1)
    + +

    Described above methods of simulating presence sound accesories are correct +for Nokia 5xxx, 6xxx and probably 9110 (but REMEMBER: you use them on YOUR OWN risk) + +

    When you connect (simulate) both accesories you have in phone function +"Automatic answer" (Menu 4-1-6 in Nokia 5110) - it allows phone +to answer automatically (without pressing key) incoming calls. In Nokia 9110 +you can activate it using test 92 too. +

    +

  • + +
  • +bbbb - audio_request bitmap in hex
  • + +
  • +cccc - accessory audio mode
  • + +
  • +dd - path for HFU-2 (Hands Free Unit-2)
  • +
+ +

In Nokia 9210 help looks like follows: + +

+ + + + +
ExtAudStatus
+AudioRequest
+AccAudMode
+HFU2Path
+ +

In Nokia 3110 this test looks like test 73. + +

Test 76 +
Ear (= downlink) audio display + +

+ + + + + + +
+ + + + +
 Vab  Pccc
+ Cddd CAeee
+PAfff
+
+ + + + +
EVol PeakVal
+CutOff COAve
+PkAver
+
+ +

+

    +
  • +ab - volume level (below information are correct for Nokia 5110): + + + + + + + + + + + + + + + + + + + + +
    ab
    speaker disabled0F
    sound like after pressing key (volume level 1)08
    sound like after pressing key (volume level 2)04
    sound like after pressing key (volume level 3 or enable loud sounds) +00
    + +

    During connection a parameter has "A" value, parameter b allows to +calculate set volume level (count it to the decimal value and substract 11 from it) +- this last parameter can be checked in +test 30 too. When you connect headset, +parameter a has "C" value (formula for counting volume level during call is +"10 - b" then). With car kit, a parameter is equal "2" and formula is "10 - b" too. + +

    When somebody calls to you (you didn't receive it yet), phone doesn't +show volume of sound always (displayed valued are for disabled speaker) - +I don't know, if it's firmware bug (5.07) or something different. +Phone shows it (volume) only with some combinations of types of rings (Ringing, Asceding) +and volume ring (I write values for both of these parameters: level 1 - A7, +level 2 - A6, level 4 - A4, level 5 - A0). +

  • + +
  • +

    ccc - peak value of downlink audio signal during last frame in dB, +decimal point and sign is not shown, ie. -10.5 is show 105. +

  • + +
  • +

    ddd - cut off counter value of last frame. This counter counts +how many samples are saturated during last frame. +

  • + +
  • +

    eee - moving average of cut off counter, decimal point and sign is +not shown, ie. -10.5 is show 105. +

  • + +
  • +

    fff - moving average of peak levels

  • +
+ +

Some English sources write about this test: +
"The display is reset and restarted when call is taken (if NetMonitor display +counters are enabled). When call is terminated the display is frozen to +show last values. Display values will not be saved to the EEPROM." + +

...but I haven't seen it my phone and they were equal 0 (without first) all the time +(is something additionaly required to enable this test ?) + +

Test 77 +
Microphone (= uplink) audio display + +

+ + + + + + +
+ + + + +
 Paaa  Abbb 
+ Cccc CAddd

+
+ + + + +
MicPeak MAve
+CutOff COAve

+
+ +

+

    +
  • +aaa - peak value of uplink audio signal during last frame in dB, +decimal point and sign is not shown, ie. -10.5 is show 105. +
  • + +
  • +bbb - moving average of peak levels, decimal point and sign is not +shown, ie. -10.5 is show 105..
  • + +
  • +ccc - cut off counter value of last frame. This counter counts +how many samples are saturated during last frame. +
  • + +
  • +ddd - moving average of cut off counter
  • +
+ +

Some English sources write about this test: +
"The display is reset and restarted when call is taken (if NetMonitor display +counters are enabled). When call is terminated the display is frozen to +show last values. Display values will not be saved to the EEPROM." + +

...but I haven't seen it my phone and they were equal 0 all the time +(is something additionaly required to enable this test ?) + +

In Nokia 3110 this test looks like test 75. + +

Test 78 +
DSP audio enhancements (AEC) + +

+ + + + + + +
+ + + + +
aaa bbb ccc 
+ddd eee fff
+ggg h i jjj
+ kkkk llll
+
+ + + + +
EAA Ada ERL 
+RxG TxG GLi
+TxN Sta Mod
+ RVAD TVAD
+
+ +

+

    +
  • +aaa - electro-acoustic attenuation of echo from DSP point of view +in dB. Decimal point and sign is not shown. E.g. -10.5dB +would be displayed as "105", -0.5 dB would be displayed +as " 5". 20*log10( Q15 )
  • + +
  • +bbb - adaptive attenuation of echo. Decimal point is not shown. 20*log10( Q15 ) +
  • + +
  • +ccc - total echo return loss. Decimal point is not shown. 20*log10( Q15 ) +
  • + +
  • +ddd - RX (received) attenuator gain in dB. Decimal point and sign is not shown. 20*log10( Q15 aec_rx_gain ) +
  • + +
  • +eee - TX (sent) attenuator gain in dB. Decimal point and sign is not shown. 20*log10( Q15 aec_tx_gain ) +
  • + +
  • +fff - gain limit for RX and TX. Decimal point and sign is not shown. 20*log10( Q15 aec_gain_limit ) +
  • + +
  • +ggg - TX (sent) noise level (see DTX description for more info) +in dB. Decimal point and sign is not shown. 20*log10( Q15 aec_tx_noise) +
  • + +
  • +h - adaptive filter status. (Q0 aec_nlms_state) (bit UPDATE << 2) | (bit NLMS2 << 1) | (bit NLMS1) +
  • + +
  • +i - comfort noise (see DTX description for details) +generation (0 or 1) (Q0 AEC_TX_COMF_GEN) +
  • + +
  • +jjj - AEC mode. (byte Q0 s_AEC_mode)
  • + +
  • +kkkk - shows 16 last RX VAD decisions in HEX format. Hex( Q0 aec_rx_vadreg ) +
  • + +
  • +llll - shows 16 last TX VAD decisions in HEX format. Hex( Q0 aec_tx_vadreg ) +
  • +
+ +

In my phone all these counters were equal 0 all the time +(is something additionaly required to enable this test ?) + +

In Nokia 3110 this test looks like test 76. + +

Test 79 +
Audio equalizer display + +

+ + + + + + +
+ + + + +
aaaaa bbbbb
+ccccc ddddd
+-ee.e -ff.f 
+
+ + + + +
MiCutB MiCTA
+EpCutB EPCTA
+MiCLev EarLv
+
+ +

+

    +
  • aaaaa - saturated samples before microphone equalizer in decimal 16 bit
  • +
  • bbbbb - saturated samples after microphone equalizer in decimal 16 bit unsigned integer format.
  • +
  • ccccc - saturated samples before earpiece equalizer in decimal 16 bit unsigned integer format.
  • +
  • ddddd - saturated samples after earpiece equalizer in decimal 16 bit unsigned integer format.
  • + +
  • -ee.e - level of the microphone signal level detector in dB format. Requires log10 function in MCU. +16 bit signed value in DSP, 0 dB = 32768. +
  • + +
  • +-ff.f - Level of the signal after earpiece equalizer in dB format. Requires log10 function in MCU. +16 bit signed value in DSP, 0 dB = 32768. +
  • +
+ +

Some English sources write about this test: +
"The display is reset and restarted when call is taken. When call is +terminated the display is frozen to show last values. Display will not be +saved to EEPROM. Saturated sample counters aaaaa - ddddd are counted in DSP +and only the new counter value is sent to MCU. The microphone and earpiece +signal levels are calculated in DSP and it sends the linear values to +MCU which makes the linear to dB transformation (20*log10(x)) for the level +values." + +

...but I haven't seen it my phone and they were equal 0 all the time (is something additionaly required to enable this test ?) + +

In Nokia 3110 this test looks like test 77. + +

Test 80 + +

+ + + + + + +
+ + + + +
+
   TIMERS   
+   RESET 
+
+ + + + +
  Use menu
+  to reset
+ field test 
+   timers
+
+ +

By direct enter to this test you can reset counters from +test 82. Phone makes it too, when you connect +charger. Some English descriptions write, that it's made too, when battery is full +(I didn't notice it). + +

In some new phones (like Nokia 3310 4.45) after using this test counters +from test 82 +are reset AND enabled (so, this test works as +test 81 too). + +

In Nokia 3110 this test looks like test 83. + +

In Nokia 6185: + +

+ + + + +
+ +RLP RESET 00
+RX 00 00 00
+TX 00 00 00
+FER  000 +
+ +

Test 81 + +

+

+ + + + + +
+ + + + +
+
   TIMERS   
+  aaaaaaaa
+
+ + + + +
Use menu to
+control test
+  display
+  timers
+
+ +

By direct enter to this test you enable (aaaaaaaa=ENABLED) or +disables (aaaaaaaa=DISABLED) counters from test 82. + +

In Nokia 3110 this test looks like test 84. + +

In Nokia 6185: + + + + + +
+ + +NXT 0       
+NEW 0
+UNA 0
+TMR 0 +
+
+ +

Test 82 + +

+ + + + + + +
+ + + + +
aaaaa bbbbb 
+ccccc ddddd
+ TIMERS eee
+
+ + + + +
PwrOn InServ
+NSPS  TxON
+   Timers
+   Status
+
+ +

+

    +
  • +aaaaa - how long phone was enabled +
  • + +
  • +bbbbb - how long phone was logged into network +
  • + +
  • +ccccc - how long phone was in +NSPS state
  • + +
  • +ddddd - how long phone's transmitter was enabled +
  • + +
  • +eee - information, whether counters are enabled (ON) or not (OFF) (you can set +it using test 81)
  • +
+ +

Each of these counters display time in aaabb format - bb changes in +range 0-60 units; when reaches 60 units, it's reset to 0 and +aaa increases by 1. In majority of models unit is 1 minute (each of counters +display time as minutes and hours). In Nokia 7110 unit is half of minute, +in some Nokia 3310 one minute and 7 seconds... + +

Some English descriptions write, that maximal value for counters is 99 h and 59 minutes. +When first of them (aaaaa) will have this value, all of them will stop. + +

Unfortunatelly, these counters work only, when you have some test in netmonitor +enabled (it means: when you will disable tests, values won't change even, when +counters are enabled). It means, that you can have information here, +how long you use netmonitor (first parameter), how long phone logged into network +during this time (next)... + +

+ + + + + + +
You you still want to measure time using this test, in +test 83 select SHOW TASK MSG BUFS and enable +test 87 (display will be empty then). +Of course, there disadvantiges of it: you won't have identification incoming calls. + +

In service menu in Nokia 6130 (*#WARRANTY# code) and 3210 +(*#WAR0ANTY# code) in "Life Timer" position you will find information, +how long you make calls - digits before ":" mean hours, digits after it minutes). +For example, 0001:35 means 1 h 35 minutes of calls. +In Nokia 3310 (*#WAR0ANTY# code too) on start there is shown value 65536 there, +and counter starts working, when calls were longer than 1 h. +

+ +

In Nokia 3110 this test looks like test 85. + +

In Nokia 6185: + + + + + +
+ + +QU 00  DL000
+NACK 00000
+RC00 BR00000
+W0000 C0000 +
+
+ +

Test 83 + +

+

+ + + + + + + + + +
+ + + + +
+
 SHOW TASK 
+ STACKS
+
+ + + + +
+
 SHOW TASK 
+ MSG BUFS
+
+ + + + +
+
 SHOW TASK 
+ FAST BUFS
+
+ + + + +
Use menu to
+select shown
+ task info
+
+ +

By direct enter to this test you can make, that in +test 84, test 85, test 86 and test 87 +are displayed values of different counters: + +

+

    +
  • +"STACKS" - shows free stack space in worst case
  • + +
  • +"MSG BUFS" - shows the peak number of pending messages
  • + +
  • +"FAST BUFS" - shows the peak number of pending fast messages
  • +
+ +

In Nokia 3110 this test looks like test 86. + +

In Nokia 6185: + + + + + +
+ + +S00000 DL000
+N00000 00000
+R00000 D0000
+00000 +
+
+ +

Test 84, 85, 86 +
Here is generally view of these tests: + +

+ + + + +
 aaaa bbbb  
+ cccc dddd
+ eeee ffff
+ gggg hhhh
+ +

and here is their help: + +

+ + + + + + + + +
+ + + + +
IDLE  DEV_IO
+LOCAL MDISND
+MDIRCV  UI
+ TONE   PN
+ +

or (Nokia 6210/8210): +

+ + + + +
IDLE  DEV_IO
+LOCAL MDISND
+MDIRCV  UI
+ TONE   PND
+ +

or (Nokia 6250): +

+ + + + +
IDLE  DEV?IO
+LOCAL MDISND
+MDIRCV  UI
+ TONE   PND
+ +

or (Nokia 9210): +

+ + + + +
IDLE  STRTUP
+DEV_IO LOCAL
+MDISND  -RCV
+UI      TONE
+ +

+ + + + +
 FBUS   AUD
+L1CTRL L1MEA
+L1SYSP  L2
+ CC     MM
+ +

or (Nokia 3210): +

+ + + + +
IRDA  FBUS
+AUD  L1CTRL
+L1MEA L1SYSP
+L2    CC
+ +

or (Nokia 6210/6250): +

+ + + + +
+WMLS    PN
+IRDA IRDAMGR
+FBUS    AUD
+PHCTRL  L2 +
+ +

or (Nokia 8210): +

+ + + + +
+IRDA IRDAMGR
+FBUS     AUD
+PHCTRL    L2
+CC        MM
+
+ +

or (Nokia 8810): +

+ + + + +
IRDA  IRMGR
+FBUS  AUD
+L1CTRL L1MEA
+L1SYSP  L2
+ +

or (Nokia 9210): +

+ + + + +
+PN     MBUS
+FBUS    AUD
+AUDCOMM  PH
+L2       CC +
+ +

+ + + + +
 RR     RM
+ SMS    EM
+SIMUPL SIML2
+ DDI
+ +

or (Nokia 3210): +

+ + + + +
MM    RR
+RM    SMS
+EM    SIMUPL
+SIML2 DDI
+ +

or (Nokia 6210/6250): +

+ + + + +
+ CC   MM  RR
+RMC  SMS  EM
+SIM SIM2 DDI
+DGC  NTB FAX +
+ +

or (Nokia 8210): +

+ + + + +
+RR        RM
+SMS       EM
+SIMUPL SIML2
+DDI      DGC
+
+ +

or (Nokia 8810): +

+ + + + +
CC     MM
+RR     RM
+SMS    EM
+SIMUPL SIML2
+ +

or (Nokia 9110): +

+ + + + +
 RR     RM
+SMS     EM
+SIMUPL SIML2
+ DGC  DGNTB
+ +

or (Nokia 9210): +

+ + + + +
+MM        RR
+RM       SMS
+EM    SIMUPL
+SIML2    DGC +
+ +

+ +

+

    +
  • +aaaa, bbbb,... - task 0, 1, ...
  • +
+ +

Numbers tell how many stack memory locations have been empty in the worst +case. So, if number is zero, stack has been full. Values are not written into +EEPROM, when phone is disabled. + +

In Nokia 3110 test 86 looks like follow: + +

+ + + + + + +
+ + + + +
MCUSW  aaaaa
+DATE   cccccc
+CHKSUM dddd
+DSP    eee
+
+ + + + +
MCUSWVersion
+DateOfMCUSW
+MCUSWChecksum
+DSPSWVersion
+
+ +

Meaning of parameters aaaaa,cccccc, dddd and eee you will find in test +88. + +

Test 87 + +

+ + + + + + +
+ + + + +
 aaaa  bbbb 

+
+ + + + +
  FIQ  IRQ  

+
+ +

+

    +
  • +aaaa - OS_SYSTEM_STACK
  • +
+ +

In Nokia 8810 it looks different: + +

+ + + + + + +
+ + + + +
+ ffff  gggg
+ eeee  dddd 
+ aaaa  bbbb 
+
+ + + + +
+ DDI   DGC
+ DGNTB DGFAX
+ FIQ   IRQ
+
+ +

In Nokia 9110 this test is different: + +

+ + + + + + +
+ + + + +
 cccc  dddd 
+ aaaa  bbbb 

+
+ + + + +
 DGTB  DGFAX
+ FIQ   IRQ

+
+ +

In Nokia 9210: + +

+ + + + +
+DGNTB  DGFAX
+DCS   PMMCLE
+PMMWR HELPER
+  +
+ +

In Nokia 7110 looks like follows: + +

+ + + + + + +
+ + + + +
+1040010363800
+  700  800
+  220
+    476   480 +
+
+ + + + +
+DGN  DGF  SCKT
+PCL  PWB
+PPC
+FIQ    IRQ +
+
+ +

and in Nokia 6210/6250: + +

+ + + + +
+ + + + +
+SRVSCK PMMCL
+PMMWR   ND
+PPC
+FIQ    IRQ +
+
+ +

and in Nokia 8210: + +

+ + + + +
+ + + + +
+NTB      FAX
+PMMWR     ND
+FIQ      IRQ
  +
+
+ +

Values of counters are not saved to EEPROM, when phone is disabled. + +

Test 88 + +

+ + + + + + +
+ + + + +
aaaaa bbbbbb
+Date  cccccc
+ChkSum dddd
+eeeeeeeeeeee
+
+ + + + +
MCUSW  PPM
+MCUSW_Date
+MCU_Checksum
+DSP_Version
+
+ +

+

    +
  • +aaaaa i cccccc - version and release date of MCU software +(codes for their checking and changes among their different versions are here)
  • + +
  • +bbbbbb - version of downloaded PPM (Post-programming Memory) packet: +Nokia Mobile Phones prepares different language versions +of firmware for phones. They're saved in "packets" - each of them contains messages and support +for few languages. Why is it done ? It's simple: internal memory in our phones is still +too small for all languages support. You will see version of PPM packet: +it's the same number as version of MCU firmware. After it +you have char (it can be "A", "B", etc. - for example, Polish language is in "B" packet). + +

    For curious: in older models (like Nokia 2110i) nobody prepared PPM packets and +preparing another language version was connected with modyfing ALL firmware. I readed too, +that phones with "generic" firmware had normally disabled services for some languages +(for example, Greek) - it could be enabled with some Nokia service programs (like Pc-Locals 0.6). +

    +

  • + +
  • +dddd - MCU memory checksum +(when it's wrong, phone display CONTACT SERVICE)
  • + +
  • +eeeeeeeeeeee - DSP software version
  • +
+ +

Information from this test are displayed in some Nokia service programs +(like PC-Locals 1.3 or WinTesla) too. + +

In Nokia 6210 there are displayed "?" chars instead of "_" in help for this test... + +

In Nokia 9210: + +

+ + + + + + + + + +
+ + + + +
+Linda SW
+aaaaa bbbbbb
+ChkSum: cccc
+HW: dddd +
+
+ + + + + +
+Linda SW
+03.62 011009
+ChkSum: 5324
+HW: 4000 +
+
+ + + + +
+Linda SW
+Version Date
+Checksum
+HW Version +
+
+ +

+

    +
  • aaaaa - firmware in PDA
  • +
  • bbbbbb - date of PDA firmware
  • +
  • cccc - checksum
  • +
  • dddd - hardware version
  • +
+ +

Test 89 + +

+ + + + + + +
+ + + + +
HW: aaaa 
+TXT: Ubbbbbb

+
+ + + + +
HW version
+Text version

+
+ +

+

    +
  • +aaaa - phone hardware version (for example, the nevest Nokia 5110 I saw, display +here 4220)
  • + +
  • +bbbbbb - information, when were prepared texts (probably operator names) +displayed by phone +
  • +
+ +

In Nokia 9210: + +

+ + + + + + + + + +
+ + + + +
+CMT SW
+aaaaa bbbbbb
+PPM:  cccccc
+ dddddddd +
+
+ + + + + +
+CMT SW
+03.21 011009
+PPM:  03.62A
+ 40.1.501 +
+
+ + + + +
+CMT SW
+Version Date
+PPM Version
+DSP Version +
+
+ +

+

    +
  • aaaaa - version of firmware in phone module
  • +
  • bbbbbb - date of firmware in phone module
  • +
  • cccccc - PPM with firmware in phone module
  • +
  • dddddddd - DSP firmware version
  • +
+ + +

Back to the top
+ +

+

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] +

+
+
+ +

Marcin Wiacek (WWW) +
Last modification: 10 March 2002
+ + + diff --git a/Docs/en_US/gsm/netmon/faq_net6.htm b/Docs/en_US/gsm/netmon/faq_net6.htm new file mode 100644 index 0000000..e4717f2 --- /dev/null +++ b/Docs/en_US/gsm/netmon/faq_net6.htm @@ -0,0 +1,3225 @@ + + + + + + + + + + NetMonitor in Nokia phones (7/7) + + + + + +

Main page

+ +
NetMonitor in Nokia phones (7/7) + +

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] + +

+ +
+ + + +
    +
  1. What is it ?
  2. +
  3. Do I need it ?
  4. +
  5. Does my phone use more power with NetMonitor enabled ?
  6. +
  7. How to activate it ?
  8. +
  9. Which NetMonitor version can be activated in my phone ?
  10. +
  11. Does NetMonitor activation void warranty ?
  12. +
  13. NetMonitor menu in my phone has different number than 10. Is it normal ?
  14. +
  15. NetMonitor menu in my phone has 11 number, hovewer previous position has 9 number. Is it normal ?
  16. +
  17. How to use it ?
  18. +
  19. Can I damage my phone ?
  20. +
  21. Glossary
  22. +
  23. Description of the individual tests
  24. +
  25. You can also use a program...
  26. +
  27. Can I use NetMonitor without SIM card inserted, without PIN number entered or when SIM card is not active ?
  28. +
  29. How can I disable NetMonitor ?
  30. +
  31. Do I need to disable NetMonitor before sending my phone to the service ?
  32. +
  33. Is it possible to re-activate NetMonitor after disabling it ?
  34. +
  35. Is NetMonitor available in analog Nokia phones ?
  36. +
  37. Does NetMonitor allow to use phone like broadcast station ?
  38. +
  39. I don't have all described tests in my phone. Why ? Can I increase their number ?
  40. +
  41. Does NetMonitor allow to identify place, where is my interlocutor ?
  42. +
  43. Does NetMonitor allow to identify place, where am I ?
  44. +
  45. What are NetMonitor codes ?
  46. +
  47. Is it the truth, that in phones with additional hardware changing frequency band NetMonitor doesn't work correct ?
  48. +
  49. Where can I find description of FBUS/MBUS protocol and commands connected with NetMonitor ?
  50. +
  51. I have non existing networks on the list of forbidden networks...
  52. +
  53. How to check frequency band (900 or 1800 Mhz), where phone work in this moment ?
  54. +
  55. Can I use DLR-2/DLR-3 cables for activating netmonitor ?
  56. +
  57. Can I activate netmonitor using Init File Editor (Nokia 9110) ?
  58. +
  59. Can I force phone to use one frequency band (900 or 1800 Mhz) only ?
  60. +
  61. How to change settings in tests ?
  62. +
  63. My phone has very short snandby time - it is possible to see the reason of it ?
  64. +
  65. Is netmonitor available in English version only ?
  66. +
  67. Information sources
  68. +
  69. Additional information
  70. +
  71. Does using/activating netmonitor cost anything ?
  72. +
  73. Does using netmonitor is legall ?
  74. +
  75. Which entries on SIM card are used in netmonitor tests ?
  76. +
  77. Can I activate netmonitor in 3310 using soft working with 3210 ?
  78. +
  79. After activating netmonitor/BTS TEST my phone can't find network...
  80. +
  81. Netmonitor shows different battery capacity than info on it...
  82. +
  83. NetMonitor in Nokia 6310, 8310,...
  84. +
+
+
+ +

Test 90 + +

In Nokia 9110 this test looks like follows: + +

+ + + + + + +
+ + + + +
 Cover  aaaa
+ CarKit bbbb
+ Heads  cccc
+
+ + + + +
CoverCnt
+CarKitCnt
+HeadsetCnt  
+
+ +

+

    +
  • aaaa - how many times Communicator's cover was opened
  • +
  • bbbb - how many times carkit was connected
  • +
  • cccc - how many times headset was used
  • +
+ +

Because Nokia 9110 seems to be 100% hardware compatible with 6110, +method of simulating headset and car kit should be the same +(see test 75). +First of them you can simulate using +test 92 too (when you use it, value of the counter +from this test doesn't change !). I recommend to read +page http://my-communicator.com/, +where you will find more informations about it (for example, another ways +to simulate them)... + +

In Nokia 9210: + +

+ + + + + + +
+ + + + +
 Cover  aaaa
+ CarKit bbbb
+ Heads  cccc
+ Desks  dddd
+
+ + + + +
CoverCnt
+CarKitCnt
+HeadsetCnt  
+DeskStandCnt
+
+ +

+

    +
  • aaaa - how many times Communicator's cover was opened
  • +
  • bbbb - how many times carkit was connected
  • +
  • cccc - how many times headset was used
  • +
+ +

here's for Nokia 5190: + +

+ + + + + + +
+ + + + +
M:DCS:DO4100
+D:HPA:NTM:NC
+D:REA:OFS:RU
+0000000:000
+
+ + + + +
+MODESERVSIM 
+DCS AMPSMOD
+DPWRAPWRSMC
+PRILIST +
+
+ +

and in Nokia 7110/8210/6210/6250/3310 looks like follows: + +

+ + + + + + + + + +
+ + + + +
+PS0 aaaa
+EC0 bbbbbbbb
+PS1 cccc
+EC1 dddddddd
+
+ + + + +
+PS0 FFFE
+EC0 00000003
+PS1 FFF8
+EC1 00000002
+
+ + + + +
+Page0 Status
+EraseCounter
+Page1 Status
+EraseCounter +
+
+ +

+

    +
  • aaaa - the same to the parameter bbbb from test 92
  • +
  • bbbbbbbb - the same to the parameter dddddddd from test 92
  • +
  • cccc - the same to the parameter bbbb from test 93
  • +
  • dddddddd - the same to the parameter dddddddd from test 93
  • +
+ +

Probably it's about one of phone's memory. Parameters +"aaaa" and "cccc" show, whether banks of this memory are free +(fffe) or not (fff8). Parameters "bbbbbbbb" and "dddddddd" show, +how many times they were erased. + +

Test 91 + +

In Nokia 9110/9210: + +

+ + + + + + +
+ + + + +
   RESET 
+   MISC
+  COUNTERS  
+
+ + + + +
  Use menu  
+  to reset
+    misc
+  counters
+
+ +

By direct enter to this test you can reset counters from +test 90. + +

In Nokia 7110/8210/6210/6250/3310 this test is different: + +

+ + + + + + +
+ + + + +
+FL  005FC998
+E2    0    0
+PR   30    1
+OM    0 0000
+
+
+
+ +Help from Nokia 7110: +

+ + + +
+NextEntry
+Addr  Length
+Small   Long
+ErCnt ErMask
+
+ +

and 8210/6210/6250/3310: +

+ + + +
+ NextEntry
+Addr  Length
+Small Long  
+ErCnt ErMask
+
+

+
+ +

Test 92 + +

In Nokia 9110/9210 it looks different: + +

+ + + + + + +
+ + + + +

  Headset   
+    xxx
+
+ + + + +
 Use menu to
+   toggle
+   headset
+   ON/OFF
+
+ +

By direct enter to this test you can enable "headset" profile +normally accesible after connecting headset (of course, +you don't have to have it ;-)) - xxx can have ON or OFF values. +When you will use it, value of counter from test 90 +don't change. I recommend to read +page http://my-communicator.com/, +where you will find more informations about it (for example, another ways +to simulate them)... + +

+ + + + + + +
Use this test, when you need 'Automatic Answer' function, which allow +to receive incoming call without pressing phone's key. This function is normally +enable in never Nokia phones with connected set only (in older phones - like +Nokia 2110i - it's always visible) +
+ +

and in Nokia 7110/8210/6210/6250/3310 it looks like follows: + +

+ + + + + + + + + +
+ + + + +
+EP aaaa bbbb
+#0      cccc
+    dddddddd
+eeeeffffffff +
+
+ + + + +
+EP F0F0 FFFE
+#0      0000
+    00000003
+FFFFFFFFFFFF
+
+
+
+Help from Nokia 7110: +

+ + + +
+EMark PgStat
+PgType
+EraseCount
+PpInd PpECnt +
+

and 8210/6210/6250/3310: +

+ + + +
+EMark PgStat
+      PgType
+  EraseCount
+PpInd PpECnt +
+

+
+ +

+

    +
  • bbbb - the same to the parameter aaaa from test 90
  • +
  • dddddddd - the same to the parameter bbbbbbbb from test 90
  • +
+ +

It's info about first bank of one of phone's memories. When it's free (parameter +bbbb=FFFE), parameters "eeeeffffffff" are equal "FFFFFFFFFFFF". +Parameter "dddddddd" shows, how many times bank was erased. + +

Test 93 + +

+ + + + + + + + + +
+ + + + +
+EP aaaa bbbb
+#1      cccc
+    dddddddd
+eeeeffffffff +
+
+ + + + +
+EP F0F0 FFF8
+#1      0001
+    00000002
+000000000002
+
+
+
+Help from Nokia 7110: +

+ + + +
+EMark PgStat
+PgType
+EraseCount
+PpInd PpECnt +
+

and 8210/6210/6250/3310: +

+ + + +
+EMark PgStat
+      PgType
+  EraseCount
+PpInd PpECnt +
+

+
+ +

+

    +
  • bbbb - the same to the parameter cccc from test 90
  • +
  • dddddddd - the same to the parameter dddddddd from test 90
  • +
+ +

It's info about second bank of one of phone's memories. When it's free (parameter +bbbb=FFFE), parameters "eeeeffffffff" are equal "FFFFFFFFFFFF". +Parameter "dddddddd" shows, how many times bank was erased. + +

In Nokia 9210 it's different: + +

+ + + + + + +
+ + + + + +
+  Power on
+ CMT wakeup 
+  enabled
 
+ +
+ + + + +
Use menu to 
+  toogle
+   state
+  ON/OFF
+
+ +

You can set here (by direct enter), that phone module will be automatically +enabled after each removing battery or software reset (for example, using +Task Manager). + +

Test 94 + +

Test in Nokia 3210: + +

+ + + + + + +
+ + + + +
Vo:  aaa bbb
+Pins:      c
+Mode:   dddd
+State:  eeee
+
+ + + + +
V: Req ADC  
+Pin Status
+Mode
+Band Ch
+
+ +

+

    +
  • dddd - one of values is AUTO
  • +
  • eeee - example values are GS05, GS09, PS01
  • +
+ +

and 7110/6210/6250: + +

+ + + + + + +
+ + + + +
+ +IN E111 F000
+ST      0000
+        0000
+        0000 +
+
+
+ +

Help from Nokia 7110: +

+ + + +
+InExc  InRec
+      EmuErr
+      EnvErr
+      RecEr +
+ +

and Nokia 6210/6250: +

+ + + +
+InExc InRec
+      EmuErr
+      EnvErr
+      RecErr +
+

+
+ +

In Nokia 9210: + +

+ + + + + + +
+ + + + + +
+DEALLOC:   0
+EEPROM:    0

  +

+ +
+ + + + +
+Error
+counters    

  +

+
+ +

Test 95 + +

In Nokia 3210 + +

+ + + + + + +
+ + + + +
1:aaa 4:ddd 
+2:bbb 5:eee
+3:ccc 6:fff
+
+ + + + +
6 lowest
+values at   
+shut down
+
+ +

and newer versions of firmware in Nokia 6210 (confirmed for 5.17 and higher): + +

+ + + + + + +
+ + + + +
+GSM pwrcls: 
+4(2W)
+Modified:No
+
+
+ + + + +
+Curr Band-3 
+Pwr-Cls
+(Watt)
+Pwr-Cls Mod +
+
+ +

In Nokia 9210: + +

+ + + + + + +
+ + + + + +
+   0      0
+   0      0
+00000000  00
+00000000  00 +
+ +
+ + + + +
+OpCod AccVio
+Aligm PageFa
+CodeAdd Exec
+DataAdd CPSR +
+
+ +

Test 96 + +

In Nokia 3210: + +

+ + + + + + +
+ + + + +
VCX0ADC: aaa
+TEMP(C):  bb
+TEMP(K): ccc
+
+ + + + +
ADC VALUE
+RF TEMP(C)
+RF TEMP(K)  
+
+ +

+

    +
  • +ccc - temperature of bb counter (in Kelvin degrees: K = C + 273)
  • +
+ +

and 7110: + +

+ + + + + + +
+ + + + +
+Co: 49 A: 279
+Tu: 49 K: 305
+Of:  0  C:+32
+V5:  2 +
+
+ + + + +
+Contrast ADC
+Tuned Kelvin
+Offset     C
  +
+
+ +

In Nokia 9210: + +

+ + + + + + +
+ + + + + +
+            

 
  +

+ +
+ + + + +
+Crash Info  

 
  +

+
+ +

Test 98 + +

+ + + + + + +
+ + + + +
+WR  00000000
+      0 0000
+ER  00000000
+        0000 +
+
+ +
+

Help from Nokia 7110: +

+ + + +
+WrErrCnt    
+WrRtry WrSta
+ErErrCnt
+ErSta
+
+ +

and 6210/6250: +

+ + + +
+    WrErrCnt
+WrRtry WrSta
+    ErErrCnt
+       ErSta
+
+

+
+ +

Test 99 + +

For Nokia 8810: + +

+ + + + + + +
+ + + + +
+ENTERING   
+FBUS
+MODE
+
+
+ + + + +
+Switches    
+phone
+to FBUS
+mode +
+
+ +

It's probably for enabling FBUS protocol instead of normal used infrared +connection. I don't have additional info... + +

And here is for Nokia 7110: + +

+ + + + + + +
+ + + + +
+Ead:aaaa    
+Mod:bb
+MODE: cccc
  +
+
+ + + + +
+EAD value   
+Acc. status
+FBUS mode
  +
+
+ +

    +
  • bb - type of connected sound accesories (example values: +HP in normal state, HD with headset - for example, HDC-9P). +In other phones this information is displayed in +test 75
  • +
  • cccc - "FBUS" in connection made during FBUS or MBUS cable from older +Nokia phone (5xxx, 6xxx) or during Irda connection
  • +
+ +

Very similiar is in Nokia 6210/6250: + +

+ + + + + + + + +
+ + + + +
+Ead: 03FF   
+Mod: HP
+

  +

+
+ + + + +
+EAD value   
+Acc. status
+

  +

+
+ +

In Nokia 9210: + +

+ + + + + + +
+ + + + +
+ +    0    0  
+    0    0
+   24   24
+    0    0 +
+
+
+ + + + +
+CCove PDAdis
+BatLatch BSI
+Bmax    Bmin
+TxOnTime MMC +
+
+ +

Test 100 + +

Test from Nokia 9110: + +

+ + + + + + +
+ + + + +
a  b 
+c  ddd    e 

+
+ + + + +
UWS DWS
+T1   N1   T2

+
+ +

and 7110/6210/6250: + +

+ + + + + + +
+ + + + +
+004D63   5.0
+0018D1   1.6
+05B1DD  94.0
  +
+
+ + + + +
+MemUseT %Use
+MemRelT %Rel
+MemUnuT %Unu
  +
+
+ +

Information about using phone's memory. I'm not sure exactly, what memory +(when position to phonebook is added, information displayed here is probably about +phonebook memory). + +

And in Nokia 8210/3310 is different (they're +information about the voice dialling feature): + +

+ + + + + + + + + +
+ + + + +
+ND  a  b  c
+    d  e  f
 
+ggggg hhhhhh +
+
+ + + + +
+ND  2  1  0
+    0  0  0
 
+02.81 120399 +
+
+ + + + +
+ND mm cs ps 
+   ss po da
 
+Vers: Date: +
+
+ +

    +
  • a - number of recorded voice tags in phone. +Maximal value is 8 (for Nokia 8210/3310) or 10 (for Nokia 6210). +It's displayed in test 101 and test 102 +(Nokia 8210/3310) or test 108 and test 109 (Nokia 6210)
  • +
  • c - info about using voice dialling engine: +
      +
    • 0 - it wasn't used after enabling phone
    • +
    • 1 - voice tag was not recognized or Play/Save function were used
    • +
    • 5 - voice tag was recognized
    • +
    • 7 - user was in voice dialling function menu and selected Cancel function
    • +
    • 8 - voice dial in progress (in use)
    • +
    +
  • +
  • ggggg - version of voice dialling engine (?)
  • +
  • hhhhhh - date of releasing voice dialling engine (?)
  • +
+ +

Values of counters (without "a" parameter) are not saved to EEPROM, when phone is disabled. + +

WARNING: in some phones (like Nokia 3310), if you want to give phone +to service for upgrading firmware, remove earlier ALL voice tags from its' memory. +In other case memory for them can be decreased for so many voice tags, as were saved in memory +in the moment, when it was given to service (example: +in Nokia 3310 with two voice tags before upgrading firmware, after it it was possible +to save maximal 6 voice tags, counter "a" showed 2, but phone in Menu 1-10 displayed, +that memory for them is empty) + + +

Test 101 + +

Test from Nokia 9110/9210: + +

+ + + + + + +
+ + + + +
  aaaaaaaa
+  bbbbbbbb
+  cccccccc  
+  dddddddd
+
+ + + + +
TX Frame Cnt
+RX Frame Cnt
+TX Retx Cnt
+RX Tetx Cnt
+
+ +

All values are in hexadecimal values. + +

and 7110/6210/6250: + +

+ + + + + + +
+ + + + +
+#0  0  #1  0
+#2  0  #3  0
+#4  0  #5  0
  +
+
+ + + + +
+Pn LoCPn LoC
+Pn LoCPn LoC
+Pn LoCPn LoC
  +
+
+ +

In Nokia 8210/3310 it's different (information about the recording voice +tags in voice dialling feature): + +

+ + + + + + + + + +
+ + + + +
+Train
+   a   b   c
+dddd    eeee
+ffff    gggg +
+
+ + + + +
+Train
+   0   0   2
+   0       0
+0000    0000 +
+
+ + + + +
+Train
+   r  ii  mm
+strt    durn
+minm    maxm +
+
+ +

    +
  • a - number of voice tags failed to record +(it increases for example, when phone didn't recognize any voice to record)
  • +
  • b - number of recorded tags, when this test was enabled
  • +
  • c - number of recorded tags in phone. Maximal value is 8 (for Nokia 8210/3310) +or 10 (for Nokia 6210). It's displayed in test 100 and +test 102 (Nokia 8210/3310) or +test 107 and test 109 (Nokia 6210).
  • +
  • dddd - how loud was start of recorded voice during last recording +(the higher, the more loud) (?)
  • +
  • eeee - how loud was recorded voice during last recording +(the higher, the more loud) (?)
  • +
  • ffff,gggg - another parameters unique to each recorded voice (hex values ?)
  • +
+ +

Values of counters (without "c" parameter) are not saved to EEPROM, when +phone is disabled. + +

WARNING: in some phones (like Nokia 3310), if you want to give phone +to service for upgrading firmware, remove earlier ALL voice tags from its' memory. +In other case memory for them can be decreased for so many voice tags, as were saved in memory +in the moment, when it was given to service (example: +in Nokia 3310 with two voice tags before upgrading firmware, after it it was possible +to save maximal 6 voice tags, counter "c" showed 2, but phone in Menu 1-10 displayed, +that memory for them is empty) + + +

Test 102 + +

Test from Nokia 9110: + +

+ + + + + + +
+ + + + +
aaaaaaaaaa
+bbbbbbbbbbbb
+ccccccccccc
+
+ + + + +
Data call
+flow control
+info
+
+ +

From Nokia 9210: + +

+ + + + + + +
+ + + + +
+Data call   
+type:
+PSTN
  +
+
+ + + + +
+Data call   
+type

  +

+
+ +

In Nokia 8210/3310 it's different (information about the recognizing voice tags +in voice dialling feature): + +

+ + + + + + + + + +
+ + + + +
+Recog a    b
+ c dddd eeee
+ f gggg hhhh
+ i jjjj kkkk +
+
+ + + + +
+Recog 0    2
+ 0 0000 0000
+ 0 0000 0000
+ 0 0000 0000 +
+
+ + + + +
+Recog r   mm
+i1 scr1 minm
+i2 penH maxm
+i3 penL penC +
+
+ +

b - number of recorded tags in phone. Maximal value is 8 (for Nokia 8210/3310) +or 10 (for Nokia 6210). It's displayed in test 100 and +test 101 (Nokia 8210/3310) or +test 107 and test 108 (Nokia 6210) + +

2'nd line - info about last recognized by phone voice tag (c=number of voice tag) +
3'nd line - info about previous recognized by phone voice tag (f=number of voice tag) +
4'td line - info about previous recognized by phone voice tag (i=number of voice tag) + +

Values of counters (without "b" parameter) are not saved to EEPROM, when phone is disabled. + +

WARNING: in some phones (like Nokia 3310), if you want to give phone +to service for upgrading firmware, remove earlier ALL voice tags from its' memory. +In other case memory for them can be decreased for so many voice tags, as were saved in memory +in the moment, when it was given to service (example: +in Nokia 3310 with two voice tags before upgrading firmware, after it it was possible +to save maximal 6 voice tags, counter "b" showed 2, but phone in Menu 1-10 displayed, +that memory for them is empty) + + +

and from Nokia 6210/6250: + +

+ + + + + + +
+ + + + +
+Pn LoCPn LoC
+Pn LoCPn LoC
+Pn LoC
  +
+
+ +

Test 103 + +

In Nokia 7110: + +

+ + + + + + +
+ + + + +
+100    0  00
+PoolS 01EA6E
+RsrvS 031386
  +
+
+ + + + +
+%FW %BW FrCo
+PoolSizeLeft
+Reservations
  +
+
+ +

and 6210/6250: + +

+ + + + + + + +
+ + + + +
+92   8  00  


  +

+
+ + + + +
+%FW %BW FrCo


  +

+
+ +

From Nokia 9210: + +

+ + + + + + +
+ + + + +
+Incoming    
+call type:
+Speech
  +
+
+ + + + +
+Incoming
+call type   

  +

+
+ +

Test 104 + +

+ + + + + + +
+ + + + +
+LOG 00000000
+COD 00000000
+WrA 00000000
+RdA 00000000 +
+
+ + + + +
+ErrorLogAddr
+ErrorCode
+WrErrorAddrs
+RdErrorAddrs +
+
+ +

Test 105 + +

+ + + + + + +
+ + + + +
+WrC 00000000
+RdC 00000000
+Group     00
+Index   0000 +
+
+ + + + +
+DevWrErrorCo
+DevRdErrorCo
+CallingGroup
+CallingIndex +
+
+ +

Test 106 + +

In Nokia 7110: + +

+ + + + + + +
+ + + + +
+RtyDaRd 0000
+RtyDaWr 0000
+RtyHeRd 0000
+RtyHeWr 0000 +
+
+ + + + +
+RtyDataRead
+RtyDataWrite
+RtyHeadRead
+RtyHeadWrite +
+
+ +

and 6210/6250: + +

+ + + + + + + + +
+ + + + +
+GT-Call 0000
+GT-Ok   0000
+Cl-Task 0000
+RtyHewr 0000 +
+
+ + + + +
+Call To BGOT
+Success BGOT
+CleanUpTask
+RtyHeadWrite +
+
+ +

Test 107 + +

In Nokia 7110: + +

+ + + + + + +
+ + + + +
+  1  1  1  1
+LLRS: 000000
+DchsmEr:0000
  +
+
+ + + + +
+PB GB  HB PB
+LastLostSize
+DtChsmErrCo
  +
+
+ +

In Nokia 6210/6250 contains information about the voice dialling feature: + +

+ + + + + + + + + +
+ + + + +
+ND  a  b  c
+    d  e  f
+ggggg hhhhhh
+  +
+
+ + + + +
+ND  2  1  0
+    0  0  0
+02.93 030300
+  +
+
+ + + + +
+ND mm cs ps 
+   ss po da
+Ver   Date
+  +
+
+ +

    +
  • a - number of recorded voice tags in phone. +Maximal value is 8 (for Nokia 8210/3310) or 10 (for Nokia 6210). +It's displayed in test 101 and test 102 +(Nokia 8210/3310) or test 108 and test 109 (Nokia 6210)
  • +
  • c - info about using voice dialling engine: +
      +
    • 0 - it wasn't used after enabling phone
    • +
    • 1 - voice tag was not recognized or Play/Save function were used
    • +
    • 5 - voice tag was recognized
    • +
    • 7 - user was in voice dialling function menu and selected Cancel function
    • +
    • 8 - voice dial in progress (in use)
    • +
    +
  • +
  • ggggg - version of voice dialling engine (?)
  • +
  • hhhhhh - date of releasing voice dialling engine (?)
  • +
+ +

Values of counters (without "a" parameter) are not saved to EEPROM, when phone is disabled. + +

Test 108 + +

In Nokia 7110: + +

+ + + + + + +
+ + + + +
+FF:FF FF:FF 
+FF:FF 00:00
+FF:FF FF:FF
+FF:FF FF:FF +
+
+ + + + +
+Link&LID 0-1
+Link&LID 2-3
+Link&LID 4-5
+Link&LID 6-7 +
+
+ +

In Nokia 6210/6250 it's like test 101 in Nokia 8210... + +

Test 109 + +

+ + + + +
+ + + + +
+Recog r   mm
+i1 scr1 minm
+i2 penu maxm
+i3 penl curp +
+
+ +

and is connected with recognizing numbers in voice dialing... + +

Test 110, 111, 112, 113, 114, 115 (115 ONLY IN NOKIA 7110 !) + +

+ + + + + + + + + +
+ + + + +
+ a bbbbccccc
+dddddd eeeee
+ffffff ggggg
+ h  i j kkkk +
+
+ + + + +
+ 0 FFFE  0.0
+000002   0.0
+000000 100.0
+ 3  1 0 FFE0 +
+
+
+

Help from Nokia 7110: +

+ + + +
+Pn  Sta %Use
+EraseCn %Rel
+NextRec %Unu
+Cu Cl Cc MmC +
+ +

and 6210/6250: +

+ + + +
+ Pn Sta %Use
+EraseCn %Rel
+NextRec %Unu
+Cu Sl Cc MnC +
+ +

+
+ +

Nokia 6210/6250/7110 and newer (new generations) +save ALL settings and datas (phonebook, SMS, ringtones, WAP, etc.) +in flash memory as part of EEPROM. This part is called +PMM (I don't know official meaning - unofficial it can be +"Post Multiple Memory"). These tests show probably info about next banks of PMM: + +

+

    +
  • a - number of bank
  • +
  • bbbb - shows, if bank is used (fff8 in Nokia 6210/7110) or not +(fff0 in Nokia 6210, fffe in Nokia 7110)
  • +
  • ccccc - how many percent of memory is used
  • +
  • dddddd - erase counter
  • +
  • eeeee - how many percent of memory was free
  • +
  • ffffff - next (free in bank ?) position shown as absolute address
  • +
  • ggggg - how many percent of memory is free (when add to ccccc, you have 100%)
  • +
+ +

In Nokia 9210 test 110 looks like test 100 in Nokia 6210, +test 111 like test 101 in Nokia 6210, +test 112 is here: + +

+ + + + + + + +
+ + + + +
+100   0  00
+PoolS 003CC7
+RsrvS 0022B6
  +
+
+ +

+ + + +
+%FW %BW FrCo
+PoolSizeLeft
+Reservations
  +
+ +

+ + +

Test 117, 118, 119 + + +

+ + + + + + + + + +
+ + + + +
+Ea bbbb     
+cccccc

  +

+
+ + + + +
+E0 FFF8     
+00001A

  +

+
+ +

+ + + +
+Ptn Sta     
+EraseCount

  +

+ +

+ +

Is it info about PMM banks ? + +

+

    +
  • a - 0, 1 or 2
  • +
  • bbbb - FFFF8 (bank is used ?) or FFFE (bank is empty ?)
  • +
  • cccccc - 00001A or 00001B
  • +
+ +

Test 120, 121, 122, 123 + +

Info about PMM in Nokia 9210. These tests look like +tests 110-115, +empty bank is marked as FFFE (like in Nokia 7110) + +

Test 130 + +

Test from Nokia 7110: + +

+ + + + + + +
+ + + + +
+aaa   bbbbbb

 
  +

+
+ + + + +
+Slide   Open

 
  +

+
+ +

    +
  • bbbbbb - how many times phone's sliding cover was opened (hex value)
  • +
+ +

and 3310: + +

+ + + + + + + + + +
+ + + + +
+DSP_RST:aaaa
+CS: bbbbbbbb
+ cc dd ee ff
+0000    gggg +
+
+ + + + +
+DSP_RST:0000
+CS: 00000000
+ 00 00 00 00
+0000    0000
+
+
+ + + + +
+DSP resetcnt
+CStandbyLoss
+ sw as pw st
+BadPwr insim +
+
+ +

+

    +
  • aaaa - number of DSP resets. Displayed also in +test 36
  • +
+ +

and newer versions of firmware in Nokia 6210 (confirmed for 5.17 and higher): + +

+ + + + + + +
+ + + + +
+ +LRW-1 SW:
+XXXXXX
+PN mode
+NOT DETECTED +
+
+
+ + + + +
+Shows
+Connectivity
+Battery
+information. +
+
+ +

Connected with BlueTooth module (in this phone it wasn't available). + +

Test 131 + +

+ + + + + + + + + +
+ + + + +
+STO:aaaaaaaa
+NB:bbLB:cc
+HOF:dddddddd
+eeee ZR:ffff +
+
+ + + + +
+STO:00000000
+NB:00LB:00
+HOF:00000005
+0000 ZR:05CA +
+
+
+ + + + +
+Stack overfl
+NoBuf LongBu
+HandOver Cnt
+HOfail ZonFa +
+
+ +

+

    +
  • dddddddd - sum of handovers from +test 41 (?). Unfortunately, values don't match +always (firmware bug ?) +
  • +
+ +

Counters are in hexadecimal form... + +

Test 132 + +

+ + + + + + + + + +
+ + + + +
+BS: aaaaaaaa
+MO: bbbbbbbb
+DRC:cccccccc
+TIM:dddddddd +
+
+ + + + +
+BS: 00000000
+MO: 00000005
+DRC:00000000
+TIM:00000000 +
+
+
+ + + + +
+BS_Call Cnt
+MO_Call cnt
+Dropped call
+Call time +
+
+ +

+

    +
  • aaaaaaaa - how many times you received call. Please notice one difference to +MTOK parameter from test 63 - you can't reset +this value from phone's menu
  • +
  • bbbbbbbb - how many times you made successfull outgoing call from your phone. +Please notice one difference to MOOK parameter from test 63 +- you can't reset this value from phone's menu. One interesting thing: this counter +can have bigger value than MOOK from +test 63 (firmware bug ?)
  • +
  • dddddddd - counter shows, how long (in second) there were calls made. +Doesn't work in all firmware versions
  • +
+ +

Counters are in hexadecimal form... + +

Test 133 + +

+ + + + + + + + + +
+ + + + +
+BFu:aaaaaaaa
+ChC:bbbb  cc
+StB:
+NSe: +
+
+ + + + +
+BFu:00000002
+ChC:0004  00
+StB:
+NSe: +
+
+
+ + + + +
+FullChargCnt
+ChaCon Wrong
+Standby time
+NoServTimer +
+
+ +

+

    +
  • aaaaaaaa - how many times info about full charged battery was displayed +(when it was done correctly - for example FullM info in +test 20...or not - for example MaBFD info +in the same test). +Counter doesn't increase value, when phone is disabled.
  • +
  • bbbb - how many times charger was connected. Counter increases value, when (each +time, when you will do it): +
      +
    1. phone is enabled, you connect charger
    2. +
    3. phone is disabled, you connect changer and enable phone
    4. +
    +Counter doesn't increase, when phone is disabled. +
  • +
+ +

Test 140 + +

Test from Nokia 6250: + +

+ + + + + + + + +
+ + + +
+AVC:  02    
+SLM:  00
+VOL:  09
 
+
+
+
+ + + +
+AVC state
+SLM  state
+BIAS  volume
  +
+
+
+
+ +

Second line changes to 02, when phone measure noise level. + +

and 8210: + +

+ + + + + + + + +
+ + + +
+Driver nr:01
+ManuDeviAddi
+00B000480000
+  +
+
+
+
+ + + +
+Return value
+from MFS

  + + +

+
+ +

Test 240 +
It doesn't show any values, but: + +

+

+ +

Test 241 +
+NetMonitor menu in Nokia 5110 +Disables netmonitor (it means, deactivates its' menu) ! +To again activate it you will have to use methods described in +How to activate it ? +Probably after using it you will have to disable and enable phone (to +make arrows up/down usable). It's possible too, that these arrows will work +only, when you will deactivate netmonitor from computer... + +

Test 242 +
Enables limited netmonitor +(tests from 1 to 19 only). To enable full netmonitor version +you will have to use methods described in +How to activate it ? question +(phone doesn't allow to use it from its' menu +test 243, which normally enable full +netmonitor version - you will be able to enter it in program enabling +netmonitor in computer only). + + +

Test 243 +
Enables full netmonitor. + +

Test 250 +
Some English descriptions write, that this test cleans information from +test 57 (I didn't notice it). + +

Test 497 +
It should deactivate +netmonitor like test 241 (497-256=241). +But some sites (for example, +www.versamart.com/Nokia5110/nokia5110code.shtml) +show, that it could make more: + +

The tips needs Net Monitor enabled. +
Be aware that the trick wil remove Netmonitor in some +
sw versions like v4.73 and v5.04. + +

+

    +
  1. Laungh the NetMonitor in your Nokia 51xx / 61xx
  2. +
  3. Execute the test number 497
  4. +
  5. Free calling for about 90 sec should now have been activated.
  6. +
+ +

The trick has not been comfirmed working yet. + +

For me, it's rather joke... + + +

Back to the top + + +

13. You can also use a program...
+


+ +

There are programs, which allow to track some of these parameters on computer's screen +(of course, phone must be connected to computer): + +

+

    +
  • +program created by Andreas Schmidt (www.aschmidt.de/): +shows values displayed by phone in given test and allows to track +BTSes (for example, compare their signal level) +
  • + +
  • +gnokii: it's the name of project (official page - www.gnokii.org) +and software (nevest versions - ftp://ftp.linux.cz/pub/linux/people/pavel_janik/Gnokii/), +which want to be Nokia Cellular Data Suite for Unix and Linux. In this moment +it displays information similiar to these displayed by program described earlier. +
  • + +
  • Logo Manager (http://www.logomanager.co.uk/) +it shows view of netmonitor tests.
  • + +
  • +created by N. Hüttisch (www.nobbi.com/). +It can work with differenet phones (for example, Siemens C10). +When you want to use it with Nokia, Nokia Cellular Data Suite is required +(program communicates using AT commands). When you will unpack it, in file +monitor.ini (it's in archive with program) +change comport parameter (you will give there name of port, where +'Nokia GSM Data' and 'Nokia GSM Voice' modems are installed). And that's all... +
  • + +
  • http://www.club.cz/nokia.monitor/ +- it has the similiar possibilities to program below. + +
  • +Logo Express (http://memsu1.iam.ntu.edu.tw/~jrywu/ +or http://logoexpress.bizland.com/): +shows LAC and CID.
  • + +
  • +from http://members.tripod.com/smssend/gsm_csq.htm +(versions for PSION, DOS and Windows): display chart of signal level +(besed on signal from phone), work probably with Nokia 6xxx phones only. +
  • + +
  • +WinTesla: this commercional service program displays many detailed information +(for details search some description on pages somewhere in Internet) +
  • + +
  • software from +http://members.tripod.de/gsmplanet/psion.html for Psion 5mx (MX 218) and Psion Revo. +It requires additional software supporting IrDa +(see http://www.symbiandevnet.com/downloads/opl/projectopx/scomms.zip) +Works with Nokia 7110, 6210, 8210 and with Siemens S35i, S25. +Options depends on phone.
  • + +
  • +version 1.3 of PC-Locals: there two ways to make it: + +

    +

      +
    1. +in the window, where netmonitor is normally activated, enter number of +test - computer will display everything, what could be displayed by phone +in this test. +
    2. + +
    3. enabling internal program's netmonitor: + +

      +

        +
      1. select menu 8 (Event Trace)
      2. + +
      3. select menu 9 (Load TRC file)
      4. + +
      5. +write name of TRC file (with PC-Locals 1.3 in Internet you can find +nse3_433.trc file for Nokia 6110 firmware 4.33) +correct for phone's model and firmware (or press Enter and select adequate +file). When version from file and phone's version is not the same, computer +will confirm, that you really want to load it (it won't damage phone, +but parameters displayed by program will be different than adequate parameters +from netmonitor in phone). +
      6. + +
      7. +select menu 1 (MCU Events)
      8. + +
      9. +change status of events, which will be tracked in Trace window - you can make +it using gray + on the right side of keyboard (you can disable tracking, enable +normal or extended tracking). If you want to enable netmonitor displayed after +pressing F8 key, you have to enable tracking event CONSTANT_WINDOW_TRA +(change to NORM or EXT).
      10. + +
      11. +select menu 2 (Event Control) and change to On.
      12. + +
      +
    4. + +

      In "Trace" window you will see now tracked events. Network parameters can be +observed after pressing F8. Menu 6 (Break Trace Functions) +breakes tracking events.

    +
  • +
+ + +

Back to the top + + +

14. Can I use NetMonitor without SIM card inserted, without PIN number entered or when SIM card is not active ?
+


+ +

GSM standards say, that cellular phone always should allow to make +emergency calls (usually 112) - even, when it's was blocked by GSM operator +(it means, when normally you can't use this phone - with this +IMEI - in network) or when it's without +SIM card (eventually it was blocked too). It makes, that after enabling your +Nokia looks for available cellular networks. There are some programs in this +moment (see in You can also use a program...), +which display on computer's screen everything, what could be displayed +by phone in this test. Or I will write it different: when you will connect your +Nokia to computer and use (for example) Pc-Locals 1.3 or program written +by Andreas Schmidt, you can +see some information given normally in "Net Monitor" menu. In some phones +(I checked it with Nokia 5110) you can have access to this menu (generally, +to phone's menu) using gnokii: you should send dtmf sequence to phone +(for example, run gnokii with parameter "--senddtmf sequence", where +sequence consists of some digits). + +

When you will enter PIN code, you will be "normally" able to use "Net monitor" +menu from phone's keyboard (of course, if it was activated) and all settings +and tests inside (for example, not till then in +test 6 you will see +"preffered" and "forbidden" networks). You can still display tests using described +above programs (it can be usefull, when you want to monitor network state and when +you don't want to loose caller identification or when you want to check kind +of channel after entering PIN code) - they work independent of it, if you +have "Net monitor" menu activated and which test is displayed in phone... + +

SIM card data can be readed in test 51 +(of course, if your phone supports this test) using these programs +independent of it, if you entered PIN code or not. When you don't have SIM +card in phone, you will see there "ERROR1". + +

When you use deactived SIM card, you have access to tests in netmonitor +(of course, when its' menu was activated earlier). Network of SIM card is +normally monitored. Phone tries to communicate with it only once after +enabling phone (netmonitor shows, that +CCCH, AGCH, +SDCC (phone refreshes TA then), +BCCH and CCCH channels +are used then - like in normal SIM card). Later it's impossible. It's made againg +after reseting phone. Of course, you don't have name of monitored network +on screen or cellinfo. Interesting thing is, that, for example, +you can normally use BTS test... + + +

Back to the top + + +

15. How can I disable NetMonitor ?
+


+ +

GSM/DCS/PCS phones: + +

+NetMonitor menu in Nokia 5110 +Enter 241 test in phone or use one of described in +question How to activate it ? programs +(you enter number 241 there, select "OFF" or something similiar...). + +

TDMA 800/TDMA 1900 phones: + +

Enter NAM programming menu (*3001#12345# code - +some sources write, that you have to write security code instead of 12345), set "Field Test display" to "Off"/"Disable" and reboot phone. + + +

Na pocz±tek + + +

16. Do I need to disable NetMonitor before sending my phone to the service ?
+


+ +

Normally Nokia phones don't have activated netmonitor. When you will give your +handy to service, somebody there can think, that you made some strange things with it +(of course, it isn't any maxim - it depends on concrete service and people, +who will repair your phone)... But I think, that it will be better to save +eventually problems connected with it and deactivate netmonitor's menu before +giving phone to service (I repeat: it isn't sometimes required, but it's better +to make it, when you don't want to have problems)... + + +

Back to the top + + +

17. Is it possible to re-activate NetMonitor after disabling it ?
+


+ +

YES ! You can activate (and deactivate) +netmonitor's menu repeat infinitely (and once more ;-)) + + +

Back to the top + + +

18. Is NetMonitor available in analog Nokia phones ?
+


+ +

Yes, it seems, that is available in majority of Nokia phones (working in different +cellular systems). + + +

Back to the top + + +

19. Does NetMonitor allow to use phone like broadcast station ?
+


+ +

No - if you want to speak without costs with people, which are near to you, +you have to use broadcasting station or walkie-takie. + + +

Back to the top + + +

20. I don't have all described tests in my phone. Why ? Can I increase their number ?
+


+ +

This FAQ describes tests from DIFFERENT Nokia phones (models). If you want +to increase number of available tests, you can only change your phone to +new, which has more tests (like Nokia 7110) or change it's firmware to never +- sometimes (like in Nokia 5110) you can have ONE :-) new test (firmware +5.04 and never has additionaly test 89). + +

If you have ONLY 19 first tests, you have activated ONLY standard netmonitor +- enable full (here is more details). + +

Sometimes you can find concrete copies of phones, where is really a little number of tests. +For example: I read about Nokia 6110 with 5.48 firmware, where it wasn't possible +to activate full netmonitor and where first tests didn't have some parameters +(for example, test 7 was empty). In such "cases" +I can find one explanation only: phone had not "full" firmware donwloaded. User +of such phone should take it to the service to download new firmware... + + +

Back to the top + + +

21. Does NetMonitor allow to identify place, where is my interlocutor ?
+


+ +

NO. This information are in networks registry, but they're not sent +to your phone. NetMonitor allows however (at least theoretically) +to look into parameters of sound, which is sent from his(her) phone... + + +

Back to the top + + +

22. Does NetMonitor allow to identify place, where am I ?
+


+ +

It's possible, but not too precisely. Why ? + +

Phone can read such parameters required to identify (location of) BTSes +like their numbers (see test 11) or +TA (see test 1), +but readed TA couldn't have been distance +from BTS station in straight line (signal can break down) +and continuosly isn't possible finding, in what direction (what corner) +BTS stations are located (which are "seen" by your +phone). So, it's possible to identify area only, where you're (in cities, where +BTSes are located more close, it will be more +precisely). And it can be done by you or your operator... + +

More info about implementing Mobile Station Location in GSM: +www.willassen.no/msl/ + + +

Back to the top + + +

23. What are NetMonitor codes ?
+


+ +

Sometimes I read advertisements with requests about NetMonitor codes and I don't know +exactly, what is it... It simple: in Poland (my country) rather only +GSM/DCS phones are used +and you don't have rather some special "secret" codes, which activate NetMonitor... When +you need it's description - it's in this FAQ. + + +

Back to the top + + +

24. Is it the truth, that in phones with additional hardware changing frequency band NetMonitor doesn't work correct ?
+


+ +

I didn't heard about such hardware. Article about it in Polish +Twoja Komorka number 4/2000 (page 18) +was only joke... + + +

Back to the top + + +

25. Where can I find description of FBUS/MBUS protocol and commands connected with NetMonitor ?
+


+ +

There are not official information about it. All pages below were created by different people, +which observed work of compiled software: + +

+

+ +

On the pages above you will find information about commands connected with +NetMonitor for NSx models (if you don't know model of you phone, +read this page). Always you can use ready and free +ActiveX control (http://www.gertjaap.com) +working with these models too... + + +

Back to the top + + +

26. I have non existing networks on the list of forbidden networks...
+


+ +

You should remember, that it's possible to change list of forbidden and preffered networks, +for example, using SIM card readers ot some phones (it's possible, this "strange" +position was entered this way). + +

When we speak about 260-99 network (260-3F position) - it was number of +test network run by the operator of Era GSM network on +the exhibition for Day of Telecommunication in Warsaw (May 2000). It presented +GPRS. + + +

Back to the top + + +

27. How to check frequency band (900 or 1800 Mhz), where phone work in this moment ?
+


+ +

Everything depends on used channel (for GSM 900 1-124, for GSM 1800 512-885) - +see description of 1'st test... + + +

Back to the top + + +

28. Can I use DLR-2/DLR-3 cables for activating netmonitor ?
+


+ +

Yes, Logo Manager (http://www.logomanager.co.uk) +works with DLR-3 cable. I don't know software supporting DLR-2... + + +

Back to the top + + +

29. Can I activate netmonitor using Init File Editor (Nokia 9110) ?
+


+ +

NO, Init File Editor is connected with PDA part of phone, netmonitor not... + + +

Back to the top + + +

30. Can I force phone to use one frequency band (900 or 1800 Mhz) only ?
+


+ +

Unfortunatelly not (of course, some other phones - for example, Motorola - have such function). +The only thing, you can do: you can force phone to use one selected channel +from concrete frequency (see test 18). +Of course, there are some disadvantiges of it - for example, when phone will lost +signal on this channel, will report, that network not found (in normal situation +it would try to find another channel). + + +

Back to the top + + +

31. How to change settings in tests ?
+


+ + + +
+Netmonitor menu in Nokia 5110 +Netmonitor menu in Nokia 5110 +Netmonitor menu in Nokia 5110 + +By direct enter to them. How ? You should enter to phone's menu, go into +"Netmonitor/Field Test" menu, enter the number of test, where you want to change +setting and ENTER DIRECTLY INTO IT. It's described more detailed in +question 9. + +

Sometimes (I write it in such tests) you have to change values in some +positions in phonebook before entering to them (see, for example, +test 18). + +

+ + +

Back to the top + + +

32. My phone has very short snandby time - it is possible to see the reason of it ?
+


+ +

Here are some possible to check reasons: + +

    +
  • if it depends of configuration of your network - see +test 10 (PRP parameter), +test 12 and +test 13 (DTX; +or test 2 in Nokia 2120/2160/6160)
  • + +
  • general energy consumption (it can depend on +older firmware version or enabled +"Info service") or "Cell info display") functions - +test 23 +(in Nokia 6185/6188 test 45)
  • + +
  • capacity of the battery (test 20; +in Nokia 6185/6188 test 42) +and their age (LiION) (test 23; +in Nokia 6185/6188 test 45)
  • +
+ + +

Back to the top + + +

33. Is netmonitor available in English version only ?
+


+ + + +
+Menu 9 in Nokia 3210 +Menu 11 in Nokia 3210 + +In Nokia phones only, in some other (for example, Motorola) in different languages... + +Menu 9 in Nokia 3210 +Menu 11 in Nokia 3210 +
+ + +

Back to the top + + +

34. Information sources
+


+ +

To make this FAQ I used: + +

+

+ +

People, which are not on this list, should write to me :-) ! + + +

Back to the top + + +

35. Additional information
+


+ +

+

+ +

For links to pages and sources in Polish language see Polish version of this description. + + +

Back to the top
+ +

36. Does using/activating netmonitor cost anything ?
+


+ +

Your phone HAS TO monitor network state/signal level, etc. to normal work +(and your operator DOESN'T TAKE MONEY for it !). You only can decide, if info +about it will be displayed or not - it depends ONLY on you. The same situation +is with other parameters connected with phone (for example, battery charging). + +

You can activate netmonitor FREE using methods from +How to activate it ?, eventually pay +somebody for it ANY money ;-)) - he will do it the same thing... + + +

Back to the top + + +

37. Does using netmonitor is legall ?
+


+ +

Pryvatly I think: I received (free ;-)) software for it and I don't +make anything wrong. So, why I can't observe parameters ? + +

BTW - different thing is with simlocks (especially, when phone was bought +in promotion and signed agreement is not expired ;-)))) .... + + +

Back to the top + + +

38. Which entries on SIM card are used in netmonitor tests ?
+


+ +

In new Nokia phones you have to write/read some values changed in some tests +in/from some entries in phonebook on SIM card: + +

+

    +
  • 31 - test 71 (AUDIO ENHANCEMENT). You should write value 0-65536 there
  • +
  • 32 - test 72 (AUDIO ENHANCEMENT). You should write value 0-65536 there
  • +
  • 33 - test 17 (BTS TEST). You should write +channel number (for GSM 900 1-124, for GSM 1800 512-885) there
  • +
  • 34, 35, 36 - test 52 (reading files from SIM) +and test 53 (writing files to SIM). In entry +34 will be put address of file, 35 its' contenst and in 36 info about +success/failure of reading/writing
  • +
+ +

Similiar activities in older models (2110i, etc.) were connected with writing values +into (for example) internal phone phonebook in entry 98. + + +

Back to the top + + +

39. Can I activate netmonitor in 3310 using soft working with 3210 ?
+


+ +

YES - in all new models of Nokia phones you can use the same computer soft. +I advice reading point How to activate it ?... + + +

Back to the top + + +

40. After activating netmonitor/BTS TEST my phone can't find network...
+


+ +

Nokia phones had always good firmware without too many errors, bugs and mistakes. +Some new models (like 6210) make more problems, but even they're so good, that +simple activating netmonitor menu doesn't make problems. +They can be sometimes visible (like hanging phone) when use concrete tests. +It's good to update firmware of phone then and inform me about problem :-))) +-> I collect firmware bugs in my pages. + +

Finding and loosing network signal doesn't depend rather on netmonitor - +it's possible, that in concrete place and time you don't have transmitters +of your operator or network is busy. It happens and is rather normal. + +

Different situation is, when BTS TEST is enabled. Your operator can use +set in test channel on small area only and outside it your phone will not show +network signal. So, disable it then (see description of test 17). + + +

Back to the top + + +

41. Netmonitor shows different battery capacity than info on it...
+


+ +

Phone takes info about battery capacity from resistor inside. +If it's different than should be, you see such incorrect info in netmonitor. +You can only check (and compare with original), if phone has longer standby/speech time. +If yes, you have bigger battery... + +

You have to remember about one detail: +In case of LiION battery you will find in netmonitor +(test 20) +the same value as on battery casing, in NiMH batteries +this value can differ even by 200 mAh (and it changes)... + +

42. NetMonitor in Nokia 6310, 8310,...
+


+ +

Problems with activating netmonitor started with DCT-4 generation of Nokia phones. +There are two possibilities: + +

+

    +
  1. Nokia changed method of activation (if yes, earlier or later it will be +known)
  2. +
  3. in phones for "normal" users firmware is WITHOUT this function (no comments)
  4. +
+ +

It's very difficult to say something about it without flash dump from +these phones for me + + +

Back to the top + + +

+

[Part 1][Part 2][Part 3][Part 4][Part 5][Part 6][Part 7] +

+
+
+ +

Marcin Wiacek (WWW) +
Last modification: 10 March 2002
+ + + diff --git a/Docs/en_US/gsm/netmon/net_mon1.gif b/Docs/en_US/gsm/netmon/net_mon1.gif new file mode 100644 index 0000000..4a89889 Binary files /dev/null and b/Docs/en_US/gsm/netmon/net_mon1.gif differ diff --git a/Docs/en_US/gsm/netmon/net_mon2.gif b/Docs/en_US/gsm/netmon/net_mon2.gif new file mode 100644 index 0000000..841ead5 Binary files /dev/null and b/Docs/en_US/gsm/netmon/net_mon2.gif differ diff --git a/Docs/en_US/gsm/netmon/net_mon3.gif b/Docs/en_US/gsm/netmon/net_mon3.gif new file mode 100644 index 0000000..b34b340 Binary files /dev/null and b/Docs/en_US/gsm/netmon/net_mon3.gif differ diff --git a/Docs/en_US/gsm/netmon/net_spis.htm b/Docs/en_US/gsm/netmon/net_spis.htm new file mode 100644 index 0000000..ab0d814 --- /dev/null +++ b/Docs/en_US/gsm/netmon/net_spis.htm @@ -0,0 +1,138 @@ + + + + + Links of NetMonitor tests + + + + + + +

Select test number

+ +1 +2 +3 +4 +5 +6 +7 +8 +9 +10 +11 +12 +13 +14 +15 +17 +18 +19 +20 +21 +22 +23 +24 +25 +30 +31 +32 +34 +35 +36 +37 +38 +39 +40 +41 +42 +43 +44 +45 +46 +48 +51 +52 +53 +54 +55 +56 +57 +58 +59 +60 +61 +62 +63 +64 +65 +66 +67 +68 +70 +71 +72 +73 +74 +75 +76 +77 +78 +79 +80 +81 +82 +83 +84 +85 +86 +87 +88 +89 +90 +91 +92 +93 +94 +95 +96 +98 +99 +100 +101 +102 +103 +104 +105 +106 +107 +108 +109 +110-115 +117-119 +120-123 +130 +131 +132 +133 +140 +240 +241 +242 +243 +250 +497 + +

+ + diff --git a/Docs/en_US/gsm/netmon/nm_01.gif b/Docs/en_US/gsm/netmon/nm_01.gif new file mode 100644 index 0000000..06f7e8e Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_01.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_02.gif b/Docs/en_US/gsm/netmon/nm_02.gif new file mode 100644 index 0000000..dbc93fd Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_02.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_03.gif b/Docs/en_US/gsm/netmon/nm_03.gif new file mode 100644 index 0000000..1098642 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_03.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_04.gif b/Docs/en_US/gsm/netmon/nm_04.gif new file mode 100644 index 0000000..083a488 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_04.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_05.gif b/Docs/en_US/gsm/netmon/nm_05.gif new file mode 100644 index 0000000..daa119d Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_05.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_06.gif b/Docs/en_US/gsm/netmon/nm_06.gif new file mode 100644 index 0000000..a4a5c5a Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_06.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_07.gif b/Docs/en_US/gsm/netmon/nm_07.gif new file mode 100644 index 0000000..8b65f6f Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_07.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_08.gif b/Docs/en_US/gsm/netmon/nm_08.gif new file mode 100644 index 0000000..dd6b3b5 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_08.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_09.gif b/Docs/en_US/gsm/netmon/nm_09.gif new file mode 100644 index 0000000..3117ef0 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_09.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_10.gif b/Docs/en_US/gsm/netmon/nm_10.gif new file mode 100644 index 0000000..78becb8 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_10.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_11.gif b/Docs/en_US/gsm/netmon/nm_11.gif new file mode 100644 index 0000000..8f3acaf Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_11.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_12.gif b/Docs/en_US/gsm/netmon/nm_12.gif new file mode 100644 index 0000000..dd099a9 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_12.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_14.gif b/Docs/en_US/gsm/netmon/nm_14.gif new file mode 100644 index 0000000..4e96bff Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_14.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_15.gif b/Docs/en_US/gsm/netmon/nm_15.gif new file mode 100644 index 0000000..e7f44c4 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_15.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_3210.gif b/Docs/en_US/gsm/netmon/nm_3210.gif new file mode 100644 index 0000000..f1259fb Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_3210.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_32102.gif b/Docs/en_US/gsm/netmon/nm_32102.gif new file mode 100644 index 0000000..3437673 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_32102.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_3310.gif b/Docs/en_US/gsm/netmon/nm_3310.gif new file mode 100644 index 0000000..695841a Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_3310.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_5110.gif b/Docs/en_US/gsm/netmon/nm_5110.gif new file mode 100644 index 0000000..7d41c3d Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_5110.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_6150.gif b/Docs/en_US/gsm/netmon/nm_6150.gif new file mode 100644 index 0000000..b69427e Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_6150.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_6190.gif b/Docs/en_US/gsm/netmon/nm_6190.gif new file mode 100644 index 0000000..c658a13 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_6190.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_6210.gif b/Docs/en_US/gsm/netmon/nm_6210.gif new file mode 100644 index 0000000..30ccb35 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_6210.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_6310.gif b/Docs/en_US/gsm/netmon/nm_6310.gif new file mode 100644 index 0000000..f00b938 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_6310.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_7110.gif b/Docs/en_US/gsm/netmon/nm_7110.gif new file mode 100644 index 0000000..4768efd Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_7110.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_8210.gif b/Docs/en_US/gsm/netmon/nm_8210.gif new file mode 100644 index 0000000..1d3a51f Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_8210.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_8310.gif b/Docs/en_US/gsm/netmon/nm_8310.gif new file mode 100644 index 0000000..e04405a Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_8310.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_9110.gif b/Docs/en_US/gsm/netmon/nm_9110.gif new file mode 100644 index 0000000..921ccdb Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_9110.gif differ diff --git a/Docs/en_US/gsm/netmon/nm_9210.gif b/Docs/en_US/gsm/netmon/nm_9210.gif new file mode 100644 index 0000000..75d4679 Binary files /dev/null and b/Docs/en_US/gsm/netmon/nm_9210.gif differ diff --git a/Docs/en_US/gsm/sms/sms.htm b/Docs/en_US/gsm/sms/sms.htm new file mode 100644 index 0000000..5159073 --- /dev/null +++ b/Docs/en_US/gsm/sms/sms.htm @@ -0,0 +1,157 @@ + + + + + SMS FAQ + + + + + +

Main page

+
SMS FAQ
+ +


+ +

What is SMS ?
+


+ +

You can send from your phone short text letters. And this is SMS +(Short Messaging System). + +

What is SMSC ?
+


+ +

This is Short Messaging System Centre. + +

Idea is simple: when you write +your SMS, select recipient(s) and send your SMS, it's send to SMSC. +If you see "Message sent" ot something like that, don't worry. It means, +that your SMS was delivered to SMSC and SMSC try to delivery it to recipient(s). + +

Why is it done this way ? Let's say, that recipient's phone is disabled. +If it will done this way, that your phone will try to delivery it directly, +it will loose energy during each try and you have to be in network coverage +during it. GSM network makes it easier - not you, but SMSC try to delivery it. +And of course, you can decide, how long it should be done (after it SMS will +deleted). + +

What SMSC should I use ?
+


+ +

The most simple answer is: ask your operator and use its' own SMSC. + +

But sometimes it's not so simple: it's possible, that SMSC of your operator +CAN'T send SMS to some other network. You should try to use different SMSC then. +But remember: if you will try to use SMSC from different country, you have +to have activated international calls. + +

Can I use my own SMSC in roaming ?
+


+ +

Yes. + +

Can SMS contains not only text ?
+


+ +

Of course. Each SMS contains some bytes filled with contest. Normally they're +filled with chars. But of course you can decide, that they have different meaning +and send +binary data this way too... + +

In this moment we can classify SMS to: + +

+

    +
  • 7 bit SMS - you can put each of 127 chars into it
  • +
  • Unicode SMS - you can each of 65550 chars into it
  • +
  • binary data SMS - ringtone, picture, etc.
  • +
+ +

What is length of SMS ?
+


+ +

Each SMS can contains ONLY 140 8 bit chars. When you code it as 7 bit SMS, +you can save 160 chars (you have 140*8 bits inside and they're divided into +7 bits) and when code as Unicode SMS, 70 chars (each char in such SMS contains +of 2 8 bit chars). + +

It's also possible to put into each sent SMS +special flag, which will mean: this +is first, second, third,... part of SMS. Some phones can display this info +(for example info "Linked: 1/...") or even display each SMS with such flag +as one long... Such SMS are called concatenated or linked. + +

What is price for sending SMS ?
+


+ +

Ask your operator :-) + +

Generally you pay for EACH SMS with 140 8 bit chars. It means, that +after sending Linked SMS consist of 2 such SMS, you will pay for 2. The similiar +thing is with Picture Images (each of them consist of 3 SMS) and Reminders +from Nokia 3310 (2 SMS). + +

Something it's free. When ? When you are in roaming and network, you use, +write in logs, that sent SMS, when it was send ONLY over SMSC of this network (remember: +you can you SMSC from your home network). Or when SMSC, you used, gives info +to network about error during sending, but send it correctly ! + +

What is price for receiving SMS ?
+


+ +

In many networks it's free... + +

What is SMS class ?
+


+ +

Each SMS have flag with info, what should be done with it after delivering +to recipients' phone. There are 4 possiblities (classes): + +

    +
  • Class 0: displayed immedietaly after receiving + in display of SMS recipient
  • +
  • Class 1:
  • +
  • Class 2: saved in SIM card of recipient
  • +
  • Class 3:
  • +
+ +

What is delivery time ?
+


+ +

This is the time, during it SMSC will try to delivery your SMS. + +

What is delivery raport ?
+


+ +

You can know, if your SMS was delivered to recipients' phone +(don't misguide it with reading !). It's free. There are two ways +to do it: + +

+

    +
  1. enable such option in your phone. Of course, it will work +only, when used SMSC will accept this feature
  2. +
  3. write special text on the start of SMS. It can be different for +each SMSC
  4. +
+ +

What it "Reply via own centre" ?
+


+ +

Theoretically, when you send SMS with flag to somebody, it should +be able to send answer over your SMSC. Often it doesn't work (many SMSC +doesn't accept SMS from forbidden networks even with this flag). + +

I have error, when answer to received SMS
+


+ +

+

    +
  • you don't have correct SMSC in phone
  • +
  • person, who sent SMS to you, marked "Reply via own center" option. +Try to send SMS over your own SMSC
  • +
  • you can't send SMS (don't have it activated in your operator)
  • +
+ + + diff --git a/Docs/en_US/gsm/tip.gif b/Docs/en_US/gsm/tip.gif new file mode 100644 index 0000000..9837057 Binary files /dev/null and b/Docs/en_US/gsm/tip.gif differ diff --git a/Docs/en_US/index.htm b/Docs/en_US/index.htm new file mode 100644 index 0000000..a45a54b --- /dev/null +++ b/Docs/en_US/index.htm @@ -0,0 +1,52 @@ + + + + + GNOKII/XGNOKII HELP + + + + + 
+GNOKII/XGNOKII HELP + +

Welcome in our help system. + +

Gnokii related topics +

+ +

If you want to know something more about Nokia/GSM mobile phones... +

+ + + + diff --git a/Docs/en_US/styl.css b/Docs/en_US/styl.css new file mode 100644 index 0000000..02b023e --- /dev/null +++ b/Docs/en_US/styl.css @@ -0,0 +1,46 @@ + + + diff --git a/Docs/examples/axelf.txt b/Docs/examples/axelf.txt new file mode 100644 index 0000000..df51e7f --- /dev/null +++ b/Docs/examples/axelf.txt @@ -0,0 +1 @@ +AxelF:d=4,o=5,b=125:32p,8g,8p,16a#.,8p,16g,16p,16g,8c6,8g,8f,8g,8p,16d.6,8p,16g,16p,16g,8d#6,8d6,8a#,8g,8d6,8g6,16g,16f,16p,16f,8d,8a#,2g,p,SS,16f6,8d6,8c6,8a#,g,8a#.,16g,16p,16g,8c6,8g,8f,g,8d.6,16g,16p,16g,8d#6,8d6,8a#,8g,8d6,8g6,16g,16f,16p,16f,8d,8a#,2g \ No newline at end of file diff --git a/Docs/examples/gnokiirc b/Docs/examples/gnokiirc new file mode 100644 index 0000000..13b4584 --- /dev/null +++ b/Docs/examples/gnokiirc @@ -0,0 +1,185 @@ +# This is a sample ~/.gnokiirc file. +# In Unix/Linux: copy it into your home directory and name it .gnokiirc +# or into /etc and name it gnokiirc +# In Win32: copy it into directory with (my)gnokii.exe + +[global] + +port = /dev/ttyS1 +model = auto +initlength = 30 +connection = fbus +bindir = /usr/local/sbin/ +synchronizetime = yes +;logfile = mygnokiilog +;use_locking = yes + +[gnokiid] + +port = /dev/ttyS1 +model = auto +initlength = 30 +connection = fbus +bindir = /usr/local/sbin/ +synchronizetime = yes + +[receivesms] +path = c:\ + +# DESCRIPTION OF PARAMETERS + +# PORT +# ----------- +# Set port to the physical serial port used to connect to your phone +# In Linux /dev/ttyS0, /dev/ttyS1, etc. +# In Win32 COM1:, COM2:, etc. + +# MODEL +# ----------- +# Set model to the model number of your phone +# In this moment: +# +# for Nokia: +# 6185 +# 3210|3310|5110|5130|5190|6110|6130|6150|6190|8210|8850 +# 6210|7110 +# +# for AT phones: +# at +# +# Please notice, that in some phones (like 7110) +# it will be (now or in the future) provided double support - AT commands +# or protocol specific for phone model (fbus, mbus, etc.) +# +# You can also use model "auto" and gnokii will try to find your +# phone model on "port" port. This option is during development and +# can not work excellent...Let'say - with all new supported Nokia phone +# connected over FBUS/DLR3 cable you will not have any problem. +# With other can be and it will have to be set manually. + +# INITLENGTH +# ----------- +# Initlength controls the number of characters sent to the +# phone during initialisation. You can either set it to +# the word "default" or a positive integer. +# +# You can try setting this value if you want to connect +# to the phone quicker. If you've never noticed the +# connection to be slow, it is suggested that you +# leave this alone. Read the initialisation code in fbus-xxxx +# to understand what this changes if you're curious. + +# CONNECTION +# ----------- +# The type of the connection. Can be: +# +# @"mbus". Models: +# 6210|6250|7110 +# 6185 +# 3210|3310|3330|5110|5130|5190|6110|6130|6150|6190|8210|8850 +# +# "infrared" (for direct infrared connection - in 8210/8250 use two players +# snake menu to enter into it). Models: +# 6110|6130|6150|8210|8850 +# +# "tekram210" (for direct infrared connection using Tekram 210 +# - in 8210/8250 use two players snake menu to enter into it). Now in Unix only. +# Models: +# 6110|6130|6150|8210|8850 +# +# "irda" (infrared over Irda sockets - now in Unix only) +# Models: +# 6210|6250|7110 +# +# @"fbus". Models: +# 6210|6250|7110 +# 3210|3310|3330|5110|5130|5190|6110|6130|6150|6190|8210|8850 +# +# @"dlr3". Models: +# 6210|6250|7110 +# +# @"at". Models: +# at + +# BINDIR +# ----------- +# Set bindir to point to the location of the various gnokii binaries. +# In particular ensure that mgnokiidev is in this location, with +# permissions 4754, owned by root, group gnokii. Ensure you +# are in the gnokii group and that the group exists... +# Setting not important for win32 + +# SYNCHRONIZETIME +# ----------- +# set it to "yes", if want to have set time from computer to phone +# each time, when use gnokii, xgnokii or gnokiid +# Function works, of course, only then, when setting time is implemented +# for your phone +# With some phones (if it's enabled or if you generally changed date/time +# during session with phone), after soft reset (without asking for PIN) +# phone can lost date/time settings and ask for them or disable clock +# on the phone screen. Seen for 6150 and 6210 + +# LOGFILE +# ----------- +# When there are problems with mygnokii, you have two ways +# to help in resolving them: +# 1.compiling mygnokii with debug and sending dump to marcin-wiacek@topnet.pl +# 2.using this option. Mygnokii will be slower, because during work will +# create file with name set here with short +# info about transmission. Send it to marcin-wiacek@topnet.pl +# Method 1 is better. When not possible (for example, when have only +# compiled binary version), use 2. + +# USE_LOCKING +# ----------- +# Under Unix set this to 'yes' if you want gnokii to set and check the +# lock file in /var/lock directory. It avoids potential conflicts with +# other serial port software (eg. minicom). If you have wrong permissions +# for the directory, a warning will be generated. If you don't want a lockfile, +# set it to 'no'. + +# EXAMPLES + +#1.Nokia 5110, fbus cable on "/dev/ttyS1" port with gnokii/xgnokii +# Gnokiid uses "default" config +#[global] +#port=/dev/ttyS1 +#model=5110 +#connection=fbus + +#2.Nokia 5110 working with NCDS (win32) on "com1:" port with gnokii +# Gnokiid uses "default" config +#[global] +#port=com1: +#model=ATGSM + +#3.Nokia 7110 and dlr-3 cable. It's connected to "/dev/ttyS1" port. +# First we want to run gnokiiid and connect to phone with fbus. +# Then run gnokii/xgnokii and work over gnokiid (for testing gnokii +# AT emulator and AT module - in normal work gnokiid is not required, because +# 7110 with dlr3 has own AT commands interpreter). +#[global] +#port=/dev/gnokii +#model=ATGSM +#[gnokiid] +#port=/dev/ttyS1 +#model=7110 +#connection=dlr3 + +#4.Nokia 7110 and dau9p cable. It's connected to "/dev/ttyS1" port. +# Gnokii/xgnokii work using fbus protocol (can't use AT commands +# from 7110, when use dau9p) +# Gnokiid uses "default" config +#[global] +#port=/dev/ttyS1 +#model=7110 +#connection=fbus + +#5.Nokia 7110 and dlr-3 cable. We want to connect with it using fbus +# Gnokiid from gnokii is not required (with dlr3 can use AT commands built in +# into phone, not our small ;-) AT interpreter) +#[global] +#port=/dev/ttyS1 +#model=7110 +#connection=dlr3 diff --git a/Docs/examples/logos/gnokii.nol b/Docs/examples/logos/gnokii.nol new file mode 100644 index 0000000..9885942 Binary files /dev/null and b/Docs/examples/logos/gnokii.nol differ diff --git a/Docs/examples/logos/gnokii.xpm b/Docs/examples/logos/gnokii.xpm new file mode 100644 index 0000000..8d4a307 --- /dev/null +++ b/Docs/examples/logos/gnokii.xpm @@ -0,0 +1,303 @@ +/* XPM */ +static char * gnokii_xpm[] = { +"49 44 256 2", +" c None", +". c #020203", +"+ c #4C5A4C", +"@ c #C2CAD2", +"# c #8EA68C", +"$ c #627661", +"% c #0D1210", +"& c #1A2622", +"* c #6E8A6E", +"= c #EAEAEB", +"- c #223A36", +"; c #A3A68E", +"> c #9A9A8A", +", c #A2B2A4", +"' c #DADEDC", +") c #524E4E", +"! c #869E85", +"~ c #8E7666", +"{ c #506250", +"] c #324A46", +"^ c #8F9080", +"/ c #6A626A", +"( c #ADBAAE", +"_ c #7B7A7B", +": c #7E967E", +"< c #667E66", +"[ c #CED2D0", +"} c #566653", +"| c #444244", +"1 c #293E38", +"2 c #878A77", +"3 c #566A56", +"4 c #424A44", +"5 c #121A16", +"6 c #B8C1BA", +"7 c #122E2A", +"8 c #0E0E10", +"9 c #26628E", +"0 c #D6DADA", +"a c #5A82A6", +"b c #768E76", +"c c #373E3A", +"d c #566E86", +"e c #757773", +"f c #E2E2E2", +"g c #545C59", +"h c #6A826A", +"i c #EEEEEF", +"j c #5E725E", +"k c #9EAE9C", +"l c #252D2B", +"m c #9AB2C2", +"n c #A2A692", +"o c #8F9A8F", +"p c #425650", +"q c #7E856D", +"r c #A6B4A6", +"s c #7C8A98", +"t c #BEC6BE", +"u c #AEAEAE", +"v c #1A322E", +"w c #666C68", +"x c #36423C", +"y c #6D6E6E", +"z c #494A49", +"A c #869EB2", +"B c #373A38", +"C c #828676", +"D c #262223", +"E c #4E6682", +"F c #828A72", +"G c #626A68", +"H c #0E0909", +"I c #151E1A", +"J c #9AA28A", +"K c #6E786E", +"L c #666666", +"M c #8E8E8E", +"N c #929E8A", +"O c #92A6B6", +"P c #828F7D", +"Q c #29342F", +"R c #DAD6DA", +"S c #464F46", +"T c #8E968A", +"U c #AEB5B0", +"V c #827A72", +"W c #768574", +"X c #B2BABA", +"Y c #7A8E77", +"Z c #3E423E", +"` c #D2D6D5", +" . c #5A655E", +".. c #82967F", +"+. c #F1F2F2", +"@. c #6E866E", +"#. c #9AAA99", +"$. c #BEBEBF", +"%. c #466686", +"&. c #7A927B", +"*. c #7C7F7B", +"=. c #767E7A", +"-. c #C9CECC", +";. c #1E2626", +">. c #787068", +",. c #9EA28E", +"'. c #0A0507", +"). c #687671", +"!. c #8AA288", +"~. c #829A81", +"{. c #E2E6E3", +"]. c #364644", +"^. c #667A65", +"/. c #5A6E5A", +"(. c #263A36", +"_. c #171615", +":. c #898A8A", +"<. c #5B5A5A", +"[. c #555654", +"}. c #A6A6A6", +"|. c #1C1E1C", +"1. c #7C867E", +"2. c #B2B2B2", +"3. c #BEC2C0", +"4. c #362E32", +"5. c #2E3631", +"6. c #889692", +"7. c #32463E", +"8. c #364A46", +"9. c #9EA292", +"0. c #060708", +"a. c #313E3C", +"b. c #667267", +"c. c #96A795", +"d. c #4D4E4C", +"e. c #889284", +"f. c #9A9A99", +"g. c #828671", +"h. c #3E524E", +"i. c #727E76", +"j. c #2E3A33", +"k. c #B6B6B6", +"l. c #A9AAAA", +"m. c #5A6A6A", +"n. c #646C70", +"o. c #3A4A45", +"p. c #D2D2D2", +"q. c #8C827E", +"r. c #929292", +"s. c #F5F6F6", +"t. c #768A86", +"u. c #7E8E84", +"v. c #6E826C", +"w. c #BABABA", +"x. c #9E9E8E", +"y. c #A2B2BE", +"z. c #616262", +"A. c #728A72", +"B. c #2E2D2D", +"C. c #526262", +"D. c #9AA296", +"E. c #8A9E87", +"F. c #828A84", +"G. c #5B5656", +"H. c #4C524E", +"I. c #060204", +"J. c #7E927B", +"K. c #3A463E", +"L. c #4D564D", +"M. c #4B5A57", +"N. c #828282", +"O. c #869A83", +"P. c #323A34", +"Q. c #728278", +"R. c #6A6662", +"S. c #454645", +"T. c #32423E", +"U. c #969697", +"V. c #625C56", +"W. c #526652", +"X. c #6A869A", +"Y. c #6A726D", +"Z. c #5E6A5E", +"`. c #5A5054", +" + c #CECECE", +".+ c #8A8E7E", +"++ c #768A73", +"@+ c #92AA90", +"#+ c #6A7E69", +"$+ c #C2C6C4", +"%+ c #6A7A68", +"&+ c #726A6A", +"*+ c #272627", +"=+ c #707270", +"-+ c #728670", +";+ c #1A221E", +">+ c #858685", +",+ c #9EA2A4", +"'+ c #D6D6D6", +")+ c #DEDEDE", +"!+ c #191A19", +"~+ c #8EA28A", +"{+ c #9E9E9E", +"]+ c #4E4E56", +"^+ c #DEDADE", +"/+ c #5E5E5E", +"(+ c #56665E", +"_+ c #667272", +":+ c #859686", +"<+ c #CACACA", +"[+ c #121616", +"}+ c #3E3E3E", +"|+ c #AAB2BE", +"1+ c #6E7E6F", +"2+ c #92A690", +"3+ c #4E4A4B", +"4+ c #323631", +"5+ c #5A6A62", +"6+ c #E6E6E6", +"7+ c #929A98", +"8+ c #7C8E7E", +"9+ c #C2C2C2", +"0+ c #3E4E4E", +"a+ c #424E44", +"b+ c #888E8B", +"c+ c #8E9296", +"d+ c #9EAEAA", +"e+ c #3A423D", +"f+ c #3E3A3E", +"g+ c #5F6661", +"h+ c #3A4643", +"i+ c #16221F", +"j+ c #627266", +"k+ c #5A6A5B", +"l+ c #E6E2E6", +"m+ c #969A8A", +"n+ c #1E221E", +"o+ c #C6C6C7", +"p+ c #0A0A0A", +"q+ c #525252", +"r+ c #3E4640", +"s+ c #4A4647", +"t+ c #121211", +"u+ c #4E5E4E", +"v+ c #4A5E56", +"w+ c #465252", +"x+ c #2C3A3A", +"y+ c #6B6A6A", +"z+ c #323A3A", +"A+ c #3E4A42", +"B+ c #A2A2A2", +"C+ c #93A196", +"D+ c #7A7276", +"E+ c #626E65", +"F+ c #DADADA", +"G+ c #BEBABE", +" J V d.q.) x z G.q+S.e+L.Y.1.o l.k.$+ +p.'+p.p.<+$.u {+b+=.G a+x+a.a.a.K.d.h+7 T.- H ", +" v+,.>.G.~ 4 x 4 e 7+3.f = 6+l+f )+)+)+' F+R F+R '+'+p.'+^+^+' )+` 2.e._+A+S | v x+(.H ", +" M.; &+S V.K 2.= i i i = = 6+l+0 R '+p.9+9+<+'+9+o+'+9+'+0 ' ' ^+' F+)+' F+3.b+7.x+(.H ", +" h.; R.e.i F+F+= = = 6+6+6+f {.R.c >+) y q+3+/+:.<.}.B.B+'+F+^+F+^+)+F+)+^+= 6+9+].1 8 ", +" p ,.z.X i '+F+= 6+= 6+f {.)+)+y f.;.q+/+z q+_ y+<.H./+z +F+F+F+)+)+^+)+F+6+= <+0+a.8 ", +" v+; <.$+= '+F+6+6+6+6+6+f f )+R ^+p.p.<+<+ +'+-. + +p. +'+'+F+F+F+F+' F+F+f i +h.T.8 ", +" u+,.G.[ 6+p.'+6+{.{.f l+)+^+'+[ <+o+9+$.w.X G+k.G+G+9+9+$+-.` '+F+F+)+F+F+f i p.M.7.% ", +" C.,.+ F+f +w.P 1.K b. .u+v++ + u+{ { 3 j j+$ ^.^.< %+^.1+1+Q.%+1+W u.e.T [ +.p.C.T.8 ", +" (+x.H.)+' <+E+{ W.W.3 3 3 /./.j j+$ $ $ ^.< #+#+#+h v.@.-+-+A.++Y b &.8+J.( s.p. .].t+ ", +" } x.p {.R $. .{ W.W.W.} 3 3 k+/.j $ $ $ ^.$ < #+#+#+h v.@.A.++A.++Y Y &.J.U +.F+G ].[+D ", +" .> S {.p.$.{ { { W.3 3 /././.j /.j $ $ ^.^.< #+#+#+h -+-+-+++b ++b J.&.J.r s.0 E+7.[+q+ ", +" 3 > h.= +2.} { W.} 3 3 3 /././.$ $ $ $ $ ^.^.#+#+v.v.-+A.Y ++J.J...J.J.: , s.F+Y.h+[+3+ ", +" k+> A+6+<+u W.W.W.W.3 /././.j j j $ ^.^.%+%+#+h h -+v.-+-+++E+:+-+F.: : ..k +.F+Y.].5 s+ ", +" E+^ 4 {.$+}.W.3 3 3 k+/./.j j j $ $ $ ^.< #+#+#+H.!++ ++++b j+l e.;.1+....#.s.^+=+].!+| ", +" E+^ a+{.9+{+{ 3 3 } P.A+r+S g+r+r+P.+ v.u+c r+^.a+I.) Z.S Q.j+_.F n+K ....#.s.^+=+x !+| ", +" j+^ K.l+6 {+W.3 3 P.. D . 8 d.. |.I.'.g+. *+'.p+) . z _.I.e.y I 1.Q *...O.c.s.' y 7.!+| ", +" j ^ o.f $.f.W.k+k+B . >.8 8 3+. H._.0.q+I.w !+. `.. I . 4+N C.|.).l *...~.C++.F+).].I | ", +" b..+r+F+6 U.W././.B . R.8 8 z . [.[+0.q+. R._.I.[.. . . _ : T.l /+% :+! O.2++.0 y 7.i+S. ", +" Q.^ r+p.$.c+W././.B . n.8 8 3+. G.t+'.3+I.y+_.. G.I.. . g+:+n+}+]+8 D.! O.c.i '+n.].i+S. ", +" t..+K.<+3.M W././.4+. _+8 8 3+. [._.'.3+I.y+!+I.<.I.. . *+E.8 S.c _.c.! ! C+s.` m.8.|.| ", +" ++2 r+3.$+:.3 j j B . e 8 8 z . [._.'.]+I.y+_.. G.. e+0.. 1.% }+a.t+D.!.! C+s.[ C.8.& s+ ", +" J.2 4 U <+b+W./.j B I.*+0.8 3+. [._.0./ . D 0.0.V.. H.4+. B I l H.'.o E.!.c.+.<+M.].i+z ", +" A.F r+#.-.:./.j $ K 4 s+. 8 Q.w F.Y.K T E+s+q+>+1.w F.Q.&+D+*._+O. .#.~+!.#.s.<+h.].i+3+ ", +" &.>+e+7+p.:./.j j .p+p+I.B P v.v.v.Q.-+++++++Y Y Y J.....~.~.! O.E.!.!.!.d+s.9+o.].i+d. ", +" : C ].s ` >+b.j $ %+%+Y.K P h h v.@.-+-+++Y Y Y J.&.J.......~.! ! !.!.~+~+r +.w.x 8.i+]+ ", +" 8+g.Z i.^+N.^.j j ^.^.%+%+#+v.v.@.-+-+A.++b b &.&.: : : O.! O.! E.E.~+# # U +.2.x+h+& ) ", +" ..g.Z E+)+N.%+/./.$ ^.< #+#+v.v.-+A.++++++Y Y J.J.......~.! E.!.~+~+~+# @+6 i }.a.8.& q+ ", +" ..g.e++ )+>+%+j $ $ ^.#+#+v.v.-+@.-+++b b Y &.&.J.: ..~.O.E.! E.!.!.# # 2+t = U.a.h+;+q+ ", +" ..g.T.o.)+:.K j $ ^.^.#+#+v.v.-+-+-+++++b Y Y &.J.: ..~.~.O.! ! !.~+# @+@+ +)+N.T.7.;+[. ", +" 6.q a.c +r.y j $ $ < #+h #+v.v.-+A.A.Y ++Y &.J.&.: ~...O.! ! E.E.!.# # @+' ' ).T.o.& G. ", +" e.q a.x 2.}.w j $ $ < #+h v.-+@.-+++A.Y b Y &.J.: : ~.~.O.! !.!.~+~+# 2+# {.[ g 7.].& <. ", +" ..q P.T.{+$._ i.v.Q.v.v.v.@.@.A.++A.++b &.J.J.: ....O.! ! E.! ~+# 2+c.@+, s.$+h.].h+n+<. ", +" o g.P.P.1. +w. +{.= {.' ` -.6 ( #.C+T ..J.J.J...E.~+#.U 6 $+-.-.[ p.p.'++.= X ] ].].n+D ", +" q j.P.G R $.p.f f )+F+[ <+ +<+p.'+' )+f {.6+6+6+6+f ' p.[ <+ +<+<+ +'+F+-.u 1 e+K.n+ ", +" q 5.4+A+R w.X G+$.3.o+<+-.p.p.p. +p. +p.'+R ^+)+f )+F+'+` + +-.<+o+<+o+o+M j.h+].n+ ", +" g.j.j.P.G+k.u 2.u u u u l.u l.2.k.$.o+o+ + +<+<+9+$.$.9+9+o+o+o+o+o+9+$.k.g+x K.K.;+ ", +" F j.P.a.B.| <.z._ {+}.l.}.l.}.}.}.}.l.l.x.{+l.2.w.$.$.$.$.$.$.$.l._ q+S.Q [+x e+e+n+ ", +" q 5.5.4+l -.)+<+B+e /+>+B+B+B+B+B+}.f.<.e e q+U.2.k.w.$.$.G+r.q+/ r.G+o+{+;.x x o.;+ ", +" q 5.5.5.P.l.[ |+p.R p.M <.M {+B+{+{+<. + + +9+[.x.k.k.w.}.[.N.$+<+o+u r.e B.x x K.;+ ", +" q j.j.Q B w '+O a @ F+'+<+R.U.{+B+z.w.9+2.l.G+2.<.u w.k.L o+ + +$+s d ,+| T.].e+e+;+ ", +" g.5.P.5.5.B $+p.m 9 A 9+3.{+:.f.U._ 2.B+4.;.U.u _ M 2.u B+3.3.k.%.E ,+:.l e+].h+r+;+ ", +" q 4+Q Q 4+a._ ` -.d+X.l.{+_ f.{+L u }.U.C M :.B+2.z.2.w.r.B+l.l.s }.{+]+a.].h+h+K.|. ", +" F P.5.5.4+5.c G+o+w.B+b+y {+f.f.y $.2.u l.u 2.u k.y+}.k.G+>+:.f.{+{+>+Q Z h+h+h+h+;+ ", +" F B Q 4+4+4+j.z.9+2.>+*.{+r.r.M :.$.o+<+ + +<+o+9+r.N.u k.w.c+*.f.U.| x e+e+r+r+A+I "}; diff --git a/Docs/examples/logos/gnokii2.nol b/Docs/examples/logos/gnokii2.nol new file mode 100644 index 0000000..03e92cb Binary files /dev/null and b/Docs/examples/logos/gnokii2.nol differ diff --git a/Docs/examples/logos/magic b/Docs/examples/logos/magic new file mode 100644 index 0000000..d1822a4 --- /dev/null +++ b/Docs/examples/logos/magic @@ -0,0 +1,14 @@ +# Add these to magic file (located in /etc or /usr/share/misc) +# to let the file command recognize NOL and NGG files +# +# Pawe³ Kot +# Based on the gnokii (http://www.gnokii.org/) sources + +# GSM Operator Logos - NOL +0 string NOL GSM Operator Logo, NOL format +>10 byte x (size %d x +>12 byte x %d) +# GSM Caller Icons - NGG +0 string NGG GSM Caller Icon, NGG format +>6 byte x (size %d x +>8 byte x %d) diff --git a/Docs/examples/netmon/netmonitordata_6110_433.dat b/Docs/examples/netmon/netmonitordata_6110_433.dat new file mode 100644 index 0000000..442bb2a --- /dev/null +++ b/Docs/examples/netmon/netmonitordata_6110_433.dat @@ -0,0 +1,455 @@ +# GNOKII NETMONITOR PARAMETERS specifications +# (pretty on screen large at least 112 columns) +# +# data in this file are specific to: NOKIA 6110 NSE-3 v4.33 11-03-98 +# +# format of definition of SCREEN +# SCREEN=screen-number:optional-description (separator may be also tab, or spaces) +# +# SCREEN entry may be duplicated, order is not important, we use "test nr" +# screen number must be between 1 and 255 +# +# format of definition of PARAMETERS +# VAR=X:Y:LEN:NMman:TYPE:DESCRIPTION +# (separator may be also tab, or spaces) +# VAR: is name of parameter, it should be as you can see by pressing '*' key +# on phone, from inside a netmonitor menu. +# X,Y: are coordinates x & y, start form 0, 0, upper-left corner. +# LEN: must be specified, and must not be 0. +# NMman: name as referrred in NetMonitor manuals from Marcin Wiacek, +# TYPE : optional, default (predefined), is string, +# else may be D as Decimal or H as Hexadecimal, '-' as predefined. +# so, no matter what you get from phone, on command line parameters +# you can specify if uou want Hex or you want Dec. +# Example is LAC/CID that may be HEX or DEC depending on firmware version. +# TYPE refer to how data is displayed by phone, not to program output! +# DESCRIPTION: description of parameters (optional) +# +# Either Type and Description are optional, so, for parsing reason +# if you want specify Description but not Type, you MUST specify '-' as Type +# no conversions are made in this case. +# +# VAR name implies two problems: +# 1-some parameters can be in more then one screen (example H value) +# so we had changed some names. +# +# 2-some screen report channel parameters, once for every channel +# (example C2, screen 1, 3, 4, 5) +# so we had changed some names also here. +# +# We check duplicate names, data len, presence of netmon man name, ... +# Changed names are described near each interested parameters. +# +# Here we have adopted some convention, as described in comments, if you don't like it +# you can change VAR names in this file and use coherents name on command line. +# +# Order of parameters definition is relevant only for human readability. +# We allow max 512 parameters definition and max 255 screens, +# (defineds in gnokii.h NM_MAX_FIELDS, NM_MAX_SCREENS) +# +# ATTENTION: all names are case sensitive! SCREEN def must be uppercase +# ATTENTION: some firmware versions has some bugs (check screen 34, 38 here) +# in this file all at right of '#' are comments, even if " # enquoted " +# +# Have a lot of fun! +# +# Andrea Scopece, a.scopece@tin.it, 22-08-2000 + +SCREEN 0 Host Date-Time +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +DATE 0 0 10 0 - - Host Date # host date +TIME 0 1 8 0 - - Host Time # host time +#PDATE 0 0 0 0 - - Phone Date # phone date (NOT IMPLEMENTED) +#PTIME 0 0 0 0 - - Phone Time # phone time (NOT IMPLEMENTED) + +# USERS SHOULD NOT CHANGE SCREEN 0 DEFINITIONS, IT REFERS A HOST PARAMETER, NOT PHONE !!!! + +SCREEN 1 Communication with Cell +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +H 0 0 1 1 a # H, changed in screen 2, 7 +CH 1 0 3 1 bbb - Channel +RxL 5 0 3 1 ccc - RxLevel(dB) +TxPwr 9 0 3 1 ddd - TxPower(dBm) +TS 1 1 1 1 e - Time Slot +TA 3 1 2 1 ff - Time advance +RQ 6 1 1 1 g +RLT 8 1 4 1 mmmm +C1 1 2 3 1 nnn +C2 9 2 3 1 ppp +CHT 4 3 4 1 oooo + + +SCREEN 2 More info about used Cell +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +PM 1 0 2 2 aa +RAR 4 0 2 2 b +Ro 6 0 1 2 c +BC 9 0 3 2 Bdd +RelR 1 1 2 2 ee +QLF 6 1 1 2 f + +SCREEN 3 Info about current and neighbor cells (1-2) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +SCH 0 0 3 3 aaa # SCH, changed in screen 11, 66 +0C1 3 0 3 3 bbb # was C1, conflict this and other screen +0rx 6 0 3 3 ccc # was rx, conflict this and other screen +0C2 9 0 3 3 ddd # was C2, conflict this and other screen + +1CH 0 1 3 3 aaa +1C1 3 1 3 3 bbb # idem as above ... +1rx 6 1 3 3 ccc # idem as above ... +1C2 9 1 3 3 ddd # idem as above ... + +2CH 0 2 3 3 aaa +2C1 3 2 3 3 bbb # idem as above ... +2rx 6 2 3 3 ccc # idem as above ... +2C2 9 2 3 3 ddd # idem as above ... + +1N 4 3 2 3 ef +2N 7 3 2 3 gh + + +SCREEN 4 Info about neighbor cells (3-4-5) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +3CH 0 0 3 4 aaa +3C1 3 0 3 4 bbb +3rx 6 0 3 4 ccc +3C2 9 0 3 4 ddd + +4CH 0 1 3 4 aaa +4C1 3 1 3 4 bbb +4rx 6 1 3 4 ccc +4C2 9 1 3 4 ddd + +5CH 0 2 3 4 aaa +5C1 3 2 3 4 bbb +5rx 6 2 3 4 ccc +5C2 9 2 3 4 ddd + +3N 2 3 2 4 ef +4N 5 3 2 4 gh +5N 8 3 2 4 ij + + +SCREEN 5 Info about neighbor cells (6-7-8) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +6CH 0 0 3 5 aaa +6C1 3 0 3 5 bbb +6rx 6 0 3 5 ccc +6C2 9 0 3 5 ddd + +7CH 0 1 3 5 aaa +7C1 3 1 3 5 bbb +7rx 6 1 3 5 ccc +7C2 9 1 3 5 ddd + +8CH 0 2 3 5 aaa +8C1 3 2 3 5 bbb +8rx 6 2 3 5 ccc +8C2 9 2 3 5 ddd + +6N 2 3 2 5 ef +7N 5 3 2 5 gh +8N 8 3 2 5 ij + + +SCREEN 6 Preferred and forbidden networks +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +LReg 0 0 5 6 aaabb +1_Pre 0 1 5 6 aaabb +2_Pre 0 2 5 6 aaabb +3_Pre 0 3 5 6 aaabb + +1_For 7 0 5 6 aaabb +2_For 7 1 5 6 aaabb +3_For 7 2 5 6 aaabb +4_For 7 3 5 6 aaabb + + +SCREEN 7 Info about last monitored cell +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +E 0 1 1 7 a +A 2 1 1 7 b +Ho 4 1 1 7 c # was H, conflict screen 1, 2 +C 6 1 1 7 d +I 8 1 1 7 e +BR 10 1 2 7 fg + +SCREEN 8 NO TEST +SCREEN 9 NO TEST +SCREEN 9 NO TEST + +SCREEN 10 "Network information (last monitored cell) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TMSI 4 0 8 10 aaaaaaaa H +T3212 5 1 7 10 bbb-ccc +PaRP 4 2 1 10 d +DSF 7 2 2 10 ee +AGC 10 2 2 10 ff +AFC 1 3 5 10 ggggg +Ch 9 3 3 10 hhh + +SCREEN 11 Cell identification +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MCC 3 0 3 11 xxx +MNC 9 0 2 11 xxx +LAC 6 1 4 11 xxx H +sch 7 2 3 11 xxx # was SCH, conflict in screen 3, 66 +CID 6 3 4 11 xxx H + +SCREEN 12 Network parameters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +Cipher 8 0 3 12 aaa +Hopping 8 1 3 12 bbb +DTX 8 2 3 12 ccc +IMSI 8 3 3 12 ddd + +SCREEN 13 Info DTX / Network +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +DTXMode 0 0 10 13 aaaaaaaaaa +DTX_Def 9 1 3 13 bbb +DTX_BS 9 2 3 13 ccc + +SCREEN 14 NO TEST +SCREEN 15 NO TEST +SCREEN 16 NO TEST + +SCREEN 17 BTS channel test +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +BTS 4 2 3 17 aaa + +SCREEN 18 NO TEST + +SCREEN 19 Cell selection +CBARR 2 2 8 19 aaaaaaaa + +SCREEN 20 Battery and phone charger mode +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +BatVol 1 0 3 20 aaa +ChMod 6 0 5 20 bbbbb +BTemp 2 1 3 20 ccc +ChTime 8 1 3 20 ddd +ChrgVol 2 2 3 20 eee +Pwm 8 2 3 20 fff +BTyp 1 3 4 20 gggg +BFDC 7 3 4 20 hhhh + +SCREEN 21 Charger parameters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MTDif 1 0 4 21 aaaa +MPDif 7 0 4 21 bbbb +BUpV 2 1 3 21 ccc +BDownV 8 1 3 21 ddd +AverV 2 2 3 21 eee +SumMF 8 2 3 21 fff + +SCREEN 22 Charger parameters and indicators +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +DeriC 1 0 4 22 aaaa +ChAm 7 0 4 22 bbbb +Vdif 1 1 4 22 cccc +VDrop 7 1 4 22 dddd +VDTi 1 2 4 22 eeee +AvDif 7 2 4 22 ffff +Temp 1 3 4 22 gggg +Volt 7 3 4 22 hhhh + +SCREEN 23 Battery full detection +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TxOn 1 0 4 23 aaaa +TxOff 7 0 4 23 bbbb +ChCur 1 1 4 23 cccc +Stdby 7 1 4 23 dddd +Age 0 2 3 23 eee +CAP 4 2 3 23 fff +Curr 8 2 4 23 gggg +Tmp 0 3 3 23 hhh +CmAh 4 3 4 23 iiii +Targ 8 3 4 23 jjjj + +SCREEN 24 NO TEST +SCREEN 25 NO TEST +SCREEN 26 NO TEST +SCREEN 27 NO TEST +SCREEN 28 NO TEST +SCREEN 29 NO TEST +SCREEN 30 NO TEST +SCREEN 31 NO TEST +SCREEN 32 NO TEST +SCREEN 33 NO TEST +SCREEN 34 NO TEST + +SCREEN 35 Last reboot +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +ResetReason 1 0 5 35 aaaaa +TaskName 1 1 8 35 bbbbbbbb + +SCREEN 36 Info about rebootings +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +UN 1 0 2 36 aa +WD 5 0 2 36 bb +DSP 9 0 2 36 cc +SIM 1 1 2 36 dd +IDL 5 1 2 36 ee +STK 9 1 2 36 ff + +SCREEN 37 NO TEST +SCREEN 38 NO TEST + +SCREEN 39 Last connection status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +CC 7 0 2 39 aa # CC, changed in screen 85 +MM 7 1 2 39 bb # MM, changed in screen 86 +RR 7 2 2 39 cc # RR, changed in screen 86 + +SCREEN 40 Reset Handover Counters # only for manual reset + +SCREEN 41 Info about handover +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +HandOOK 9 0 3 41 aaa +PrevCh 9 1 3 41 bbb +HoNotOK 9 2 3 41 ccc +HoIntra 9 3 3 41 ddd + +SCREEN 42 NO TEST + +SCREEN 43 T200 counter expired +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +T200MS 9 0 3 43 aaa +T200BS 9 1 3 43 bbb + +SCREEN 44 NO TEST +SCREEN 45 NO TEST +SCREEN 46 NO TEST +SCREEN 47 NO TEST +SCREEN 48 NO TEST +SCREEN 49 NO TEST +SCREEN 50 NO TEST +SCREEN 51 NO TEST +SCREEN 52 NO TEST +SCREEN 53 NO TEST + +SCREEN 54 Info about memory block free +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +ResF1 1 0 5 54 aa-bb # split these, if you like ... +ResF2 7 0 5 54 aa-bb +ResF3 1 1 5 54 aa-bb +ResF4 7 1 5 54 aa-bb +ResF5 1 2 5 54 aa-bb +ResF6 7 2 5 54 aa-bb +ResF7 1 3 5 54 aa-bb +ResF8 7 3 5 54 aa-bb + +SCREEN 55 NO TEST + +SCREEN 56 Block display +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +Ptr 1 0 6 56 aaaaaa +Cntr 9 0 3 56 bbb +Task 1 1 8 56 cccccccc + +SCREEN 57 Memory status before reset +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +StatusOfStacks1 0 0 12 57 aaaaaaaaaaaa # You really need this ? +StatusOfStacks2 0 1 12 57 aaaaaaaaaaaa # This is a composite field 1,2,3 +StatusOfStacks3 0 2 2 57 aa # but if you want ... +BlockSets 0 3 8 57 bbbbbbbb + +SCREEN 58 NO TEST +SCREEN 59 NO TEST + +SCREEN 60 Reset counters + +SCREEN 61 Counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +NOPSW 8 0 4 61 aaaa H +SYNCR 8 1 4 61 bbbb H # SYNCR, changed on screen 62 +RESEL 8 2 4 61 cccc H + +SCREEN 62 Counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +PSW 7 0 4 62 aaaa H +SYNCRm 7 1 4 62 bbbb H # was SYNCR, conflict in screen 61 +BCCH 7 2 4 62 cccc H +BCCHE 7 3 4 62 dddd H + +SCREEN 63 Call counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +CalRel 3 0 2 63 aa +RelDi 9 0 2 63 bb +MOCAtmp 2 1 3 63 ccc +MOOK 8 1 3 63 ddd # MOOK, changed in screen 65 +AllMT 2 2 3 63 eee +MTOK 8 2 3 63 fff # MTOK, changed in screen 65 + +SCREEN 64 NO TEST +SCREEN 65 NO TEST +SCREEN 66 NO TEST +SCREEN 67 NO TEST +SCREEN 68 NO TEST +SCREEN 69 NO TEST + +SCREEN 70 (unknown) + +SCREEN 71 NO TEST +SCREEN 72 NO TEST +SCREEN 73 NO TEST +SCREEN 74 NO TEST +SCREEN 75 NO TEST +SCREEN 76 NO TEST +SCREEN 77 NO TEST +SCREEN 78 NO TEST +SCREEN 79 NO TEST +SCREEN 80 NO TEST +SCREEN 81 NO TEST +SCREEN 82 NO TEST + +SCREEN 83 Show Task Stacks + +SCREEN 84 status ... ?? +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +IDLE 1 0 4 84 aaaa +DEV_IO 6 0 4 84 bbbb +LOCAL 1 1 4 84 cccc +MDISND 6 1 4 84 dddd +MDIRCV 1 2 4 84 eeee +UI 6 2 4 84 ffff +TONE 1 3 4 84 gggg +PN 6 3 4 84 hhhh + +SCREEN 85 Connection info ?? +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +IRDA 1 0 4 85 aaaa +FBUS 6 0 4 85 bbbb +AUD 1 1 4 85 cccc +L1CTRL 6 1 4 85 dddd +L1MEA 1 2 4 85 eeee +L1SYSP 6 2 4 85 ffff +L2 1 3 4 85 gggg +CCC 6 3 4 85 hhhh # was CC, conflict screen 39 + +SCREEN 86 Memories status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MMM 1 0 4 86 aaaa # was MM, conflict screen 39 +RRR 6 0 4 86 bbbb # was RR, conflict screen 39 +RM 1 1 4 86 cccc +SMS 6 1 4 86 dddd +EM 1 2 4 86 eeee +SIMUPL 6 2 4 86 ffff +SIML2 1 3 4 86 gggg +DDI 6 3 4 86 hhhh + +SCREEN 87 OS system stack +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +FIQ 2 0 3 87 aaa +IRQ 7 0 3 87 bbb + +SCREEN 88 Phone Hw/Firmware info 1 +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MCUSW 0 0 5 88 aaaaa +PPM 6 0 6 88 bbbbbb +MCUDate 6 1 6 88 cccccc +ChkSum 7 2 4 88 dddd H +DSPVer 0 3 12 88 eeeeeeeeeeee + +SCREEN 89 NO TEST diff --git a/Docs/examples/netmon/netmonitordata_6150_413.dat b/Docs/examples/netmon/netmonitordata_6150_413.dat new file mode 100644 index 0000000..27a7cb6 --- /dev/null +++ b/Docs/examples/netmon/netmonitordata_6150_413.dat @@ -0,0 +1,600 @@ +# GNOKII NETMONITOR PARAMETERS specifications +# (pretty on screen large at least 112 columns) +# +# data in this file are specific to: NOKIA 6150 NSM-1 v4.13 +# +# format of definition of SCREEN +# SCREEN=screen-number:optional-description (separator may be also tab, or spaces) +# +# SCREEN entry may be duplicated, order is not important, we use "test nr" +# screen number must be between 1 and 255 +# +# format of definition of PARAMETERS +# VAR=X:Y:LEN:NMman:TYPE:DESCRIPTION +# (separator may be also tab, or spaces) +# VAR: is name of parameter, it should be as you can see by pressing '*' key +# on phone, from inside a netmonitor menu. +# X,Y: are coordinates x & y, start form 0, 0, upper-left corner. +# LEN: must be specified, and must not be 0. +# NMman: name as referrred in NetMonitor manuals from Marcin Wiacek, +# TYPE : optional, default (predefined), is string, +# else may be D as Decimal or H as Hexadecimal, '-' as predefined. +# so, no matter what you get from phone, on command line parameters +# you can specify if uou want Hex or you want Dec. +# Example is LAC/CID that may be HEX or DEC depending on firmware version. +# TYPE refer to how data is displayed by phone, not to program output! +# DESCRIPTION: description of parameters (optional) +# +# Either Type and Description are optional, so, for parsing reason +# if you want specify Description but not Type, you MUST specify '-' as Type +# no conversions are made in this case. +# +# VAR name implies two problems: +# 1-some parameters can be in more then one screen (example H value) +# so we had changed some names. +# +# 2-some screen report channel parameters, once for every channel +# (example C2, screen 1, 3, 4, 5) +# so we had changed some names also here. +# +# We check duplicate names, data len, presence of netmon man name, ... +# Changed names are described near each interested parameters. +# +# Here we have adopted some convention, as described in comments, if you don't like it +# you can change VAR names in this file and use coherents name on command line. +# +# Order of parameters definition is relevant only for human readability. +# We allow max 512 parameters definition and max 255 screens, +# (defineds in gnokii.h NM_MAX_FIELDS, NM_MAX_SCREENS) +# +# ATTENTION: all names are case sensitive! SCREEN def must be uppercase +# ATTENTION: some firmware versions has some bugs (check screen 34, 38 here) +# in this file all at right of '#' are comments, even if " # enquoted " +# +# Have a lot of fun! +# +# Andrea Scopece, a.scopece@tin.it, 22-08-2000 + +SCREEN 0 Host Date-Time +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +DATE 0 0 10 0 - - Host Date # host date +TIME 0 1 8 0 - - Host Time # host time +#PDATE 0 0 0 0 - - Phone Date # phone date (NOT IMPLEMENTED) +#PTIME 0 0 0 0 - - Phone Time # phone time (NOT IMPLEMENTED) + +# USERS SHOULD NOT CHANGE SCREEN 0 DEFINITIONS, IT REFERS A HOST PARAMETER, NOT PHONE !!!! + +SCREEN 1 Communication with Cell +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +H 0 0 1 1 a # H, changed in screen 2, 7 +CH 1 0 3 1 bbb - Channel +RxL 5 0 3 1 ccc - RxLevel(dB) +TxPwr 9 0 3 1 ddd - TxPower(dBm) +TS 1 1 1 1 e - Time Slot +TA 3 1 2 1 ff - Time advance +RQ 6 1 1 1 g +RLT 8 1 4 1 mmmm +C1 1 2 3 1 nnn +C2 9 2 3 1 ppp +CHT 4 3 4 1 oooo + + +SCREEN 2 More info about used Cell +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +PM 1 0 2 2 aa +RAR 4 0 2 2 b +Ro 6 0 1 2 c +BC 9 0 3 2 Bdd +RelR 1 1 2 2 ee +QLF 6 1 1 2 f +CRO 1 2 3 2 ggg +TO 5 2 2 2 hh +PenT 8 2 3 2 iii +H2 1 3 3 2 j # was H, conflict screen 1 +MAIO 5 3 2 2 mm +HSN 8 3 2 2 nn + + +SCREEN 3 Info about current and neighbor cells (1-2) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +SCH 0 0 3 3 aaa # SCH, changed in screen 11, 66 +0C1 3 0 3 3 bbb # was C1, conflict this and other screen +0rx 6 0 3 3 ccc # was rx, conflict this and other screen +0C2 9 0 3 3 ddd # was C2, conflict this and other screen + +1CH 0 1 3 3 aaa +1C1 3 1 3 3 bbb # idem as above ... +1rx 6 1 3 3 ccc # idem as above ... +1C2 9 1 3 3 ddd # idem as above ... + +2CH 0 2 3 3 aaa +2C1 3 2 3 3 bbb # idem as above ... +2rx 6 2 3 3 ccc # idem as above ... +2C2 9 2 3 3 ddd # idem as above ... + +1N 4 3 2 3 ef +2N 7 3 2 3 gh + + +SCREEN 4 Info about neighbor cells (3-4-5) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +3CH 0 0 3 4 aaa +3C1 3 0 3 4 bbb +3rx 6 0 3 4 ccc +3C2 9 0 3 4 ddd + +4CH 0 1 3 4 aaa +4C1 3 1 3 4 bbb +4rx 6 1 3 4 ccc +4C2 9 1 3 4 ddd + +5CH 0 2 3 4 aaa +5C1 3 2 3 4 bbb +5rx 6 2 3 4 ccc +5C2 9 2 3 4 ddd + +3N 2 3 2 4 ef +4N 5 3 2 4 gh +5N 8 3 2 4 iJ + + +SCREEN 5 Info about neighbor cells (6-7-8) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +6CH 0 0 3 5 aaa +6C1 3 0 3 5 bbb +6rx 6 0 3 5 ccc +6C2 9 0 3 5 ddd + +7CH 0 1 3 5 aaa +7C1 3 1 3 5 bbb +7rx 6 1 3 5 ccc +7C2 9 1 3 5 ddd + +8CH 0 2 3 5 aaa +8C1 3 2 3 5 bbb +8rx 6 2 3 5 ccc +8C2 9 2 3 5 ddd + +6N 2 3 2 5 ef +7N 5 3 2 5 gh +8N 8 3 2 5 iJ + + +SCREEN 6 Preferred and forbidden networks +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +LReg 0 0 5 6 aaabb +1_Pre 0 1 5 6 aaabb +2_Pre 0 2 5 6 aaabb +3_Pre 0 3 5 6 aaabb + +1_For 7 0 5 6 aaabb +2_For 7 1 5 6 aaabb +3_For 7 2 5 6 aaabb +4_For 7 3 5 6 aaabb + + +SCREEN 7 Info about last monitored cell +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +E 0 1 1 7 a +A 2 1 1 7 b +Ho 4 1 1 7 c # was H, conflict screen 1, 2 +C 6 1 1 7 d +I 8 1 1 7 e +BR 10 1 2 7 fg + +ECSC 2 3 1 7 h +2Ter 7 3 1 7 i +MB 11 3 1 7 j + +SCREEN 8 NO TEST +SCREEN 9 NO TEST +SCREEN 9 NO TEST + +SCREEN 10 "Network information (last monitored cell) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TMSI 4 0 8 10 aaaaaaaa H +T3212 5 1 7 10 bbb-ccc +PaRP 4 2 1 10 d +DSF 7 2 2 10 ee +AGC 10 2 2 10 ff +AFC 1 3 5 10 ggggg +Ch 9 3 3 10 hhh + +SCREEN 11 Cell identification +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MCC 3 0 3 11 xxx +MNC 9 0 2 11 xxx +LAC 5 1 5 11 xxx D +sch 7 2 3 11 xxx # was SCH, conflict in screen 3, 66 +CID 5 3 5 11 xxx D + +SCREEN 12 Network parameters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +Cipher 8 0 3 12 aaa +Hopping 8 1 3 12 bbb +DTX 8 2 3 12 ccc +IMSI 8 3 3 12 ddd + +SCREEN 13 Info DTX / Network +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +DTXMode 0 0 10 13 aaaaaaaaaa +DTX_Def 9 1 3 13 bbb +DTX_BS 9 2 3 13 ccc + +SCREEN 14 NO TEST +SCREEN 15 NO TEST +SCREEN 16 NO TEST + +SCREEN 17 BTS channel test +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +BTS 4 2 3 17 aaa + +SCREEN 18 Lights status +LIGHTS 4 2 3 18 aaa + +SCREEN 19 Cell selection +CBARR 2 2 8 19 aaaaaaaa + +SCREEN 20 Battery and phone charger mode +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +BatVol 1 0 3 20 aaa +ChMod 6 0 5 20 bbbbb +BTemp 2 1 3 20 ccc +ChTime 8 1 3 20 ddd +ChrgVol 2 2 3 20 eee +Pwm 8 2 3 20 fff +BTyp 1 3 4 20 gggg +BFDC 7 3 4 20 hhhh + +SCREEN 21 Charger parameters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MTDif 1 0 4 21 aaaa +MPDif 7 0 4 21 bbbb +BUpV 2 1 3 21 ccc +BDownV 8 1 3 21 ddd +AverV 2 2 3 21 eee +SumMF 8 2 3 21 fff + +SCREEN 22 Charger parameters and indicators +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +DeriC 1 0 4 22 aaaa +ChAm 7 0 4 22 bbbb +Vdif 1 1 4 22 cccc +VDrop 7 1 4 22 dddd +VDTi 1 2 4 22 eeee +AvDif 7 2 4 22 ffff +Temp 1 3 4 22 gggg +Volt 7 3 4 22 hhhh + +SCREEN 23 Battery full detection +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TxOn 1 0 4 23 aaaa +TxOff 7 0 4 23 bbbb +ChCur 1 1 4 23 cccc +Stdby 7 1 4 23 dddd +Age 0 2 3 23 eee +CAP 4 2 3 23 fff +Curr 8 2 4 23 gggg +Tmp 0 3 3 23 hhh +CmAh 4 3 4 23 iiii +Targ 8 3 4 23 jjjj + +SCREEN 24 NO TEST +SCREEN 25 NO TEST +SCREEN 26 NO TEST +SCREEN 27 NO TEST +SCREEN 28 NO TEST +SCREEN 29 NO TEST + +SCREEN 30 Audio API registers +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +A1Cnf 1 0 4 30 aaaa +A2Cnf 6 0 4 30 bbbb +ST 1 1 4 30 cccc +AU3 6 1 4 30 dddd +1Tone 1 2 4 30 eeee +2Tone 6 2 4 30 ffff +Conf 1 3 4 30 gggg +HFVol 6 3 4 30 hhhh + + +SCREEN 31 NO TEST +SCREEN 32 NO TEST +SCREEN 33 NO TEST + +SCREEN 34 Info about connection type +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +CM 0 0 2 34 aa +LD 2 0 2 34 bb +LM 4 0 2 34 cc +NM 6 0 2 34 dd + +PEC 0 1 2 34 ee # Hmmf, hard to make this screen well defined ... +FEC 2 1 2 34 ff +OEC 4 1 2 34 gg +ACC 6 1 2 34 hh +RXS 8 1 2 34 iii + +inf 10 1 2 34 xxx # NEW PARAM, [P] when active infrared, +# # else [-] + # you can verify it only by phone + +TXS 12 1 2 34 jjj # ATT:this seems on line 2 but really + # is on x=12, y=1 + +Mod 0 2 3 34 k-m # ATT:this seems on line 3 but really + # is on x=0, y=2 + # Mod, changed in screen 75 + +SCREEN 35 Last reboot +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +ResetReason 1 0 5 35 aaaaa +TaskName 1 1 8 35 bbbbbbbb + +SCREEN 36 Info about rebootings +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +UN 1 0 2 36 aa +WD 5 0 2 36 bb +DSP 9 0 2 36 cc +SIM 1 1 2 36 dd +IDL 5 1 2 36 ee +STK 9 1 2 36 ff + +SCREEN 37 NO TEST + +SCREEN 38 Memory dump (firmware bug ?) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +LINE1 0 0 53 38 aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + # may be a bug, it return only line 0, len=53 + # this exceed --netmonitor Screen[50], so crash! + +SCREEN 39 Last connection status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +CC 7 0 2 39 aa # CC, changed in screen 85 +MM 7 1 2 39 bb # MM, changed in screen 86 +RR 7 2 2 39 cc # RR, changed in screen 86 + +SCREEN 40 Reset Handover Counters # only for manual reset + +SCREEN 41 Info about handover +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +GGok 1 0 4 41 aaaa +DDok 7 0 4 41 bbbb +GDok 1 1 4 41 cccc +DGok 7 1 4 41 dddd + +GGf 0 2 3 41 aaa +DDf 3 2 3 41 bbb +GDf 6 2 3 41 ccc +DGf 9 2 3 41 ddd + +GGb 0 3 3 41 aaa +DDb 3 3 3 41 bbb +GDb 6 3 3 41 ccc +DGb 9 3 3 41 ddd + + +SCREEN 42 Info about intracell handover (broken ? all zeroes) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment + +IGGok 1 0 4 42 aaaa +IDDok 7 0 4 42 bbbb +IGDok 1 1 4 42 cccc +IDGok 7 1 4 42 dddd + +IGGf 0 2 3 42 aaa +IDDf 3 2 3 42 bbb +IGDf 6 2 3 42 ccc +IDGf 9 2 3 42 ddd + +IGGb 0 3 3 42 aaa +IDDb 3 3 3 42 bbb +IGDb 6 3 3 42 ccc +IDGb 9 3 3 42 ddd + + +SCREEN 43 T200 counter expired +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +T200MS 8 0 4 43 aaaa +T200BS 8 1 4 43 bbbb + +SCREEN 44 NO TEST + +SCREEN 45 Trasmitter status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TRASM 2 2 8 45 aaaaaaaa + +SCREEN 46 NO TEST +SCREEN 47 NO TEST +SCREEN 48 NO TEST +SCREEN 49 NO TEST +SCREEN 50 NO TEST + +SCREEN 51 Info about SIM card +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +VSel 0 0 3 51 aaa +Bau 4 0 3 51 bbb +SAl 8 0 3 51 ccc + +SCond 1 1 8 51 dddddddd +# CStop 1 0 0 51 # firmware bug ? + +PIN1 1 2 1 51 e +PIN2 3 2 1 51 f +PUK1 6 2 2 51 gg +PUK2 9 2 2 51 hh + +ATR 2 3 1 51 i +FE_PE 6 3 4 51 jjjj + +SCREEN 52 NO TEST +SCREEN 53 NO TEST + +SCREEN 54 Info about memory block free +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +ResF1 1 0 5 54 aa-bb # split these, if you like ... +ResF2 7 0 5 54 aa-bb +ResF3 1 1 5 54 aa-bb +ResF4 7 1 5 54 aa-bb +ResF5 1 2 5 54 aa-bb +ResF6 7 2 5 54 aa-bb +ResF7 1 3 5 54 aa-bb +ResF8 7 3 5 54 aa-bb + +SCREEN 55 NO TEST + +SCREEN 56 Block display +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +Ptr 1 0 6 56 aaaaaa +Cntr 9 0 3 56 bbb +Task 1 1 8 56 cccccccc + +SCREEN 57 Memory status before reset +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +StatusOfStacks1 0 0 12 57 aaaaaaaaaaaa # You really need this ? +StatusOfStacks2 0 1 12 57 aaaaaaaaaaaa # This is a composite field 1,2,3 +StatusOfStacks3 0 2 2 57 aa # but if you want ... +BlockSets 0 3 8 57 bbbbbbbb + +SCREEN 58 NO TEST +SCREEN 59 NO TEST + +SCREEN 60 Reset counters + +SCREEN 61 Counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +NOPSW 8 0 4 61 aaaa H +SYNCR 8 1 4 61 bbbb H # SYNCR, changed on screen 62 +RESEL 8 2 4 61 cccc H + +SCREEN 62 Counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +PSW 7 0 4 62 aaaa H +SYNCRm 7 1 4 62 bbbb H # was SYNCR, conflict in screen 61 +BCCH 7 2 4 62 cccc H +BCCHE 7 3 4 62 dddd H + +SCREEN 63 Call counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +CalRel 3 0 2 63 aa +RelDi 9 0 2 63 bb +MOCAtmp 2 1 3 63 ccc +MOOK 8 1 3 63 ddd # MOOK, changed in screen 65 +AllMT 2 2 3 63 eee +MTOK 8 2 3 63 fff # MTOK, changed in screen 65 + +SCREEN 64 Location update counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +NFai 2 0 2 64 aa +NL 5 0 3 64 bbb +NLOK 9 0 3 64 ccc +Pfai 2 1 2 64 dd +PL 5 1 3 64 eee +PLOK 9 1 3 64 fff + +SCREEN 65 SMS counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +SFai 2 0 2 65 aa +MO 5 0 3 65 bbb +MOOKs 9 0 3 65 ccc # was MOOK conflict screen 63 +RFai 2 1 2 65 dd +MT 5 1 3 65 eee +MTOKs 9 1 3 65 fff # was MTOK, conflict screen 63 +Sched 0 2 4 65 gggg + +SCREEN 66 SMS timeout counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TR1 0 0 3 66 aaa +TR2 0 0 3 66 bbb +TRA 0 0 2 66 cc +TC1 0 0 3 66 ddd +TC2 0 0 3 66 eee +SCHED 0 0 2 66 ff # was SCH, conflict screen 3, 11 + +SCREEN 67 NO TEST +SCREEN 68 NO TEST +SCREEN 69 NO TEST +SCREEN 70 NO TEST +SCREEN 71 NO TEST +SCREEN 72 NO TEST +SCREEN 73 NO TEST +SCREEN 74 NO TEST + +SCREEN 75 Audio option status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +ExAuSt 4 0 8 75 aaaaaaaa # was mod, conflict screen 34 +AudReq 8 1 4 75 bbbb H +AccMod 8 2 2 75 cc H # len diff from netmon manuals +H2Path 8 3 2 75 dd H + +SCREEN 76 NO TEST +SCREEN 77 NO TEST +SCREEN 78 NO TEST +SCREEN 79 NO TEST + +SCREEN 80 Reset Timers + +SCREEN 81 Timers status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TIMSTS 2 2 8 81 aaaaaaaa + +SCREEN 82 Timers values +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +PwrOn 0 0 5 82 aaaaa +InServ 6 0 5 82 bbbbb +NSPS 0 1 5 82 ccccc +TxON 6 1 5 82 ddddd +TSt 8 2 3 82 eee + +SCREEN 83 Show Task Stacks + +SCREEN 84 status ... ?? +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +IDLE 1 0 4 84 aaaa +DEV_IO 6 0 4 84 bbbb +LOCAL 1 1 4 84 cccc +MDISND 6 1 4 84 dddd +MDIRCV 1 2 4 84 eeee +UI 6 2 4 84 ffff +TONE 1 3 4 84 gggg +PN 6 3 4 84 hhhh + +SCREEN 85 Connection info ?? +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +IRDA 1 0 4 85 aaaa +FBUS 6 0 4 85 bbbb +AUD 1 1 4 85 cccc +L1CTRL 6 1 4 85 dddd +L1MEA 1 2 4 85 eeee +L1SYSP 6 2 4 85 ffff +L2 1 3 4 85 gggg +CCC 6 3 4 85 hhhh # was CC, conflict screen 39 + +SCREEN 86 Memories status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MMM 1 0 4 86 aaaa # was MM, conflict screen 39 +RRR 6 0 4 86 bbbb # was RR, conflict screen 39 +RM 1 1 4 86 cccc +SMS 6 1 4 86 dddd +EM 1 2 4 86 eeee +SIMUPL 6 2 4 86 ffff +SIML2 1 3 4 86 gggg +DDI 6 3 4 86 hhhh + +SCREEN 87 OS system stack +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +FIQ 2 0 3 87 aaa +IRQ 7 0 3 87 bbb + +SCREEN 88 Phone Hw/Firmware info 1 +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MCUSW 0 0 5 88 aaaaa +PPM 6 0 6 88 bbbbbb +MCUDate 6 1 6 88 cccccc +ChkSum 7 2 4 88 dddd H +DSPVer 0 3 12 88 eeeeeeeeeeee + +SCREEN 89 Phone Hw/Firmware info 2A +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +HW 4 0 4 89 aaaa +TXT 4 1 7 89 Ubbbbbb diff --git a/Docs/examples/netmon/netmonitordata_6150_522.dat b/Docs/examples/netmon/netmonitordata_6150_522.dat new file mode 100644 index 0000000..e8f88cf --- /dev/null +++ b/Docs/examples/netmon/netmonitordata_6150_522.dat @@ -0,0 +1,596 @@ +# GNOKII NETMONITOR PARAMETERS specifications +# (pretty on screen large at least 112 columns) +# +# data in this file are specific to: NOKIA 6150 NSM-1 v5.22 +# +# format of definition of SCREEN +# SCREEN=screen-number:optional-description (separator may be also tab, or spaces) +# +# SCREEN entry may be duplicated, order is not important, we use "test nr" +# screen number must be between 1 and 255 +# +# format of definition of PARAMETERS +# VAR=X:Y:LEN:NMman:TYPE:DESCRIPTION +# (separator may be also tab, or spaces) +# VAR: is name of parameter, it should be as you can see by pressing '*' key +# on phone, from inside a netmonitor menu. +# X,Y: are coordinates x & y, start form 0, 0, upper-left corner. +# LEN: must be specified, and must not be 0. +# NMman: name as referrred in NetMonitor manuals from Marcin Wiacek, +# TYPE : optional, default (predefined), is string, +# else may be D as Decimal or H as Hexadecimal, '-' as predefined. +# so, no matter what you get from phone, on command line parameters +# you can specify if uou want Hex or you want Dec. +# Example is LAC/CID that may be HEX or DEC depending on firmware version. +# TYPE refer to how data is displayed by phone, not to program output! +# DESCRIPTION: description of parameters (optional) +# +# Either Type and Description are optional, so, for parsing reason +# if you want specify Description but not Type, you MUST specify '-' as Type +# no conversions are made in this case. +# +# VAR name implies two problems: +# 1-some parameters can be in more then one screen (example H value) +# so we had changed some names. +# +# 2-some screen report channel parameters, once for every channel +# (example C2, screen 1, 3, 4, 5) +# so we had changed some names also here. +# +# We check duplicate names, data len, presence of netmon man name, ... +# Changed names are described near each interested parameters. +# +# Here we have adopted some convention, as described in comments, if you don't like it +# you can change VAR names in this file and use coherents name on command line. +# +# Order of parameters definition is relevant only for human readability. +# We allow max 512 parameters definition and max 255 screens, +# (defineds in gnokii.h NM_MAX_FIELDS, NM_MAX_SCREENS) +# +# ATTENTION: all names are case sensitive! SCREEN def must be uppercase +# ATTENTION: some firmware versions has some bugs (check screen 34 here) +# in this file all at right of '#' are comments, even if " # enquoted " +# +# Have a lot of fun! +# +# Andrea Scopece, a.scopece@tin.it, 22-08-2000 + +SCREEN 0 Host Date-Time +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +DATE 0 0 10 0 - - Host Date # host date +TIME 0 1 8 0 - - Host Time # host time +#PDATE 0 0 0 0 - - Phone Date # phone date (NOT IMPLEMENTED) +#PTIME 0 0 0 0 - - Phone Time # phone time (NOT IMPLEMENTED) + +# USERS SHOULD NOT CHANGE SCREEN 0 DEFINITIONS, IT REFERS A HOST PARAMETER, NOT PHONE !!!! + +SCREEN 1 Communication with Cell +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +H 0 0 1 1 a # H, changed in screen 2, 7 +CH 1 0 3 1 bbb - Channel +RxL 5 0 3 1 ccc - RxLevel(dB) +TxPwr 9 0 3 1 ddd - TxPower(dBm) +TS 1 1 1 1 e - Time Slot +TA 3 1 2 1 ff - Time advance +RQ 6 1 1 1 g +RLT 8 1 4 1 mmmm +C1 1 2 3 1 nnn +C2 9 2 3 1 ppp +CHT 4 3 4 1 oooo + + +SCREEN 2 More info about used Cell +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +PM 1 0 2 2 aa +RAR 4 0 2 2 b +Ro 6 0 1 2 c +BC 9 0 3 2 Bdd +RelR 1 1 2 2 ee +QLF 6 1 1 2 f +CRO 1 2 3 2 ggg +TO 5 2 2 2 hh +PenT 8 2 3 2 iii +H2 1 3 3 2 j # was H, conflict screen 1 +MAIO 5 3 2 2 mm +HSN 8 3 2 2 nn + + +SCREEN 3 Info about current and neighbor cells (1-2) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +SCH 0 0 3 3 aaa # SCH, changed in screen 11, 66 +0C1 3 0 3 3 bbb # was C1, conflict this and other screen +0rx 6 0 3 3 ccc # was rx, conflict this and other screen +0C2 9 0 3 3 ddd # was C2, conflict this and other screen + +1CH 0 1 3 3 aaa +1C1 3 1 3 3 bbb # idem as above ... +1rx 6 1 3 3 ccc # idem as above ... +1C2 9 1 3 3 ddd # idem as above ... + +2CH 0 2 3 3 aaa +2C1 3 2 3 3 bbb # idem as above ... +2rx 6 2 3 3 ccc # idem as above ... +2C2 9 2 3 3 ddd # idem as above ... + +1N 4 3 2 3 ef +2N 7 3 2 3 gh + + +SCREEN 4 Info about neighbor cells (3-4-5) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +3CH 0 0 3 4 aaa +3C1 3 0 3 4 bbb +3rx 6 0 3 4 ccc +3C2 9 0 3 4 ddd + +4CH 0 1 3 4 aaa +4C1 3 1 3 4 bbb +4rx 6 1 3 4 ccc +4C2 9 1 3 4 ddd + +5CH 0 2 3 4 aaa +5C1 3 2 3 4 bbb +5rx 6 2 3 4 ccc +5C2 9 2 3 4 ddd + +3N 2 3 2 4 ef +4N 5 3 2 4 gh +5N 8 3 2 4 iJ + + +SCREEN 5 Info about neighbor cells (6-7-8) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +6CH 0 0 3 5 aaa +6C1 3 0 3 5 bbb +6rx 6 0 3 5 ccc +6C2 9 0 3 5 ddd + +7CH 0 1 3 5 aaa +7C1 3 1 3 5 bbb +7rx 6 1 3 5 ccc +7C2 9 1 3 5 ddd + +8CH 0 2 3 5 aaa +8C1 3 2 3 5 bbb +8rx 6 2 3 5 ccc +8C2 9 2 3 5 ddd + +6N 2 3 2 5 ef +7N 5 3 2 5 gh +8N 8 3 2 5 iJ + + +SCREEN 6 Preferred and forbidden networks +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +LReg 0 0 5 6 aaabb +1_Pre 0 1 5 6 aaabb +2_Pre 0 2 5 6 aaabb +3_Pre 0 3 5 6 aaabb + +1_For 7 0 5 6 aaabb +2_For 7 1 5 6 aaabb +3_For 7 2 5 6 aaabb +4_For 7 3 5 6 aaabb + + +SCREEN 7 Info about last monitored cell +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +E 0 1 1 7 a +A 2 1 1 7 b +Ho 4 1 1 7 c # was H, conflict screen 1, 2 +C 6 1 1 7 d +I 8 1 1 7 e +BR 10 1 2 7 fg + +ECSC 2 3 1 7 h +2Ter 7 3 1 7 i +MB 11 3 1 7 j + +SCREEN 8 NO TEST +SCREEN 9 NO TEST +SCREEN 9 NO TEST + +SCREEN 10 "Network information (last monitored cell) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TMSI 4 0 8 10 aaaaaaaa H +T3212 5 1 7 10 bbb-ccc +PaRP 4 2 1 10 d +DSF 7 2 2 10 ee +AGC 10 2 2 10 ff +AFC 1 3 5 10 ggggg +Ch 9 3 3 10 hhh + +SCREEN 11 Cell identification +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MCC 3 0 3 11 xxx +MNC 9 0 2 11 xxx +LAC 5 1 5 11 xxx D +sch 7 2 3 11 xxx # was SCH, conflict in screen 3, 66 +CID 5 3 5 11 xxx D + +SCREEN 12 Network parameters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +Cipher 8 0 3 12 aaa +Hopping 8 1 3 12 bbb +DTX 8 2 3 12 ccc +IMSI 8 3 3 12 ddd + +SCREEN 13 Info DTX / Network +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +DTXMode 0 0 10 13 aaaaaaaaaa +DTX_Def 9 1 3 13 bbb +DTX_BS 9 2 3 13 ccc + +SCREEN 14 NO TEST +SCREEN 15 NO TEST +SCREEN 16 NO TEST + +SCREEN 17 BTS channel test +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +BTS 4 2 3 17 aaa + +SCREEN 18 Lights status +LIGHTS 4 2 3 18 aaa + +SCREEN 19 Cell selection +CBARR 2 2 8 19 aaaaaaaa + +SCREEN 20 Battery and phone charger mode +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +BatVol 1 0 3 20 aaa +ChMod 6 0 5 20 bbbbb +BTemp 2 1 3 20 ccc +ChTime 8 1 3 20 ddd +ChrgVol 2 2 3 20 eee +Pwm 8 2 3 20 fff +BTyp 1 3 4 20 gggg +BFDC 7 3 4 20 hhhh + +SCREEN 21 Charger parameters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MTDif 1 0 4 21 aaaa +MPDif 7 0 4 21 bbbb +BUpV 2 1 3 21 ccc +BDownV 8 1 3 21 ddd +AverV 2 2 3 21 eee +SumMF 8 2 3 21 fff + +SCREEN 22 Charger parameters and indicators +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +DeriC 1 0 4 22 aaaa +ChAm 7 0 4 22 bbbb +Vdif 1 1 4 22 cccc +VDrop 7 1 4 22 dddd +VDTi 1 2 4 22 eeee +AvDif 7 2 4 22 ffff +Temp 1 3 4 22 gggg +Volt 7 3 4 22 hhhh + +SCREEN 23 Battery full detection +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TxOn 1 0 4 23 aaaa +TxOff 7 0 4 23 bbbb +ChCur 1 1 4 23 cccc +Stdby 7 1 4 23 dddd +Age 0 2 3 23 eee +CAP 4 2 3 23 fff +Curr 8 2 4 23 gggg +Tmp 0 3 3 23 hhh +CmAh 4 3 4 23 iiii +Targ 8 3 4 23 jjjj + +SCREEN 24 NO TEST +SCREEN 25 NO TEST +SCREEN 26 NO TEST +SCREEN 27 NO TEST +SCREEN 28 NO TEST +SCREEN 29 NO TEST + +SCREEN 30 Audio API registers +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +A1Cnf 1 0 4 30 aaaa +A2Cnf 6 0 4 30 bbbb +ST 1 1 4 30 cccc +AU3 6 1 4 30 dddd +1Tone 1 2 4 30 eeee +2Tone 6 2 4 30 ffff +Conf 1 3 4 30 gggg +HFVol 6 3 4 30 hhhh + + +SCREEN 31 NO TEST +SCREEN 32 NO TEST +SCREEN 33 NO TEST + +SCREEN 34 Info about connection type +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +CM 0 0 2 34 aa +LD 2 0 2 34 bb +LM 4 0 2 34 cc +NM 6 0 2 34 dd + +PEC 0 1 2 34 ee # Hmmf, hard to make this screen well defined ... +FEC 2 1 2 34 ff +OEC 4 1 2 34 gg +ACC 6 1 2 34 hh +RXS 8 1 2 34 iii + +inf 10 1 2 34 xxx # NEW PARAM, [P] when active infrared, +# # else [-] + # you can verify it only by phone + +TXS 12 1 2 34 jjj # ATT:this seems on line 2 but really + # is on x=12, y=1 + +Mod 0 2 3 34 k-m # ATT:this seems on line 3 but really + # is on x=0, y=2 + # Mod, changed in screen 75 + +SCREEN 35 Last reboot +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +ResetReason 1 0 5 35 aaaaa +TaskName 1 1 8 35 bbbbbbbb + +SCREEN 36 Info about rebootings +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +UN 1 0 2 36 aa +WD 5 0 2 36 bb +DSP 9 0 2 36 cc +SIM 1 1 2 36 dd +IDL 5 1 2 36 ee +STK 9 1 2 36 ff + +SCREEN 37 NO TEST + +SCREEN 38 NO TEST + +SCREEN 39 Last connection status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +CC 7 0 2 39 aa # CC, changed in screen 85 +MM 7 1 2 39 bb # MM, changed in screen 86 +RR 7 2 2 39 cc # RR, changed in screen 86 + +SCREEN 40 Reset Handover Counters # only for manual reset + +SCREEN 41 Info about handover +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +GGok 1 0 4 41 aaaa +DDok 7 0 4 41 bbbb +GDok 1 1 4 41 cccc +DGok 7 1 4 41 dddd + +GGf 0 2 3 41 aaa +DDf 3 2 3 41 bbb +GDf 6 2 3 41 ccc +DGf 9 2 3 41 ddd + +GGb 0 3 3 41 aaa +DDb 3 3 3 41 bbb +GDb 6 3 3 41 ccc +DGb 9 3 3 41 ddd + + +SCREEN 42 Info about intracell handover (broken ? all zeroes) +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment + +IGGok 1 0 4 42 aaaa +IDDok 7 0 4 42 bbbb +IGDok 1 1 4 42 cccc +IDGok 7 1 4 42 dddd + +IGGf 0 2 3 42 aaa +IDDf 3 2 3 42 bbb +IGDf 6 2 3 42 ccc +IDGf 9 2 3 42 ddd + +IGGb 0 3 3 42 aaa +IDDb 3 3 3 42 bbb +IGDb 6 3 3 42 ccc +IDGb 9 3 3 42 ddd + + +SCREEN 43 T200 counter expired +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +T200MS 8 0 4 43 aaaa +T200BS 8 1 4 43 bbbb + +SCREEN 44 NO TEST + +SCREEN 45 Trasmitter status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TRASM 2 2 8 45 aaaaaaaa + +SCREEN 46 NO TEST +SCREEN 47 NO TEST +SCREEN 48 NO TEST +SCREEN 49 NO TEST +SCREEN 50 NO TEST + +SCREEN 51 Info about SIM card +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +VSel 0 0 3 51 aaa +Bau 4 0 3 51 bbb +SAl 8 0 3 51 ccc + +SCond 1 1 8 51 dddddddd +# CStop 1 0 0 51 # firmware bug ? + +PIN1 1 2 1 51 e +PIN2 3 2 1 51 f +PUK1 6 2 2 51 gg +PUK2 9 2 2 51 hh + +ATR 2 3 1 51 i +FE_PE 6 3 4 51 jjjj + +SCREEN 52 NO TEST +SCREEN 53 NO TEST + +SCREEN 54 Info about memory block free +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +ResF1 1 0 5 54 aa-bb # split these, if you like ... +ResF2 7 0 5 54 aa-bb +ResF3 1 1 5 54 aa-bb +ResF4 7 1 5 54 aa-bb +ResF5 1 2 5 54 aa-bb +ResF6 7 2 5 54 aa-bb +ResF7 1 3 5 54 aa-bb +ResF8 7 3 5 54 aa-bb + +SCREEN 55 NO TEST + +SCREEN 56 Block display +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +Ptr 1 0 6 56 aaaaaa +Cntr 9 0 3 56 bbb +Task 1 1 8 56 cccccccc + +SCREEN 57 Memory status before reset +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +StatusOfStacks1 0 0 12 57 aaaaaaaaaaaa # You really need this ? +StatusOfStacks2 0 1 12 57 aaaaaaaaaaaa # This is a composite field 1,2,3 +StatusOfStacks3 0 2 2 57 aa # but if you want ... +BlockSets 0 3 8 57 bbbbbbbb + +SCREEN 58 NO TEST +SCREEN 59 NO TEST + +SCREEN 60 Reset counters + +SCREEN 61 Counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +NOPSW 8 0 4 61 aaaa H +SYNCR 8 1 4 61 bbbb H # SYNCR, changed on screen 62 +RESEL 8 2 4 61 cccc H + +SCREEN 62 Counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +PSW 7 0 4 62 aaaa H +SYNCRm 7 1 4 62 bbbb H # was SYNCR, conflict in screen 61 +BCCH 7 2 4 62 cccc H +BCCHE 7 3 4 62 dddd H + +SCREEN 63 Call counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +CalRel 3 0 2 63 aa +RelDi 9 0 2 63 bb +MOCAtmp 2 1 3 63 ccc +MOOK 8 1 3 63 ddd # MOOK, changed in screen 65 +AllMT 2 2 3 63 eee +MTOK 8 2 3 63 fff # MTOK, changed in screen 65 + +SCREEN 64 Location update counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +NFai 2 0 2 64 aa +NL 5 0 3 64 bbb +NLOK 9 0 3 64 ccc +Pfai 2 1 2 64 dd +PL 5 1 3 64 eee +PLOK 9 1 3 64 fff + +SCREEN 65 SMS counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +SFai 2 0 2 65 aa +MO 5 0 3 65 bbb +MOOKs 9 0 3 65 ccc # was MOOK conflict screen 63 +RFai 2 1 2 65 dd +MT 5 1 3 65 eee +MTOKs 9 1 3 65 fff # was MTOK, conflict screen 63 +Sched 0 2 4 65 gggg + +SCREEN 66 SMS timeout counters +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TR1 0 0 3 66 aaa +TR2 0 0 3 66 bbb +TRA 0 0 2 66 cc +TC1 0 0 3 66 ddd +TC2 0 0 3 66 eee +SCHED 0 0 2 66 ff # was SCH, conflict screen 3, 11 + +SCREEN 67 NO TEST +SCREEN 68 NO TEST +SCREEN 69 NO TEST +SCREEN 70 NO TEST +SCREEN 71 NO TEST +SCREEN 72 NO TEST +SCREEN 73 NO TEST +SCREEN 74 NO TEST + +SCREEN 75 Audio option status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +ExAuSt 4 0 8 75 aaaaaaaa # was mod, conflict screen 34 +AudReq 8 1 4 75 bbbb H +AccMod 8 2 2 75 cc H # len diff from netmon manuals +H2Path 8 3 2 75 dd H + +SCREEN 76 NO TEST +SCREEN 77 NO TEST +SCREEN 78 NO TEST +SCREEN 79 NO TEST + +SCREEN 80 Reset Timers + +SCREEN 81 Timers status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +TIMSTS 2 2 8 81 aaaaaaaa + +SCREEN 82 Timers values +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +PwrOn 0 0 5 82 aaaaa +InServ 6 0 5 82 bbbbb +NSPS 0 1 5 82 ccccc +TxON 6 1 5 82 ddddd +TSt 8 2 3 82 eee + +SCREEN 83 Show Task Stacks + +SCREEN 84 status ... ?? +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +IDLE 1 0 4 84 aaaa +DEV_IO 6 0 4 84 bbbb +LOCAL 1 1 4 84 cccc +MDISND 6 1 4 84 dddd +MDIRCV 1 2 4 84 eeee +UI 6 2 4 84 ffff +TONE 1 3 4 84 gggg +PN 6 3 4 84 hhhh + +SCREEN 85 Connection info ?? +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +IRDA 1 0 4 85 aaaa +FBUS 6 0 4 85 bbbb +AUD 1 1 4 85 cccc +L1CTRL 6 1 4 85 dddd +L1MEA 1 2 4 85 eeee +L1SYSP 6 2 4 85 ffff +L2 1 3 4 85 gggg +CCC 6 3 4 85 hhhh # was CC, conflict screen 39 + +SCREEN 86 Memories status +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MMM 1 0 4 86 aaaa # was MM, conflict screen 39 +RRR 6 0 4 86 bbbb # was RR, conflict screen 39 +RM 1 1 4 86 cccc +SMS 6 1 4 86 dddd +EM 1 2 4 86 eeee +SIMUPL 6 2 4 86 ffff +SIML2 1 3 4 86 gggg +DDI 6 3 4 86 hhhh + +SCREEN 87 OS system stack +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +FIQ 2 0 3 87 aaa +IRQ 7 0 3 87 bbb + +SCREEN 88 Phone Hw/Firmware info 1 +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +MCUSW 0 0 5 88 aaaaa +PPM 6 0 6 88 bbbbbb +MCUDate 6 1 6 88 cccccc +ChkSum 7 2 4 88 dddd H +DSPVer 0 3 12 88 eeeeeeeeeeee + +SCREEN 89 Phone Hw/Firmware info 2A +#-Name--X-------Y-------LEN-----Screen--NMman---Type----Descr.----------#Comment +HW 4 0 4 89 aaaa +TXT 4 1 7 89 Ubbbbbb diff --git a/Docs/examples/netmon/nmd_commands.dat b/Docs/examples/netmon/nmd_commands.dat new file mode 100644 index 0000000..933f1a8 --- /dev/null +++ b/Docs/examples/netmon/nmd_commands.dat @@ -0,0 +1,5 @@ +-n 4 DATE TIME H CH Ch SCH AGC AFC RxL TxPwr TS TA RQ RLT C1 C2 CHT + -n 4 DATE TIME SCH 0rx 1CH 1rx 2CH 2rx 3CH 3rx 4CH 4rx 5CH 5rx 6CH 6rx 7CH 7rx 8CH 8rx + -n 4 TIME LINE1 + -n 4 DATE CM LD LM NM PEC FEC OEC ACC RXS inf TXS Mod + -n 4 LINE1 DATE TIME diff --git a/Docs/examples/ppp/options b/Docs/examples/ppp/options new file mode 100644 index 0000000..63e0eb6 --- /dev/null +++ b/Docs/examples/ppp/options @@ -0,0 +1,7 @@ +modem +crtscts +defaultroute +asyncmap 0 +mtu 1500 +mru 1500 +user ppp diff --git a/Docs/examples/ppp/pap-secrets b/Docs/examples/ppp/pap-secrets new file mode 100644 index 0000000..96d459b --- /dev/null +++ b/Docs/examples/ppp/pap-secrets @@ -0,0 +1 @@ +ppp * ppp diff --git a/Docs/examples/ppp/ppp-6210-modem b/Docs/examples/ppp/ppp-6210-modem new file mode 100755 index 0000000..3111a52 --- /dev/null +++ b/Docs/examples/ppp/ppp-6210-modem @@ -0,0 +1,11 @@ +#!/bin/sh +/usr/sbin/chat -v \ + TIMEOUT 30 \ + ABORT '\nBUSY\r' \ + ABORT '\nNO ANSWER\r' \ + ABORT '\nRINGING\r\n\r\nRINGING\r' \ + ABORT '\nNO CARRIER\r' \ + '' '\r\dATZ' \ + TIMEOUT 60 \ + OK ATDT$TELEPHONE \ + CONNECT '' diff --git a/Docs/examples/ppp/ppp-FILES b/Docs/examples/ppp/ppp-FILES new file mode 100644 index 0000000..8732ffb --- /dev/null +++ b/Docs/examples/ppp/ppp-FILES @@ -0,0 +1,6 @@ +ppp-6210-modem Basic chat script to use with AT modem (eg. Nokia 6210) +ppp-gnokii Basic chat script to make a connection with gnokiid and at-emulator (eg. Nokia 6110) +ppp-hscsd Sample chat script to make a hscsd connection +ppp-on Sample ppp script to estabilish a dialup connection +options Sample ppp options file +pap-secrets Sample pap-secrets file diff --git a/Docs/examples/ppp/ppp-gnokii b/Docs/examples/ppp/ppp-gnokii new file mode 100644 index 0000000..2b12aaf --- /dev/null +++ b/Docs/examples/ppp/ppp-gnokii @@ -0,0 +1,9 @@ +#!/bin/sh +/usr/sbin/chat -v \ + TIMEOUT 30 \ + ABORT '\nBUSY\r' \ + ABORT '\nNO ANSWER\r' \ + ABORT '\nRINGING\r\n\r\nRINGING\r' \ + ABORT '\nNO CARRIER\r' \ + '' ATDT$TELEPHONE \ + CONNECT '' diff --git a/Docs/examples/ppp/ppp-hscsd b/Docs/examples/ppp/ppp-hscsd new file mode 100644 index 0000000..745759d --- /dev/null +++ b/Docs/examples/ppp/ppp-hscsd @@ -0,0 +1,13 @@ +#!/bin/sh +chat -v \ + TIMEOUT 60 \ + ABORT '\nBUSY\r' \ + ABORT '\nNO ANSWER\r' \ + ABORT '\nRINGING\r\n\r\nRINGING\r' \ + ABORT '\nNO CARRIER\r' \ + '' "\r\dATZ" \ + OK "AT+CBST=51,0,1" \ + OK "AT+CHSN=6,0,0,0" \ + TIMEOUT 60 \ + OK ATD$TELEPHONE \ + CONNECT '' diff --git a/Docs/examples/ppp/ppp-on b/Docs/examples/ppp/ppp-on new file mode 100644 index 0000000..3774465 --- /dev/null +++ b/Docs/examples/ppp/ppp-on @@ -0,0 +1,9 @@ +#!/bin/sh +TELEPHONE=501808080 +LOCAL_IP=0.0.0.0 +REMOTE_IP=0.0.0.0 +NETMASK=255.255.255.0 +DIALER_SCRIPT=/etc/ppp/ppp-gnokii +export $TELEPHONE +exec /usr/sbin/pppd debug /dev/gnokii 115200 $LOCAL_IP:$REMOTE_IP connect $DIALER_SCRIPT + diff --git a/Docs/examples/test.vcs b/Docs/examples/test.vcs new file mode 100644 index 0000000..140418e --- /dev/null +++ b/Docs/examples/test.vcs @@ -0,0 +1,40 @@ +BEGIN:VCALENDAR +VERSION:1.0 + +BEGIN:VEVENT +CATEGORIES:PHONE CALL +SUMMARY:0123456789 +DESCRIPTION:Call to John +DTSTART:20000623T194400 +DALARM:20000623T194300 +END:VEVENT + +BEGIN:VEVENT +CATEGORIES:MISCELLANEOUS +SUMMARY:Gnokii Reminder +DTSTART:20000623T204400 +DALARM:20000623T204300 +END:VEVENT + +BEGIN:VEVENT +CATEGORIES:MEETING +SUMMARY:Gnokii Meeting +DTSTART:20000623T204400 +DALARM:20000623T204300 +END:VEVENT + +BEGIN:VEVENT +CATEGORIES:SPECIAL OCCASION +SUMMARY:Marcels Birthday +DTSTART:19790806T031000 +DALARM:20000806T100000 +END:VEVENT + +BEGIN:VEVENT +CATEGORIES:MISCELLANEOUS +SUMMARY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:Wi=C4=85cek Marcin +DTSTART:19991111T235959 +DALARM:20010510T222200 +END:VEVENT + +END:VCALENDAR diff --git a/Docs/gnokii-hackers-howto b/Docs/gnokii-hackers-howto new file mode 100644 index 0000000..4c1be0c --- /dev/null +++ b/Docs/gnokii-hackers-howto @@ -0,0 +1,193 @@ +GNOKII Hackers Guide +-------------------- + + +Purpose +------- + +Now that we know in some detail the workings of the protocols it makes +sense to organise the gnokii code to fit them better. This should mean +that when new models come out, it is easier to get the code in place to +support them. It is hoped that the new structure will also work for other +makes of phone. + + +Overview: + +Application (gnokii/xgnoki) + | DoSomething() +(Middle-layer) + | GSM->Function() +Gsm-api + | P*_Functions() +Phone specific code (eg nk7110.c) + | SM_SendMessage(), SM_Wait(), SM_Loop() +StateMachine + | SendMessage(), Loop() +Link specific code (eg fbus.c) + | +Hardware code + + + +Detailed operation +------------------ + + +Initialisation: + +The gnokii application (eg gnokii, xgnokii) decides on the phone type and +required connection method from the config file. It then calls the +gsm-api init code which in turn calls the init code for the correct phone. +This code is located in a series of files phone/*.c. This code creates a +GSM_State structure (which contains a GSM_Link structure) and passes this +to the common code for the specific link (eg FBUS_Initialise, contained in +fbus.c). The link code fills in the GSM_Link part of state (and +also stores state to use later). The phone code chooses the appropriate +link and is free to perform any phone specific init. It then initialises +the StateMachine by passing it the state struct and a GSM_Phone struct. + + +The Link: + +The link serves to deal with bits of the phone protocol which are common to +every exchange for that particular phone. + +The GSM_Link structure is used to contain any information about the link +which is required by the StateMachine. Two vital functions in the link +are SendMessage and Loop: + +SendMessage(u16 messagesize, u8 messagetype, void *message) + is the function called by the statemachine code to send a message 'down + the pipe'. The parameters are intended to be generic (though with + obvious origins :-) For example 'at' commands could be enumerated and + passed as messagetype. + +Loop(struct timeval *timeout) + is a function which must be called regularly by the statemachine code + to enable to link code to process date from the phone. This is due to + the code now being single threaded and using select/poll. The timeout + passed can therefore be used to make this function block for a while + (or not). + +In the loop function, the link code checks for any incoming messages from +the phone. Any received correctly are passed up to the statemachine code. + + +The Middle Layer + +All common/*.c files contain the code that is general and is used by all +of the phones. The functions within should convert the gnokii internal +structures into the frames (without the header) that can be sent to the +phone and understood by it. It's obvious that this layer should be phone +independent. All the phone specific stuff should be done in the phone layer. +In the case when phone frames are similiar but not the same, the phone layer +can export some help structures to let be the code shared in the middle +layer. Using the middle layer is optional. Currently almost no code does use +it. Although it is recommended to use it to avoid the code duplication and +to keep clean the phone drivers. + + +The Phone: + +The phone/*.c code therefore basically contains code to package up and +unpack information from the phone specific format to generic gnokii +structures (eg GSM_Bitmap). However, it is also at the top of the tree +and contains functions called by the application. Generally there are +three types of exchanges that can occur. Firstly the computer can send +the phone a command and expect no answer (not including acks etc which +are dealt with by the phone code). Secondly the computer may send a command +and expect a response within a certain time - often containing useful +information. Lastly the phone may send the computer unrequested +information (ring!). Therefore the functions in the phone code need to +process one of these three things: + +1) Just sending out is easy - we simply call SM_SendMessage - which in +turn calls the link sendmessage. + +2) Command and response. There are two ways to do this. In both cases we +start out by sending a message via the statemachine. Next we either a) +wait for the reply or b) wait for some other code to process the reply. +My (*new improved*!!!) suggestion is that the statemachine calls phone +functions (like parts of DispatchMessage) which process the received data +into a generic structure tagged with the data type (one function for each +data type). This is returned to the statemachine. The statemachine then +returns this 'baggage' to the other part of the phone code which is +waiting for it. + +3) Notification. Here, as for 2) the statemachine calls some phone code, +but the phone code merely remembers it and does not return any data. + + +So, the phone file contains two types of functions. Some are called by +the application (via GSM_Functions) - and some by the statemachine +(IncomingFunctions[]). The application ones assemble a request and pass +it on down to the statemachine. They then block to the statemachine until +the answer is ready. The statemachine recieves data from the link and +passes it up to the appropriate IncomingFunction in phone, which returns +the answer which is finally passed back to the blocked phone function. + + +The StateMachine: + +This therefore has the following states: + +Startup +Initialised +MessageSent +Waiting +AnswerReady + +When SM_SendMessage is called by the phone (application code), we go to +state MessageSent. The message is passed on to the link, but stored +internally as well in-case it needs to be resent. + +If at any point an message from the link is received this is passed onto +the phone (incoming) code. + +If the phone code calls SM_WaitFor, we go to state Waiting. Now if an +answer comes back from the phone code (eg a received logo) we store it +internally in the statemachine and go to state AnswerReady. + +When the phone code calls SM_GetAnswer, we pass up the stored answer and +go back to Initialised. + +Note that all of this can, or can not be done as a seperate thread. For +now, we will have a SM_Loop function (which blocks for a required time and +returns the current state) so that we can work within one thread. + + +PhoneGeneric: + +This now contains one handy helper function which serves only to call +SM_WaitFor, then SM_Loop repeatedly until the state goes to AnswerReady, +and then SM_GetAnswer. This is just to save repeating code. + + +----------------------- + +Note that this leaves the phone code very similar to the basic layout of +eg fbus-6110.c but removes all the: + +static GSM_DateTime *CurrentAlarm; +static GSM_Error CurrentAlarmError; + +,makes everything well orderd and splits up DispatchMessage into byte +sized chunks! + +----------------------- + + + +Other Notes +----------- + +Within a phone/*.c or link file the functions should be made static. It +is therefore not necessary to use prefixes such as FB61_ but this may help +code legibility to distiguish the major functions. + + +-- +$Id$ +Chris Kemp +Pawel Kot diff --git a/Docs/pl_PL/mygnokii.htm b/Docs/pl_PL/mygnokii.htm new file mode 100644 index 0000000..6320858 --- /dev/null +++ b/Docs/pl_PL/mygnokii.htm @@ -0,0 +1,974 @@ + + + + + + + + + + + Nadzieja dla Kontestatorów + + + + + +
Nadzieja dla Kontestatorów + +
+
Poni¿szy tekst jest rozwiniêciem artyku³u +opublikowanego na ³amach czasopisma Chip Special zima 2001.
+
+ +
+ +

Producenci telefonów komórkowych czêsto do³±czaj± do swoich produktów +oprogramowanie umo¿liwiaj±ce obs³ugê wiêkszo¶ci funkcji aparatu z klawiatury +komputera. K³opoty zaczyn± siê wówczas, je¿eli nasz komputer nie korzysta +z "jedynie s³usznych" systemów operacyjnych: MS Windows lub Mac OS ... +

U¿ytkownicy systemów BSD i Linux s± w znacznie gorszej sytuacji. Jak +dotychczas ¿aden producent "komórek" nie zdoby³ siê na upublicznienie programów +dla tych systemów. ¯ycie jednak nie znosi pró¿ni. Ponad 3 lata temu pojawi³ +siê Gnokii - projekt umo¿liwiaj±cy obs³ugê telefonów komórkowych Nokia +w systemach uniksowych. + +

Na pocz±tek

+ +1. Nieco historii
+


+ +

Gnokii wywodzi siê z dwóch projektów: pierwszego, zapocz±tkowanego m.in. +przez Francois Dessarta i Hugh Blemingsa w pa¼dzierniku 1998, przeznaczonego +dla modeli 3110 i 8110 oraz innego, rozpoczêtego m.in. Staffana Ulfberga +obs³uguj±cego model 6110. Projekty te po³±czone zosta³y w lutym 1999 roku. +Za³o¿eniem twórców Gnokii by³o opracowanie interfejsu programistycznego +oraz graficznego do obs³ugi najpopularniejszych wówczas modeli telefonów +komórkowych. Tworzona aplikacja mia³ równie¿ umo¿liwiaæ wykonywanie transmisji +danych, nie przewidziano jednak transmisji faksów. +

Projekt rozwija³ siê bez przeszkód do drugiej po³owy zesz³ego roku (wersja +0.3.3_pre8), Na skutek sporów dotycz±cych przysz³o¶ci pakietu, jego rózwój +zosta³ na pewien czas wstrzymany. Odesz³o wtedy kilka osób, które wnosi³y +wiele zmian. +

W tym roku prace nad pakietem zosta³y znów rozpoczête. Programi¶ci skupili +siê nad wersj± rozwojow±. Zdecydowano siê przepisaæ tê czê¶æ kodu ¼ród³owego, +która jest odpowiedzialna za komunikacjê programu z telefonem. Zmiany te +maj± pomóc w usuwaniu b³êdów, s± tak¿e potrzebne aby wspó³dzieliæ czê¶ci +kodu u¿ywane przez ró¿ne modele telefonów. Pojawi³y siê równie¿ pierwsze +funkcje do Dancalla 2711 oraz Nokii 2110, 7110 i 62xx. Praca ta nie jest +ci±gle dokoñczona - wersja rozwojowa 0.4.0_pre2 z listopada mo¿e nie zapewniaæ +jeszcze takiego wsparcia do niektórych modeli (np. serii 61xx) jak stabilna +0.3.3 opublikowana we wrze¶niu (do której nie do³±czono wielu partii nowego +kodu). + +

Na pocz±tek

+ +2. Mygnokii
+


+ +

MyGnokii jest obecnie jedyn± konkurencyjn± dystrybucj± dla oryginalnego +Gnokii, Zosta³a stworzona w okresie sporów po opublikowaniu wersji 0.3.3_pre8 +Gnokii. Twórc± tego projektu jest Marcin Wi±cek. +

Nowa dystrybucja pocz±tkowo zosta³a oparta na Gnokii 0.3.3_pre8 i zawiera³a +wy³±cznie poprawki do oryginalnego kodu. Jednak w ci±gu ostatnich miesiêcy +wprowadzono znaczne zmiany w stosunku zarówno do wersji rozwojowej jak +i stabilnej Gnokii. Ró¿nice te mo¿na scharakteryzowaæ nastêpuj±co: +

    +
  1. +Obs³ugiwane s± praktycznie wszystkie nowe modele Nokii, a liczba dostêpnych +funkcji jest szersza ni¿ w Gnokii. MyGnokii wspó³pracuje z telefonami Nokia +3210, 3310, 8210/8850, 61xx/51xx, 62xx, 7110 oraz 3330. Niestety, trzy +ostatnie modele nie mog± jeszcze wykorzystaæ wszystkich dostêpnych opcji +pakietu. MyGnokii nie zapewnia te¿ du¿ego wsparcia modelom serii 3110/8110 +(tzn. liczba obs³ugiwanych funkcji programu dla tych modeli jest ma³a), +w ogóle nie wspó³pracuje z Noki± 2110.
  2. + +
  3. +W pakiecie wprowadzono pe³n± obs³ugê technologii Smart Messaging. Dziêki +temu MyGnokii nie ma ¿adnych problemów z przesy³aniem czy odbieraniem dzwonków, +obrazków albo wpisów w kalendarzu.
  4. + +
  5. +Dokumentacje obydwu projektów ró¿ni± siê nie tylko form± ale tak¿e tre¶ci±. +Po¶wiêcono jej osobny rozdzia³ w artykule.
  6. + +
  7. +Udostêpniono zestaw standardowych dzwonków i obrazków (m.in. logo startowych) +ró¿nych modeli telefonów Nokia.
  8. + +
  9. +Zmiany kodu ¼ród³owego umo¿liwi³y szybsze dzia³anie programów.
  10. + +
  11. +Dostêpne jest znacznie wiêcej funkcji i opcji w wersji dzia³aj±cej w konsoli +ni¿ w analogicznej aplikacji z gnokii.
  12. + +
  13. +MyGnokii przesta³o byæ oprogramowaniem wy³±cznie dla systemów uniksowych. +Kod ¼ród³owy zawiera od razu w sobie wszystkie poprawki i pliki niezbêdne +do skompilowania w Windows (kompilator Visual C++ 6). Dostêpna jest biblioteka +DLL, któr± mo¿na wykorzystaæ w praktycznie ka¿dym jêzyku programowania +- w pakiecie znajduje siê zreszt± przyk³adowy, wykorzystuj±cy j± interfejs +u¿ytkownika napisany w Delphi. Interfejs mo¿na skompilowaæ u¿ywaj±c bezp³atnego +Delphi 6PE dostêpnego na Chip CD 10/2001 oraz stronie WWW Borlanda. Skompilowana +wersja pakietu i biblioteka DLL dostêpna jest tak¿e na stronie domowej +autora.
  14. + +
  15. +Inna jest struktura kodu odpowiedzialnego za wysy³anie komend do telefonu +i ich odbieranie. Jest ona podobna do tej, która obecna jest w wersji stabilnej +0.3.3 Gnokii.
  16. + +
  17. +Programistów zainteresuj± procedury wspomagaj±ce "podgl±danie" transmisji +prowadzonej z innych programów pomiêdzy komputerem a telefonem (zamiast +prowadziæ reverse engineering programów, których kody ¼ród³owe nie s± dostêpne, +mo¿na pos³u¿yæ siê t± funkcj± programu by uzyskaæ informacje w jaki sposób +inne aplikacje komunikuja siê ze sprzêtem). Oprócz tych funkcji w pakiecie +jest zreszt± zawarta bogata dokumentacja opisuj±ca protoko³y u¿yte w ró¿nych +modelach telefonów.
  18. +
+W momencie dodawania nowych funkcji do Gnokii, czê¶æ z nich jest bie¿±co +adaptowana na potrzeby MyGnokii. Tak by³o np. z poprawkami dotycz±cymi +transmisji danych czy kodowania znaków na potrzeby SMS. +

Niestety, ró¿nice pomiêdzy dystrybucjami powoduj±, ¿e czê¶æ oprogramowania +pisanego dla Gnokii mo¿e nie dzia³aæ z MyGnokii. Jest tak przyk³adowo z +modu³em pozwalaj±cym korzystaæ z funkcji pakietu z programów napisanych +w Perlu. + +

Na pocz±tek

+ +3. Jak telefon z komputerem ...
+


+ +

Istniej± 3 sposoby po³±czenia komputera z telefonem komórkowym: kabel, +podczerwieñ i modu³ Bluetooth. Dwa pierwsze postaramy siê nieco przybli¿yæ. +

    +
  1. +Kabel.
  2. + +
    Mo¿e dzia³aæ w co najmniej jednym z trzech trybów: FBUS, MBUS (s± to +wewnêtrzne protoko³y Nokii) albo w trybie komend AT. Ró¿ni± siê one fizycznie +m.in. prêdko¶ci± transmisji oraz u¿ywanymi sygna³ami z³±cza szeregowego. +Kable przeznaczone dla nowszych modeli telefonów wyprowadzaj± ni¿sze napiêcia. +Oznacza to, i¿ do obs³ugi modeli serii 21xx/31xx/81xx mo¿emy potrzebowaæ +innego kabla ni¿ dla modeli serii 3210, 33xx, 62xx czy 7110. +

    Kable mo¿emy zrobiæ korzystaj±c ze schematów ogólnie dostêpnych w Internecie +(np. w Telekomunikacyjnym Serwisie Informacyjnym fkn.pl) ewentualnie skorzystaæ +z tych dodawanych do oryginalnych pakietów Nokii - np. Nokia Cellular Data +Suite. Nie znajdziemy oczywi¶cie w ¿adnym salonie kabla do modeli serii +3210/33xx/8210/8850 dlatego, i¿ oficjalnie modele te nie maj± takich mo¿liwo¶ci +- dlatego równie¿ wtyczek do nich nale¿y szukaæ wy³±cznie np. na gie³dach +elektronicznych albo w sprzeda¿y wysy³kowej. +

    Odpowiedni kabel mo¿emy tak¿e kupiæ - na stronie domowej Marcina Wi±cka +znajdziemy adresy wytwórców. Polecamy kable FBUS/MBUS (mog± byæ opisane +jako DAU9P), bêd± one dzia³aæ praktycznie z ka¿dym nowszym modelem telefonu. +

    Czê¶æ telefonów (jak np.: 62xx, 7110 czy 8210/8850) posiadaj± wbudowany +modem, z którym mo¿na kontaktowaæ siê poprzez zestaw komend AT (zgodny +z standardem Hayes i normami ETSI). Niestety, aby korzystaæ z niego musimy +nabyæ kabel DLR-3P (ewentualnie starsz± wersjê DLR-3). Obs³uguje on tryb +komend AT oraz FBUS. Mo¿na go wykorzystaæ jedynie z Noki± 62xx/7110 - ze +starszymi modelami nie bêdzie dzia³a³ w ogóle, nawet w trybie FBUS ! Kabel +taki trudno jest wykonaæ samodzielnie - posiada bowiem uk³ad scalony zawieraj±cy +unikalne oprogramowanie Nokii. Z tego te¿ powodu mo¿emy co najwy¿ej poleciæ +odwiedzenie strony "Cable Connecting Data" - oprócz schematu elektrycznego +zawiera tak¿e dane dotycz±ce zaprogramowania wspomnianego uk³adu scalonego. +
      +

  3. +Podczerwieñ.
  4. + +
    Czê¶æ telefonów pozwoli skorzystaæ z podczerwieni. Komunikacja taka +mo¿e byæ realizowana przez dwa rodzaje urz±dzeñ. Pierwsze z nich to specjalny +odbiornik, który pod³±czamy do z³±cza podczerwieni dostêpnego w wiêkszo¶ci +wspó³czesnych p³yt g³ównych (przyk³adowy schemat takiego urz±dzenia oraz +wiêcej informacji na ten temat podano w Chipie 12/2000). Musimy tak¿e uaktywniæ +odpowiedni± opcjê w BIOSie. Sposób ten jest najczê¶ciej realizowany w komputerach +przeno¶nych.Drugi rodzaj urz±dzeñ to tzw. dongle. Jest to pude³eczko pod³±czane +zewnêtrznie do portu szeregowego, zawieraj±ce port podczerwieni oraz ca³± +niezbêdn± elektronikê. +

    Równie¿ komunikacja w podczerwieni mo¿e byæ realizowana na dwa sposoby. +Pierwszy z nich jest u¿ywany we wszystkich nowych modelach: serii 8210/8850 +oraz w modelach 62xx i 7110. Jest to tzw. podczerwieñ socketowa - realizowana +przez system operacyjny komputera. Telefon u¿ywa tutaj pewnego znormalizowanego +(dziêki temu wykorzystywanego w wielu ró¿nych urz±dzeniach) formatu danych. +Czê¶æ funkcji potrzebnych programi¶cie jest wbudowywana w system operacyjny. +W systemie znajduj± siê tak¿e sterowniki do ró¿nych modu³ów podczerwieni. +Programy u¿ywaj±ce tego interfejsu mog± zaj±æ siê wy³±cznie interpretacj± +otrzymywanych komend i ich wysy³aniem (poprzez wykorzystywanie odpowiednich +funkcji systemowych). U¿ycie takiej podczerwieni wymaga w³±czenia jej obs³ugi +w j±drze systemu. +

    Realizacja po³±czenia komputera z telefonem opisanym sposobem wymaga +(oprócz portu podczerwieni oczywi¶cie) aby j±dro Linuksa umo¿liwia³o taki +rodzaj komunikacji, czyli musi byæ skompilowane z odpowiedni± opcj±. Po +aktywacji portu podczerwieni w Nokii, Linux powinien znale¼æ modem bêd±cy +modemem telefonu, z którym komputer po³aczony jest podczerwieni±. +

    Drugi sposób dotyczy wszystkich modeli 61xx oraz 8210/8850 (w tych dwóch +ostatnich podczerwieñ uruchamiamy opcj± w³±czaj±c± dwóch graczy w wê¿a, +a nie z menu g³ównego !). Telefon wykorzystuje tu wewnêtrzny format Nokii. +Poniewa¿ ¿aden system operacyjny nie zapewnia jego obs³ugi, w komputerze +musi byæ uruchomiony odpowiedni program (np. MyGnokii lub Gnokii), który +bezpo¶rednio odczyta i zinterpretuje ka¿dy wys³any z telefonu znak, jak +równie¿ prze¶le ka¿d± komendê z komputera po przekszta³ceniu jej do formatu +Nokii. Taki rodzaj komunikacji podczerwonej to tzw. podczerwieñ bezpo¶rednia. +Aby z niej korzystaæ, j±dro Linuksa nie mo¿e byæ skompilowane z opcj± wspomagania +podczerwnieni (poniewa¿ opcja dotyczy tylko podczerwieni socketowej). Warto +zauwa¿yæ, ¿e MyGnokii nie jest w stanie komunikowaæ siê w ten sposób z +Windows NT/2000/XP - w systemach tych oprogramowanie nie mo¿e bowiem bezpo¶rednio +odwo³ywaæ siê do ¿adnego urz±dzenia. +

    Ograniczeniem metody bezpo¶redniej jest tak¿e to, i¿ MyGnokii i Gnokii +nie obs³uguje wszystkich typów dongle. W chwili obecnej mo¿liwa jest tylko +obs³uga urz±dzeñ zgodnych ze standardem Tekram 210. +
      +

  5. +Bluetooth.
  6. + +
    Modu³y Bluetooth, dostêpne obecnie tylko dla Nokii 6210, s± stosunkowo +s³abo rozpowszechnione i autorzy MyGnokii i Gnokii nie maj± ¿adnych informacji +o mo¿liwo¶ci wykorzystania tej metody komunikacji telefonu z komputerem. +Wydaje siê natomiast, i¿ modu³y te s± ci±gle dopracowywane i lepsz± stabilno¶æ +po³±czeñ uzyskamy u¿ywaj±c podczerwieni lub kabla (wskazuj± na to testy +publikowane w popularnych serwisach telekomunikacyjnych).
+ +

Na pocz±tek

+ +4. Instalacja
+


+ +

Kiedy po³±czylismy ju¿ telefon z komputerem, mo¿emy przyst±piæ do instalowania +i konfigurowania MyGnokii. Powinni¶my pobraæ plik zawieraj±cy kod ¼ród³owy +pakiety mygnokii.tar.gz (pakiet nie jest dostepny w formatach rpm czy deb) +wraz z plikiem zawieraj±cym "skóry" telefonów mygnokii_skins.tar.gz . "Skóry" +to nic innego jak piktogramy telefonów wykorzystywane w X-Window. Przystêpujemy +do instalacji. Najpierw rozpakowujemy pakiet zawieraj±cy kod ¼ród³owy +

tar zxvf mygnokii.tar.gz + +

Wchodzimy od utworzonego +katalogu mygnokii i konfigurujemy MyGnokii. +

./configure --enable-security +

W podanym przyk³adzie, utworzony pakiet bêdzie móg³ odczytaæ informacje +zwi±zane z zabezpieczeniami telefonu (np.: kod zabezpieczaj±cy). +

Je¿eli nie zamierzamy korzystaæ z xgnokii ("okienkowej" wersji gnokii) +powinni¶my do polecenia +./configure +do³±czyæ tak¿e parametr --without-x. +Kompilacja xgnokii jest mo¿liwa o ile posiadamy w systemie pliki nag³ówkowe +do tworzenia programów w gtk (pakiety gtk+-devel-1.2.x, glib-devel-1.2.x) +oraz bibliotekê libXpm. Informacje o innych parametrach, które mog± zostaæ +u¿yte przy konfiguracji znajdziemy w pliku mygnokii/Docs/en_US/gnokii/config.htm. +

W kolejnym kroku kompilujemy pakiet: +

make +

Po kompilacji instalujemy pakiet w systemie wykonuj±c (tutaj s± wymagane +uprawnienia roota): +

make install +

make install-docs +

Od tego momentu w systemie powinny istnieæ polecenia +gnokii (wersja +konsolowa), xgnokii (wersja pod X-windows) oraz gnokiid (transmisja +danych w podczerwieni bezpo¶redniej/przez kabel). +

Pliki ze skórami telefonów do xgnokii rozpakowujemy i kopiujemy +do katalogu xpm utworzonego podczas instalacji xgnokii - +/usr/local/lib/xgnokii/xpm/ +lub +/usr/local/share/xgnokii/xpm/ +zale¿nie +od posiadanej dystrybucji Linuksa. Prawa dostêpu do tych plików ma jedynie +root. Oznacza to, ¿e pozostali u¿ytkownicy systemu nie bêd± mogli w pe³ni +wykorzystaæ mo¿liwo¶ci pakietu. Mo¿emy to jednak zmieniæ, poniewa¿ prawa +dostêpu tych plików nie maj± wp³ywu na bezpieczeñstwo systemu (chmod +a+rw *). +

W odró¿nieniu od MyGnokii, Gnokii jest udostêpniana tak¿e jako plik +rpm, deb albo w formie CVS. Instalacja z posiadanego kodu ¼ród³owego przebiega +podobnie (nie trzeba jednak instalowaæ "skór" z oddzielnego pliku - s± +w³±czone w pakiecie). Natomiast instalacja pliku w formacie rpm lub deb +przebiega tak samo jak innych pakietów w tych formatach. +

Objêtnie czy korzystamy z pakietu Gnokii czy MyGnokii polecenia uruchamiaj±ce +aplikacjê (gnokii w trybie tekstowym i xgnokii w trybach +graficznych) s± takie same. + +

Na pocz±tek

+ +5. Konfiguracja.
+


+ +

+

Przyk³adowy zbiór konfiguracyjny znajdziemy w katalogu mygnokii/Docs/examples +(w +Gnokii bêdzie to katalog gnokii/Docs/sample) pod nazw± gnokiirc. +Kopiujemy go do katalogu domowego pod nazw±..gnokiirc +lub katalogu +/etc +jako gnokiirc. W sekcji +global ustawiamy nastêpuj±ce parametry: +

    +
  • +Port - podajemy port, do którego do³±czony jest telefon. Mo¿e to +byæ/dev/ircommx w przypadku podczerwieni socketowej lub /dev/ttySx +w pozosta³ych (zamiast x wstawiamy numer portu). Nale¿y oczywi¶cie +mieæ prawa dostêpu do wybranego portu (mo¿na je ustawiæ np. przez chmod +u+rwx nazwa_portu)
  • + +
  • +Model - podajemy model telefonu, np. 6210. +Podanie nazwy +konkretnego modelu wymagane jest je¶li u¿ywamy Gnokii. Korzystaj±c z MyGnokii, +mo¿emy te¿ u¿yæ parametru +auto i pakiet przy ka¿dym po³±czeniu bêdzie +próbowa³ automatycznie wykryæ model.
  • + +
  • +Initlength - w przypadku trybu komunikacji FBUS przez kabel albo +przy u¿yciu bezpo¶redniej podczerwieni mo¿na skróciæ czasu synchronizacji +pomiêdzy urz±dzeniami. Nale¿y pamiêtaæ, i¿ zbytnie zmniejszenie tego parametru +mo¿e uniemo¿liwiæ komunikacjê. W wiêkszo¶ci przypadków warto¶æ 30 jest +tutaj w zupe³no¶ci wystarczaj±ca, w razie potrzeby nale¿y j± zwiêkszyæ.
  • + +
  • +Connection - typ po³±czenia. Podawanym parametrem mo¿e byæ irda +(podczerwieñ przez sockety), +infrared (podczerwieñ bezpo¶rednia), +tekram210 +(podczerwieñ bezpo¶rednia przez dongle zgodne ze standardem Tekram 210), +mbus +(tylko w MyGnokii: standard MBUS), serial (w Gnokii) albo fbus +(w MyGnokii) - standard FBUS.
  • + +
  • +Synchronizetime - parametr wystêpuje wy³±cznie w MyGnokii. Przenosi +datê i czas komputera do telefonu przy ka¿dym po³±czeniu (opcja przydatna, +gdy synchronizujemy czas w komputerze z serwerów internetowych). Uwaga: +ustawienie czasu w telefonie mo¿e powodowaæ pewne drobne problemy - je¿eli +w trakcie tej samej sesji (w której ustawili¶my czas) zresetujemy telefon, +czas bêdzie trzeba ustawiæ ponownie.
  • +
+Je¶li chcemy korzystaæ z programu +gnokiid, ustawienia z sekcji +global +nale¿y powtórzyæ w sekcji +gnokiid. + +

Na pocz±tek

+ +6. Na konsoli i w X Window
+


+ +

Zarówno Gnokii jak i MyGnokii umo¿liwiaj± pracê w trybie tekstowym (w +x-terminalu i na konsoli) jak i w trybach graficznych. Praca w trybie tekstowym +nie jest zbyt wygodna (przyk³ady podane zosta³y w ramce na koñcu tekstu), +pozwala jednak wykorzystaæ w pe³ni wszystkie mo¿liwo¶ci programu. O ile +skompilowali¶my pakiet wraz z xgnokii czyli interfejsem graficznym, +wygodniej jest korzystaæ z MyGnokii w X Window. Mo¿liwo¶ci pakietu s± naprawdê +du¿e. MyGnokii umo¿liwia m. in. obs³ugê smsów, kalendarza (tworzenie i +edycja notatek), ksi±¿ki telefonicznej, tworzenie i przesy³anie logo oraz +melodyjek. Oprogramowanie pozwala tak¿e uruchomiæ monitor sieci - funkcjê +umo¿liwiaj±c± poznanie parametrów pracy sieci GSM i telefonu. + +

Na pocz±tek

+ +7. Konkurencja
+


+ +

MyGnokii oraz Gnokii nie maj± konkurentów w ¶rodowisku uniksowym. Jednak +w systemie MS Windows, konkurencja dla MyGnokii jest silna. Najpopularniejszymi +programami do obs³ugi telefonów komórkowych s± z ca³± pewno¶ci± LogoManager +i Oxygen. LogoManager pozwala u¿ytkownikowi na tworzenie i przesy³anie +logo oraz melodyjek. Umo¿liwia tak¿e edycjê ksi±¿ki telefonicznej oraz +wysy³aæ standardowe smsy, jednak tutaj oferowane mo¿liwo¶ci s± bardzo ograniczone. +Natomiast Oxygen jest ¶wietnym programem do modyfikowania ksi±¿ki telefonicznej, +edycji notatek w kalendarzu, potrafi tak¿e wymieniaæ dane pomiêdzy telefonem +a MS Outlook i Lotus Notes. Podobnie jak LogoManager potrafi tworzyæ loga +nie mniej ustêpuje temu ostatniemu pod wzglêdem wygody obs³ugi. Wielu u¿ytkowników +korzysta z obydwu programów wykorzystuj±c Oxygen do zarz±dzania informacj± +w telefonie, a LogoManager do tworzenia i wysy³ania grafik i d¼wiêków. +Nie jest to zbyt wygodne rozwi±zanie. Najwiêksz± wad± tych programów jest +jednak to, ¿e s± p³atne. Mo¿na oczywi¶cie za darmo pobraæ wersje shareware, +jednak posiadaj± one istotne ograniczenia wp³ywaj±ce na ich funkcjonalno¶æ. +

MyGnokii ³±czy w sobie zalety wymienionych wy¿ej programów. - wszystkie +mo¿liwo¶ci oferowane przez LogoManager czy Oxygen s± dostêpne tak¿e w MyGnokii. +Jedynym wyj±tkiem jest tu wymiana informacji pomiêdzy MyGnokii a MS Outlook +czy Lotus Notes. Jak ka¿de oprogramowanie dostêpne na licencji GNU, nie +posiada ograniczeñ czasowych czy funkcjonalnych. Co wiêcej, jest udostêpniane +z pe³nym kodem ¼ród³owym i pozwala na wykorzystanie funkcji telefonów we +w³asnych aplikacjach. +

Nie znaczy to oczywi¶cie, ¿e MyGnokii jest pakietem idealnym. Pracuj±ca +w trybie tekstowym gnokii zosta³a dobrze dopracowana. Jedynie okienkowa +wersja pakietu, xgnokii, mimo ¿e bardzo prosta i intuicyjna w obs³udze, +mo¿e sprawiæ ma³y zawód. Wersja xgnokii zawarta w pakiecie pochodzi +sprzed prawie pó³tora roku i niestety nie jest niestety dokoñczona. Podczas +testów przeprowadzonych przy u¿yciu dwóch telefonów Nokia 6210, stwierdzili¶my +problemy z obs³ug± kalendarza i ksi±¿ki telefonicznej. W przypadku kalendarza +- czê¶æ typów alarmów nie mo¿na by³o ustawiæ. Z kolei ksi±¿ka telefoniczna +nie umo¿liwia³a zapisywania zmian na karcie SIM telefonu, ponadto nie mo¿na +by³o wprowadziæ nowego numeru telefonu. Oczywi¶cie problemy te znika³y, +kiedy korzystano z gnokii w trybie tekstowym, trzeba jednak przyznaæ, +¿e praca w trybie graficznym jest znacznie prostsza i przyjemniejsza ni¿ +w trybie tekstowym. + +

Na pocz±tek

+ +8. Transmisja danych
+


+ +

Transmisja danych realizowana jest przez ró¿ne modele telefonów Nokia +ró¿nymi sposobami. W dodatku, nie w ka¿dym modelu jest ona mo¿liwa. +

MyGnokii (równie¿ Gnokii) daje u¿ytkownikowi narzêdzie, jakim jest gnokiid, +s³u¿±ce przesy³aniu danych w starszych modelach telefonów. +

Transmisja danych z u¿yciem +gnokiid jest prowadzona w specyficzny +sposób. Po po³±czeniu siê z telefonem poprzez kabel/podczerwieñ w wersji +bezpo¶redniej gnokiid przetwarza dane z telefonu do postaci komend +AT, które s± przekazywane do innych programów w komputerze. Podobnie w +przypadku otrzymania komendy AT, jest ona przetwarzana do postaci wewnêtrznych +poleceñ Nokii i przesy³ana do telefonu. + +

Gnokiid mo¿na wykorzystywaæ tylko z telefonami serii 31xx/51xx/61xx/81xx. +Je¿eli chodzi o modele 21xx, brak jest odpowiednich funkcji. Nie zosta³y +one bowiem przeniesione z oryginalnego oprogramowania Nokii (pakietu Nokia +CellWare) z tej prostej przyczyny, i¿ po prostu nie ma chêtnych do wykonania +tego zadania. +

A co maj± zrobiæ u¿ytkownicy nowszych telefonów ? W przypadku modeli +3210/33xx transmisja danych jest oficjalnie niedostêpna i projektanci MyGnokii +i Gnokii nie posiadaj± ¿adnych informacji, czy funkcja ta faktycznie zosta³a +usuniêta z oprogramowania telefonów, czy te¿ zosta³ zmieniony sposób jej +wywo³ania. +

Z kolei w telefonach serii 62xx/7110/8210/8850 ¿adne dodatkowe oprogramowanie +nie jest konieczne. Telefony te maj± wbudowane modemy, wystarczy wiêc zakupiæ +kabel (DLR-3P) lub wykorzystaæ porty podczerwieni by transmisja by³a mo¿liwa. +Korzystaj±c z narzêdzi dostepnych w systemie (np.: modemtool w dystrybucji +Red Hat) Linux powinien rozpoznaæ przy³±czony telefon jako modem i zainstalowaæ +go w systemie. Dalsza komunikacja ze sprzêtem odbywa siê tak, jak z tradycyjnym +modemem. +

Konfiguruj±c dostêp do Internetu musimy tylko pamiêtaæ, ¿e powinni¶my +korzystaæ ze specjalnych numerów dostêpowych naszego operatora sieci GSM +a nie np.: z numeru dostêpowego TPSA. Ten drugi mo¿e byæ bowiem niedostêpny. +Je¿eli natomiast uda siê z nim nawet po³±czyæ, jego u¿ycie bêdzie na pewno +znacznie dro¿sze. + +

Na pocz±tek

+ +9. Dokumentacja
+


+ +

W pakiecie u¿ytkownik znajdzie wyczerpuj±c± dokumentacjê, napisan± w +formacie HTML. W procesie instalacji jest kopiowana z lokalnego katalogu +z plikami ¼ród³owymi do folderu +/usr/local/doc/gnokii. W podkatalogach +znajdziemy tak¿e loga do aparatów 3210, 3310, 6150 oraz 6210 oraz d¼wiêki +(melodyjki), które mo¿emy przes³aæ do telefonu. Znajdziemy tak¿e przyk³adowy +zbiór konfiguracyjny oraz przyk³adowe pliki z danymi do wykorzystania z +ró¿nymi opcjami. +

Zawarta dokumentacja jest bardzo obszerna. W detalach opisuje procesy +instalacji i konfiguracji (ze szczegó³ami wyja¶nia znaczenie poszczególnych +komend), opisuje w jaki sposób po³aczyæ telefony 6210 i 7110 z komputerem +przez podczerwieñ, wyja¶nia dostêpne polecenia gnokii. Dociekliwi +znajd± bardzo szczegó³owe informacje o uruchomieniu i korzystaniu z monitora +sieci, poradnik jak wykonaæ kabel ³±cz±cy telefon z komputerem, informacje +o zmianach w oprogramowaniu telefonów, kodach i dokumentacjê protoko³ów +transmisji. +

Niestety, prawie wszystkie informacje podane zosta³y w jêzyku angielskim. + +

Na pocz±tek

+ +10. Przysz³o¶æ
+


+ +

Niestety, nie rysuje siê ona najlepiej. Gnokii i MyGnokii s± rozwijane +oddzielnie przez niewielkie grupy programistów, którzy nie maj± dostêpu +do wszystkich sprzedawanych telefonów. A sami u¿ytkownicy tego oprogramowania +najczê¶ciej nie s± niestety zainteresowani jak±kolwiek pomoc± w ulepszaniu +pakietów czy zg³aszaniu lub usuwaniu b³êdów. +

Natomiast ci±gle jest wiele do zrobienia: dokoñczenie graficznych interfejsów +u¿ytkownika, stworzenie bardziej wyspecjalizowanych struktur do obs³ugi +niektórych funkcji (przyk³adowo: ulepszenie czê¶ci zwi±zanej z sms), upraszczanie +kodu ¼ród³owego tak, aby implementacja obs³ugi nowych modeli by³a ³atwiejsza, +dodanie funkcji obecnych w innych pakietach "komórkowych", rozszerzenie +obs³ugi komend AT. Na pewno tak¿e sporo bêdzie do zrobienia z nowymi modelami +(np. Noki± 5510, która bêdzie siê ³±czyæ z komputerem przez USB). +

Bez tego oba pakiety z czasem stan± siê wy³±cznie ciekawostk±. Miejmy +jednak nadziejê, i¿ tak siê nie stanie i znajd± siê programi¶ci oraz u¿ytkownicy, +którzy pomog± w rozszerzaniu opisywanego oprogramowania. Naprawdê nie trzeba +tutaj du¿o: wystarczy znajomo¶æ programowania w Delphi (w celu dokoñczenia +instniej±cego interfejsu graficznego), Visual Basic (mo¿e kto¶ zdecyduje +siê na rozpoczêcie napisania w³asnej wersji okienkowej Logo Managera ?), +C (rozszerzanie ca³o¶ci pakietu lub jego czê¶ci o nowe funkcje oraz usuwanie +b³êdów), C++, pisania programów w GTK (dokoñczenie Xgnokii) albo chocia¿by +znajomo¶æ HTML (opieka nad dokumentacj±). Mile widziana by³aby tak¿e pomoc +zaawansowanych programistów - wszak odkrywanie funkcji nowych modeli jest +fascynuj±c± przygod±, podobnie interesuj±cym wyzwaniem mo¿e byæ kwestia +stworzenia w³asnego sterownika modemu do starszych modeli telefonów do +systemu Windows. Przeszkod± nie powinna byæ tutaj bariera jêzykowa (nie +trzeba znaæ jêzyka angielskiego) - wszak zarówno MyGnokii i Gnokii s± aktywnie +tworzone przez Polaków - m.in. Marcina Wi±cka i Paw³a Kota. Mo¿na siê z +nimi skontaktowaæ pod adresami email podanymi w ramce "Sieæ". + +

Marcin Wi±cek +
Ryszard Gabryszewski
+ +

Na pocz±tek

+ +11. Czy tylko Nokia ?
+


+ +

Telefony Nokii s± najbardziej rozpowszechnionymi aparatami komórkowymi +nie tylko w Polsce, tak¿e na ¶wiecie. Wiêcej, nazwa firmy sta³a siê wrêcz +synonimem "komórki". Tak wiêc powstanie pakietów, które umo¿liwiaj± komunikacje +Linuksa z tym typem aparatów nie powinno wydawaæ siê dziwne. +

Na szczê¶cie posiadacze Ericssonów, Alcateli, Siemensów i innych nie +powinni traciæ nadziei :-) Istnieje tak¿e inny, ciekawy projekt Open Source: +gsmlib. Ma on na celu tworzenie biblioteki i programów w wersji na konsolê +pozwalaj±cych wykonywaæ podstawowe czynno¶ci typu edycja ksi±¿ki telefonicznej +czy smsów w telefonach u¿ywaj±cych komend AT. Podobnie jak MyGnokii mo¿na +go bez problemu kompilowaæ i u¿ywaæ tak¿e w Windows. Gsmlib obecnie rozwija +siê znacznie szybciej ni¿ MyGnokii czy Gnokii. Dzieje siê tak dlatego, +poniewa¿ coraz wiêcej telefonów jest wyposa¿anych w komendy AT. A to oznacza, +¿e popularno¶æ projektu z czasem bêdzie coraz bardziej rosn±æ. + +

Na pocz±tek

+ +12. MyGnokii w trybie tekstowym
+


+ +

Poni¿ej zosta³y podane przyk³ady u¿ycia poleceñ i funkcji MyGnokii w +trybie tekstowym. +

+Ksi±¿ka telefoniczna

+gnokii --getmemory SM 1 10 -short > ks-tel.txt +

Pobiera pierwszych 10 numerów z ksi±¿ki telefonicznej na karcie SIM +i zapisuje w pliku ks-tel.txt. Je¿eli nie podamy parametru -short, +zostanie u¿yty format bardziej czytelny dla u¿ytkownika, ale nie bêdzie +mo¿na u¿yæ opcji --writephonebook z utworzonym plikiem. +

gnokii --writephonebook < ks-tel.txt +

Odtwarza ksi±¿kê telefoniczn± z pliku ks-tel.txt. +

+SMS

+gnokii --getsms SM 1 +

Pobiera SMS z karty SIM, pozycja 1. +

gnokii --sendsms +48601234567 -d --long 200 < file +

Czyta 200 znaków z pliku file, tworzy z nich tre¶ci SMSów (tutaj bêd± +2 SMSy - pierwszy o d³ugo¶ci 160 znaków) i wysy³a pod numer +48601234567. +W telefonie zostanie zapisany raport dorêczenia. Je¿eli zast±pimy --sendsms +przez --savesms, SMSy zostan± zapisane na karcie SIM. Dodanie parametru +--unicode +spowoduje ich zakodowanie w Unicodzie (wtedy w jednym mo¿e zmie¶ciæ siê +tylko 70 znaków, ale bêd± mog³y to byæ wszystkie znaki ze strony kodowej +w komputerze). +

gnokii --getsmsc 1 +

Pobiera pierwszy numer centrum SMS zapisany na karcie SIM. +

gnokii --renamesmsc 1 "Era GSM" +

Zmienia nazwê pierwszego centrum SMS na karcie SIM +

+Czas i data

+gnokii --setdatetime +

Ustawia w telefonie czas z komputera. Ustawianie czasu mo¿e byæ wymuszone +tak¿e opcj± synchronizetime w zbiorzegnokiirc. +

gnokii --setalarm 22 10 +

Ustawia w telefonie alarm na godzinê 22:10. +

+Kalendarz

+gnokii --getcalendarnote 1 3 -v30 +

Pobiera pierwsz±, drug± i trzeci± notatkê z kalendarza telefonu (w Nokii +33xx jest on okrojony do 10 przypomnieñ - pod tak± nazw± kalendarz dostêpny +jest w menu telefonu). Je¿eli nie podamy parametru -v30, zostanie +u¿yty format bardziej czytelny dla u¿ytkownika, ale nie bêdzie mo¿na u¿yæ +opcji --writecalendarnote i --sendcalendarnote z utworzonym +plikiem. +

gnokii --sendcalendarnote +48601234567 vcardfile 1 -d +

Odczytuje 1 pozycjê z pliku +vcardfile i wysy³a pod numer +48601234567 +z raportem dorêczenia (opcja +--getcalendarnote wypisze tre¶æ takiej +notki, je¿eli dodamy prze³±cznik -v30). +

gnokii --writecalendarnote vcardfile 1 +

Odczytuje 1 pozycjê z pliku +vcardfile i wpisuje do telefonu (opcja +--getcalendarnote +wypisze tre¶æ takiej notki, je¿eli dodamy prze³±cznik -v30). +

+Dzwonki

+ +


gnokii --playringtone ringtonefile +

Odtwarza plik z dzwonkiem (format mid albo rttl) z pliku ringtonefile +prze g³o¶nik telefonu. +

gnokii --composer ringtonefile +

Pokazuje, co i jak nale¿y wpisaæ w kompozytorze dostêpnym w menu np. +Nokii 3210/33xx, aby uzyskaæ dzwonek z pliku ringtonefile (nie wymaga +po³±czenia z telefonem). +

gnokii --setringtone plik 1 +

Ustawia dzwonek ze zbioru plik na pozycji 1. +

gnokii --sendringtone +48602123456 plik -d --scale --profilestyle +

Wysy³a dzwonek pod numer +48602123456 z raportem dorêczenia. Opcja --scale +jest konieczna do u¿ycia w przypadku b³êdnej interpretacji dzwonków przez +niektóre modele (np. starsze Nokie 3310). Opcja +--profilestyle pozwala +zapisaæ d³ugie dzwonki w 2 SMSach. Bêd± one poprawnie interpretowane wy³±cznie +przez nowsze telefony - np. Nokie 3330. +

gnokii --setbinringtone plik 1 +

Je¿eli mamy plik z dzwonkiem w specjalnym formacie binarnym (w MyGnokii +tak s± zapisane wszystkie standardowe dzwonki umieszczone w katalogu +mygnokii/Docs/default/sounds), +przy pomocy tej opcji mo¿na je w niektórych modelach - np. serii 61xx/6210 +- ustawiæ jako dzwonki wgrywane przez u¿ytkownika). +

gnokii --getringtone plik 1 +

Pobiera dzwonek z pozycji 1 i zapisuje w zbiorze plik. Dzwonek +zostanie zapisany w formacie binarnym (Nokie 6xxx/3210) albo standardowym +(Nokie 33xx). +

+WAP

+gnokii --getwapbookmark 1 +

Pobiera zak³adkê WAP z pozycji 1. +

gnokii --sendwapbookmark 1 +48602123456 -d +

Pobiera zak³adkê WAP z pozycji 1 i wysy³a pod numer +48602123456 (z +raportem dorêczenia). +

gnokii --getwapsettings 1 +

Pobiera ustawienia WAP z pozycji 1. +

+Loga i obrazki

+gnokii --showbitmap logofile +

Pokazuje logo z pliku logofile. Dostêpne formaty: bmp (2 kolorowe), +ngg, nol, nlm, nsm. +

gnokii --getlogo picture plik.nlm 1 +

Pobiera grafikê (tzw. Picture Image) z pozycji 1 i zapisuje w zbiorze +plik.nlm. +

gnokii --setlogo picture plik.nlm 1 "tekst" +48602123456 +

Odczytuje grafikê ze zbioru plik.nlm i zapisuje na pozycji 1 z dodatkowym +tekstem "tekst" i numerem +48602123456. +

gnokii --sendlogo picture +48602123456 plik.nlm "tekst" -d +

Wysy³a grafikê pod podany numer z raportem dorêczenia i dodatkowym tekstem +(Uwaga: 1 grafika to 3 SMSy). +

gnokii --getlogo startup|7110startup|6210startup plik.nlm +

Pobiera logo startowe (parametry +7110startup lub 6210startup +pozwalaj± pobraæ loga o rozmiarach wy¶wietlaczy Nokii 7110 i 6210) i zapisuje +w pliku plik.nlm. Opcja +--setlogo z takimi samymi parametrami +ustawia logo w telefonie. W nowszych Nokiach 3210 oraz z serii 33xx przed +wgraniem loga, trzeba u¿yæ opcji +--resetphonesettings, która wykasuje +logo animowane (Uwaga: nie bêdzie mo¿na potem do niego powróciæ !). +

gnokii --getlogo op|7110op plik.nlm +

Pobiera logo operatora (parametr +7110op pozwala pobraæ logo o +rozmiarach dostêpnych w Nokii 62xx/7110) i zapisuje w pliku plik.nlm. +

gnokii --setlogo op|7110op plik.nlm +

Ustawia logo operatora (je¿eli nie podamy nazwy pliku, logo zostanie +wykasowane w telefonie). +

gnokii --sendlogo op +48602123456 logo.nlm kod_operatora -d +

Wysy³a logo operatora (uwaga, du¿ych logo znanych z Nokii 62xx/7110 +nie mo¿na przesy³aæ) pod numer +48602123456 z raportem dorêczenia. Logo +bêdzie pokazywane w sieci o kodzie kod_operatora ("260 01" dla Plusa, +"260 02" dla Ery i "260 03" dla Idei). Je¿eli nie podamy numeru odbiorcy, +parametru -d i zamienimy --sendlogo przez +--savelogo, logo +zostanie zapisane na karcie SIM. +

gnokii --getlogo caller logo.nlm 1 +

Pobiera logo grupy o numerze 1 i zapisuje w pliku +logo.nlm. Je¿eli +zast±pimy --getlogo przez --setlogo, logo zostanie ustawione +w telefonie. +

gnokii --setlogo dealer "tekst" +

Ustawia w telefonie tzw. powitanie dealera - tekst z powitaniem widoczny +po w³±czeniu telefonu, którego nie mo¿na ustawiæ z jego menu. +

+Inne

+ +


gnokii --reset soft +

Resetuje telefon. +

gnokii --dialvoice +48601123456 +

Inicjuje po³±czenie g³osowe pod numer +48601123456. +

gnokii --netmonitor devel +

W³±cza pe³ne menu monitora sieci w telefonie (opcja ta pozwala dok³adnie +sprawdzaæ stan sieci komórkowej "widzianej" przez telefon oraz pokazuje +dok³adne informacje o samym telefonie, karcie SIM oraz baterii). Szerzej +o tej funkcji mo¿na przeczytaæ na stronie autora artyku³u lub w dokumentacji +MyGnokii. W przypadku niektórych wersji oprogramowania telefonu, niezbêdne +bêdzie wy³±czenie i ponowne w³±czenie aparatu by pojawi³a siê w nim nowa +pozycja w menu. +

gnokii --identify +

Pokazuje podstawowe informacje o telefonie - m.in. model i wersjê oprogramowania. +

gnokii --presskeysequence sequence +

W telefonie "wciska" kombinacjê klawiszy sequence. +

gnokii --getsecuritycode SecurityCode +

Pobiera z telefonu kod zabezpieczaj±cy (SecurityCode). Opcja dostêpna +wy³±cznie, gdy przy wywo³aniu skryptu configure dodano prze³±cznik--enable-security. +

gnokii --simlock +

Informacje o simlocku - zabezpieczeniu uniemo¿liwiaj±cym korzystanie +z kart SIM innych ni¿ macierzystego operatora GSM. Blokada taka pojawia +siê najczê¶ciej w telefonach sprzedawanych w promocjach. +

gnokii --phonetests +

Wykonuje test telefonu. Krótkie wyja¶nienie do testów REAL TIME CLOCK +BATTERY oraz MCU EEPROM COMPONENT: pierwszy testuje dzia³anie baterii podtrzymuj±cej +datê/czas w telefonie po od³±czeniu baterii g³ównej. Baterii tej nie ma +m.in w Nokiach 3210 i 33xx i wtedy bêdzie on mia³ b³êdny wynik. Nie jest +to jednak uszkodzenie telefonu ! Podobnie we wszystkich nowych modelach +(33xx, 62xx, 7110, 8210/8850 i nowszych) pamiêæ z ustawieniami telefonu +(EEPROM) nie jest w formie oddzielnego uk³adu scalonego i program równie¿ +poka¿e tutaj b³±d. +

gnokii --displayoutput +

Pokazuje na ekranie komputera teksty wy¶wietlane przez telefon (dotyczy +serii 51xx/61xx). + +

Na pocz±tek

+ +13. Porównanie
+


+ +

Poni¿sza tabela zbiera informacje dotycz±ce sposobów komunikacji pomiêdzy +telefonem a komputerem. Znak zapytania w komórce oznacza, ¿e dana konfiguracja +nie by³a jeszcze sprawdzana. Natomiast znak x oznacza brak mo¿liwo¶ci wspó³pracy. +
  + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
  +
Mbus
+
+
Fbus
+
+
Podczerwieñ bezpo¶rednia
+
+
Podczerwieñ socketowa
+
+
Nokia 21xx/9000
+
+
Gnokii
+
+
X
+
+
X
+
+
X
+
+
31xx/81xx
+
+
X
+
+
MyGnokii +

Gnokii

+
+
X
+
+
X
+
+
3210/33xx
+
+
MyGnokii
+
+
MyGnokii +

Gnokii

+
+
X
+
+
X
+
+
51xx
+
+
MyGnokii
+
+
MyGnokii +

Gnokii

+
+
X
+
+
X
+
+
61xx
+
+
MyGnokii
+
+
MyGnokii +

Gnokii

+
+
MyGnokii +

Gnokii

+
+
X
+
+
62xx/7110
+
+
MyGnokii
+
+
MyGnokii +

Gnokii

+
+
X
+
+
MyGnokii +

Gnokii

+
+
8210/8850
+
+
MyGnokii
+
+
MyGnokii +

Gnokii

+
+
MyGnokii
+
+
MyGnokii
+
+
9110/9210
+
+
MyGnokii
+
+
X
+
+
?
+
+
?
+
+
Nokia Card Phone 2.0
+
+
MyGnokii +

(czê¶ciowo)

+
+
X
+
+
X
+
+
X
+
+ +

Na pocz±tek

+ +14. Sieæ
+


+ +

MyGnokii +
http://marcin-wiacek.topnet.pl +
marcin-wiacek@topnet.pl +

Gnokii +
http://www.gnokii.org +
ftp://urtica.linuxnews.pl/pub/people/pkot/gnokii/ +
pkot@linuxnews.pl +

GSMLib +
http://www.pxh.de/fs/gsmlib/ +

Kable +
http://www.fkn.pl/varia/kable.html +
http://www.atrox.at/datacable/ +

Specyfikacje GSM +
http://www.etsi.org +

Windows & Nokia +

Oxygen Phone Manager: http://www.oxygensoftware.com +
ActiveX dla Nokii: http://www.gertjaap.com/ +
Logo Manager: http://www.logomanager.co.uk + +

Na pocz±tek + + + diff --git a/Docs/pl_PL/styl.css b/Docs/pl_PL/styl.css new file mode 100644 index 0000000..02b023e --- /dev/null +++ b/Docs/pl_PL/styl.css @@ -0,0 +1,46 @@ + + + diff --git a/Docs/sample/cimd-connect b/Docs/sample/cimd-connect deleted file mode 100755 index 320c4e9..0000000 --- a/Docs/sample/cimd-connect +++ /dev/null @@ -1,6 +0,0 @@ -#! /usr/sbin/chat -vEf -# ^^^ all options MUST be given as ONE word only (all are passed as ARGV[1]) -TIMEOUT 3 "" "ATZ" "OK-ATZ-OK" "" ABORT "BUSY" ABORT "NO CARRIER" ABORT "NO DIAL TONE" ABORT "ERROR" ABORT "VOICE" "" -ATL2 OK -ATD$TELEPHONE -TIMEOUT 90 CONNECT \c ^M \c diff --git a/Docs/sample/magic b/Docs/sample/magic new file mode 100644 index 0000000..d1822a4 --- /dev/null +++ b/Docs/sample/magic @@ -0,0 +1,14 @@ +# Add these to magic file (located in /etc or /usr/share/misc) +# to let the file command recognize NOL and NGG files +# +# Pawe³ Kot +# Based on the gnokii (http://www.gnokii.org/) sources + +# GSM Operator Logos - NOL +0 string NOL GSM Operator Logo, NOL format +>10 byte x (size %d x +>12 byte x %d) +# GSM Caller Icons - NGG +0 string NGG GSM Caller Icon, NGG format +>6 byte x (size %d x +>8 byte x %d) diff --git a/README b/README new file mode 100644 index 0000000..ceccec6 --- /dev/null +++ b/README @@ -0,0 +1,79 @@ +1.What is this ? +---------------- +This is my own version of gnokii... + +It was created from CVS gnokii 0.3.3_pre8-gold and contains many other changes. +I decided to make it, since gnokii project seemed to be frozen (from 07.2000 ?) +and my changes were ignored. + +In this moment CVS gnokii is developed again. It went into different +direction (doesn't use threads and probably will work better on multi CPU +systems), but many functions still are worse than in mygnokii + +Now there is small cooperation of these two projects(some new CVS source is in +mygnokii and some things from mygnokii are in CVS), but they're more and more +different and I don't think, that they will join again +(well, I implemented almost all Smart Messaging and other functions +Everything works rather correct and only bugs need to be removed. Because of +it I'm not sure, if it will have sence for me to write it again for CVS gnokii- +especially, that I don't like organisation there and IMHO every change needs +there tons of explanations and emails) + +So, if you think, that mygnokii works better for you, use it and please help +in improving or testing. I will try to answer on each your email (of course, +I can't promise :-( ). + +If you like more CVS gnokii, use gnokii. That's all. + +2.Where to send your updates to gnokii ? +---------------------------------------- +If you made something - patch, script, etc., which could be useful for gnokii +users, please send it to the Marcin-Wiacek@Topnet.PL. THX + +3.How to apply patches ? +------------------------ +Make "patch < patchfile", where patchfile is name of file with patch. + +4.How to create patches ? +------------------------- +1.copy source with gnokii, you start from, into "gnokii" dir +2.copy source with gnokii, you want to modify, into "work" dir +3.make changes in "work" +4.go into subdirectory with "gnokii" and "work" +5.make "diff -urx CVS gnokii work > patchfile" +6.send "patchfile" to me ;-) + +5.TODO +------ +6210: + * support for voice tags in phonebook + * NBS (with preview) uploading for caller/op logos + * probably speed dials need some improvements + +Other: + * support for 5210, 5510, 6310, 6510, 8310 (sniffs required) + * support for irda sockets in win32 + * EMS + * support for more AT phones and commands + * compatibility with gnomecal + * end xgnokii + +6.BUGS and INCOMPATIBILITIES +---------------------------- +Other: + * gnome viewers have sometimes problems with displaying bmp files + written by gnokii. This is NOT mygnokii fault. + * phone sometimes doesn't want to speak over mbus (when previous + transmission was cut - some ACK were not sent/received) in command line + gnokii in Unix/Linux. Must restart phone and then and works... + * sometimes, when read alphanumeric numbers, name is 1 char too long + * when save some SMS to phone (8 bit with UDH), after forwarding them + from phone menu they're changed. 100% firmware bug (6210, probably + each Nokia phone with SMS memory) + +----- +If know some other, please let me know to marcin-wiacek@topnet.pl. +Please include version of mygnokii, description of bug and debug info from it +(the best, if you can compile it with debug and send me it; if have only + executables, you can use "logfile" option in gnokiirc to make it). + \ No newline at end of file diff --git a/common/devices/device.c b/common/devices/device.c new file mode 100644 index 0000000..bf48de3 --- /dev/null +++ b/common/devices/device.c @@ -0,0 +1,586 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + +*/ + +#ifndef WIN32 + #include "devices/unixserial.h" + #include "devices/unixirda.h" + #include "devices/tekram.h" + #include + #include + #include + #include + #include +#else + #include + #include "devices/winserial.h" +#endif + +#include "gsm-api.h" +#include "devices/device.h" +#include "files/cfgreader.h" + +#include + +#ifdef VC6 + /* for VC6 make scripts save VERSION constant in mversion.h file */ + #include "mversion.h" +#endif + +char PortDevice[GSM_MAX_DEVICE_NAME_LENGTH]={0x00}; + +bool duringwrite; + +#ifndef WIN32 + +char *lockfile; + +//pthread_t Thread; +#if defined(__svr4__) || defined(__FreeBSD__) + pthread_t selThread; +#endif + +int device_portfd = -1; + +#define max_buf_len 128 +#define lock_path "/var/lock/LCK.." + +/* Lock the device. Return allocated string with a lock name */ +char *lock_device(const char* port) +{ + char *lock_file = NULL; + char buffer[max_buf_len]; + const char *aux = rindex(port, '/'); + int fd, len = strlen(aux) + strlen(lock_path); + + /* Remove leading '/' */ + if (aux) aux++; + else aux = port; + + memset(buffer, 0, sizeof(buffer)); + lock_file = calloc(len + 1, 1); + if (!lock_file) { + fprintf(stderr, _("Out of memory error while locking device\n")); + return NULL; + } + /* I think we don't need to use strncpy, as we should have enough + * buffer due to strlen results + */ + strcpy(lock_file, lock_path); + strcat(lock_file, aux); + + /* Check for the stale lockfile. + * The code taken from minicom by Miquel van Smoorenburg */ + if ((fd = open(lock_file, O_RDONLY)) >= 0) { + char buf[max_buf_len]; + int pid, n = 0; + + n = read(fd, buf, sizeof(buf) - 1); + close(fd); + if (n > 0) { + pid = -1; + if (n == 4) + /* Kermit-style lockfile. */ + pid = *(int *)buf; + else { + /* Ascii lockfile. */ + buf[n] = 0; + sscanf(buf, "%d", &pid); + } + if (pid > 0 && kill((pid_t)pid, 0) < 0 && errno == ESRCH) { + fprintf(stderr, _("Lockfile %s is stale. Overriding it..\n"), lock_file); + sleep(1); + if (unlink(lock_file) == -1) { + fprintf(stderr, _("Overriding failed, please check the permissions\n")); + fprintf(stderr, _("Cannot lock device\n")); + goto failed; + } + } else { + fprintf(stderr, _("Device already locked.\n")); + goto failed; + } + } + /* this must not happen. because we could open the file */ + /* no wrong permissions are set. only reason could be */ + /* flock/lockf or a empty lockfile due to a broken binary */ + /* which is more likely (like gnokii 0.4.0pre11 ;-) */ + if (n == 0) { + fprintf(stderr, _("Unable to read lockfile %s.\n"), lock_file); + fprintf(stderr, _("Please check for reason and remove the lockfile by hand.\n")); + fprintf(stderr, _("Cannot lock device\n")); + goto failed; + } + } + + /* Try to create a new file, with 0644 mode */ + fd = open(lock_file, O_CREAT | O_EXCL | O_WRONLY, 0644); + if (fd == -1) { + if (errno == EEXIST) + fprintf(stderr, _("Device seems to be locked by unknown process\n")); + else if (errno == EACCES) + fprintf(stderr, _("Please check permission on lock directory\n")); + else if (errno == ENOENT) + fprintf(stderr, _("Cannot create lockfile %s. Please check for existence of path"), lock_file); + goto failed; + } + sprintf(buffer, "%10ld gnokii\n", (long)getpid()); + write(fd, buffer, strlen(buffer)); + close(fd); + return lock_file; +failed: + free(lock_file); + return NULL; +} + +/* Removes lock and frees memory */ +bool unlock_device(char *lock_file) +{ + int err; + + if (!lock_file) { +// fprintf(stderr, _("Cannot unlock device\n")); + return false; + } + err = unlink(lock_file); + free(lock_file); + return (err + 1); +} + +/* + * Structure to store the filedescriptor we use. + * + */ +int device_getfd(void) +{ + return device_portfd; +} + +int device_open(__const char *__file, int __with_odd_parity) { + struct CFG_Header *cfg_info; + char *aux; + + cfg_info=CFG_FindGnokiirc(); + if (cfg_info!=NULL) { + aux = CFG_Get(cfg_info, "global", "use_locking"); + if (aux) { + if (!strcmp(aux, "yes")) { + lockfile = lock_device(__file); + if (!lockfile) return false; + } + } + } + + switch (CurrentConnectionType) { + case GCT_Tekram: + device_portfd = tekram_open(__file); + break; + case GCT_Irda: + device_portfd = irda_open(); + break; + default: + device_portfd = serial_opendevice(__file, __with_odd_parity, true, false); + break; + } + + return (device_portfd >= 0); +} + +void device_close(void) +{ + AppendLogText("CLOSE\n",false); + + /* Now wait for thread to terminate. */ + //pthread_join(Thread, NULL); + + unlock_device(lockfile); + + switch (CurrentConnectionType) { + case GCT_Tekram: tekram_close(device_portfd); break; + case GCT_Irda : irda_close(device_portfd); break; + default : serial_close(device_portfd); break; + } + + PortDevice[0]=0x00; +} + +void device_reset(void) { +} + +void device_setdtrrts(int __dtr, int __rts) +{ + switch (CurrentConnectionType) { + case GCT_Tekram: + case GCT_Irda: + break; + default: + serial_setdtrrts(device_portfd, __dtr, __rts); +#ifdef DEBUG + device_dumpserial(); +#endif + break; + } +} + +void device_changespeed(int __speed) +{ + switch (CurrentConnectionType) { + case GCT_Irda: + break; + case GCT_Tekram: + tekram_changespeed(device_portfd, __speed); + break; + default: + serial_changespeed(device_portfd, __speed); +#ifdef DEBUG + fprintf(stdout,_("Serial device: changing speed to %i\n"),__speed); +#endif + break; + } +} + +size_t device_read(__ptr_t __buf, size_t __nbytes) +{ + switch (CurrentConnectionType) { + case GCT_Tekram: return (tekram_read(device_portfd, __buf, __nbytes)); break; + case GCT_Irda : return ( irda_read(device_portfd, __buf, __nbytes)); break; + default : return (serial_read(device_portfd, __buf, __nbytes)); break; + } +} + +size_t device_write(__const __ptr_t __buf, size_t __n) { + u8 buffer[300]; + size_t mysize; + + while (duringwrite) {} + + memcpy(buffer,__buf,__n); + AppendLog(buffer,__n,true); + + duringwrite=true; + switch (CurrentConnectionType) { + case GCT_Irda : mysize = irda_write(device_portfd, __buf, __n); break; + case GCT_Tekram: mysize = tekram_write(device_portfd, __buf, __n); break; + default : mysize = serial_write(device_portfd, __buf, __n); break; + } + duringwrite=false; + return mysize; +} + +#ifdef DEBUG +void device_dumpserial(void) +{ + int PortFD; + unsigned int Flags=0; + + PortFD = device_getfd(); + + ioctl(PortFD, TIOCMGET, &Flags); + + fprintf(stdout, _("Serial device:")); + fprintf(stdout, _(" DTR is %s"), Flags&TIOCM_DTR?_("up"):_("down")); + fprintf(stdout, _(", RTS is %s"), Flags&TIOCM_RTS?_("up"):_("down")); + fprintf(stdout, _(", CAR is %s"), Flags&TIOCM_CAR?_("up"):_("down")); + fprintf(stdout, _(", CTS is %s\n"), Flags&TIOCM_CTS?_("up"):_("down")); +} +#endif /* DEBUG */ + +void SigHandler(int status) +{ + + unsigned char buffer[2048]; + + int count, res; + + res = device_read(buffer, 255); + + for (count = 0; count < res ; count ++) { + Protocol->StateMachine(buffer[count]); + } +} + + +#if defined(__svr4__) || defined(__FreeBSD__) +/* thread for handling incoming data */ +void SelectLoop() { + int err; + fd_set readfds; + struct timeval timeout; + + FD_ZERO(&readfds); + FD_SET(device_portfd,&readfds); + /* set timeout to 15 seconds */ + timeout.tv_sec=15; + timeout.tv_usec=0; + while (!CurrentRequestTerminate) { + err=select(device_portfd+1,&readfds,NULL,NULL,&timeout); + if ( err > 0 ) { + /* call singal handler to process incoming data */ + SigHandler(0); + /* refresh timeout, just for linux :-( */ + /* required for irda */ + timeout.tv_sec=15; + } else { + if (err == -1) + perror("Error in SelectLoop"); + } + } +} +#endif + +bool StartConnection (char *port_device, bool with_odd_parity, GSM_ConnectionType con) +{ + int result; + + char text[100]; + +#if defined(__svr4__) || defined(__FreeBSD__) + int rtn; +#else + struct sigaction sig_io; +#endif + +#ifdef DEBUG + if ((strstr(GSM_Info->IrdaModels,"decode")!=NULL) && (CurrentConnectionType == GCT_Irda)) + { + printf("DEBUG and Irda decode Model -> not realy open ;-)\n"); + return true; + } +#endif + + if (PortDevice[0]!=0x00) return true; + + duringwrite=false; + + strncpy(PortDevice, port_device, GSM_MAX_DEVICE_NAME_LENGTH); + +#ifdef DEBUG + fprintf(stdout,_("Opening \"%s\" device...\n"),PortDevice); +#endif + + strcpy(text,"\n\n\nMygnokii "); + sprintf(text+strlen(text), "%s",VERSION); + strcpy(text+strlen(text),"\n"); + AppendLogText(text,false); + + strcpy(text,"Port "); + strcpy(text+strlen(text),PortDevice); + strcpy(text+strlen(text),"\n"); + AppendLogText(text,false); + + strcpy(text,"Connection "); + switch (con) { + case GCT_FBUS :strcpy(text+strlen(text),"FBUS");break; + case GCT_Infrared:strcpy(text+strlen(text),"infrared");break; + case GCT_Irda :strcpy(text+strlen(text),"irda sockets");break; + case GCT_MBUS :strcpy(text+strlen(text),"MBUS");break; + case GCT_DLR3 :strcpy(text+strlen(text),"DLR3");break; + case GCT_Tekram :strcpy(text+strlen(text),"Tekram");break; + case GCT_AT :strcpy(text+strlen(text),"AT");break; + default :strcpy(text+strlen(text),"unknown");break; + } + strcpy(text+strlen(text),"\n"); + AppendLogText(text,false); + + /* Ralf Thelen: In this moment there is NO method of communication, + which require keepalive packets and GSM->KeepAlive is + always NULL_KeepAlive, I comment this thread, */ + + /* Create and start main thread. */ +// rtn = pthread_create(&Thread, NULL,(void*)GSM->KeepAlive, (void *)NULL); +// +// if (rtn != 0) { +// fprintf(stdout,_("Error\n")); +// return false; +// } + +#if defined(__svr4__) || defined(__FreeBSD__) +#else + /* Set up and install handler before enabling async IO on port. */ + sig_io.sa_handler = SigHandler; + sig_io.sa_flags = 0; + sigaction (SIGIO, &sig_io, NULL); +#endif + + /* Open device. */ + result = device_open(PortDevice, with_odd_parity); + + if (!result) { + fprintf(stdout,_("Error\n")); + return false; + } + +#if defined(__svr4__) || defined(__FreeBSD__) + /* create a thread to handle incoming data from mobile phone */ + rtn=pthread_create(&selThread,NULL,(void*)SelectLoop,(void*)NULL); + if (rtn != 0) { + fprintf(stdout,_("Error\n")); + return false; + } +#endif + + return true; +} + +/* ---------------- RTH: #ifdef WIN32 ------------------ */ + +#else + + extern HANDLE hPhone; + +void device_close(void) +{ + AppendLogText("CLOSE\n",false); + + CloseConnection(); + + PortDevice[0]=0x00; +} + +#ifdef DEBUG +void device_dumpserial(void) +{ + DCB dcb; + + dcb.DCBlength = sizeof(DCB); + GetCommState(hPhone, &dcb); + + fprintf(stdout, _("Serial device:")); + fprintf(stdout, _(" DTR is ")); + switch (dcb.fDtrControl) { + case DTR_CONTROL_ENABLE : fprintf(stdout, _("up")); break; + case DTR_CONTROL_DISABLE : fprintf(stdout, _("down")); break; + case DTR_CONTROL_HANDSHAKE: fprintf(stdout, _("handshake"));break; + } + fprintf(stdout, _(", RTS is ")); + switch (dcb.fRtsControl) { + case RTS_CONTROL_ENABLE : fprintf(stdout, _("up\n")); break; + case RTS_CONTROL_DISABLE : fprintf(stdout, _("down\n")); break; + case RTS_CONTROL_HANDSHAKE: fprintf(stdout, _("handshake\n"));break; + case RTS_CONTROL_TOGGLE : fprintf(stdout, _("toggle\n")); break; + } +} +#endif /* DEBUG */ + +void device_setdtrrts(int __dtr, int __rts) +{ + DCB dcb; + + dcb.DCBlength = sizeof(DCB); + GetCommState(hPhone, &dcb); + + if (__dtr==1) dcb.fDtrControl = DTR_CONTROL_ENABLE; + else dcb.fDtrControl = DTR_CONTROL_DISABLE; + + if (__rts==1) dcb.fRtsControl = RTS_CONTROL_ENABLE; + else dcb.fRtsControl = RTS_CONTROL_DISABLE; + + SetCommState(hPhone, &dcb); + +#ifdef DEBUG + device_dumpserial(); +#endif +} + +void device_changespeed(int __speed) +{ + + DCB dcb; + + dcb.DCBlength = sizeof(DCB); + GetCommState(hPhone, &dcb); + + switch (__speed) { + case 115200: dcb.BaudRate=CBR_115200; break; + case 19200 : dcb.BaudRate=CBR_19200; break; + case 9600 : dcb.BaudRate=CBR_9600; break; + } + + SetCommState(hPhone, &dcb); + +#ifdef DEBUG + fprintf(stdout,_("Serial device: changing speed to %i\n"),__speed); +#endif +} + +bool StartConnection (char *port_device, bool with_odd_parity, GSM_ConnectionType con) +{ + DCB dcb; + char text[100]; + + int rtn; + + if (PortDevice[0]!=0x00) return true; + + duringwrite=false; + strncpy(PortDevice, port_device, GSM_MAX_DEVICE_NAME_LENGTH); + +#ifdef DEBUG + fprintf(stdout,_("Opening \"%s\" device...\n"),PortDevice); +#endif + + strcpy(text,"\n\n\nMygnokii "); + sprintf(text+strlen(text), "%s",VERSION); + strcpy(text+strlen(text),"\n"); + AppendLogText(text,false); + + strcpy(text,"Port "); + strcpy(text+strlen(text),PortDevice); + strcpy(text+strlen(text),"\n"); + AppendLogText(text,false); + + strcpy(text,"Connection "); + switch (con) { + case GCT_FBUS :strcpy(text+strlen(text),"FBUS");break; + case GCT_Infrared:strcpy(text+strlen(text),"infrared");break; + case GCT_Irda :strcpy(text+strlen(text),"irda sockets");break; + case GCT_MBUS :strcpy(text+strlen(text),"MBUS");break; + case GCT_DLR3 :strcpy(text+strlen(text),"DLR3");break; + case GCT_Tekram :strcpy(text+strlen(text),"Tekram");break; + case GCT_AT :strcpy(text+strlen(text),"AT");break; + default :strcpy(text+strlen(text),"unknown");break; + } + strcpy(text+strlen(text),"\n"); + AppendLogText(text,false); + + CurrentDisableKeepAlive = true; + + /* Create and start main thread. */ + rtn = ! OpenConnection(PortDevice, Protocol->StateMachine, GSM->KeepAlive); + + if (rtn != 0) { + + fprintf(stdout,_("Error\n")); + return false; + } else { + CurrentDisableKeepAlive = false; + } + + if (with_odd_parity) { + dcb.DCBlength = sizeof(DCB); + GetCommState(hPhone, &dcb); + + dcb.Parity=ODDPARITY; + + SetCommState(hPhone, &dcb); + } + + return true; +} + +size_t device_write(const __ptr_t __buf, size_t __n) { + int i; + while (duringwrite) {} + duringwrite=true; + AppendLog(__buf,__n,true); + i=WriteCommBlock(__buf,__n); + duringwrite=false; + if (i) return __n; else return 0; +} + +#endif /*WIN32*/ diff --git a/common/devices/tcp.c b/common/devices/tcp.c deleted file mode 100644 index ea4918e..0000000 --- a/common/devices/tcp.c +++ /dev/null @@ -1,205 +0,0 @@ -/* - - $Id$ - - G N O K I I - - A Linux/Unix toolset and driver for Nokia mobile phones. - - Copyright (C) 2002 Jan Kratochvil - - Released under the terms of the GNU GPL, see file COPYING for more details. - -*/ - -#include "misc.h" -#include "cfgreader.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#if __unices__ -# include -#endif - -#include -#include "devices/tcp.h" -#include "devices/unixserial.h" - -#ifdef HAVE_SYS_IOCTL_COMPAT_H - #include -#endif - -#ifdef HAVE_SYS_SELECT_H -#include -#endif - -#ifndef O_NONBLOCK - #define O_NONBLOCK 0 -#endif - -/* Open the serial port and store the settings. */ - -int tcp_open(__const char *__file) { - - int __fd; - int i; - struct sockaddr_in addr; - static bool atexit_registered=false; - char *filedup,*portstr,*end; - unsigned long portul; - struct hostent *hostent; - - if (!atexit_registered) { - memset(serial_close_all_openfds,-1,sizeof(serial_close_all_openfds)); -#if 0 /* Disabled for now as atexit() functions are then called multiple times for pthreads! */ - signal(SIGINT,unixserial_interrupted); -#endif - atexit(serial_close_all); - atexit_registered=true; - } - - __fd = socket(PF_INET,SOCK_STREAM,IPPROTO_TCP); - if (__fd == -1) { - perror("Gnokii tcp_open: socket()"); - return (-1); - } - if (!(filedup=strdup(__file))) { -fail_close: - close(__fd); - return (-1); - } - if (!(portstr=strchr(filedup,':'))) { - fprintf(stderr,"Gnokii tcp_open: colon (':') not found in connect strings \"%s\"!\n",filedup); -fail_free: - free(filedup); - goto fail_close; - } - *portstr++='\0'; - portul=strtoul(portstr,&end,0); - if ((end && *end) || portul>=0x10000) { - fprintf(stderr,"Gnokii tcp_open: Port string \"%s\" not valid for IPv4 connection!\n",portstr); - goto fail_free; - } - if (!(hostent=gethostbyname(filedup))) { - fprintf(stderr,"Gnokii tcp_open: Unknown host \"%s\"!\n",filedup); - goto fail_free; - } - if (hostent->h_addrtype!=AF_INET || hostent->h_length!=sizeof(addr.sin_addr) || !hostent->h_addr_list[0]) { - fprintf(stderr,"Gnokii tcp_open: Address resolve for host \"%s\" not compatible!\n",filedup); - goto fail_free; - } - free(filedup); - - addr.sin_family=AF_INET; - addr.sin_port=htons(portul); - memcpy(&addr.sin_addr,hostent->h_addr_list[0],sizeof(addr.sin_addr)); - - if (connect(__fd,(struct sockaddr *)&addr,sizeof(addr))) { - perror("Gnokii tcp_open: connect()"); - goto fail_close; - } - - for (i=0;i +#include +#include +#include +#include + +#include "devices/winserial.h" + +#define sleep(x) Sleep((x) * 1000) +#define usleep(x) Sleep(((x) < 1000) ? 1 : ((x) / 1000)) + +#define BAUDRATE CBR_115200 + +DWORD FAR PASCAL CommWatchProc(LPSTR lpData); +DWORD FAR PASCAL KeepAliveProc(LPSTR lpData); +BOOL SetupConnection(); +#define MAXBLOCK 1024 + +//--------------------------------------------------------------------------- +// BOOL OpenConnection(char *szPort) +// +// Description: +// Opens communication port. +// It also sets the CommState and notifies the window via +// the fConnected flag. +// +// Parameters: +// - szPort - name of com port eg "com1" +// +//--------------------------------------------------------------------------- + +OVERLAPPED osWrite, osRead; +HANDLE hPhone, hThread, hKAThread; +BOOL isConnected; +DWORD ThreadID, KAThreadID; + +BOOL OpenConnection(char *szPort, sigcallback fn, keepalive ka) +{ + BOOL fRetVal; + HANDLE hCommWatchThread; + DWORD dwThreadID; + COMMTIMEOUTS CommTimeOuts; + + if ((hPhone = + CreateFile(szPort, GENERIC_READ | GENERIC_WRITE, + 0, // exclusive access + NULL, // no security attrs + OPEN_EXISTING, + FILE_ATTRIBUTE_NORMAL | + FILE_FLAG_OVERLAPPED, // overlapped I/O + NULL)) == (HANDLE) -1) + return (FALSE); + else { + // get any early notifications + + SetCommMask(hPhone, EV_RXCHAR); + + // setup device buffers + + SetupComm(hPhone, 4096, 4096); + + // purge any information in the buffer + + PurgeComm(hPhone, PURGE_TXABORT | PURGE_RXABORT | + PURGE_TXCLEAR | PURGE_RXCLEAR); + + // set up for overlapped I/O + + CommTimeOuts.ReadIntervalTimeout = 0xFFFFFFFF; + CommTimeOuts.ReadTotalTimeoutMultiplier = 0; + CommTimeOuts.ReadTotalTimeoutConstant = 1000; +#if 0 + // CBR_9600 is approximately 1byte/ms. For our purposes, allow + // double the expected time per character for a fudge factor. + CommTimeOuts.WriteTotalTimeoutMultiplier = 2*CBR_9600/BAUDRATE; +#else + CommTimeOuts.WriteTotalTimeoutMultiplier = 10; +#endif + CommTimeOuts.WriteTotalTimeoutConstant = 0; + SetCommTimeouts(hPhone, &CommTimeOuts); + } + + fRetVal = SetupConnection(); + + if (fRetVal) { + isConnected = TRUE; + + // Create a secondary thread to issue keepAlive packets + +/* Marcin Wiacek. In this moment there is NO method of communication, + which require keepalive packets. I comment this thread, because it + makes only CPU time (100%) and makes it more hot */ +// hKAThread = CreateThread((LPSECURITY_ATTRIBUTES) NULL, +// 0, +// (LPTHREAD_START_ROUTINE) KeepAliveProc, +// (LPVOID) ka, +// 0, &KAThreadID ); +// if (!hKAThread) +// { +// isConnected = FALSE; +// CloseHandle(hPhone); +// return FALSE; +// } + + // Create a secondary thread + // to watch for an event. + + hCommWatchThread = CreateThread((LPSECURITY_ATTRIBUTES) NULL, + 0, + (LPTHREAD_START_ROUTINE) CommWatchProc, + (LPVOID) fn, + 0, &dwThreadID); + if (!hCommWatchThread) + { + isConnected = FALSE; + CloseHandle(hPhone); + fRetVal = FALSE; + } + else { + ThreadID = dwThreadID; + hThread = hCommWatchThread; + + // assert DTR + + EscapeCommFunction(hPhone, SETDTR); + } + } + else { + isConnected = FALSE; + CloseHandle(hPhone); + } + + return (fRetVal); + +} // end of OpenConnection() + +//--------------------------------------------------------------------------- +// BOOL SetupConnection() +// +// Description: +// This routines sets up the DCB based on settings in the +// TTY info structure and performs a SetCommState(). +// +// Parameters: +// +//--------------------------------------------------------------------------- + +BOOL SetupConnection() +{ + BOOL fRetVal; + DCB dcb; + + dcb.DCBlength = sizeof(DCB); + + GetCommState(hPhone, &dcb); + + dcb.BaudRate = BAUDRATE; + dcb.ByteSize = 8; + dcb.Parity = NOPARITY; + dcb.StopBits = ONESTOPBIT; + + // set DTS + + dcb.fOutxDsrFlow = 0; + dcb.fDtrControl = DTR_CONTROL_ENABLE; + + // clear RTS + + dcb.fOutxCtsFlow = 0; + dcb.fRtsControl = RTS_CONTROL_DISABLE; + + // no software flow control + + dcb.fInX = dcb.fOutX = 0; + + fRetVal = SetCommState(hPhone, &dcb); + + if (fRetVal == 0) + fRetVal = GetLastError(); + + return (fRetVal); + +} // end of SetupConnection() + +//--------------------------------------------------------------------------- +// BOOL CloseConnection() +// +// Description: +// Closes the connection to the port. Resets the connect flag +// +// Parameters: +// +//--------------------------------------------------------------------------- + +BOOL CloseConnection() +{ + isConnected = FALSE; + + // block until keepalive thread terminates (should wake it really) + +/* Marcin Wiacek. In this moment there is NO method of communication, + which require keepalive packets. I comment this thread, because it + makes only CPU time (100%) and makes it more hot */ +// WaitForSingleObject( hKAThread, INFINITE ); +#ifdef _NEVER_SAY_NEVER_AGAIN_ +// while (KAThreadID != 0) +// Sleep(250); +#endif + + // disable event notification and wait for thread + // to halt + + SetCommMask(hPhone, 0); + + // block until thread has been halted + + WaitForSingleObject( hThread, INFINITE ); +#ifdef _NEVER_SAY_NEVER_AGAIN_ + while(ThreadID != 0) + Sleep(250); +#endif + + // drop DTR + + EscapeCommFunction(hPhone, CLRDTR); + + // purge any outstanding reads/writes and close device handle + + PurgeComm(hPhone, PURGE_TXABORT | PURGE_RXABORT | + PURGE_TXCLEAR | PURGE_RXCLEAR); + + CloseHandle(hPhone); + return (TRUE); + +} // end of CloseConnection() + +//--------------------------------------------------------------------------- +// int ReadCommBlock(LPSTR lpszBlock, int nMaxLength) +// +// Description: +// Reads a block from the COM port and stuffs it into +// the provided buffer. +// +// Parameters: +// +// LPSTR lpszBlock +// block used for storage +// +// int nMaxLength +// max length of block to read +// +//--------------------------------------------------------------------------- + +int ReadCommBlock(LPSTR lpszBlock, int nMaxLength) +{ + BOOL fReadStat; + COMSTAT ComStat; + DWORD dwErrorFlags; + DWORD dwLength; + DWORD dwError; + + // only try to read number of bytes in queue + ClearCommError(hPhone, &dwErrorFlags, &ComStat); + dwLength = min((DWORD) nMaxLength, ComStat.cbInQue); + + if (dwLength > 0) { + fReadStat = ReadFile(hPhone, lpszBlock, + dwLength, &dwLength, &osRead); + if (!fReadStat) { + if (GetLastError() == ERROR_IO_PENDING) { + fprintf(stderr, "\n\rIO Pending"); + // We have to wait for read to complete. + // This function will timeout according to the + // CommTimeOuts.ReadTotalTimeoutConstant variable + // Every time it times out, check for port errors + while(!GetOverlappedResult(hPhone, + &osRead, &dwLength, TRUE)) { + dwError = GetLastError(); + if(dwError == ERROR_IO_INCOMPLETE) + // normal result if not finished + continue; + else { + // an error occurred, try to recover + fprintf(stderr, "", dwError); + ClearCommError(hPhone, &dwErrorFlags, &ComStat); + if (dwErrorFlags > 0) + fprintf(stderr, "", dwErrorFlags); + break; + } + + } + + } + else { + // some other error occurred + dwLength = 0; + ClearCommError(hPhone, &dwErrorFlags, &ComStat); + if (dwErrorFlags > 0) + fprintf(stderr, "", dwErrorFlags); + } + } + } + + return (dwLength); + +} // end of ReadCommBlock() + +//--------------------------------------------------------------------------- +// BOOL WriteCommBlock(BYTE *pByte, DWORD dwBytesToWrite) +// +// Description: +// Writes a block of data to the COM port specified in the associated +// TTY info structure. +// +// Parameters: +// +// BYTE *pByte +// pointer to data to write to port +// +//--------------------------------------------------------------------------- + +BOOL WriteCommBlock(LPSTR lpByte , DWORD dwBytesToWrite) +{ + + BOOL fWriteStat; + DWORD dwBytesWritten; + DWORD dwErrorFlags; + DWORD dwError; + DWORD dwBytesSent=0; + COMSTAT ComStat; + + fWriteStat = WriteFile(hPhone, lpByte, dwBytesToWrite, + &dwBytesWritten, &osWrite); + + // Note that normally the code will not execute the following + // because the driver caches write operations. Small I/O requests + // (up to several thousand bytes) will normally be accepted + // immediately and WriteFile will return true even though an + // overlapped operation was specified + + if (!fWriteStat) { + if(GetLastError() == ERROR_IO_PENDING) { + // We should wait for the completion of the write operation + // so we know if it worked or not + + // This is only one way to do this. It might be beneficial to + // place the write operation in a separate thread + // so that blocking on completion will not negatively + // affect the responsiveness of the UI + + // If the write takes too long to complete, this + // function will timeout according to the + // CommTimeOuts.WriteTotalTimeoutMultiplier variable. + // This code logs the timeout but does not retry + // the write. + + while(!GetOverlappedResult(hPhone, + &osWrite, &dwBytesWritten, TRUE)) { + dwError = GetLastError(); + if(dwError == ERROR_IO_INCOMPLETE) + { + // normal result if not finished + dwBytesSent += dwBytesWritten; + continue; + } + else { + // an error occurred, try to recover + fprintf(stderr, "", dwError); + ClearCommError(hPhone, &dwErrorFlags, &ComStat); + if (dwErrorFlags > 0) + fprintf(stderr, "", dwErrorFlags); + break; + } + } + + dwBytesSent += dwBytesWritten; +#if 0 + if(dwBytesSent != dwBytesToWrite) + fprintf(stderr, "\nProbable Write Timeout: Total of %ld bytes sent (%ld)", dwBytesSent, dwBytesToWrite); + else + fprintf(stderr, "\n%ld bytes written", dwBytesSent); +#endif + } + else { + // some other error occurred + ClearCommError(hPhone, &dwErrorFlags, &ComStat); + if (dwErrorFlags > 0) + fprintf(stderr, "", dwErrorFlags); + return (FALSE); + } + } + return (TRUE); + +} // end of WriteCommBlock() + + +//************************************************************************ +// DWORD FAR PASCAL CommWatchProc(LPSTR lpData) +// +// Description: +// A secondary thread that will watch for COMM events. +// +// Parameters: +// LPSTR lpData +// 32-bit pointer argument +// +//************************************************************************ + +DWORD FAR PASCAL CommWatchProc(LPSTR lpData) +{ + DWORD dwEvtMask; + OVERLAPPED os; + int nLength; + BYTE abIn[ MAXBLOCK + 1]; + + sigcallback fn = (sigcallback)lpData; + + memset(&os, 0, sizeof(OVERLAPPED)); + + // create I/O event used for overlapped read + + os.hEvent = CreateEvent(NULL, // no security + TRUE, // explicit reset req + FALSE, // initial event reset + NULL); // no name + if (os.hEvent == NULL) + return (FALSE); + + if (!SetCommMask(hPhone, EV_RXCHAR)) + return (FALSE); + + while (isConnected) { + dwEvtMask = 0; + + WaitCommEvent(hPhone, &dwEvtMask, NULL); + + if ((dwEvtMask & EV_RXCHAR) == EV_RXCHAR) { + do { + if ((nLength = ReadCommBlock((LPSTR) abIn, MAXBLOCK))) { + int i; + + for (i = 0; i < nLength; i++) + (*fn)(abIn[i]); + } + } + while (nLength > 0); + } + } + + // get rid of event handle + + CloseHandle(os.hEvent); + + // clear information in structure (kind of a "we're done flag") + + ThreadID = 0; + hThread = NULL; + + return(TRUE); + +} // end of CommWatchProc() + + +DWORD FAR PASCAL KeepAliveProc(LPSTR lpData) +{ +/* Marcin Wiacek. In this moment there is NO method of communication, + which require keepalive packets. I comment this thread, because it + makes only CPU time (100%) and makes it more hot */ +// keepalive ka = (keepalive)lpData; +// while (isConnected) +// (*ka)(); +// KAThreadID = 0; + return 0; +} + +#endif +/* end */ diff --git a/common/files/cfgreader.c b/common/files/cfgreader.c new file mode 100644 index 0000000..dd0e575 --- /dev/null +++ b/common/files/cfgreader.c @@ -0,0 +1,339 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Config file (/etc/gnokiirc and ~/.gnokiirc) reader. + + Modified from code by Tim Potter. + +*/ + +#include "misc.h" + +#include +#include +#include +#if __unices__ +# include +#endif +#include +#include + +#include "files/cfgreader.h" + +/* Read configuration information from a ".INI" style file */ +struct CFG_Header *CFG_ReadFile(char *filename) +{ + FILE *handle; + char *line; + char *buf; + struct CFG_Header *cfg_info = NULL, *cfg_head = NULL; + + /* Error check */ + if (filename == NULL) { + return NULL; + } + + /* Initialisation */ + if ((buf = (char *)malloc(255)) == NULL) { + return NULL; + } + + /* Open file */ + if ((handle = fopen(filename, "r")) == NULL) { +#ifdef DEBUG +// fprintf( stderr, "CFG_ReadFile - open %s: %s\n", filename, strerror(errno)); +#endif /* DEBUG */ + return NULL; + } +#ifdef DEBUG + else + fprintf( stderr, "Opened configuration file %s\n", filename ); +#endif /* DEBUG */ + + /* Iterate over lines in the file */ + while (fgets(buf, 255, handle) != NULL) { + + line = buf; + + /* Strip leading, trailing whitespace */ + while(isspace((int) *line)) + line++; + + while((strlen(line) > 0) && isspace((int) line[strlen(line) - 1])) + line[strlen(line) - 1] = '\0'; + + /* Ignore blank lines and comments */ + if ((*line == '\n') || (*line == '\0') || (*line == '#')) + continue; + + /* Look for "headings" enclosed in square brackets */ + if ((line[0] == '[') && (line[strlen(line) - 1] == ']')) { + struct CFG_Header *heading; + + /* Allocate new heading entry */ + if ((heading = (struct CFG_Header *)malloc(sizeof(*heading))) == NULL) { + return NULL; + } + + /* Fill in fields */ + memset(heading, '\0', sizeof(*heading)); + + line++; + line[strlen(line) - 1] = '\0'; + + /* FIXME: strdup is not ANSI C compliant. */ + heading->section = strdup(line); + + /* Add to tail of list */ + heading->prev = cfg_info; + + if (cfg_info != NULL) { + cfg_info->next = heading; + } else { + /* Store copy of head of list for return value */ + cfg_head = heading; + } + + cfg_info = heading; + +#ifdef DEBUG +// fprintf(stderr, "Added new section %s\n", heading->section); +#endif + /* Go on to next line */ + + continue; + } + + /* Process key/value line */ + + if ((strchr(line, '=') != NULL) && cfg_info != NULL) { + struct CFG_Entry *entry; + char *value; + + /* Allocate new entry */ + if ((entry = (struct CFG_Entry *)malloc(sizeof(*entry))) == NULL) { + return NULL; + } + + /* Fill in fields */ + memset(entry, '\0', sizeof(*entry)); + + value = strchr(line, '='); + *value = '\0'; /* Split string */ + value++; + + while(isspace((int) *value)) { /* Remove leading white */ + value++; + } + + entry->value = strdup(value); + + while((strlen(line) > 0) && isspace((int) line[strlen(line) - 1])) { + line[strlen(line) - 1] = '\0'; /* Remove trailing white */ + } + + /* FIXME: strdup is not ANSI C compliant. */ + entry->key = strdup(line); + + /* Add to head of list */ + + entry->next = cfg_info->entries; + + if (cfg_info->entries != NULL) { + cfg_info->entries->prev = entry; + } + + cfg_info->entries = entry; + +#ifdef DEBUG +// fprintf(stderr, "Adding key/value %s/%s\n", entry->key, entry->value); +#endif + /* Go on to next line */ + continue; + } + + /* Line not part of any heading */ + fprintf(stderr, "Orphaned line: %s\n", line); + } + + /* Return pointer to configuration information */ + return cfg_head; +} + +/* Write configuration information to a config file */ + +int CFG_WriteFile(struct CFG_Header *cfg, char *filename) +{ + /* Not implemented - tricky to do and preserve comments */ + + return 0; +} + +/* + * Find the value of a key in a config file. Return value associated + * with key or NULL if no such key exists. + */ + +char *CFG_Get(struct CFG_Header *cfg, char *section, char *key) +{ + struct CFG_Header *h; + struct CFG_Entry *e; + + if ((cfg == NULL) || (section == NULL) || (key == NULL)) { + return NULL; + } + + /* Search for section name */ + for (h = cfg; h != NULL; h = h->next) { + if (strcmp(section, h->section) == 0) { + /* Search for key within section */ + for (e = h->entries; e != NULL; e = e->next) { + if (strcmp(key, e->key) == 0) { + /* Found! */ + return e->value; + } + } + } + } + /* Key not found in section */ + return NULL; +} + +/* Set the value of a key in a config file. Return the new value if + the section/key can be found, else return NULL. */ + +char *CFG_Set(struct CFG_Header *cfg, char *section, char *key, + char *value) +{ + struct CFG_Header *h; + struct CFG_Entry *e; + + if ((cfg == NULL) || (section == NULL) || (key == NULL) || + (value == NULL)) { + return NULL; + } + + /* Search for section name */ + for (h = cfg; h != NULL; h = h->next) { + if (strcmp(section, h->section) == 0) { + /* Search for key within section */ + for (e = h->entries; e != NULL; e = e->next) { + if ((e->key != NULL) && strcmp(key, e->key) == 0) { + /* Found - set value */ + free(e->key); + /* FIXME: strdup is not ANSI C compliant. */ + e->key = strdup(value); + return e->value; + } + } + } + } + /* Key not found in section */ + return NULL; +} + +struct CFG_Header *CFG_FindGnokiirc() +{ + struct CFG_Header *cfg_info; + char *homedir; + char rcfile[200]; + +#ifdef WIN32 + homedir = getenv("HOMEDRIVE"); + strncpy(rcfile, homedir ? homedir : "", 200); + homedir = getenv("HOMEPATH"); + strncat(rcfile, homedir ? homedir : "", 200); + strncat(rcfile, "\gnokiirc", 200); +#else + homedir = getenv("HOME"); + if (homedir) strncpy(rcfile, homedir, 200); + strncat(rcfile, "/.gnokiirc", 200); +#endif + + /* Try opening .gnokirc from users home directory first */ + if ((cfg_info = CFG_ReadFile(rcfile)) == NULL) { +#ifndef WIN32 + + /* It failed so try for /etc/gnokiirc */ + if ((cfg_info = CFG_ReadFile("/etc/gnokiirc")) == NULL) { + /* That failed too so exit */ +#ifdef DEBUG +// fprintf(stderr, _("Couldn't open %s or /etc/gnokiirc. Using defaults...\n"), rcfile); +#endif /* DEBUG */ + return NULL; + } + +#else /* WIN32 */ + + /* It failed so try for gnokiirc */ + if ((cfg_info = CFG_ReadFile("gnokiirc")) == NULL) { + /* That failed too so exit */ +#ifdef DEBUG +// fprintf(stderr, _("Couldn't open %s or gnokiirc. Using defaults...\n"), rcfile); +#endif /* DEBUG */ + return NULL; + } + +#endif /* WIN32 */ + } + + return cfg_info; +} + +int CFG_ReadConfig(char **model, char **port, char **initlength, + char **connection, char **bindir, char **synchronizetime, + bool isgnokiid) +{ + struct CFG_Header *cfg_info; +#ifdef WIN32 + char *DefaultPort = "com2:"; +#else + char *DefaultPort = "/dev/ttyS1"; +#endif + char *DefaultModel = "auto"; + char *DefaultConnection = "fbus"; + char *DefaultBindir = "/usr/local/sbin/"; + char *DefaultSynchronizeTime = "yes"; + char *DefaultInitLength = "30"; + + char *section = "global"; + + (char *)*model = DefaultModel; + (char *)*port = DefaultPort; + (char *)*connection = DefaultConnection; + (char *)*bindir = DefaultBindir; + (char *)*synchronizetime = DefaultSynchronizeTime; + (char *)*initlength = DefaultInitLength; + + cfg_info=CFG_FindGnokiirc(); + if (cfg_info==NULL) return 0; + + if (isgnokiid) (char *)section = "gnokiid"; + + (char *)*model = CFG_Get(cfg_info, section, "model"); + if (!*model) (char *)*model = DefaultModel; + + (char *)*port = CFG_Get(cfg_info, section, "port"); + if (!*port) (char *)*port = DefaultPort; + + (char *)*connection = CFG_Get(cfg_info, section, "connection"); + if (!*connection) (char *)*connection = DefaultConnection; + + (char *)*bindir = CFG_Get(cfg_info, section, "bindir"); + if (!*bindir) (char *)*bindir = DefaultBindir; + + (char *)*synchronizetime = CFG_Get(cfg_info, section, "synchronizetime"); + if (!*synchronizetime) (char *)*synchronizetime = DefaultSynchronizeTime; + + (char *)*initlength = CFG_Get(cfg_info, section, "initlength"); + if (!*initlength) (char *)*initlength = "default"; + + return 0; +} diff --git a/common/files/gsm-filetypes.c b/common/files/gsm-filetypes.c new file mode 100644 index 0000000..8e5fc39 --- /dev/null +++ b/common/files/gsm-filetypes.c @@ -0,0 +1,2248 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Copyright (C) 1999, 2000 Hugh Blemings & Pavel Janík ml. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Functions to read and write common file types. + +*/ + +#include +#include +#include +#include +#include +#ifndef VC6 +#include +#endif + +#include "gsm-common.h" +#include "gsm-ringtones.h" +#include "gsm-bitmaps.h" +#include "files/gsm-filetypes.h" +#include "files/midifile.h" +#include "gsm-coding.h" +#include "misc.h" +#include "newmodules/n7110.h" +#include "newmodules/n6110.h" + +#ifdef XPM + #include +#endif + +/** +* GetvCalTime +* +* Fills vCalendar time string into GSM_DateTime structure +* +* in: +* dt: datetime structure +* time: string in format yyyymmddThhmmss +* out: +* <>0 if error +*/ +int GetvCalTime(GSM_DateTime *dt, char *time) +{ + char year[5]="", month[3]="", day[3]="", hour[3]="", minute[3]="", second[3]=""; + dt->Year=dt->Month=dt->Day=dt->Hour=dt->Minute=dt->Second=dt->Timezone=0; + + strncpy(year, time, 4); + strncpy(month, time+4, 2); + strncpy(day, time+6, 2); + strncpy(hour, time+9, 2); + strncpy(minute, time+11, 2); + strncpy(second, time+13, 2); + +/* FIXME: Should check ranges... */ + dt->Year=atoi(year); + dt->Month=atoi(month); + dt->Day=atoi(day); + dt->Hour=atoi(hour); + dt->Minute=atoi(minute); + dt->Second=atoi(second); +/* FIXME */ + dt->Timezone=0; + + return 0; +} + +/** +* FillCalendarNote +* +* Fills calendar data from strings into calendar note +* +* in: +* note: calendar note structure +* type: type of calendar note +* text: text or phonenumber +* time: string in format yyyymmddThhmmss +* alarm: dito +* out: +* <>0 if error +*/ +int FillCalendarNote(GSM_CalendarNote *note, char *type, + char *text, char *time, char *alarm) +{ + GetvCalTime(¬e->Time, time); + GetvCalTime(¬e->Alarm, alarm); + + note->Location=0; + + strncpy(note->Text, text, MAX_CALENDAR_TEXT_LENGTH); + strcpy(note->Phone, ""); /* correct in most cases */ + + /* FIXME: Handle additional strings, maybe from configuration file */ + + if(!strcmp(type, "PHONE CALL")) + { + strncpy(note->Phone, text, MAX_CALENDAR_PHONE_LENGTH); + note->Type=GCN_CALL; + } + else if(!strcmp(type, "MEETING")) + note->Type=GCN_MEETING; + else if(!strcmp(type, "SPECIAL OCCASION")) + note->Type=GCN_BIRTHDAY; + else + note->Type=GCN_REMINDER; + + return 0; +} + +/** +* GSM_ReadVCalendarFile +* +* Reads vCalendar file +* +* in: +* FileName: name of vCalendar file +* cnote: pointer to calendar note +* number: number in file of calendar note to read +* out: +* <>0 if error +*/ +GSM_Error GSM_ReadVCalendarFile(char *FileName, GSM_CalendarNote *cnote, int *number) +{ + FILE *file; + char type[21]="", text[40]="", time[16]="", alarm[16]=""; + char phone[40]=""; + long recurr=0L; + char altype=0x00; + + int veventcounter=0; + int isOK=0; + + bool NoteOK=false; + + char *Line, OLine[1024], BackLine[1024]; + + Line = OLine; + + file=fopen(FileName, "r"); + if (!file) { +#ifdef DEBUG + fprintf(stderr, _("File cannot be opened!\n")); +#endif + return GE_CANTOPENFILE; + } + + /* Go through data from file. */ + while (GetLine(file, Line, sizeof(OLine))!=-1) { + + strcpy(BackLine, Line); + + switch (isOK) { + case 0: + if (!strcmp(Line,"BEGIN:VCALENDAR")) + isOK++; + break; + case 1: + if (!strcmp(Line,"BEGIN:VEVENT")) { + isOK++; + veventcounter++; + } + if (!strcmp(Line,"END:VCALENDAR")) + isOK--; + break; + case 2: + if (veventcounter==*number) { + if (!strncmp(Line,"CATEGORIES:",11)) { + strncpy(type,Line+11,strlen(Line)-11); + type[strlen(Line)-11]=0; + } + if (!strncmp(Line,"DESCRIPTION:",12)) { + strncpy(phone,Line+12,strlen(Line)-12); + phone[strlen(Line)-12]=0; + } + if (!strncmp(Line,"SUMMARY:",8)) { + strncpy(text,Line+8,strlen(Line)-8); + text[strlen(Line)-8]=0; + } + if (!strncmp(Line,"SUMMARY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:",48)) { + DecodeUTF8(text,Line+48,strlen(Line)-48); + text[strlen(Line)-48]=0; + } + if (!strncmp(Line,"DTSTART:",8)) { + strncpy(time,Line+8,strlen(Line)-8); + time[strlen(Line)-8]=0; + } + if (!strncmp(Line,"DALARM:",7)) { + strncpy(alarm,Line+7,strlen(Line)-7); + alarm[strlen(Line)-7]=0; + } + + /* Obsolete */ + if (!strncmp(Line,"RECURR:",7)) { + recurr=mem_to_int(Line+7,strlen(Line)-7); + } + + if (!strncmp(Line,"RRULE:D1 :",9)) { + recurr=1; + } + if (!strncmp(Line,"RRULE:W1 :",9)) { + recurr=7; + } + if (!strncmp(Line,"RRULE:W2 :",9)) { + recurr=14; + } + if (!strncmp(Line,"RRULE:YD1 :",10)) { + recurr=365; + } + + if (!strncmp(Line,"ALTYPE:",7)) { + altype=(!strncmp("TONE",Line+7,4)) ? 0x00 : 0x01; + } + } + if (!strcmp(Line,"END:VEVENT")) { + if (veventcounter==*number) NoteOK=true; + isOK--; + } + break; + } + + if (NoteOK) break; + } + + if (!NoteOK) { + *number=veventcounter; +#ifdef DEBUG + fprintf(stdout,_("Note not found in VCalendarfile\n")); +#endif + return GE_TOOSHORT; + } + + FillCalendarNote(cnote, type, text, time, alarm); + + cnote->Recurrance = recurr*24; /* it was in days. I convert in hours */ + cnote->AlarmType = altype; + + if( strcmp( phone, "" ) ) { /* Invert data if CALL ... */ + strcpy( cnote->Text, phone ); + strcpy( cnote->Phone, text ); // alread FillCalendar does it .. + } + + fclose(file); + + return 0; +} + +GSM_Error GSM_ReadBinRingtoneFile(char *FileName, GSM_BinRingtone *ringtone) +{ + FILE *file; + int i; + + file = fopen(FileName, "rb"); + + if (!file) + return(GE_CANTOPENFILE); + + ringtone->length=fread(ringtone->frame, 1, 500, file); + + fclose(file); + + if (ringtone->frame[0]!=0x00 || ringtone->frame[1]!=0x00 || + ringtone->frame[2]!=0x0C || ringtone->frame[3]!=0x01) + return GE_NOTSUPPORTED; + + i=5; + while (ringtone->frame[i]!=0x00) { + ringtone->name[i-5]=ringtone->frame[i]; + i++; + } + ringtone->name[i-5]=0x00; + + return GE_NONE; +} + +/* Function to convert scale field in to correct number. */ +int GetRTTLDuration (char *num) +{ + +int duration=0; + + switch (atoi(num)) { + + case 1: duration=128; break; + case 2: duration= 64; break; + case 4: duration= 32; break; + case 8: duration= 16; break; + case 16: duration= 8; break; + case 32: duration= 4; break; + } + + return (duration); + +} + +int GetRTTLScale (char *num) +{ + + /* This may well need improving. */ + + int scale=0; + + if ((atoi(num))<4) scale=(atoi(num)); + if ((atoi(num))>4) scale=(atoi(num))-4; + + return (scale); +} + +GSM_Error GSM_ReadRingtoneFile(char *FileName, GSM_Ringtone *ringtone) +{ + FILE *file; + unsigned char buffer[300]; + GSM_Error error; + GSM_Filetypes filetype=RTTL; + + file = fopen(FileName, "rb"); + + if (!file) + return(GE_CANTOPENFILE); + + fread(buffer, 1, 4, file); /* Read the header of the file. */ + + /* Attempt to identify filetype */ + + if (memcmp(buffer, "MThd",3)==0) /* MIDI files have 'MThd' at the start */ + filetype=MIDI; + + if (buffer[0]==0xc7 && buffer[1]==0x45 && buffer[2]==0xc1 && buffer[3]==0x53) + filetype=COMMUNICATOR; + + if (strstr(FileName,".ott")) filetype=OTT; /* OTT files saved by NCDS3 */ + + error=GE_NONE; + + rewind(file); + + switch (filetype) { + case RTTL: + error=loadrttl(file,ringtone); + fclose(file); + break; + case OTT: + error=loadott(file,ringtone); + fclose(file); + break; + case COMMUNICATOR: + error=loadcommunicator(file,ringtone); + fclose(file); + break; + case MIDI: + fclose(file); + error=loadmid(FileName,ringtone); + break; + default: + error=GE_INVALIDFILEFORMAT; + } + + return(error); + +} + +GSM_Error loadott(FILE *file, GSM_Ringtone *ringtone) +{ + char Buffer[2000]; + int i; + + i=fread(Buffer, 1, 2000, file); + + if (!feof(file)) return GE_TOOLONG; + + return GSM_UnPackRingtone(ringtone, Buffer, i); +} + +GSM_Error loadcommunicator(FILE *file, GSM_Ringtone *ringtone) +{ + char Buffer[4000]; + int i,j; + + i=fread(Buffer, 1, 4000, file); + + if (!feof(file)) return GE_TOOLONG; + + i=0;j=0; + while (true) { + if (Buffer[j]==0x00 && Buffer[j+1]==0x02 && + Buffer[j+2]==0x4a && Buffer[j+3]==0x3a) break; + if (j==i-4) return GE_INTERNALERROR; + j++; + } + j++; + + return GSM_UnPackRingtone(ringtone, Buffer+j, i-j); +} + +/* TODO: spaces should not be interpreted */ +/* Note: ringtone have to be in one line (without 0x13 and 0x10 chars) */ +GSM_Error loadrttl(FILE *file, GSM_Ringtone *ringtone) +{ + int NrNote=0; + + u8 DefNoteScale=2, DefNoteDuration=4; + int DefNoteTempo=63; + u8 DefNoteStyle=ContinuousStyle; + + unsigned char buffer[2000]; + unsigned char *def, *notes, *ptr; + + ringtone->Loop=15; //default value + + fread(buffer, 2000, 1, file); + + /* This is for buggy RTTTL ringtones without name. */ + if (buffer[0] != RTTTL_SEP[0]) { + strtok(buffer, RTTTL_SEP); + sprintf(ringtone->name, "%s", buffer); + def=strtok(NULL, RTTTL_SEP); + notes=strtok(NULL, RTTTL_SEP); + } + else { + sprintf(ringtone->name, "GNOKII"); + def=strtok(buffer, RTTTL_SEP); + notes=strtok(NULL, RTTTL_SEP); + } + + ptr=strtok(def, ", "); + + /* Parsing the section. */ + while (ptr) { + + switch(*ptr) { + case 'd': + case 'D': + DefNoteDuration=GetRTTLDuration(ptr+2); + break; + case 'o': + case 'O': + DefNoteScale=GetRTTLScale(ptr+2); + break; + case 'b': + case 'B': + DefNoteTempo=atoi(ptr+2); + break; + case 'l': + case 'L': + ringtone->Loop=atoi(ptr+2); + break; + case 's': + case 'S': + switch (*(ptr+1)) { + case 'C': + case 'c': + DefNoteStyle=ContinuousStyle; + break; + case 'N': + case 'n': + DefNoteStyle=NaturalStyle; + break; + case 'S': + case 's': + DefNoteStyle=StaccatoStyle; + break; + } + switch (*(ptr+2)) { + case 'c': + case 'C': + DefNoteStyle=ContinuousStyle; + break; + case 'n': + case 'N': + DefNoteStyle=NaturalStyle; + break; + case 's': + case 'S': + DefNoteStyle=StaccatoStyle; + break; + } + break; + } + + ptr=strtok(NULL,", "); + } + +#ifdef DEBUG + printf("DefNoteDuration=%d\n", DefNoteDuration); + printf("DefNoteScale=%d\n", DefNoteScale); +#endif + + ptr=strtok(notes, ", "); + + /* Parsing the + section. */ + while (ptr && NrNote] */ + ringtone->notes[NrNote].duration=GetRTTLDuration(ptr); + if (ringtone->notes[NrNote].duration==0) + ringtone->notes[NrNote].duration=DefNoteDuration; + + /* Skip all numbers in duration specification. */ + while(isdigit(*ptr)) + ptr++; + + /* */ + /* B or b is not in specs, but I decided to put it, because + it's in some RTTL files. It's the same to H note */ + if ((*ptr=='B') || (*ptr=='b')) ringtone->notes[NrNote].note=12; + else if ((*ptr=='H') || (*ptr=='h')) ringtone->notes[NrNote].note=12; + else if ((*ptr>='a') && (*ptr<='g')) ringtone->notes[NrNote].note=((*ptr-'a')*2)+10; + else if ((*ptr>='A') && (*ptr<='G')) ringtone->notes[NrNote].note=((*ptr-'A')*2)+10; + else ringtone->notes[NrNote].note=255; + + if ((ringtone->notes[NrNote].note>13)&&(ringtone->notes[NrNote].note!=255)) + ringtone->notes[NrNote].note-=14; + + ptr++; + + if ((*ptr)=='#') { + ringtone->notes[NrNote].note++; + if ((ringtone->notes[NrNote].note==5) || (ringtone->notes[NrNote].note==13)) + ringtone->notes[NrNote].note++; + ptr++; + } + + /* Check for dodgy rttl */ + /* [] */ + if (*ptr=='.') { + ringtone->notes[NrNote].duration*=1.5; + ptr++; + } + + /* [] */ + if (ringtone->notes[NrNote].note!=255) { + if (isdigit(*ptr)) { + ringtone->notes[NrNote].note+=GetRTTLScale(ptr)*14; + ptr++; + } else + ringtone->notes[NrNote].note+=DefNoteScale*14; + } + + /* [] */ + if (*ptr=='.') { + ringtone->notes[NrNote].duration*=1.5; + ptr++; + } + + /* Style */ + ringtone->notes[NrNote].style=DefNoteStyle; + + /* Tempo */ + ringtone->notes[NrNote].tempo=DefNoteTempo; + + NrNote++; + + break; + } + ptr=strtok(NULL, ", "); + } + + ringtone->NrNotes=NrNote; + + return GE_NONE; +} + +GSM_Error GSM_SaveRingtoneFile(char *FileName, GSM_Ringtone *ringtone) +{ + + FILE *file; + bool done=false; + + file = fopen(FileName, "wb"); + + if (!file) + return(GE_CANTOPENFILE); + + if (strstr(FileName,".ott")) + { + saveott(file, ringtone); + done=true; + } + if (strstr(FileName,".mid")) + { + savemid(file, ringtone); + done=true; + } + + if (!done) saverttl(file, ringtone); + + fclose(file); + + return GE_NONE; +} + +void saveott(FILE *file, GSM_Ringtone *ringtone) +{ + char Buffer[2000]; + + int i=2000; + + GSM_PackRingtone(ringtone, Buffer, &i); + + fwrite(Buffer, 1, i, file); +} + +void saverttl(FILE *file, GSM_Ringtone *ringtone) +{ + u8 DefNoteScale=2, DefNoteDuration=4; + int DefNoteTempo=63; + u8 DefNoteStyle=ContinuousStyle; + + int CurrentNote; + int buffer[6]; + int i,j,k=0; + + /* Saves ringtone name */ + fprintf(file,_("%s:"),ringtone->name); + + /* Find the most frequently used duration and use this for the default */ + + for (i=0;i<6;i++) buffer[i]=0; + for (i=0;iNrNotes;i++) { + switch (ringtone->notes[i].duration) { + case 192:buffer[0]++; break; + case 128:buffer[0]++; break; + case 96:buffer[1]++; break; + case 64:buffer[1]++; break; + case 48:buffer[2]++; break; + case 32:buffer[2]++; break; + case 24:buffer[3]++; break; + case 16:buffer[3]++; break; + case 12:buffer[4]++; break; + case 8:buffer[4]++; break; + case 6:buffer[5]++; break; + case 4:buffer[5]++; break; + } + } + + /* Now find the most frequently used */ + j=0; + for (i=0;i<6;i++) { + if (buffer[i]>j) { + k=i; + j=buffer[i]; + } + } + + /* Finally convert and save the default duration */ + + switch (k) { + case 0: DefNoteDuration=128; fprintf(file, _("d=1,")); break; + case 1: DefNoteDuration= 64; fprintf(file, _("d=2,")); break; + case 2: DefNoteDuration= 32; fprintf(file, _("d=4,")); break; + case 3: DefNoteDuration= 16; fprintf(file, _("d=8,")); break; + case 4: DefNoteDuration= 8; fprintf(file,_("d=16,")); break; + case 5: DefNoteDuration= 4; fprintf(file,_("d=32,")); break; + default: DefNoteDuration= 16; fprintf(file, _("d=8,")); break; + } + + + /* Find the most frequently used scale and use this for the default */ + + for (i=0;i<6;i++) buffer[i]=0; + for (i=0;iNrNotes;i++) { + if (ringtone->notes[i].note!=255) { + buffer[ringtone->notes[i].note/14]++; + } + } + j=0; + for (i=0;i<6;i++) { + if (buffer[i]>j) { + DefNoteScale=i; + j=buffer[i]; + } + } + + if (ringtone->NrNotes!=0) { + DefNoteTempo=ringtone->notes[0].tempo; + DefNoteStyle=ringtone->notes[0].style; + } + + /* Save the default scale */ + fprintf(file,_("o=%i,"),DefNoteScale+4); + + switch (DefNoteStyle) { + case StaccatoStyle: fprintf(file,_("s=S,")); break; + case NaturalStyle : fprintf(file,_("s=N,")); break; + } + + /* Save the default tempo */ + fprintf(file,_("b=%i,"),DefNoteTempo); + + /* Save the default loop */ + fprintf(file,_("l=%i:"),ringtone->Loop); + +#ifdef DEBUG + printf("DefNoteDuration=%d\n", DefNoteDuration); + printf("DefNoteScale=%d\n", DefNoteScale); + printf("Number of notes=%d\n",ringtone->NrNotes); +#endif + + /* Now loop round for each note */ + + for (i=0;iNrNotes;i++) { + CurrentNote=ringtone->notes[i].note; + + if (ringtone->notes[i].style!=DefNoteStyle) { + DefNoteStyle=ringtone->notes[i].style; + switch (DefNoteStyle) { + case StaccatoStyle : fprintf(file,_("s=S")); break; + case NaturalStyle : fprintf(file,_("s=N")); break; + case ContinuousStyle: fprintf(file,_("s=C")); break; + } + /* And a separator before next note */ + if (i!=ringtone->NrNotes-1) + fprintf(file,_(",")); + } + + if (ringtone->notes[i].tempo!=DefNoteTempo) { + DefNoteTempo=ringtone->notes[i].tempo; + fprintf(file,_("b=%i"),DefNoteTempo); + if (i!=ringtone->NrNotes-1) + fprintf(file,_(",")); + } + + /* This note has a duration different than the default. We must save it */ + if (ringtone->notes[i].duration!=DefNoteDuration) { + switch (ringtone->notes[i].duration) { + case 192: fprintf(file, _("1")); break; //192=128*1.5 + case 128: fprintf(file, _("1")); break; + case 96: fprintf(file, _("2")); break; //96=64*1.5 + case 64: fprintf(file, _("2")); break; + case 48: fprintf(file, _("4")); break; //48=32*1.5 + case 32: fprintf(file, _("4")); break; + case 24: fprintf(file, _("8")); break; //24=16*1.5 + case 16: fprintf(file, _("8")); break; + case 12: fprintf(file,_("16")); break; //12=8*1.5 + case 8: fprintf(file,_("16")); break; + case 6: fprintf(file,_("32")); break; //6=4*1.5 + case 4: fprintf(file,_("32")); break; + default: + break; + } + } + + /* Now save the actual note */ + switch (GSM_GetNote(CurrentNote)) { + case Note_C :fprintf(file,_("c"));break; + case Note_Cis:fprintf(file,_("c#"));break; + case Note_D :fprintf(file,_("d"));break; + case Note_Dis:fprintf(file,_("d#"));break; + case Note_E :fprintf(file,_("e"));break; + case Note_F :fprintf(file,_("f"));break; + case Note_Fis:fprintf(file,_("f#"));break; + case Note_G :fprintf(file,_("g"));break; + case Note_Gis:fprintf(file,_("g#"));break; + case Note_A :fprintf(file,_("a"));break; + case Note_Ais:fprintf(file,_("a#"));break; + case Note_H :fprintf(file,_("h"));break; + default :fprintf(file,_("p"));break; //Pause ? + } + + /* Saving info about special duration */ + if (ringtone->notes[i].duration==128*1.5 || + ringtone->notes[i].duration==64*1.5 || + ringtone->notes[i].duration==32*1.5 || + ringtone->notes[i].duration==16*1.5 || + ringtone->notes[i].duration==8*1.5 || + ringtone->notes[i].duration==4*1.5) + fprintf(file,_(".")); + + /* This note has a scale different than the default, so save it */ + if ( (CurrentNote!=255) && (CurrentNote/14!=DefNoteScale)) + fprintf(file,_("%i"),(CurrentNote/14)+4); + + /* And a separator before next note */ + if (i!=ringtone->NrNotes-1) + fprintf(file,_(",")); + + } +} + +void WriteVarLen(char* midifile, int* current, long value) +{ + long buffer; + + buffer = value & 0x7f; + + while (value >>= 7) { + buffer <<= 8; + buffer |= 0x80; + buffer += (value & 0x7f); + } + + while (1) { + midifile[(*current)++] = buffer; + if (buffer & 0x80) + buffer >>= 8; + else + break; + } +} + +#define singlepauses + +/* FIXME: need adding tempo before each note and scale too ? */ +void savemid(FILE* file, GSM_Ringtone *ringtone) +{ + char midifile[3000] = { 0x4D, 0x54, 0x68, 0x64, // MThd + 0x00, 0x00, 0x00, 0x06, // chunk length + 0x00, 0x00, // format 0 + 0x00, 0x01, // one track + 0x00, 0x20, // 32 per quarter note + 0x4D, 0x54, 0x72, 0x6B, // MTrk + 0x00, 0x00, 0x00, 0x00, // chunk length + 0x00, 0xFF, 0x51, 0x03, // tempo meta event + 0x00, 0x00, 0x00 // 3 bytes for us for a quarter note + }; + +//{ "c", "c#", "d", "d#", "e", "f", "f#", "g", "g#", "a", "a#", "h" }; +char midinotes[14] = + { 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10 , 11, 11 }; + + int length = 20; + int start = 22; + int current = 26, i, note, pause = 0; + bool notesexisting = false; + + /* FIXME: we need add tempo before each note or so... */ + long duration=60000000/63; // us for a quarter note + if (ringtone->NrNotes!=0) + duration=60000000/ringtone->notes[0].tempo; + midifile[current++] = duration >> 16; + midifile[current++] = duration >> 8; + midifile[current++] = duration; + + for (i = 0; i < ringtone->NrNotes; i++) { + + note = ringtone->notes[i].note; + if (note == 255) { // readmid does not read pauses at the beginning + + if (notesexisting) { + pause += ringtone->notes[i].duration; +#ifdef singlepauses + WriteVarLen(midifile,¤t,pause); + pause=0; + midifile[current++]=0x00; // pause + midifile[current++]=0x00; +#endif + } + + } else { + + notesexisting = true; + note = 48+12*((note/14)%4) + midinotes[note%14]; + + WriteVarLen(midifile,¤t,pause); + pause=0; + midifile[current++]=0x90; // note on + midifile[current++]=note; + midifile[current++]=0x64; // forte + + WriteVarLen(midifile,¤t,ringtone->notes[i].duration); + midifile[current++]=0x80; // note off + midifile[current++]=note; + midifile[current++]=0x64; + + } + } + + if (pause) { + WriteVarLen(midifile,¤t,pause); + midifile[current++]=0x00; // pause + midifile[current++]=0x00; // + } + midifile[current++] = 0x00; + midifile[current++] = 0xFF; // track end + midifile[current++] = 0x2F; + midifile[current++] = 0x00; + midifile[length++] = (current-start) >> 8; + midifile[length++] = current-start; + + fwrite(midifile,1,current,file); +} + +GSM_Error GSM_ReadBitmapFile(char *FileName, GSM_Bitmap *bitmap) +{ + + FILE *file; + unsigned char buffer[300]; + GSM_Error error; + GSM_Filetypes filetype=None; + + file = fopen(FileName, "rb"); + + if (!file) + return(GE_CANTOPENFILE); + + fread(buffer, 1, 9, file); /* Read the header of the file. */ + + /* Attempt to identify filetype */ + + if (memcmp(buffer, "NOL",3)==0) { /* NOL files have 'NOL' at the start */ + filetype=NOL; + } else if (memcmp(buffer, "NGG",3)==0) { /* NGG files have 'NGG' at the start */ + filetype=NGG; + } else if (memcmp(buffer, "FORM",4)==0) { /* NSL files have 'FORM' at the start */ + filetype=NSL; + } else if (memcmp(buffer, "NLM",3)==0) { /* NLM files have 'NLM' at the start */ + filetype=NLM; + } else if (memcmp(buffer, "BM",2)==0) { /* BMP, I61 and GGP files have 'BM' at the start */ + filetype=BMP; + } else if (memcmp(buffer, "/* XPM */",9)==0) { /* XPM files have 'XPM' at the start */ + filetype=XPMF; + } else filetype=None; + + if (strstr(FileName,".otb")) filetype=OTA; /* OTA files saved by NCDS3 */ + + error=GE_NONE; + + rewind(file); + + switch (filetype) { + case NOL: error=loadnol(file,bitmap); fclose(file); break; + case NGG: error=loadngg(file,bitmap); fclose(file); break; + case NSL: error=loadnsl(file,bitmap); fclose(file); break; + case NLM: error=loadnlm(file,bitmap); fclose(file); break; + case OTA: error=loadota(file,bitmap); fclose(file); break; + case BMP: error=loadbmp(file,bitmap); fclose(file); break; +#ifdef XPM + case XPMF:fclose(file);error=loadxpm(FileName,bitmap);break; +#endif + default : error=GE_INVALIDFILEFORMAT; + } + + return(error); +} + +#ifdef XPM + +GSM_Error loadxpm(char *filename, GSM_Bitmap *bitmap) +{ + int y,x,error; + XpmImage image; + XpmInfo info; + + error=XpmReadFileToXpmImage(filename,&image,&info); + + switch (error) { + case XpmColorError: return GE_WRONGCOLORS;break; + case XpmColorFailed: return GE_WRONGCOLORS;break; + case XpmOpenFailed: return GE_CANTOPENFILE;break; + case XpmFileInvalid: return GE_INVALIDFILEFORMAT;break; + case XpmSuccess: break; + } + + if (image.ncolors!=2) { + printf("Wrong number of colors\n"); + return GE_WRONGNUMBEROFCOLORS; + } + + if ((image.height==48) && (image.width==84)) { + bitmap->type=GSM_StartupLogo; + } + else if ((image.height==65) && (image.width==96)) { + bitmap->type=GSM_7110StartupLogo; + } + else if ((image.height==60) && (image.width==96)) { + bitmap->type=GSM_6210StartupLogo; + } + else if ((image.height==28) && (image.width==72)) { + bitmap->type=GSM_PictureImage; + } + else if ((image.height==14) && (image.width==72)) { + bitmap->type=GSM_CallerLogo; + } + else { +#ifdef DEBUG + printf("Invalid Image Size (%dx%d).\n",image.width,image.height); +#endif + return GE_INVALIDIMAGESIZE; + } + + bitmap->height=image.height; + bitmap->width=image.width; + bitmap->size=GSM_GetBitmapSize(bitmap); + + GSM_ClearBitmap(bitmap); + + for(y=0;ytype=GSM_7110StartupLogo; + bitmap->width=96; + bitmap->height=65; + + if (h==48 && w==84) { + bitmap->width=84; + bitmap->height=48; + bitmap->type=GSM_StartupLogo; + } + if (h==60 && w==96) { + bitmap->width=96; + bitmap->height=60; + bitmap->type=GSM_6210StartupLogo; + } + if (h==14 && w==72) { + bitmap->width=72; + bitmap->height=14; + bitmap->type=GSM_CallerLogo; + } + if (h==28 && w==72) { + bitmap->width=72; + bitmap->height=28; + bitmap->type=GSM_PictureImage; + } + if (h==21 && w==78) { + bitmap->width=78; + bitmap->height=21; + bitmap->type=GSM_7110OperatorLogo; + } + + bitmap->size=GSM_GetBitmapSize(bitmap); + + GSM_ClearBitmap(bitmap); + +#ifdef DEBUG + printf("Number of colors in BMP file: "); + switch (buffer[28]) { + case 1:printf("2 (supported by gnokii)\n");break; + case 4:printf("16 (not supported by gnokii)\n");break; + case 8:printf("256 (not supported by gnokii)\n");break; + case 24:printf("True Color (not supported by gnokii)\n");break; + default:printf("unknown\n");break; + } +#endif + if (buffer[28]!=1) { + printf("Wrong number of colors\n"); //we support only 2 colors images ! + return GE_WRONGNUMBEROFCOLORS; + } + +#ifdef DEBUG + printf("Compression in BMP file: "); + switch (buffer[30]) { + case 0:printf("no compression (supported by gnokii)\n");break; + case 1:printf("RLE8 (not supported by gnokii)\n");break; + case 2:printf("RLE4 (not supported by gnokii)\n");break; + default:printf("unknown\n");break; + } +#endif + if (buffer[30]!=0) { +#ifdef DEBUG + printf("Subformat not supported\n"); //we don't support RLE compression +#endif + return GE_SUBFORMATNOTSUPPORTED; + } + + pos=buffer[10]-34; + fread(buffer, 1, pos, file); //rest of header (if exists) and color palette + +#ifdef DEBUG + printf("First color in BMP file: %i %i %i ",buffer[pos-8], buffer[pos-7], buffer[pos-6]); + if (buffer[pos-8]==0 && buffer[pos-7]==0 && buffer[pos-6]==0) printf("(white)"); + if (buffer[pos-8]==0xFF && buffer[pos-7]==0xFF && buffer[pos-6]==0xFF) printf("(black)"); + if (buffer[pos-8]==102 && buffer[pos-7]==204 && buffer[pos-6]==102) printf("(green)"); + printf("\n"); + + printf("Second color in BMP file: %i %i %i ",buffer[pos-4], buffer[pos-3], buffer[pos-2]); + if (buffer[pos-4]==0 && buffer[pos-3]==0 && buffer[pos-2]==0) printf("(white)"); + if (buffer[pos-4]==0xFF && buffer[pos-3]==0xFF && buffer[pos-2]==0xFF) printf("(black)"); + printf("\n"); +#endif + first_white=true; + if (buffer[pos-8]!=0 || buffer[pos-7]!=0 || buffer[pos-6]!=0) first_white=false; + + sizeimage=0; + pos=7; + for (y=h-1;y>=0;y--) { //lines are written from the last to the first + i=1; + for (x=0;xwidth && y<=bitmap->height) { //we have top left corner ! + if (first_white) { + if ((buffer[0]&(1<0) GSM_SetPointBitmap(bitmap,x,y); + } + } + pos--; + if (pos<0) pos=7; //going to new byte + } + pos=7; //going to new byte + if (i!=1) { + while (i!=5) //each line is written in multiply of 4 bytes + { + fread(buffer, 1, 1, file); + sizeimage++; + i++; + } + } + } + +#ifdef DEBUG + printf("Data size in BMP file: %i\n",sizeimage); +#endif + + return(GE_NONE); +} + +GSM_Error loadnol(FILE *file, GSM_Bitmap *bitmap) +{ + + unsigned char buffer[2000]; + int i,j; + + bitmap->type=GSM_OperatorLogo; + + fread(buffer, 1, 6, file); + fread(buffer, 1, 4, file); + sprintf(bitmap->netcode, "%d %02d", buffer[0]+256*buffer[1], buffer[2]); + + fread(buffer, 1, 4, file); /* Width and height of the icon. */ + bitmap->width=buffer[0]; + bitmap->height=buffer[2]; + bitmap->size=GSM_GetBitmapSize(bitmap); + + if ((bitmap->height!=14) || (bitmap->width!=72)) { +#ifdef DEBUG + printf("Invalid Image Size (%dx%d).\n",bitmap->width,bitmap->height); +#endif + return GE_INVALIDIMAGESIZE; + } + + fread(buffer, 1, 6, file); /* Unknown bytes. */ + + for (i=0; isize; i++) { + if (fread(buffer, 1, 8, file)==8) { + bitmap->bitmap[i]=0; + for (j=7; j>=0;j--) + if (buffer[7-j] == '1') + bitmap->bitmap[i]|=(1<type=GSM_CallerLogo; + + fread(buffer, 1, 6, file); + fread(buffer, 1, 4, file); /* Width and height of the icon. */ + bitmap->width=buffer[0]; + bitmap->height=buffer[2]; + bitmap->size=GSM_GetBitmapSize(bitmap); + + if ((bitmap->height!=14) || (bitmap->width!=72)) { +#ifdef DEBUG + printf("Invalid Image Size (%dx%d).\n",bitmap->width,bitmap->height); +#endif + return GE_INVALIDIMAGESIZE; + } + + fread(buffer, 1, 6, file); /* Unknown bytes. */ + + for (i=0; isize; i++) { + if (fread(buffer, 1, 8, file)==8){ + bitmap->bitmap[i]=0; + for (j=7; j>=0;j--) + if (buffer[7-j] == '1') + bitmap->bitmap[i]|=(1<size=0; + + while (fread(block,1,6,file)==6) { + + block_size=block[4]*256+block[5]; + +#ifdef DEBUG + fprintf(stdout,_("Block %c%c%c%c, size %i\n"),block[0],block[1],block[2],block[3],block_size); +#endif + + if (!strncmp(block, "FORM", 4)) { +#ifdef DEBUG + fprintf(stdout,_(" File ID\n")); +#endif + } else + { + if (block_size>504) return(GE_INVALIDFILEFORMAT); + + if (block_size!=0) { + + fread(buffer,1,block_size,file); + buffer[block_size]=0; //if it's string, we end it with \0 + +#ifdef DEBUG + if (!strncmp(block, "VERS", 4)) fprintf(stdout,_(" File saved by: %s\n"),buffer); + if (!strncmp(block, "MODL", 4)) fprintf(stdout,_(" Logo saved from: %s\n"),buffer); + if (!strncmp(block, "COMM", 4)) fprintf(stdout,_(" Phone was connected to COM port: %s\n"),buffer); +#endif + + if (!strncmp(block, "NSLD", 4)) { + bitmap->type=GSM_StartupLogo; + bitmap->height=48; + bitmap->width=84; + bitmap->size=GSM_GetBitmapSize(bitmap); + + memcpy(bitmap->bitmap,buffer,bitmap->size); + +#ifdef DEBUG + fprintf(stdout,_(" Startup logo (size %i)\n"),block_size); +#endif + } + } + } + } + + if (bitmap->size==0) return(GE_TOOSHORT); + + return(GE_NONE); +} + +GSM_Error loadnlm (FILE *file, GSM_Bitmap *bitmap) +{ + unsigned char buffer[1000]; + int pos,pos2,x,y; + div_t division; + + fread(buffer,1,5,file); + fread(buffer,1,1,file); + + switch (buffer[0]) { + case 0x00: bitmap->type=GSM_OperatorLogo; break; + case 0x01: bitmap->type=GSM_CallerLogo; break; + case 0x02: bitmap->type=GSM_StartupLogo; break; + case 0x03: bitmap->type=GSM_PictureImage; break; + default: + return(GE_SUBFORMATNOTSUPPORTED); + } + + fread(buffer,1,4,file); + bitmap->width=buffer[1]; + bitmap->height=buffer[2]; + + if (bitmap->type==GSM_StartupLogo && bitmap->width==96 && bitmap->height==65) + bitmap->type=GSM_7110StartupLogo; + if (bitmap->type==GSM_StartupLogo && bitmap->width==96 && bitmap->height==60) + bitmap->type=GSM_6210StartupLogo; + if (bitmap->type==GSM_OperatorLogo && bitmap->width==78 && bitmap->height==21) + bitmap->type=GSM_7110OperatorLogo; + + bitmap->size=GSM_GetBitmapSize(bitmap); + + division=div(bitmap->width,8); + if (division.rem!=0) division.quot++; /* For startup logos */ + + if (fread(buffer,1,(division.quot*bitmap->height),file)!=(division.quot*bitmap->height)) + return(GE_TOOSHORT); + + GSM_ClearBitmap(bitmap); + + pos=0;pos2=7; + for (y=0;yheight;y++) { + for (x=0;xwidth;x++) { + if ((buffer[pos]&(1<0) GSM_SetPointBitmap(bitmap,x,y); + pos2--; + if (pos2<0) {pos2=7;pos++;} //going to new byte + } + if (pos2!=7) {pos2=7;pos++;} //for startup logos-new line means new byte + } + + return (GE_NONE); +} + +GSM_Error loadota(FILE *file, GSM_Bitmap *bitmap) +{ + + char buffer[4]; + + fread(buffer,1,4,file); + + bitmap->width=buffer[1]; + bitmap->height=buffer[2]; + + if ((bitmap->height==48) && (bitmap->width==84)) { + bitmap->type=GSM_StartupLogo; + } + else if ((bitmap->height==14) && (bitmap->width==72)) { + bitmap->type=GSM_CallerLogo; + } + else { +#ifdef DEBUG + printf("Invalid Image Size (%dx%d).\n",bitmap->width,bitmap->height); +#endif + return GE_INVALIDIMAGESIZE; + } + + bitmap->size=GSM_GetBitmapSize(bitmap); + + if (fread(bitmap->bitmap,1,bitmap->size,file)!=bitmap->size) + return(GE_TOOSHORT); + + return(GE_NONE); +} + +GSM_Error GSM_SaveBitmapFile(char *FileName, GSM_Bitmap *bitmap) +{ + + FILE *file; + bool done=false; + + file = fopen(FileName, "wb"); + + if (!file) + return(GE_CANTOPENFILE); + + if (strstr(FileName,".xpm")) { savexpm(file, bitmap); done=true; } + if (strstr(FileName,".nlm")) { savenlm(file, bitmap); done=true; } + if (strstr(FileName,".ngg")) { savengg(file, bitmap); done=true; } + if (strstr(FileName,".nsl")) { savensl(file, bitmap); done=true; } + if (strstr(FileName,".otb")) { saveota(file, bitmap); done=true; } + if (strstr(FileName,".nol")) { savenol(file, bitmap); done=true; } + if (strstr(FileName,".bmp") || + strstr(FileName,".ggp") || + strstr(FileName,".i61")) + { + savebmp(file, bitmap); + done=true; + } + + if (!done) + { + switch (bitmap->type) { + case GSM_CallerLogo : savengg(file, bitmap); break; + case GSM_OperatorLogo : savenol(file, bitmap); break; + case GSM_7110OperatorLogo: savebmp(file, bitmap); break; + case GSM_7110StartupLogo : savebmp(file, bitmap); break; + case GSM_6210StartupLogo : savebmp(file, bitmap); break; + case GSM_StartupLogo : savensl(file, bitmap); break; + case GSM_PictureImage : savenlm(file, bitmap); break; + case GSM_WelcomeNoteText : break; + case GSM_DealerNoteText : break; + case GSM_None : break; + } + } + + fclose(file); + + return GE_NONE; +} + +void savexpm(FILE *file, GSM_Bitmap *bitmap) +{ + int x,y; + + fprintf(file,_("/* XPM */\n")); + fprintf(file,_("static char * ala_xpm[] = {\n")); + fprintf(file,_("\"%i %i 2 1\",\n"),bitmap->width,bitmap->height); + fprintf(file,_("\". s c m #000000 g4 #000000 g #000000 c #000000\",\n")); + fprintf(file,_("\"# s c m #ffffff g4 #ffffff g #ffffff c #ffffff\",\n")); + + for (y=0;yheight;y++) { + fprintf(file,_("\"")); + for (x=0;xwidth;x++) + if (GSM_IsPointBitmap(bitmap,x,y)) + fprintf(file,_(".")); + else + fprintf(file,_("#")); + fprintf(file,_("\"")); + if (y==bitmap->height-1) + fprintf(file,_("};\n")); + else + fprintf(file,_(",\n")); + } +} + +/* Based on the article from the Polish Magazine "Bajtek" 11/92 */ + /* Marcin-Wiacek@Topnet.PL */ +void savebmp(FILE *file, GSM_Bitmap *bitmap) +{ + int x,y,pos,i,sizeimage; + unsigned char buffer[1]; + div_t division; + + unsigned char header[]={ +/*1'st header*/ 'B','M', /* BMP file ID */ + 0x00,0x00,0x00,0x00, /* Size of file */ + 0x00,0x00, /* Reserved for future use */ + 0x00,0x00, /* Reserved for future use */ + 62,0x00,0x00,0x00, /* Offset for image data */ + +/*2'nd header*/ 40,0x00,0x00,0x00, /* Length of this part of header */ + 0x00,0x00,0x00,0x00, /* Width of image */ + 0x00,0x00,0x00,0x00, /* Height of image */ + 1,0x00, /* How many planes in target device */ + 1,0x00, /* How many colors in image. 1 means 2^1=2 colors */ + 0x00,0x00,0x00,0x00, /* Type of compression. 0 means no compression */ +/*Sometimes */ 0x00,0x00,0x00,0x00, /* Size of part with image data */ +/*ttttttt...*/ 0xE8,0x03,0x00,0x00, /* XPelsPerMeter */ +/*hhiiiiissss*/ 0xE8,0x03,0x00,0x00, /* YPelsPerMeter */ +/*part of header*/2,0x00,0x00,0x00, /* How many colors from palette is used */ +/*doesn't exist*/ 0x00,0x00,0x00,0x00, /* How many colors from palette is required to display image. 0 means all */ + +/*Color palette*/ 0x00,0x00,0x00, /* First color in palette in Blue, Green, Red. Here white */ + 0x00, /* Each color in palette is end by 4'th byte */ + 102,204,102, /* Second color in palette in Blue, Green, Red. Here green */ + 0x00}; /* Each color in palette is end by 4'th byte */ + + header[22]=bitmap->height; + header[18]=bitmap->width; + + pos=7; + sizeimage=0; + for (y=bitmap->height-1;y>=0;y--) { //lines are written from the last to the first + i=1; + for (x=0;xwidth;x++) { + if (pos==7) { //new byte ! + if (x!=0) sizeimage++; + i++; + if(i==5) i=1; //each line is written in multiply of 4 bytes + } + pos--; + if (pos<0) pos=7; //going to new byte + } + pos=7; //going to new byte + sizeimage++; + if (i!=1) { + while (i!=5) //each line is written in multiply of 4 bytes + { + sizeimage++; + i++; + } + } + } +#ifdef DEBUG + printf("Data size in BMP file: %i\n",sizeimage); +#endif + division=div(sizeimage,256); + header[35]=division.quot; + header[34]=sizeimage-(division.quot*256); + + sizeimage=sizeimage+sizeof(header); +#ifdef DEBUG + printf("Size of BMP file: %i\n",sizeimage); +#endif + division=div(sizeimage,256); + header[3]=division.quot; + header[2]=sizeimage-(division.quot*256); + + fwrite(header,1,sizeof(header),file); + + pos=7; + for (y=bitmap->height-1;y>=0;y--) { //lines are written from the last to the first + i=1; + for (x=0;xwidth;x++) { + if (pos==7) { //new byte ! + if (x!=0) fwrite(buffer, 1, sizeof(buffer), file); + i++; + if(i==5) i=1; //each line is written in multiply of 4 bytes + buffer[0]=0; + } + if (!GSM_IsPointBitmap(bitmap,x,y)) buffer[0]|=(1<=0;j--) + if ((copy.bitmap[i]&(1<0) { + buffer[7-j] = '1'; + } else { + buffer[7-j] = '0'; + } + fwrite(buffer,1,8,file); + } +} + +void savenol(FILE *file, GSM_Bitmap *bitmap) +{ + + char header[]={'N','O','L',0x00,0x01,0x00, + 0x00,0x00, /* MCC */ + 0x00,0x00, /* MNC */ + 0x00,0x00, /* Width */ + 0x00,0x00, /* Height */ + 0x01,0x00,0x01,0x00, + 0x00, /* Unknown.Can't be checksum - for */ + /* the same logo files can be different */ + 0x00}; + char buffer[8]; + int i,j,country,net; + GSM_Bitmap copy; + + copy=*bitmap; + + GSM_ResizeBitmap(©,GSM_OperatorLogo); + + sscanf(copy.netcode, "%d %d", &country, &net); + + header[6]=country%256; + header[7]=country/256; + header[8]=net%256; + header[9]=net/256; + header[10]=copy.width; + header[12]=copy.height; + + fwrite(header,1,sizeof(header),file); + + for (i=0; i=0;j--) + if ((copy.bitmap[i]&(1<0) { + buffer[7-j] = '1'; + } else { + buffer[7-j] = '0'; + } + fwrite(buffer,1,8,file); + } +} + +void savensl(FILE *file, GSM_Bitmap *bitmap) +{ + + u8 header[]={'F','O','R','M', 0x01,0xFE, /* File ID block, size 1*256+0xFE=510*/ + 'N','S','L','D', 0x01,0xF8}; /* Startup Logo block, size 1*256+0xF8=504*/ + GSM_Bitmap copy; + + copy=*bitmap; + + GSM_ResizeBitmap(©,GSM_StartupLogo); + + fwrite(header,1,sizeof(header),file); + + fwrite(copy.bitmap,1,copy.size,file); +} + +void saveota(FILE *file, GSM_Bitmap *bitmap) +{ + + char header[]={0x01, + 0x00, /* Width */ + 0x00, /* Height */ + 0x01}; + GSM_Bitmap copy; + + copy=*bitmap; + + header[1]=copy.width; + header[2]=copy.height; + + fwrite(header,1,sizeof(header),file); + + fwrite(copy.bitmap,1,copy.size,file); +} + +void savenlm(FILE *file, GSM_Bitmap *bitmap) +{ + + char header[]={'N','L','M', /* Nokia Logo Manager file ID. */ + 0x20, + 0x01, + 0x00, /* 0x00 (OP), 0x01 (CLI), 0x02 (Startup), 0x03 (Picture)*/ + 0x00, /* Number of images inside file - 1. 0x01==2 images, 0x03==4 images, etc. */ + 0x00, /* Width. */ + 0x00, /* Height. */ + 0x01}; + + unsigned char buffer[1000]; + int x,y,pos,pos2; + div_t division; + GSM_Bitmap copy; + + copy=*bitmap; + + switch (copy.type) { + case GSM_OperatorLogo : header[5]=0x00; break; + case GSM_7110OperatorLogo: header[5]=0x00; break; + case GSM_CallerLogo : header[5]=0x01; break; + case GSM_StartupLogo : header[5]=0x02; break; + case GSM_7110StartupLogo : header[5]=0x02; break; + case GSM_6210StartupLogo : header[5]=0x02; break; + case GSM_PictureImage : header[5]=0x03; break; + case GSM_WelcomeNoteText : break; + case GSM_DealerNoteText : break; + case GSM_None : break; + } + + header[7]=copy.width; + header[8]=copy.height; + + pos=0;pos2=7; + for (y=0;y overwrite + * mode == 1 -> ask + * mode == 2 -> append + */ +int GSM_SaveTextFile(char *FileName, char *text, int mode) +{ + + FILE *file; + + if (mode == 2) file = fopen(FileName, "a"); + else file = fopen(FileName, "w"); + + if (!file) return -1; + + fprintf(file, "%s\n\n", text); + + fclose(file); + + return mode; +} + +GSM_Error GSM_SaveBackupFile(char *FileName, GSM_Backup *backup) +{ + + FILE *file; + + file = fopen(FileName, "wb"); + + if (!file) return(GE_CANTOPENFILE); + + savelmb(file, backup); + + fclose(file); + + return GE_NONE; +} + +void savelmbstartupentry(FILE *file, GSM_Bitmap startup, GSM_Bitmap text, bool available) +{ + /* Welcome note and logo header block */ + char req[1000] = {'W','E','L',' ', /*block identifier*/ + 00,00, /*block data size*/ + 0x02,00,00,00,00,00, + + 0x02}; /*number of blocks (like in 6110 frame)*/ + + int count=13; + + if (!available) { + } else { + count=count+N6110_MakeStartupLogoFrame(req+13,startup); + } + + req[count++]=0x02; + req[count++]=strlen(text.text); + memcpy(req+count,text.text,strlen(text.text)); + count=count+strlen(text.text); + + req[4]=(count-12)%256; + req[5]=(count-12)/256; + + fwrite(req, 1, count, file); +} + +void savelmbopentry(FILE *file, GSM_Bitmap bitmap) +{ + /* Operator logo header block */ + char req[500] = {'O','L','G',' ', /*block identifier*/ + 0x88,00, /*block data size*/ + 0x02,00,00,00,00,00, + + 00}; + + int count=13,i; + + count=count+N6110_MakeOperatorLogoFrame(req+13,bitmap); + + if (bitmap.width!=0x48) { + req[4]=(count-7)%256; + req[5]=(count-7)/256; + + for (i=1;i<=5;i++) req[count++]=0; + + req[17]=req[17]+5; //we fix size of logo block + } else { + req[4]=(count-12)%256; + req[5]=(count-12)/256; + } + + fwrite(req, 1, count, file); +} + +/* Work in progress ! */ +void savelmbspeedentry(FILE *file, GSM_SpeedDial speed) +{ + /* Speed dial header block */ + char req[] = {'S','P','D',' ', /*block identifier*/ + 0x03,00, /*block data size*/ + 0x02,00, + 00, /*number of speed dial*/ + 00,0xFF,00, + + 00, /*number of speed dial*/ + 03, /*memory type. ME=02;SM=03*/ + 00}; /*number of location assigned to speed dial*/ + + req[8]=req[12]=speed.Number; + + if (speed.MemoryType==GMT_ME) req[13]=2; //memory type=GMT_ME + + req[14]=speed.Location; + + fwrite(req, 1, 15, file); +} + +void savelmbcallerentry(FILE *file, GSM_Bitmap bitmap) +{ + char req[500] = {'C','G','R',' ', /*block identifier*/ + 00,00, /*block data size*/ + 02,00, + 00, /*group number=0,1,etc.*/ + 00,00,00}; + + int count=12; + + req[8]=bitmap.number; + + count=count+N6110_MakeCallerGroupFrame(req+12,bitmap); + + req[count++]=0; + + req[4]=(count-12)%256; + req[5]=(count-12)/256; + + fwrite(req, 1, count, file); +} + +void savelmbpbkentry(FILE *file, GSM_PhonebookEntry entry) +{ + char req[500] = {'P','B','E','2', /*block identifier*/ + 00,00, /*block data size*/ + 00,00, + 00,00, /*position of phonebook entry*/ + 03, /*memory type. ME=02;SM=03*/ + 00, + + 00,00, /*position of phonebook entry*/ + 03, /*memory type. ME=02;SM=03*/ + 00}; + + int count = 16, blocks; + + req[9]=req[13] = (entry.Location >> 8); + req[8]=req[12] = entry.Location & 0xff; + + if (entry.MemoryType==GMT_ME) req[10]=req[14]=2; + + count=count+N7110_EncodePhonebookFrame(req+16, entry, &blocks); + + req[4]=(count-12)%256; + req[5]=(count-12)/256; + + fwrite(req, 1, count, file); +} + +void savelmb(FILE *file, GSM_Backup *backup) +{ + int i; + + char LMBHeader[] = {'L','M','B',' '}; /*file identifier*/ + + /* Phonebook header block */ + char PBKHeader[] = {'P','B','K',' ', /*block identifier*/ + 0x08,00, /*block data size*/ + 0x02,00, + 03, /*memory type. ME=02;SM=03*/ + 00,00,00, + + 00,00, /*size of phonebook*/ + 14, /*max length of each position*/ + 00,00,00,00,00}; + + fwrite(LMBHeader, 1, sizeof(LMBHeader), file); /* Write the header of the file. */ + + if (backup->SIMPhonebookUsed!=0) { + PBKHeader[12]=backup->SIMPhonebookSize%256; + PBKHeader[13]=backup->SIMPhonebookSize/256; + fwrite(PBKHeader, 1, sizeof(PBKHeader), file); + + for (i=0;iSIMPhonebookUsed;i++) + savelmbpbkentry(file, backup->SIMPhonebook[i]); + } + + if (backup->PhonePhonebookUsed!=0) { + PBKHeader[8]=2; //memory type=GMT_ME + PBKHeader[12]=backup->PhonePhonebookSize%256; + PBKHeader[13]=backup->PhonePhonebookSize/256; + PBKHeader[14]=0x16; //max size of one entry + fwrite(PBKHeader, 1, sizeof(PBKHeader), file); + + for (i=0;iPhonePhonebookUsed;i++) + savelmbpbkentry(file, backup->PhonePhonebook[i]); + } + + if (backup->CallerAvailable) + for (i=0;i<5;i++) savelmbcallerentry(file,backup->CallerGroups[i]); + +// if (backup->SpeedAvailable) +// for (i=0;i<8;i++) savelmbspeedentry(file,backup->SpeedDials[i]); + + if (backup->OperatorLogoAvailable) savelmbopentry(file,backup->OperatorLogo); + + savelmbstartupentry(file,backup->StartupLogo,backup->StartupText,backup->StartupLogoAvailable); +} + +void loadlmbcallerentry(unsigned char *buffer, unsigned char *buffer2, GSM_Backup *backup, int number) +{ + int i; + + backup->CallerAvailable=true; + +#ifdef DEBUG + fprintf(stdout, _(" Number %i, name \""), buffer2[0]); + for (i=0;iCallerGroups[number].number=buffer2[0]; + backup->CallerGroups[number].type=GSM_CallerLogo; + + for (i=0;iCallerGroups[number].text[i]=buffer2[i+2]; + } + backup->CallerGroups[number].text[buffer2[1]]=0; + + backup->CallerGroups[number].ringtone=buffer2[i+2]; + + backup->CallerGroups[number].enabled=false; + if (buffer2[i+3]==1) backup->CallerGroups[number].enabled=true; + + backup->CallerGroups[number].width=buffer2[i+7]; + backup->CallerGroups[number].height=buffer2[i+8]; + + backup->CallerGroups[number].size=GSM_GetBitmapSize(&backup->CallerGroups[number]); + + memcpy(backup->CallerGroups[number].bitmap,buffer2+i+10,backup->CallerGroups[number].size); + +#ifdef DEBUG + fprintf(stdout, _(" Caller logo")); + fprintf(stdout, _(" (size %ix%i - %i bytes)\n"), + backup->CallerGroups[number].width, backup->CallerGroups[number].height, backup->CallerGroups[number].size); + GSM_PrintBitmap(&backup->CallerGroups[number]); +#endif + +} + +void loadlmbopentry(unsigned char *buffer, unsigned char *buffer2, GSM_Backup *backup) +{ + backup->OperatorLogoAvailable=true; + + DecodeNetworkCode(buffer2+1, backup->OperatorLogo.netcode); + + backup->OperatorLogo.text[0]=0; + + backup->OperatorLogo.width=buffer2[7]; + backup->OperatorLogo.height=buffer2[8]; + + backup->OperatorLogo.type=GSM_OperatorLogo; + if (backup->OperatorLogo.width==78) backup->OperatorLogo.type=GSM_7110OperatorLogo; + + backup->OperatorLogo.size=GSM_GetBitmapSize(&backup->OperatorLogo); + +#ifdef DEBUG + fprintf(stdout, _(" GSM operator logo (size %ix%i - %i bytes) for %s (%s) network.\n"), + backup->OperatorLogo.width, backup->OperatorLogo.height, + backup->OperatorLogo.size, backup->OperatorLogo.netcode, + GSM_GetNetworkName(backup->OperatorLogo.netcode)); +#endif + + memcpy(backup->OperatorLogo.bitmap,buffer2+10,backup->OperatorLogo.size); + +#ifdef DEBUG + GSM_PrintBitmap(&backup->OperatorLogo); +#endif + +} + +void loadlmbpbkentry(unsigned char *buffer, unsigned char *buffer2, GSM_Backup *backup) +{ + GSM_PhonebookEntry pbk; + +#ifdef DEBUG + fprintf(stdout,_(" Memory : ")); + switch(buffer[10]) { + case 2: fprintf(stdout, _("(internal)\n"));break; + case 3: fprintf(stdout, _("(sim)\n"));break; + default: fprintf(stdout, _("(unknown)\n"));break; + } + fprintf(stdout,_(" Location : %i\n"),buffer2[0]+buffer2[1]*256); +#endif + + pbk.Empty = true; + pbk.Group = 5; /* 5 = no group as 6110 */ + pbk.Name[0] = 0; + pbk.Number[0] = 0; + pbk.SubEntriesCount = 0; + + N7110_DecodePhonebookFrame(&pbk,buffer2+4,(buffer[4]+buffer[5]*256)-4); + + pbk.MemoryType=GMT_SM; + if (buffer[10]==2) pbk.MemoryType=GMT_ME; + + pbk.Location=buffer2[0]+256*buffer2[1]; + + if (buffer[10]==2) backup->PhonePhonebook[backup->PhonePhonebookUsed++]=pbk; + else backup->SIMPhonebook [backup->SIMPhonebookUsed++] =pbk; +} + +void loadlmbstartupentry(unsigned char *buffer, unsigned char *buffer2, GSM_Backup *backup) +{ + int i,j; +#ifdef DEBUG + int z; +#endif + + j=1; + for (i=0;iStartupLogoAvailable=true; + backup->StartupLogo.height=buffer2[j++]; + backup->StartupLogo.width=buffer2[j++]; + backup->StartupLogo.text[0]=0; + backup->StartupLogo.type=GSM_StartupLogo; + switch (backup->StartupLogo.height) { + case 65:backup->StartupLogo.type=GSM_7110StartupLogo;break; + case 60:backup->StartupLogo.type=GSM_6210StartupLogo;break; + } + backup->StartupLogo.size=GSM_GetBitmapSize(&backup->StartupLogo); + +#ifdef DEBUG + fprintf(stdout, _(" Block 1 - startup logo (size %ix%i - %i bytes)\n"), + backup->StartupLogo.width, backup->StartupLogo.height, backup->StartupLogo.size); +#endif + + memcpy(backup->StartupLogo.bitmap,buffer2+j,backup->StartupLogo.size); +#ifdef DEBUG + GSM_PrintBitmap(&backup->StartupLogo); +#endif + j=j+backup->StartupLogo.size; + + break; + case 2: + +#ifdef DEBUG + fprintf(stdout, _(" Block 2 - welcome note \"")); + for (z=0;zPhonePhonebookUsed=0; + backup->SIMPhonebookUsed=0; + backup->StartupLogoAvailable=false; + backup->StartupText.text[0]=0; + backup->OperatorLogoAvailable=false; + backup->CallerAvailable=false; + backup->SpeedAvailable=false; + + switch (filetype) { + case LMB: error=loadlmb(file,backup); fclose(file); break; + default : error=GE_INVALIDFILEFORMAT; + } + + return(error); +} + +GSM_Error GSM_SaveBinRingtoneFile(char *FileName, GSM_BinRingtone *ringtone) +{ + + FILE *file; + + file = fopen(FileName, "wb"); + + if (!file) return(GE_CANTOPENFILE); + + fwrite(ringtone->frame, 1, ringtone->length, file); + + fclose(file); + + return GE_NONE; +} diff --git a/common/files/midifile.c b/common/files/midifile.c new file mode 100644 index 0000000..7177373 --- /dev/null +++ b/common/files/midifile.c @@ -0,0 +1,1321 @@ +/* a little modified code from http://iki.fi/too/sw/xring/ */ + +/* embedding modified midifile.h and midifile.c into this file */ + +/***** midifile.h ******/ + +struct MF { +/* definitions for MIDI file parsing code */ + int (*Mf_getc)(struct MF *); + void (*Mf_header)(struct MF *, int, int, int); + void (*Mf_trackstart)(struct MF *); + void (*Mf_trackend)(struct MF *); + void (*Mf_noteon)(struct MF *, int, int, int); + void (*Mf_noteoff)(struct MF *, int, int, int); + void (*Mf_pressure)(struct MF *, int, int, int); + void (*Mf_parameter)(struct MF *, int, int, int); + void (*Mf_pitchbend)(struct MF *, int, int, int); + void (*Mf_program)(struct MF *, int, int); + void (*Mf_chanpressure)(struct MF *, int, int); + void (*Mf_sysex)(struct MF *, int, char *); + void (*Mf_metamisc)(struct MF *, int, int, char * ); + void (*Mf_seqspecific)(struct MF *, int, int, char *); + void (*Mf_seqnum)(struct MF *, int); + void (*Mf_text)(struct MF *, int, int, char *); + void (*Mf_eot)(struct MF *); + void (*Mf_timesig)(struct MF *, int, int, int, int); + void (*Mf_smpte)(struct MF *, int, int, int, int, int); + void (*Mf_tempo)(struct MF *, long); + void (*Mf_keysig)(struct MF *, int, int); + void (*Mf_arbitrary)(struct MF *, int, char *); + void (*Mf_error)(struct MF *, char * ); +#if 0 +/* definitions for MIDI file writing code */ + void (*Mf_putc)(struct MF *); + void (*Mf_writetrack)(struct MF *); + void (*Mf_writetempotrack)(struct MF *); +#endif + /* variables */ + int Mf_nomerge; /* 1 => continue'ed system exclusives are */ + /* not collapsed. */ + long Mf_currtime; /* current time in delta-time units */ + +/* private stuff */ + long Mf_toberead; + long Mf_numbyteswritten; + + char *Msgbuff; /* message buffer */ + int Msgsize; /* Size of currently allocated Msg */ + int Msgindex; /* index of next available location in Msg */ + +}; + +float mf_ticks2sec(unsigned long ticks,int division,unsigned int tempo); +unsigned long mf_sec2ticks(float secs,int division, unsigned int tempo); + +void mferror(struct MF * mf, char * s); + +/*void mfwrite(); */ + + +/* MIDI status commands most significant bit is 1 */ +#define note_off 0x80 +#define note_on 0x90 +#define poly_aftertouch 0xa0 +#define control_change 0xb0 +#define program_chng 0xc0 +#define channel_aftertouch 0xd0 +#define pitch_wheel 0xe0 +#define system_exclusive 0xf0 +#define delay_packet (1111) + +/* 7 bit controllers */ +#define damper_pedal 0x40 +#define portamento 0x41 +#define sostenuto 0x42 +#define soft_pedal 0x43 +#define general_4 0x44 +#define hold_2 0x45 +#define general_5 0x50 +#define general_6 0x51 +#define general_7 0x52 +#define general_8 0x53 +#define tremolo_depth 0x5c +#define chorus_depth 0x5d +#define detune 0x5e +#define phaser_depth 0x5f + +/* parameter values */ +#define data_inc 0x60 +#define data_dec 0x61 + +/* parameter selection */ +#define non_reg_lsb 0x62 +#define non_reg_msb 0x63 +#define reg_lsb 0x64 +#define reg_msb 0x65 + +/* Standard MIDI Files meta event definitions */ +#define meta_event 0xFF +#define sequence_number 0x00 +#define text_event 0x01 +#define copyright_notice 0x02 +#define sequence_name 0x03 +#define instrument_name 0x04 +#define lyric 0x05 +#define marker 0x06 +#define cue_point 0x07 +#define channel_prefix 0x20 +#define end_of_track 0x2f +#define set_tempo 0x51 +#define smpte_offset 0x54 +#define time_signature 0x58 +#define key_signature 0x59 +#define sequencer_specific 0x74 + +/* Manufacturer's ID number */ +#define Seq_Circuits (0x01) /* Sequential Circuits Inc. */ +#define Big_Briar (0x02) /* Big Briar Inc. */ +#define Octave (0x03) /* Octave/Plateau */ +#define Moog (0x04) /* Moog Music */ +#define Passport (0x05) /* Passport Designs */ +#define Lexicon (0x06) /* Lexicon */ +#define Tempi (0x20) /* Bon Tempi */ +#define Siel (0x21) /* S.I.E.L. */ +#define Kawai (0x41) +#define Roland (0x42) +#define Korg (0x42) +#define Yamaha (0x43) + +/* miscellaneous definitions */ +#define MThd 0x4d546864 +#define MTrk 0x4d54726b +#define lowerbyte(x) ((unsigned char)(x & 0xff)) +#define upperbyte(x) ((unsigned char)((x & 0xff00)>>8)) + +/* the midifile interface */ +void midifile(struct MF * mf); + +/***** midifile.c ******/ + +/* + * midifile 1.11 + * + * Read and write a MIDI file. Externally-assigned function pointers are + * called upon recognizing things in the file. + * + * Original release ? + * June 1989 - Added writing capability, M. Czeiszperger. + * + * The file format implemented here is called + * Standard MIDI Files, and is part of the Musical + * instrument Digital Interface specification. + * The spec is avaiable from: + * + * International MIDI Association + * 5316 West 57th Street + * Los Angeles, CA 90056 + * + * An in-depth description of the spec can also be found + * in the article "Introducing Standard MIDI Files", published + * in Electronic Musician magazine, April, 1989. + * + */ + +#include +#include +#include +#include + +#ifdef WIN32 + + #include + +#else + + #include +#endif + +#include "gsm-common.h" +#include "gsm-ringtones.h" + +#define NULLFUNC NULL + +static void readheader(struct MF * mf); +static int readtrack(struct MF * mf); +static void chanmessage(struct MF * mf,int status,int c1,int c2); +static void msginit(struct MF * mf); +static void msgadd(struct MF * mf,int c); +static void metaevent(struct MF * mf, int type); +static void sysex(struct MF * mf); +static int msgleng(struct MF * mf); +static void badbyte(struct MF * mf,int c); +static void biggermsg(struct MF * mf); + + +static long readvarinum(struct MF * mf); +static long read32bit(struct MF * mf); +static long to32bit(int, int, int, int); +static int read16bit(struct MF * mf); +static int to16bit(int, int); +static char * msg(struct MF * mf); + +/* The only non-static function in this file. */ +void mfread(struct MF * mf) +{ + if ( mf->Mf_getc == NULLFUNC ) + mferror(mf, "mfread() called without setting Mf_getc"); + + readheader(mf); + while ( readtrack(mf) ) + ; +} + +/* for backward compatibility with the original lib */ +void midifile(struct MF * mf) +{ + mfread(mf); +} + +/* read through the "MThd" or "MTrk" header string */ +static int readmt(struct MF * mf, char * s) +{ + int n = 0; + char *p = s; + int c=0; + + while ( n++<4 && (c=mf->Mf_getc(mf)) != EOF ) { + if ( c != *p++ ) { + char buff[32]; + (void) strcpy(buff, "expecting "); + (void) strcat(buff, s); + mferror(mf, buff); + } + } + return c; +} + +/* read a single character and abort on EOF */ +static int egetc(struct MF * mf) +{ + int c = mf->Mf_getc(mf); + + if ( c == EOF ) + mferror(mf, "premature EOF"); + mf->Mf_toberead--; + return c; +} + +/* read a header chunk */ +static void readheader(struct MF * mf) +{ + int format, ntrks, division; + + if ( readmt(mf, "MThd") == EOF ) + return; + + mf->Mf_toberead = read32bit(mf); + format = read16bit(mf); + ntrks = read16bit(mf); + division = read16bit(mf); + + if ( mf->Mf_header ) + (*mf->Mf_header)(mf, format,ntrks,division); + + /* flush any extra stuff, in case the length of header is not 6 */ + while ( mf->Mf_toberead > 0 ) + (void) egetc(mf); +} + +static int readtrack(struct MF * mf) /* read a track chunk */ +{ + /* This array is indexed by the high half of a status byte. It's */ + /* value is either the number of bytes needed (1 or 2) for a channel */ + /* message, or 0 (meaning it's not a channel message). */ + static int chantype[] = { + 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00 through 0x70 */ + 2, 2, 2, 2, 1, 1, 2, 0 /* 0x80 through 0xf0 */ + }; + long lookfor; + int c, c1, type; + int sysexcontinue = 0; /* 1 if last message was an unfinished sysex */ + int running = 0; /* 1 when running status used */ + int status = 0; /* status value (e.g. 0x90==note-on) */ + int needed; + + if ( readmt(mf, "MTrk") == EOF ) + return(0); + + mf->Mf_toberead = read32bit(mf); + mf->Mf_currtime = 0; + + if ( mf->Mf_trackstart ) + (*mf->Mf_trackstart)(mf); + + while ( mf->Mf_toberead > 0 ) { + + mf->Mf_currtime += readvarinum(mf); /* delta time */ + + c = egetc(mf); + + if ( sysexcontinue && c != 0xf7 ) + mferror(mf, "didn't find expected continuation of a sysex"); + + if ( (c & 0x80) == 0 ) { /* running status? */ + if ( status == 0 ) + mferror(mf, "unexpected running status"); + running = 1; + } + else { + status = c; + running = 0; + } + + needed = chantype[ (status>>4) & 0xf ]; + + if ( needed ) { /* ie. is it a channel message? */ + + if ( running ) + c1 = c; + else + c1 = egetc(mf); + chanmessage(mf, status, c1, (needed>1)? egetc(mf): 0); + continue;; + } + + switch ( c ) { + + case 0xff: /* meta event */ + + type = egetc(mf); + lookfor = mf->Mf_toberead - readvarinum(mf); + msginit(mf); + + while ( mf->Mf_toberead > lookfor ) + msgadd(mf, egetc(mf)); + + metaevent(mf, type); + break; + + case 0xf0: /* start of system exclusive */ + + lookfor = mf->Mf_toberead - readvarinum(mf); + msginit(mf); + msgadd(mf, 0xf0); + + while ( mf->Mf_toberead > lookfor ) + msgadd(mf, c=egetc(mf)); + + if ( c==0xf7 || mf->Mf_nomerge==0 ) + sysex(mf); + else + sysexcontinue = 1; /* merge into next msg */ + break; + + case 0xf7: /* sysex continuation or arbitrary stuff */ + + lookfor = mf->Mf_toberead - readvarinum(mf); + + if ( ! sysexcontinue ) + msginit(mf); + + while ( mf->Mf_toberead > lookfor ) + msgadd(mf, c=egetc(mf)); + + if ( ! sysexcontinue ) { + if ( mf->Mf_arbitrary ) + (*mf->Mf_arbitrary)(mf, msgleng(mf),msg(mf)); + } + else if ( c == 0xf7 ) { + sysex(mf); + sysexcontinue = 0; + } + break; + default: + badbyte(mf, c); + break; + } + } + if ( mf->Mf_trackend ) + (*mf->Mf_trackend)(mf); + return(1); +} + +static void badbyte(struct MF * mf,int c) +{ + char buff[32]; + + (void) sprintf(buff,"unexpected byte: 0x%02x",c); + mferror(mf, buff); +} + +static void metaevent(struct MF * mf, int type) +{ + int leng = msgleng(mf); + char *m = msg(mf); + + switch ( type ) { + case 0x00: + if ( mf->Mf_seqnum ) + (*mf->Mf_seqnum)(mf, to16bit(m[0],m[1])); + break; + case 0x01: /* Text event */ + case 0x02: /* Copyright notice */ + case 0x03: /* Sequence/Track name */ + case 0x04: /* Instrument name */ + case 0x05: /* Lyric */ + case 0x06: /* Marker */ + case 0x07: /* Cue point */ + case 0x08: + case 0x09: + case 0x0a: + case 0x0b: + case 0x0c: + case 0x0d: + case 0x0e: + case 0x0f: + /* These are all text events */ + if ( mf->Mf_text ) + (*mf->Mf_text)(mf, type,leng,m); + break; + case 0x2f: /* End of Track */ + if ( mf->Mf_eot ) + (*mf->Mf_eot)(mf); + break; + case 0x51: /* Set tempo */ + if ( mf->Mf_tempo ) + (*mf->Mf_tempo)(mf, to32bit(0,m[0],m[1],m[2])); + break; + case 0x54: + if ( mf->Mf_smpte ) + (*mf->Mf_smpte)(mf, m[0],m[1],m[2],m[3],m[4]); + break; + case 0x58: + if ( mf->Mf_timesig ) + (*mf->Mf_timesig)(mf, m[0],m[1],m[2],m[3]); + break; + case 0x59: + if ( mf->Mf_keysig ) + (*mf->Mf_keysig)(mf, m[0],m[1]); + break; + case 0x7f: + if ( mf->Mf_seqspecific ) + (*mf->Mf_seqspecific)(mf, type, leng, m); + break; + default: + if ( mf->Mf_metamisc ) + (*mf->Mf_metamisc)(mf, type,leng,m); + } +} + +static void sysex(struct MF * mf) +{ + if ( mf->Mf_sysex ) + (*mf->Mf_sysex)(mf, msgleng(mf),msg(mf)); +} + +static void chanmessage(struct MF * mf,int status,int c1,int c2) +{ + int chan = status & 0xf; + + switch ( status & 0xf0 ) { + case 0x80: + if ( mf->Mf_noteoff ) + (*mf->Mf_noteoff)(mf, chan,c1,c2); + break; + case 0x90: + if ( mf->Mf_noteon ) + (*mf->Mf_noteon)(mf, chan,c1,c2); + break; + case 0xa0: + if ( mf->Mf_pressure ) + (*mf->Mf_pressure)(mf, chan,c1,c2); + break; + case 0xb0: + if ( mf->Mf_parameter ) + (*mf->Mf_parameter)(mf, chan,c1,c2); + break; + case 0xe0: + if ( mf->Mf_pitchbend ) + (*mf->Mf_pitchbend)(mf, chan,c1,c2); + break; + case 0xc0: + if ( mf->Mf_program ) + (*mf->Mf_program)(mf, chan,c1); + break; + case 0xd0: + if ( mf->Mf_chanpressure ) + (*mf->Mf_chanpressure)(mf, chan,c1); + break; + } +} + +/* readvarinum - read a varying-length number, and return the */ +/* number of characters it took. */ + +static long readvarinum(struct MF * mf) +{ + long value; + int c; + + c = egetc(mf); + value = c; + if ( c & 0x80 ) { + value &= 0x7f; + do { + c = egetc(mf); + value = (value << 7) + (c & 0x7f); + } while (c & 0x80); + } + return (value); +} + +static long to32bit(int c1,int c2,int c3,int c4) +{ + long value = 0L; + + value = (c1 & 0xff); + value = (value<<8) + (c2 & 0xff); + value = (value<<8) + (c3 & 0xff); + value = (value<<8) + (c4 & 0xff); + return (value); +} + +static int to16bit(int c1,int c2) +{ + return ((c1 & 0xff ) << 8) + (c2 & 0xff); +} + +static long read32bit(struct MF * mf) +{ + int c1, c2, c3, c4; + + c1 = egetc(mf); + c2 = egetc(mf); + c3 = egetc(mf); + c4 = egetc(mf); + return to32bit(c1,c2,c3,c4); +} + +static int read16bit(struct MF * mf) +{ + int c1, c2; + c1 = egetc(mf); + c2 = egetc(mf); + return to16bit(c1,c2); +} + +/* static */ +void mferror(struct MF * mf, char * s) +{ + if ( mf->Mf_error ) + (*mf->Mf_error)(mf, s); + exit(1); +} + +/* The code below allows collection of a system exclusive message of */ +/* arbitrary length. The Msgbuff is expanded as necessary. The only */ +/* visible data/routines are msginit(), msgadd(), msg(), msgleng(). */ + +#define MSGINCREMENT 128 + +static void msginit(struct MF * mf) +{ + mf->Msgindex = 0; +} + +static char * msg(struct MF * mf) +{ + return(mf->Msgbuff); +} + +static int msgleng(struct MF * mf) +{ + return(mf->Msgindex); +} + +static void msgadd(struct MF * mf,int c) +{ + /* If necessary, allocate larger message buffer. */ + if ( mf->Msgindex >= mf->Msgsize ) + biggermsg(mf); + mf->Msgbuff[mf->Msgindex++] = c; +} + +static void biggermsg(struct MF * mf) +{ + char *newmess; + char *oldmess = mf->Msgbuff; + int oldleng = mf->Msgsize; + + mf->Msgsize += MSGINCREMENT; + newmess = (char *) malloc( (unsigned)(sizeof(char) * mf->Msgsize) ); + + if(newmess == NULL) + mferror(mf, "malloc error!"); + + /* copy old message into larger new one */ + if ( oldmess != NULL ) { + register char *p = newmess; + register char *q = oldmess; + register char *endq = &oldmess[oldleng]; + + for ( ; q!=endq ; p++,q++ ) + *p = *q; + free(oldmess); + } + mf->Msgbuff = newmess; +} + +#if 0 /* saving time not converting write function at this time + */ +/* + * mfwrite() - The only fuction you'll need to call to write out + * a midi file. + * + * format 0 - Single multi-channel track + * 1 - Multiple simultaneous tracks + * 2 - One or more sequentially independent + * single track patterns + * ntracks The number of tracks in the file. + * division This is kind of tricky, it can represent two + * things, depending on whether it is positive or negative + * (bit 15 set or not). If bit 15 of division is zero, + * bits 14 through 0 represent the number of delta-time + * "ticks" which make up a quarter note. If bit 15 of + * division is a one, delta-times in a file correspond to + * subdivisions of a second similiar to SMPTE and MIDI + * time code. In this format bits 14 through 8 contain + * one of four values - 24, -25, -29, or -30, + * corresponding to the four standard SMPTE and MIDI + * time code frame per second formats, where -29 + * represents 30 drop frame. The second byte + * consisting of bits 7 through 0 corresponds the the + * resolution within a frame. Refer the Standard MIDI + * Files 1.0 spec for more details. + * fp This should be the open file pointer to the file you + * want to write. It will have be a global in order + * to work with Mf_putc. + */ +void +mfwrite(format,ntracks,division,fp) +int format,ntracks,division; +FILE *fp; +{ + int i; void mf_write_track_chunk(), mf_write_header_chunk(); + + if ( mf->Mf_putc == NULLFUNC ) + mferror(mf, "mfmf_write() called without setting Mf_putc"); + + if ( mf->Mf_writetrack == NULLFUNC ) + mferror(mf, "mfmf_write() called without setting Mf_mf_writetrack"); + + /* every MIDI file starts with a header */ + mf_write_header_chunk(format,ntracks,division); + + /* In format 1 files, the first track is a tempo map */ + if(format == 1 && ( mf->Mf_writetempotrack )) + { + (*mf->Mf_writetempotrack)(); + } + + /* The rest of the file is a series of tracks */ + for(i = 0; i < ntracks; i++) + mf_write_track_chunk(i,fp); +} + +void +mf_write_track_chunk(which_track,fp) +int which_track; +FILE *fp; +{ + unsigned long trkhdr,trklength; + long offset, place_marker; + void write16bit(),write32bit(); + + + trkhdr = MTrk; + trklength = 0; + + /* Remember where the length was written, because we don't + know how long it will be until we've finished writing */ + offset = ftell(fp); + +#ifdef DEBUG + printf("offset = %d\n",(int) offset); +#endif + + /* Write the track chunk header */ + write32bit(trkhdr); + write32bit(trklength); + + mf->Mf_numbyteswritten = 0L; /* the header's length doesn't count */ + + if( mf->Mf_writetrack ) + { + (*mf->Mf_writetrack)(which_track); + } + + /* mf_write End of track meta event */ + eputc(mf, 0); + eputc(mf, meta_event); + eputc(mf, end_of_track); + + eputc(mf, 0); + + /* It's impossible to know how long the track chunk will be beforehand, + so the position of the track length data is kept so that it can + be written after the chunk has been generated */ + place_marker = ftell(fp); + + /* This method turned out not to be portable because the + parameter returned from ftell is not guaranteed to be + in bytes on every machine */ + /* track.length = place_marker - offset - (long) sizeof(track); */ + +#ifdef DEBUG +printf("length = %d\n",(int) trklength); +#endif + + if(fseek(fp,offset,0) < 0) + mferror(mf, "error seeking during final stage of write"); + + trklength = mf->Mf_numbyteswritten; + + /* Re-mf_write the track chunk header with right length */ + write32bit(trkhdr); + write32bit(trklength); + + fseek(fp,place_marker,0); +} /* End gen_track_chunk() */ + + +void +mf_write_header_chunk(format,ntracks,division) +int format,ntracks,division; +{ + unsigned long ident,length; + void write16bit(),write32bit(); + + ident = MThd; /* Head chunk identifier */ + length = 6; /* Chunk length */ + + /* individual bytes of the header must be written separately + to preserve byte order across cpu types :-( */ + write32bit(ident); + write32bit(length); + write16bit(format); + write16bit(ntracks); + write16bit(division); +} /* end gen_header_chunk() */ + + +#ifdef WHENISTHISNEEDED +/* + * mf_write_midi_event() + * + * Library routine to mf_write a single MIDI track event in the standard MIDI + * file format. The format is: + * + * + * + * In this case, event can be any multi-byte midi message, such as + * "note on", "note off", etc. + * + * delta_time - the time in ticks since the last event. + * type - the type of meta event. + * chan - The midi channel. + * data - A pointer to a block of chars containing the META EVENT, + * data. + * size - The length of the meta-event data. + */ +int +mf_write_midi_event(delta_time, type, chan, data, size) +unsigned long delta_time; +unsigned int chan,type; +unsigned long size; +unsigned char *data; +{ + int i; + void WriteVarLen(); + unsigned char c; + + WriteVarLen(delta_time); + + /* all MIDI events start with the type in the first four bits, + and the channel in the lower four bits */ + c = type | chan; + + if(chan > 15) + perror("error: MIDI channel greater than 16\n"); + + eputc(mf, c); + + /* write out the data bytes */ + for(i = 0; i < size; i++) + eputc(mf, data[i]); + + return(size); +} /* end mf_write MIDI event */ + +/* + * mf_write_meta_event() + * + * Library routine to mf_write a single meta event in the standard MIDI + * file format. The format of a meta event is: + * + * + * + * delta_time - the time in ticks since the last event. + * type - the type of meta event. + * data - A pointer to a block of chars containing the META EVENT, + * data. + * size - The length of the meta-event data. + */ +int +mf_write_meta_event(delta_time, type, data, size) +unsigned long delta_time; +unsigned char *data,type; +unsigned long size; +{ + int i; + + WriteVarLen(delta_time); + + /* This marks the fact we're writing a meta-event */ + eputc(mf, meta_event); + + /* The type of meta event */ + eputc(mf, type); + + /* The length of the data bytes to follow */ + WriteVarLen(size); + + for(i = 0; i < size; i++) + { + if(eputc(mf, data[i]) != data[i]) + return(-1); + } + return(size); +} /* end mf_write_meta_event */ + +void +mf_write_tempo(tempo) +unsigned long tempo; +{ + /* Write tempo */ + /* all tempos are written as 120 beats/minute, */ + /* expressed in microseconds/quarter note */ + eputc(mf, 0); + eputc(mf, meta_event); + eputc(mf, set_tempo); + + eputc(mf, 3); + eputc(mf, (unsigned)(0xff & (tempo >> 16))); + eputc(mf, (unsigned)(0xff & (tempo >> 8))); + eputc(mf, (unsigned)(0xff & tempo)); +} + +#endif +/* + * Write multi-length bytes to MIDI format files + */ +void +WriteVarLen(value) +unsigned long value; +{ + unsigned long buffer; + + buffer = value & 0x7f; + while((value >>= 7) > 0) + { + buffer <<= 8; + buffer |= 0x80; + buffer += (value & 0x7f); + } + while(1){ + eputc(mf, (unsigned)(buffer & 0xff)); + + if(buffer & 0x80) + buffer >>= 8; + else + return; + } +}/* end of WriteVarLen */ + + +/* + * write32bit() + * write16bit() + * + * These routines are used to make sure that the byte order of + * the various data types remains constant between machines. This + * helps make sure that the code will be portable from one system + * to the next. It is slightly dangerous that it assumes that longs + * have at least 32 bits and ints have at least 16 bits, but this + * has been true at least on PCs, UNIX machines, and Macintosh's. + * + */ +void +write32bit(data) +unsigned long data; +{ + eputc(mf, x(unsigned)((data >> 24) & 0xff)); + eputc(mf, (unsigned)((data >> 16) & 0xff)); + eputc(mf, (unsigned)((data >> 8 ) & 0xff)); + eputc(mf, (unsigned)(data & 0xff)); +} + +void +write16bit(data) +int data; +{ + eputc(mf, (unsigned)((data & 0xff00) >> 8)); + eputc(mf, (unsigned)(data & 0xff)); +} + +/* write a single character and abort on error */ +eputc(mf, c) +unsigned char c; +{ + int return_val; + + if((mf->Mf_putc) == NULLFUNC) + { + mferror(mf, "Mf_putc undefined"); + return(-1); + } + + return_val = (mf->Mf_putc)(mf, c); + + if ( return_val == EOF ) + mferror(mf, "error writing"); + + mf->Mf_numbyteswritten++; + return(return_val); +} + +#endif + +unsigned long mf_sec2ticks(float secs,int division, unsigned int tempo) +{ + return (long)(((secs * 1000.0) / 4.0 * division) / tempo); +} + + +/* + * This routine converts delta times in ticks into seconds. The + * else statement is needed because the formula is different for tracks + * based on notes and tracks based on SMPTE times. + * + */ +float mf_ticks2sec(unsigned long ticks,int division,unsigned int tempo) +{ + float smpte_format, smpte_resolution; + + if(division > 0) + return ((float) (((float)(ticks) * (float)(tempo)) / ((float)(division) * 1000000.0))); + else + { + smpte_format = upperbyte(division); + smpte_resolution = lowerbyte(division); + return (float) ((float) ticks / (smpte_format * smpte_resolution * 1000000.0)); + } +} /* end of ticks2sec() */ + +/* code to utilize the interface */ + +#define TRACE(x, y) do { if (x) printf y; } while (0) + + +typedef unsigned long ulg; +typedef unsigned char uch; +typedef unsigned int ui; + +struct NoteInfo +{ + int beats; + int nrnotes; + struct Notes { + ui note : 4; + ui scale : 4; + ui length : 4; + ui lextra : 4; + } note[1]; +}; + +#define IBUFSIZE 1024 +struct MFX +{ + struct MF mfi; + struct NoteInfo * ni; + int allocated; + + int division; + int trackstate; + + int prevnoteonpitch; /* -1, nothing, 0 pause, 1-x note. */ + ulg prevnoteontime; + + struct { + int fd; + uch buf[IBUFSIZE]; + int len; + int p; + } istrm; +}; + +enum { TRK_NONE, TRK_READING, TRK_FINISHED }; + +#define ALLOCSIZE 256 + +#define NIALLOC(size) (struct NoteInfo *)malloc(sizeof (struct NoteInfo) + ((size) - 1) * sizeof (struct Notes)) + +#define NIREALLOC(ni, size) (struct NoteInfo *)realloc((ni), sizeof (struct NoteInfo) + ((size) - 1) * sizeof (struct Notes)) + + +static void lm_error(struct MF * mf, char * s); + +static int lm_getc(struct MF * mf); +static void lm_header(struct MF * mf, int, int, int); +static void lm_trackstart(struct MF * mf); +static void lm_trackend(struct MF * mf); +static void lm_tempo(struct MF *, long); +static void lm_noteon(struct MF *, int, int, int); +static void lm_noteoff(struct MF *, int, int, int); + + +struct NoteInfo * readmidi(int fd) +{ + struct MFX mfxi = { { 0 } }; + struct MF * mf = (struct MF *)&mfxi; + + mfxi.ni = NIALLOC(ALLOCSIZE); + mfxi.allocated = ALLOCSIZE; + + /* set variables to their initial values */ + mfxi.division = 0; + mfxi.trackstate = TRK_NONE; + mfxi.prevnoteonpitch = -1; + mfxi.ni->nrnotes = 0; + mfxi.ni->beats = 120; + + mfxi.istrm.fd = fd; + mfxi.istrm.p = mfxi.istrm.len = 0; + mf->Mf_getc = lm_getc; + + mf->Mf_header = lm_header; + mf->Mf_tempo = lm_tempo; + mf->Mf_trackstart = lm_trackstart; + mf->Mf_trackend = lm_trackend; + mf->Mf_noteon = lm_noteon; + mf->Mf_noteoff = lm_noteoff; + + mf->Mf_error = lm_error; + + midifile(mf); + + return mfxi.ni; +} + +static void lm_error(struct MF * mf, char * s) +{ + fprintf(stderr, "%s\n", s); +} + +static int lm_getc(struct MF * mf) +{ + struct MFX * mfx = (struct MFX *)mf; + + /* printf("p %d, len %d\n", mfx->istrm.p, mfx->istrm.len); */ + if (mfx->istrm.p == mfx->istrm.len) + { + mfx->istrm.len = read(mfx->istrm.fd, mfx->istrm.buf, IBUFSIZE); + /* printf("readlen %d\n", mfx->istrm.len); */ + if (mfx->istrm.len <= 0) + return -1; + + mfx->istrm.p = 1; + return mfx->istrm.buf[0]; + } + /* else */ + return mfx->istrm.buf[mfx->istrm.p++]; +} + +static void lm_header(struct MF * mf, int format, int ntrks, int division) +{ + struct MFX * mfx = (struct MFX *)mf; + + TRACE(0, ("lm_header(%p, %d, %d, %d)\n", mf, format, ntrks, division)); + + mfx->division = division; +} + +/* this is just a quess */ +static void lm_tempo(struct MF * mf, long tempo) +{ + struct MFX * mfx = (struct MFX *)mf; + + TRACE(0, ("lm_tempo(%p, %ld)\n", mf, tempo)); + + if (mfx->trackstate != TRK_FINISHED) + mfx->ni->beats = 60000000 / tempo; +} + + +static void addnote(struct MFX * mfx, int pitch, int duration, int special) +{ + int nr, p, s; + struct NoteInfo * ni; + + if (mfx->ni->nrnotes == mfx->allocated) + { + mfx->allocated += ALLOCSIZE; + mfx->ni = NIREALLOC(mfx->ni, mfx->allocated); + if (mfx->ni == NULL) + exit(1); + } + ni = mfx->ni; /* mfx->ni pointer value may have changed above */ + nr = ni->nrnotes++; + + + if (pitch == 0) { p = 0; s = 0; } + else { pitch--; p = (pitch % 12) + 1; s = pitch / 12; } + + ni->note[nr].note = p; + ni->note[nr].scale = s; + + ni->note[nr].length = duration; + ni->note[nr].lextra = special; +} + +/* currently supported */ +static /* N 32 32. 16 16. 8 8. 4 4. 2 2. 1 1. */ +int vals[] = { 15, 38, 54, 78, 109, 156, 218, 312, 437, 625, 875, 1250 }; + +static void writenote(struct MFX * mfx, int delta) +{ + ulg millinotetime = delta * 250 / mfx->division; + int i; + int duration; + int special; + + for(i = 0; i < sizeof vals / sizeof vals[0]; i++) + { + if (millinotetime < vals[i]) + break; + } + + if (i == 0) + return; + + i--; + duration = i / 2; + special = i & 1; + + addnote(mfx, mfx->prevnoteonpitch, duration, special); /* XXX think this */ +} + + +static void lm_trackstart(struct MF * mf) +{ + struct MFX * mfx = (struct MFX *)mf; + + TRACE(0, ("lm_trackstart(%p)\n", mf)); + + if (mfx->trackstate == TRK_NONE) + mfx->trackstate = TRK_READING; + + mfx->prevnoteonpitch = -1; +} + +static void lm_trackend(struct MF * mf) +{ + struct MFX * mfx = (struct MFX *)mf; + long time = mf->Mf_currtime; + + TRACE(0, ("lm_trackend(%p)\n", mf)); + + if (mfx->trackstate == TRK_READING && mfx->ni->nrnotes > 0) + mfx->trackstate = TRK_FINISHED; + + if (mfx->prevnoteonpitch >= 0) + writenote(mfx, time - mfx->prevnoteontime); + + mfx->prevnoteonpitch = -1; +} + +static void lm_noteon(struct MF * mf, int chan, int pitch, int vol) +{ + struct MFX * mfx = (struct MFX *)mf; + long time = mf->Mf_currtime; + + TRACE(0, ("lm_noteon(%p, %d, %d, %d)\n", mf, chan, pitch, vol)); + + if (vol == 0) /* kludge? to handle some (format 1? midi files) */ + return; + + if (mfx->trackstate != TRK_READING) + return; + + if (mfx->prevnoteonpitch >= 0) + writenote(mfx, time - mfx->prevnoteontime); + + if (vol == 0) + mfx->prevnoteonpitch = 0; + else + mfx->prevnoteonpitch = pitch + 1; + + mfx->prevnoteontime = time; +} + +static void lm_noteoff(struct MF * mf, int chan, int pitch, int vol) +{ + struct MFX * mfx = (struct MFX *)mf; + long time = mf->Mf_currtime; + + TRACE(0, ("lm_noteoff(%p, %d, %d, %d)\n", mf, chan, pitch, vol)); + + if (mfx->prevnoteonpitch >= 0) + { + writenote(mfx, time - mfx->prevnoteontime); + mfx->prevnoteonpitch = -1; + } + mfx->prevnoteonpitch = 0; + mfx->prevnoteontime = time; +} + +//{ "p", "c", "c#", "d", "d#", "e", "f", "f#", "g", "g#", "a", "a#", "h" }; +char notes[] = + { 255, 0, 1, 2, 3, 4, 6, 7, 8, 9, 10, 11 , 12 }; + +u8 lengths[] = { 4, 8, 16, 32, 64, 128 }; + +static void countdefaults(struct NoteInfo * ni, int * length_p, int * scale_p) +{ + int lengths[15] = { 0 }; + int scales[15] = { 0 }; + int maxlenval = 0; /* (*) */ + int maxscaleval = 0; + int i; + + for (i = 0; i < ni->nrnotes; i++) + { + struct Notes * note = &ni->note[i]; + + lengths[note->length]++; + scales[note->scale]++; + } + + maxlenval = lengths[0]; /* (*) smart compiler eliminates dead code */ + *length_p = 0; + + for (i = 1; i < 15; i++) /* `p' incremented scales[0], therefore ignored */ + { + TRACE(0, ("%d - len: %d, scale: %d\n", i, lengths[i], scales[i])); + + if (lengths[i] > maxlenval) { + *length_p = i; + maxlenval = lengths[i]; + } + if (scales[i] > maxscaleval) { + *scale_p = i; + maxscaleval = scales[i]; + } + } +} + +GSM_Error loadmid(char *filename, GSM_Ringtone *ringtone) +{ + int fd; + struct NoteInfo * ni; + int i; + int deflen, defscale; + +#ifdef WIN32 + if ((fd = open(filename, O_RDONLY | O_BINARY)) < 0) + { + perror("open"); + return GE_CANTOPENFILE; + } +#else + if ((fd = open(filename, O_RDONLY)) < 0) + { + perror("open"); + return GE_CANTOPENFILE; + } +#endif + + ni = readmidi(fd); + + if (ni == NULL) + return 0; + + countdefaults(ni, &deflen, &defscale); + + strcpy(ringtone->name,"GNOKII"); + + if (ni->nrnotesNrNotes=ni->nrnotes; + else + ringtone->NrNotes=MAX_RINGTONE_NOTES; + + for (i = 0; i < ringtone->NrNotes; i++) + { + struct Notes * note = &ni->note[i]; + + ringtone->notes[i].note=notes[note->note]; + ringtone->notes[i].note=notes[note->note]+(note->scale%4)*14; + + ringtone->notes[i].duration=lengths[note->length]; + if (note->lextra) + ringtone->notes[i].duration=ringtone->notes[i].duration*1.5; + + ringtone->notes[i].tempo=ni->beats; + + } + + ringtone->Loop=15; + + return 0; +} diff --git a/common/gsm-calendar.c b/common/gsm-calendar.c new file mode 100644 index 0000000..eadaff6 --- /dev/null +++ b/common/gsm-calendar.c @@ -0,0 +1,162 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Functions for manipulating calendar + +*/ + +#include +#include +#include +#include +#include + +#ifdef WIN32 + #include "misc_win32.h" +#else + #include +#endif + +#include "gsm-api.h" +#include "gsm-coding.h" + +char *GSM_GetVCALENDARStart(int version) { + + static char Buffer[1000]=""; + int len=0; + + len+=sprintf(Buffer, "BEGIN:VCALENDAR%c%c",13,10); + + if (version==10) sprintf(Buffer+len, "VERSION:1.0%c%c",13,10); + if (version==30) sprintf(Buffer+len, "VERSION:3.0%c%c",13,10); + + return Buffer; +} + +char *GSM_GetVCALENDARNote(GSM_CalendarNote *note, int version) { + + static char Buffer[1000]=""; + + int len=0; + + u8 buffer[50*3]; + + len+=sprintf(Buffer+len, "BEGIN:VEVENT%c%c",13,10); + len+=sprintf(Buffer+len, "CATEGORIES:"); + switch (note->Type) { + case GCN_REMINDER: + len+=sprintf(Buffer+len, "MISCELLANEOUS%c%c",13,10); + break; + case GCN_CALL: + len+=sprintf(Buffer+len, "PHONE CALL%c%c",13,10); + break; + case GCN_MEETING: + len+=sprintf(Buffer+len, "MEETING%c%c",13,10); + break; + case GCN_BIRTHDAY: + len+=sprintf(Buffer+len, "SPECIAL OCCASION%c%c",13,10); + break; + default: + len+=sprintf(Buffer+len, "UNKNOWN%c%c",13,10); + break; + } + + if( note->Type == GCN_CALL && strcmp( note->Phone, "" ) ) { + + if (note->Text[0]!=0 && version==30) + len+=sprintf(Buffer+len, "DESCRIPTION:%s%c%c",note->Text,13,10); + + EncodeUTF8(buffer,note->Phone,strlen(note->Phone)); + if (strlen(note->Phone)==strlen(buffer)) { + len+=sprintf(Buffer+len, "SUMMARY:%s%c%c",note->Phone,13,10); + } else { + len+=sprintf(Buffer+len, "SUMMARY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:%s%c%c",buffer,13,10); + } + + } else { + + EncodeUTF8(buffer,note->Text,strlen(note->Text)); + if (strlen(note->Text)==strlen(buffer)) { + len+=sprintf(Buffer+len, "SUMMARY:%s%c%c",note->Text,13,10); + } else { + len+=sprintf(Buffer+len, "SUMMARY;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:%s%c%c",buffer,13,10); + } + + } + + /* For 3310: date is set to 2090! */ + if (GetModelFeature (FN_CALENDAR)==F_CAL33) { + len+=sprintf(Buffer+len, "DTSTART:1999%02d%02dT%02d%02d%02d%c%c", + note->Time.Month, note->Time.Day, note->Time.Hour, + note->Time.Minute, note->Time.Second,13,10); + } else { + len+=sprintf(Buffer+len, "DTSTART:%04d%02d%02dT%02d%02d%02d%c%c", note->Time.Year, + note->Time.Month, note->Time.Day, note->Time.Hour, + note->Time.Minute, note->Time.Second,13,10); + } + + if (note->Alarm.Year!=0) { + len+=sprintf(Buffer+len, "DALARM:%04d%02d%02dT%02d%02d%02d%c%c", note->Alarm.Year, + note->Alarm.Month, note->Alarm.Day, note->Alarm.Hour, + note->Alarm.Minute, note->Alarm.Second,13,10); + } + + if ( GetModelFeature (FN_CALENDAR)==F_CAL71 && version==30 && note->Type == GCN_BIRTHDAY ) { + len+=sprintf(Buffer+len, "ALTYPE:%s%c%c", (note->AlarmType==0x00) ? + "TONE" : "SILENT",13,10); + } + + if ( GetModelFeature (FN_CALENDAR)==F_CAL71 && note->Recurrance!= 0 ) { + switch(note->Recurrance/24) { + case 1 :len+=sprintf(Buffer+len, "RRULE:D1 #0%c%c",13,10);break; + case 7 :len+=sprintf(Buffer+len, "RRULE:W1 #0%c%c",13,10);break; + case 14 :len+=sprintf(Buffer+len, "RRULE:W2 #0%c%c",13,10);break; + case 365:len+=sprintf(Buffer+len, "RRULE:YD1 #0%c%c",13,10);break; + } + } + + len+=sprintf(Buffer+len, "END:VEVENT%c%c",13,10); + + return Buffer; +} + +char *GSM_GetVCALENDAREnd(int version) { + + static char Buffer[1000]=""; + + sprintf(Buffer, "END:VCALENDAR%c%c",13,10); + + return Buffer; +} + +int GSM_SaveCalendarNoteToSMS(GSM_MultiSMSMessage *SMS, + GSM_CalendarNote *note) +{ + char Buffer[1000]=""; + int length; + GSM_UDH UDH=GSM_NoUDH; + + sprintf(Buffer,GSM_GetVCALENDARStart(10)); + sprintf(Buffer+strlen(Buffer),GSM_GetVCALENDARNote(note,10)); + sprintf(Buffer+strlen(Buffer),GSM_GetVCALENDAREnd(10)); + + /* 1 SMS: no UDH */ + if (strlen(Buffer)<=160-8) { //8==length of ..SCKE4. + sprintf(Buffer,"//SCKE4 "); + sprintf(Buffer+strlen(Buffer),GSM_GetVCALENDARStart(10)); + sprintf(Buffer+strlen(Buffer),GSM_GetVCALENDARNote(note,10)); + sprintf(Buffer+strlen(Buffer),GSM_GetVCALENDAREnd(10)); + } else { + UDH=GSM_CalendarNoteUDH; + } + + length=strlen(Buffer); + GSM_MakeMultiPartSMS2(SMS,Buffer,length, UDH, GSM_Coding_Default); + + return 0; +} diff --git a/common/gsm-coding.c b/common/gsm-coding.c new file mode 100644 index 0000000..c9f0e18 --- /dev/null +++ b/common/gsm-coding.c @@ -0,0 +1,483 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + +*/ + +#include +#include + +#include "gsm-common.h" +#include "gsm-coding.h" + +#ifdef WIN32 + #include +#else + #include "devices/device.h" +#endif + +/* Coding functions */ +#define NUMBER_OF_7_BIT_ALPHABET_ELEMENTS 128 + +#ifndef USE_NLS + static unsigned char GSM_DefaultAlphabet[NUMBER_OF_7_BIT_ALPHABET_ELEMENTS] = { + + /* ETSI GSM 03.38, version 6.0.1, section 6.2.1; Default alphabet */ + /* Generally table shows chars in Latin 1, but not only - Greek + chars are visible correctly in ... */ + + '@', 0xa3, '$', 0xa5, 0xe8, 0xe9, 0xf9, 0xec, // 0x08 + 0xf2, 0xc7, '\n', 0xd8, 0xf8, '\r', 0xc5, 0xe5, + +/* from v13@priest.com codes for Greek chars. Not confirmed and commented */ +// 0xc4, '_' , 0xd6, 0xc3, 0xcb, 0xd9, 0xd0, 0xd8, +// 0xd3, 0xc8, 0xce, 0xcb, 0xc6, 0xe6, 0xdf, 0xc9, // 0x20 + + '?', '_', '?', '?', '?', '?', '?', '?', + '?', '?', '?', '?', 0xc6, 0xe6, 0xdf, 0xc9, // 0x20 + ' ', '!', '\"', '#', 0xa4, '%', '&', '\'', + '(', ')', '*', '+', ',', '-', '.', '/', // 0x30 + '0', '1', '2', '3', '4', '5', '6', '7', + '8', '9', ':', ';', '<', '=', '>', '?', // 0x40 + 0xa1, 'A', 'B', 'C', 'D', 'E', 'F', 'G', + 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', + 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', + 'X', 'Y', 'Z', 0xc4, 0xd6, 0xd1, 0xdc, 0xa7, + 0xbf, 'a', 'b', 'c', 'd', 'e', 'f', 'g', + 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', + 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', + 'x', 'y', 'z', 0xe4, 0xf6, 0xf1, 0xfc, 0xe0 + }; + + #ifndef WIN32 + /*Simple UNICODE decoding and encoding from/to iso-8859-2 + First version prepared by Martin Kacer + + Following table contains triplets: + first unicode byte, second unicode byte, iso-8859-2 character*/ + unsigned char unicode_table[][3] = + { + /* C< D< E< N< R< S< T< Uo Z< */ + {0x01, 0x0C, 0xC8}, {0x01, 0x0E, 0xCF}, {0x01, 0x1A, 0xCC}, + {0x01, 0x47, 0xD2}, {0x01, 0x58, 0xD8}, {0x01, 0x60, 0xA9}, + {0x01, 0x64, 0xAB}, {0x01, 0x6E, 0xD9}, {0x01, 0x7D, 0xAE}, + /* c< d< e< n< r< s< t< uo z< */ + {0x01, 0x0D, 0xE8}, {0x01, 0x0F, 0xEF}, {0x01, 0x1B, 0xEC}, + {0x01, 0x48, 0xF2}, {0x01, 0x59, 0xF8}, {0x01, 0x61, 0xB9}, + {0x01, 0x65, 0xBB}, {0x01, 0x6F, 0xF9}, {0x01, 0x7E, 0xBE}, + /* A< A, C' D/ E, L< L' L/ */ + {0x01, 0x02, 0xC3}, {0x01, 0x04, 0xA1}, {0x01, 0x06, 0xC6}, + {0x01, 0x10, 0xD0}, {0x01, 0x18, 0xCA}, {0x01, 0x3D, 0xA5}, + {0x01, 0x39, 0xC5}, {0x01, 0x41, 0xA3}, + /* N' O" R' S' S, T, U" Z' Z. */ + {0x01, 0x43, 0xD1}, {0x01, 0x50, 0xD5}, {0x01, 0x54, 0xC0}, + {0x01, 0x5A, 0xA6}, {0x01, 0x5E, 0xAA}, {0x01, 0x62, 0xDE}, + {0x01, 0x70, 0xDB}, {0x01, 0x79, 0xAC}, {0x01, 0x7B, 0xAF}, + /* a< a, c' d/ e, l< l' l/ */ + {0x01, 0x03, 0xE3}, {0x01, 0x05, 0xB1}, {0x01, 0x07, 0xE6}, + {0x01, 0x11, 0xF0}, {0x01, 0x19, 0xEA}, {0x01, 0x3E, 0xB5}, + {0x01, 0x3A, 0xE5}, {0x01, 0x42, 0xB3}, + /* n' o" r' s' s, t, u" z' z. */ + {0x01, 0x44, 0xF1}, {0x01, 0x51, 0xF5}, {0x01, 0x55, 0xE0}, + {0x01, 0x5B, 0xB6}, {0x01, 0x5F, 0xBA}, {0x01, 0x63, 0xFE}, + {0x01, 0x71, 0xFB}, {0x01, 0x7A, 0xBC}, {0x01, 0x7C, 0xBF}, + + {0x00, 0x00, 0x00} + }; + #else + unsigned char unicode_table[][3] = + { + + /* o' */ + {0x00, 0xF3, 0xA2}, + + /* O' */ + {0x00, 0xD3, 0xE0}, + + /* A, C' E, L/ */ + {0x01, 0x04, 0xA4}, {0x01, 0x06, 0x8F}, + {0x01, 0x18, 0xA8}, + {0x01, 0x41, 0x9D}, + /* N' S' Z' Z. */ + {0x01, 0x43, 0xE3}, + {0x01, 0x5A, 0x97}, + {0x01, 0x79, 0x8D}, {0x01, 0x7B, 0xBD}, + /* a, c' e, l/ */ + {0x01, 0x05, 0xA5}, {0x01, 0x07, 0x86}, + {0x01, 0x19, 0xA9}, + {0x01, 0x42, 0x88}, + /* n' s' z' z. */ + {0x01, 0x44, 0xE4}, + {0x01, 0x5B, 0x98}, + {0x01, 0x7A, 0xAB}, {0x01, 0x7C, 0xBE}, + + {0x00, 0x00, 0x00} + }; + #endif + +unsigned char EncodeWithDefaultAlphabet(unsigned char value) +{ + unsigned char i; + + if (value == '?') return 0x3f; + + for (i = 0; i < NUMBER_OF_7_BIT_ALPHABET_ELEMENTS; i++) + if (GSM_DefaultAlphabet[i] == value) + return i; + + return '?'; +} + +unsigned char DecodeWithDefaultAlphabet(unsigned char value) +{ + return GSM_DefaultAlphabet[value]; +} + +wchar_t EncodeWithUnicodeAlphabet(unsigned char value) +{ + wchar_t retval; + + int j; + + /*If character is not found, first unicode byte is set to zero + and second one is the same as iso-8859-2 character*/ + retval = value | (0x00 << 8); + + for ( j = 0; unicode_table[j][2] != 0x00; ++j ) + if ( value == unicode_table[j][2] ) + { + retval = unicode_table[j][1] | (unicode_table[j][0] << 8); + break; + } + + return retval; +} + +unsigned char DecodeWithUnicodeAlphabet(wchar_t value) +{ + unsigned char retval; + + int j; + + retval=value & 0xff; /* default is to cut off the first byte */ + + for ( j = 0; unicode_table[j][2] != 0x00; ++j ) + if (((value >> 8) & 0xff) == unicode_table[j][0] && + (value & 0xff) == unicode_table[j][1] ) { + retval = unicode_table[j][2]; + break; + } + + return retval; +} + +#else + + /* ETSI GSM 03.38, version 6.0.1, section 6.2.1; Default alphabet */ + unsigned char GSM_DefaultAlphabetUnicode[NUMBER_OF_7_BIT_ALPHABET_ELEMENTS+1][2] = + { + {0x00,0x40},{0x00,0xa3},{0x00,0x24},{0x00,0xA5}, + {0x00,0xE8},{0x00,0xE9},{0x00,0xF9},{0x00,0xEC},//0x08 + {0x00,0xF2},{0x00,0xC7},{0x00,'\n'},{0x00,0xD8}, + {0x00,0xD9},{0x00,'\r'},{0x00,0xC5},{0x00,0xE5}, + {0x03,0x94},{0x00,0xb9}/*not exactly, but*/,{0x03,0xA6},{0x03,0x93}, + {0x03,0x9B},{0x03,0xA9},{0x03,0xA0},{0x03,0xA8}, + {0x03,0xA3},{0x03,0x98},{0x03,0x9E},{0x00,0xb9},/*not exactly, but*/ + {0x00,0xC6},{0x00,0xE6},{0x00,0xDF},{0x00,0xC9},//0x20 + {0x00,' ' },{0x00,'!' },{0x00,'\"'},{0x00,'#' }, + {0x00,0xA4},{0x00,'%' },{0x00,'&' },{0x00,'\''}, + {0x00,'(' },{0x00,')' },{0x00,'*' },{0x00,'+' }, + {0x00,',' },{0x00,'-' },{0x00,'.' },{0x00,'/' }, //0x30 + {0x00,'0' },{0x00,'1' },{0x00,'2' },{0x00,'3' }, + {0x00,'4' },{0x00,'5' },{0x00,'6' },{0x00,'7' }, + {0x00,'8' },{0x00,'9' },{0x00,':' },{0x00,';' }, + {0x00,'<' },{0x00,'=' },{0x00,'>' },{0x00,'?' }, //0x40 + {0x00,0xA1},{0x00,'A' },{0x00,'B' },{0x00,'C' }, + {0x00,'D' },{0x00,'E' },{0x00,'F' },{0x00,'G' }, + {0x00,'H' },{0x00,'I' },{0x00,'J' },{0x00,'K' }, + {0x00,'L' },{0x00,'M' },{0x00,'N' },{0x00,'O' }, + {0x00,'P' },{0x00,'Q' },{0x00,'R' },{0x00,'S' }, + {0x00,'T' },{0x00,'U' },{0x00,'V' },{0x00,'W' }, + {0x00,'X' },{0x00,'Y' },{0x00,'Z' },{0x00,0xC4}, + {0x00,0xD6},{0x00,0xD1},{0x00,0xDC},{0x00,0xA7}, + {0x00,0xBF},{0x00,'a' },{0x00,'b' },{0x00,'c' }, + {0x00,'d' },{0x00,'e' },{0x00,'f' },{0x00,'g' }, + {0x00,'h' },{0x00,'i' },{0x00,'j' },{0x00,'k' }, + {0x00,'l' },{0x00,'m' },{0x00,'n' },{0x00,'o' }, + {0x00,'p' },{0x00,'q' },{0x00,'r' },{0x00,'s' }, + {0x00,'t' },{0x00,'u' },{0x00,'v' },{0x00,'w' }, + {0x00,'x' },{0x00,'y' },{0x00,'z' },{0x00,0xE4}, + {0x00,0xF6},{0x00,0xF1},{0x00,0xFC},{0x00,0xE0}, + {0x00,0x00} + }; + +unsigned char EncodeWithDefaultAlphabet(unsigned char value) +{ + unsigned char i; + + wchar_t value2; + + if (value == '?') return 0x3f; + + for (i = 0; i < NUMBER_OF_7_BIT_ALPHABET_ELEMENTS; i++) { + + value2 = GSM_DefaultAlphabetUnicode[i][1] | ( GSM_DefaultAlphabetUnicode[i][0] << 8); + + if (EncodeWithUnicodeAlphabet(value) == value2) + return i; + } + + return '?'; +} + +unsigned char DecodeWithDefaultAlphabet(unsigned char value) +{ + wchar_t value2; + + value2 = GSM_DefaultAlphabetUnicode[value][1] | ( GSM_DefaultAlphabetUnicode[value][0] << 8); + + return DecodeWithUnicodeAlphabet(value2); +} + +wchar_t EncodeWithUnicodeAlphabet(unsigned char value) +{ + wchar_t retval; + + if (mbtowc(&retval, &value, 1) == -1) return '?'; + else return retval; +} + +unsigned char DecodeWithUnicodeAlphabet(wchar_t value) +{ + unsigned char retval; + + if (wctomb(&retval, value) == -1) return '?'; + else return retval; +} + +#endif + +void DecodeDefault (unsigned char* dest, const unsigned char* src, int len) +{ + int i; + + for (i = 0; i < len; i++) + dest[i] = DecodeWithDefaultAlphabet(src[i]); + dest[len]=0; +} + +void EncodeDefault (unsigned char* dest, const unsigned char* src, int len) +{ + int i; + + for (i = 0; i < len; i++) + dest[i] = EncodeWithDefaultAlphabet(src[i]); + return; +} + +void DecodeUnicode (unsigned char* dest, const unsigned char* src, int len) +{ + int i; + wchar_t wc; + + for (i = 0; i < len; i++) { + wc = src[(2*i)+1] | (src[2*i] << 8); + dest[i] = DecodeWithUnicodeAlphabet(wc); + } + dest[len]=0; + return; +} + +void EncodeUnicode (unsigned char* dest, const unsigned char* src, int len) +{ + int i; + wchar_t wc; + + for (i = 0; i < len; i++) { + wc = EncodeWithUnicodeAlphabet(src[i]); + dest[i*2] = (wc >> 8) &0xff; + dest[(i*2)+1] = wc & 0xff; + } +} + +bool EncodeWithUTF8Alphabet(u8 mychar, u8 *ret1, u8 *ret2) +{ + u8 mychar1,mychar2,mychar3,mychar4; + int j=0; + + mychar1=((EncodeWithUnicodeAlphabet(mychar)>>8)&0xff); + mychar2=EncodeWithUnicodeAlphabet(mychar)&0xff; + if (mychar1>0x00 || mychar2>128) { + mychar3=0x00; + mychar4=128; + while (true) { + if (mychar3==mychar1) { + if (mychar4+64>=mychar2) { + *ret1=j+0xc2; + *ret2=0x80+(mychar2-mychar4); + return true; + } + } + if (mychar4==192) { + mychar3++; + mychar4=0; + } else { + mychar4=mychar4+64; + } + j++; + } + } + return false; +} + +void DecodeWithUTF8Alphabet(u8 mychar3, u8 mychar4, u8 *ret) +{ + u8 mychar1, mychar2; + int j; + wchar_t wc; + + mychar1=0x00; + mychar2=128; + for(j=0;j=i) { + /* Need to have correct chars */ + if (src[i] =='=' && DecodeWithHexBinAlphabet(src[i+1])!=-1 + && DecodeWithHexBinAlphabet(src[i+2])!=-1 && + src[i+3]=='=' && DecodeWithHexBinAlphabet(src[i+4])!=-1 && + DecodeWithHexBinAlphabet(src[i+5])!=-1) { + mychar1=16*DecodeWithHexBinAlphabet(src[i+1])+DecodeWithHexBinAlphabet(src[i+2]); + mychar2=16*DecodeWithHexBinAlphabet(src[i+4])+DecodeWithHexBinAlphabet(src[i+5]); + DecodeWithUTF8Alphabet(mychar1,mychar2,&ret); + i=i+5; + dest[j++]=ret; + } else { + dest[j++]=src[i]; + } + } else { + dest[j++]=src[i]; + } + i++; + } + dest[j++]=0; +} + +int DecodeWithHexBinAlphabet (unsigned char mychar) { + if (mychar>='A' && mychar<='F') return mychar-'A'+10; + if (mychar>='a' && mychar<='f') return mychar-'a'+10; + if (mychar>='0' && mychar<='9') return mychar-'0'; + return -1; +} + +unsigned char EncodeWithHexBinAlphabet (int digit) { + if (digit >= 0 && digit <= 9) return '0'+(digit); + if (digit >=10 && digit <=15) return 'A'+(digit-10); + return 0; +} + +void DecodeHexBin (unsigned char* dest, const unsigned char* src, int len) +{ + int i,current=0; + + for (i = 0; i < len/2 ; i++) { + dest[current++]=DecodeWithHexBinAlphabet(src[i*2])*16+ + DecodeWithHexBinAlphabet(src[i*2+1]); + } + dest[current++]=0; +} + +void EncodeHexBin (unsigned char* dest, const unsigned char* src, int len) +{ + int i,current=0; + + for (i = 0; i < len; i++) { + dest[current++]=EncodeWithHexBinAlphabet(src[i] >> 0x04); + dest[current++]=EncodeWithHexBinAlphabet(src[i] & 0x0f); + } +} + +void DecodeBCD (unsigned char* dest, const unsigned char* src, int len) +{ + int i,current=0,digit; + + for (i = 0; i < len; i++) { + digit=src[i] & 0x0f; + if (digit<10) dest[current++]=digit + '0'; + digit=src[i] >> 4; + if (digit<10) dest[current++]=digit + '0'; + } + dest[current++]=0; +} + +void EncodeBCD (unsigned char* dest, const unsigned char* src, int len, bool fill) +{ + int i,current=0; + + for (i = 0; i < len; i++) { + if (i & 0x01) { + dest[current]=dest[current] | ((src[i]-'0') << 4); + current++; + } else { + dest[current]=src[i]-'0'; + } + } + + /* When fill is set: we fill in the most significant bits of the + last byte with 0x0f (1111 binary) if the number is represented + with odd number of digits. */ + if (fill && (len & 0x01)) { + dest[current]=dest[current] | 0xf0; + } +} + +unsigned char EncodeWithBCDAlphabet(int value) +{ + div_t division; + + division=div(value,10); + return ( ( (value-division.quot*10) & 0x0f) << 4) | (division.quot & 0xf); +} + +int DecodeWithBCDAlphabet(unsigned char value) +{ + return 10*(value & 0x0f)+(value >> 4); +} diff --git a/common/gsm-datetime.c b/common/gsm-datetime.c new file mode 100644 index 0000000..274e640 --- /dev/null +++ b/common/gsm-datetime.c @@ -0,0 +1,88 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + +*/ + +#include +#include + +#include "misc.h" +#include "gsm-datetime.h" +#include "gsm-common.h" + +char DayOfWeekChar; + +/* Based on article in Polish PC-Kurier 8/1998 page 104 */ +/* Archive on http://www.pckurier.pl */ +char *DayOfWeek (int year, int month, int day) { + int p,q,r,w; + + p=(14-month) / 12; + q=month+12*p-2; + r=year-p; + w=(day+(31*q) / 12 + r + r / 4 - r / 100 + r / 400) % 7; + strcpy(&DayOfWeekChar,""); + switch (w) { + case 0: strcpy(&DayOfWeekChar,"Sun"); break; + case 1: strcpy(&DayOfWeekChar,"Mon"); break; + case 2: strcpy(&DayOfWeekChar,"Tue"); break; + case 3: strcpy(&DayOfWeekChar,"Wed"); break; + case 4: strcpy(&DayOfWeekChar,"Thu"); break; + case 5: strcpy(&DayOfWeekChar,"Fri"); break; + case 6: strcpy(&DayOfWeekChar,"Sat"); break; + } + return &DayOfWeekChar; +} + +/* GetMachineDateTime ---------------------------------------------------------- +Purpose: Gets system date and time. +Use: - +Input: - +Output: date - System date in the format "aaaa-mm-gg". + time - System time in the format "hh:mm:ss". +Return: - +----------------------------------------------------------------------------- */ +void GetMachineDateTime( char nowdate[], char nowtime[] ) +{ + struct tm *now; + time_t nowh; + + nowh=time(NULL); + now=localtime(&nowh); + + /* I have 100 (for 2000) Year now :-) */ + if (now->tm_year>99 && now->tm_year<1900) { + now->tm_year=now->tm_year+1900; + } + + sprintf(nowdate,"%04d-%02d-%02d",now->tm_year,now->tm_mon+1,now->tm_mday); + sprintf(nowtime, "%02d:%02d:%02d",now->tm_hour,now->tm_min,now->tm_sec); + +} + +void EncodeDateTime(unsigned char* buffer, GSM_DateTime *datetime) +{ + buffer[0] = datetime->Year / 256; + buffer[1] = datetime->Year % 256; + buffer[2] = datetime->Month; + buffer[3] = datetime->Day; + + buffer[4] = datetime->Hour; + buffer[5] = datetime->Minute; +} + +void DecodeDateTime(unsigned char* buffer, GSM_DateTime *datetime) +{ + datetime->Year = buffer[0] * 256 + buffer[1]; + datetime->Month = buffer[2]; + datetime->Day = buffer[3]; + + datetime->Hour = buffer[4]; + datetime->Minute = buffer[5]; + datetime->Second = buffer[6]; +} diff --git a/common/gsm-phonebook.c b/common/gsm-phonebook.c new file mode 100644 index 0000000..bf0fdd3 --- /dev/null +++ b/common/gsm-phonebook.c @@ -0,0 +1,162 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Functions for manipulating phonebook + +*/ + +#include +#include +#include +#include +#include + +#ifdef WIN32 + #include "misc_win32.h" +#endif + +#include "gsm-api.h" +#include "gsm-coding.h" + +char *GSM_GetVCARD(GSM_PhonebookEntry *entry, int version) { + + static char Buffer[1000]=""; + + u8 buffer[50*3]; + + int len=0,i; + + bool pref=false; + + char memory_type_string[20]; + + GetMemoryTypeString(memory_type_string, &entry->MemoryType); + + switch (version) { + case 10: + len+=sprintf(Buffer+len,_("BEGIN:VCARD%c%c"),13,10); + len+=sprintf(Buffer+len,_("N:%s%c%c"),entry->Name,13,10); + if (*entry->Number) + len+=sprintf(Buffer+len,_("TEL:%s%c%c"),entry->Number,13,10); + len+=sprintf(Buffer+len,_("END:VCARD%c%c"),13,10); + break; + case 21: + len+=sprintf(Buffer+len,_("BEGIN:VCARD%c%cVERSION:2.1%c%c"),13,10,13,10); + + EncodeUTF8(buffer,entry->Name,strlen(entry->Name)); + if (strlen(entry->Name)==strlen(buffer)) { + len+=sprintf(Buffer+len,_("N:%s%c%c"),entry->Name,13,10); + } else { + len+=sprintf(Buffer+len,_("N;CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:%s%c%c"),buffer,13,10); + } + + if (*entry->Number) { + len+=sprintf(Buffer+len,_("TEL;PREF:%s%c%c"),entry->Number,13,10); + pref=true; + } + + /* Rest of the subentries */ + for (i = 0; i < entry->SubEntriesCount; i++) { + switch( entry->SubEntries[i].EntryType ) { + case GSM_Number: + switch( entry->SubEntries[i].NumberType ) { + case GSM_General :len+=sprintf(Buffer+len,_("TEL"));break; + case GSM_Home :len+=sprintf(Buffer+len,_("TEL;HOME;VOICE"));break; + case GSM_Mobile :len+=sprintf(Buffer+len,_("TEL;CELL"));break; + case GSM_Work :len+=sprintf(Buffer+len,_("TEL;WORK;VOICE"));break; + case GSM_Fax :len+=sprintf(Buffer+len,_("TEL;FAX"));break; + default :break; + } + if (!pref) { + len+=sprintf(Buffer+len,_(";PREF")); + pref=true; + } + break; + case GSM_Note :len+=sprintf(Buffer+len,_("NOTE"));break; + case GSM_Postal: + len+=sprintf(Buffer+len,_("LABEL")); + EncodeUTF8(buffer,entry->SubEntries[i].data.Number,strlen(entry->SubEntries[i].data.Number)); + if (strlen(entry->SubEntries[i].data.Number)==strlen(buffer)) { + len+=sprintf(Buffer+len,_(":%s%c%c"),entry->SubEntries[i].data.Number,13,10); + } else { + len+=sprintf(Buffer+len,_(";CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:%s%c%c"),buffer,13,10); + } + len+=sprintf(Buffer+len,_("ADR")); + break; + case GSM_Email :len+=sprintf(Buffer+len,_("EMAIL"));break; + default :break; + } + + EncodeUTF8(buffer,entry->SubEntries[i].data.Number,strlen(entry->SubEntries[i].data.Number)); + if (strlen(entry->SubEntries[i].data.Number)==strlen(buffer)) { + len+=sprintf(Buffer+len,_(":%s%c%c"),entry->SubEntries[i].data.Number,13,10); + } else { + len+=sprintf(Buffer+len,_(";CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:%s%c%c"),buffer,13,10); + } + } + len+=sprintf(Buffer+len,_("END:VCARD%c%c"),13,10); + break; + case 30: + len+=sprintf(Buffer+len,_("BEGIN:VCARD\nVERSION:3.0\n")); + len+=sprintf(Buffer+len,_("FN:%s\n"),entry->Name); + len+=sprintf(Buffer+len,_("TEL;PREF:%s\n"),entry->Number); + len+=sprintf(Buffer+len,_("X_GSM_STORE_AT:%s%i\n"),memory_type_string,entry->Location); + len+=sprintf(Buffer+len,_("X_GSM_CALLERGROUP:%i\n"),entry->Group); + for( i = 0; i < entry->SubEntriesCount; i++ ) + { + if( entry->SubEntries[i].EntryType == GSM_Number ) { + len+=sprintf(Buffer+len,_("TEL;UNKNOWN_%d:%s\n"), + entry->SubEntries[i].NumberType, + entry->SubEntries[i].data.Number ); + } + } + len+=sprintf(Buffer+len,_("END:VCARD\n\n")); + break; + } + + return Buffer; +} + +int GSM_SavePhonebookEntryToSMS(GSM_MultiSMSMessage *SMS, + GSM_PhonebookEntry *entry, int version) +{ + char Buffer[1000]=""; + int length; + GSM_UDH UDH=GSM_NoUDH; + GSM_Coding_Type Coding=GSM_Coding_Default; + + sprintf(Buffer,GSM_GetVCARD(entry,version)); + + switch (version) { + case 10: + /* 1 SMS: no UDH */ + if (strlen(Buffer)<=160-8) { //8==length of ..SCKE2. + sprintf(Buffer,"//SCKE2 "); + sprintf(Buffer,GSM_GetVCARD(entry,version)); + } else { + UDH=GSM_PhonebookUDH; //FIXME:is this true ? +// Coding=GSM_Coding_8bit; //FIXME:is this true ? + } + break; + case 21: + /* 1 SMS: no UDH */ + if (strlen(Buffer)<=160-12) { //12==length of ..SCKL... + sprintf(Buffer,_("//SCKL23F4%c%c"),13,10); + sprintf(Buffer,GSM_GetVCARD(entry,version)); + } else { + UDH=GSM_PhonebookUDH; +// Coding=GSM_Coding_8bit; //can be 8 bit, but no abligatory + } + break; + } + + length=strlen(Buffer); + GSM_MakeMultiPartSMS2(SMS,Buffer,length, UDH, Coding); + + return 0; +} diff --git a/common/gsm-wap.c b/common/gsm-wap.c new file mode 100644 index 0000000..0ef16cc --- /dev/null +++ b/common/gsm-wap.c @@ -0,0 +1,255 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Functions for manipulating WAP settings and bookmarks + +*/ + +#include +#include +#include +#include +#include + +#include "gsm-common.h" +#include "gsm-wap.h" +#include "gsm-sms.h" +#include "gsm-coding.h" + +int GSM_SaveWAPBookmarkToSMS(GSM_MultiSMSMessage *SMS, + GSM_WAPBookmark *bookmark) +{ + unsigned char Data[500]; + GSM_UDH UDHType; + u16 current=0; + u8 buffer[50*3]; + + strcpy(Data+current,"\x01\x06-\x1F");current=current+4; + strcpy(Data+current,"+application/x-wap-prov.browser-bookmarks");current=current+12+29; + Data[current++]=0x00; + + strcpy(Data+current,"\x81\xEA");current=current+2; + + EncodeUTF8(buffer,bookmark->title,strlen(bookmark->title)); + if (strlen(bookmark->title)==strlen(buffer)) { + strcpy(Data+current,"\x00");current=current+1; + strcpy(Data+current,"\x01\x00");current=current+2; + } else { + strcpy(Data+current,"\x01\x01\x87\x68\x00");current=current+5; + } + + strcpy(Data+current,"\x45\xC6\x7F");current=current+3; + + /* The same to "title" block in WAP settings */ + strcpy(Data+current,"\x01\x87\x15\x11\x03");current=current+5; + if (strlen(bookmark->title)==strlen(buffer)) { + strcpy(Data+current,bookmark->title);current=current+strlen(bookmark->title); + } else { + EncodeUnicode (Data+current, bookmark->title, strlen(bookmark->title)); + current=current+2*strlen(bookmark->title); + Data[current++]=0x00; + } + Data[current++]=0x00; + + /* The same to "homepage" block in WAP settings */ + strcpy(Data+current,"\x01\x87\x17\x11\x03");current=current+5; + if (strlen(bookmark->title)==strlen(buffer)) { + strcpy(Data+current,bookmark->address);current=current+strlen(bookmark->address); + } else { + EncodeUnicode (Data+current, bookmark->address, strlen(bookmark->address)); + current=current+2*strlen(bookmark->address); + Data[current++]=0x00; + } + Data[current++]=0x00; + + /* Mark of end */ + strcpy(Data+current,"\x01\x01\x01");current=current+3; + + if (current>(140-7)) { //more than 1 SMS + UDHType=GSM_WAPBookmarkUDHLong; + } else { + UDHType=GSM_WAPBookmarkUDH; + } + + GSM_MakeMultiPartSMS2(SMS, Data,current, UDHType, GSM_Coding_Default); + + return 0; +} + +GSM_Error GSM_ReadWAPBookmark(GSM_SMSMessage *message, GSM_WAPBookmark *bookmark) +{ + unsigned char Data[250]; + int current=0,i,j; + + switch (message->UDHType) { + case GSM_WAPBookmarkUDH: + + strcpy(Data+current,"\x01\x06-\x1F");current=current+4; + strcpy(Data+current,"+application/x-wap-prov.browser-bookmarks");current=current+12+29; + Data[current++]=0x00; + + strcpy(Data+current,"\x81\xEA\x00");current=current+3; + + strcpy(Data+current,"\x01\x00");current=current+2; + strcpy(Data+current,"\x45\xC6\x7F");current=current+3; + + strcpy(Data+current,"\x01\x87\x15\x11\x03");current=current+5; + + for (i=0;iMessageText[i]!=Data[i]) return GE_UNKNOWN; + + j=0; + while (message->MessageText[current]!=0x00) { + bookmark->title[j++]=message->MessageText[current]; + current++; + } + bookmark->title[j]=0; + + current=current+6; + + j=0; + while (message->MessageText[current]!=0x00) { + bookmark->address[j++]=message->MessageText[current]; + current++; + } + bookmark->address[j]=0; + + break; + + default: /* error */ + return GE_UNKNOWN; + break; + } + + return GE_NONE; +} + +/* Made from sniff of WAP settings sent from Logo Manager with such file: +[GSMCSD] +Name=Orange +URL=http://OtherSites/ +Gateway=192.168.71.81 +; 9200=Temporary,Normal 9201=Continuous,Normal 9202=Temp,Secure 9203=Continuous,Secure +Port=9201 +DialString=+447973100501 +; Auth Type can be PAP, CHAP or MS_CHAP +PPPAuthType=PAP +PPPAuthName=Orange +PPPAuthPass=Multimedia +; ISDN or ANALOGUE +CallType=ISDN +CallSpeed=14400 + +SMS contenst: + +0106 +, +1F +*application/x-wap-prov.browser-settings +00 +81ea01016a +0045c606 +0187121145 +0187141101 +0187131103 +00 +0187211103 +00 +0187281172 +018729116b +01872211700101c608 +0187151103 + settings->title +00 +01 +0186071103 + settings->homepage +0001c67f +0187151103 + settings->title +00 +0187171103 + settings->homepage +00 +010101 +*/ + +/* Function created from software from + http://www.tektonica.com/projects/gsmsms/ */ +int GSM_SaveWAPSettingsToSMS(GSM_MultiSMSMessage *SMS, + GSM_WAPSettings *settings) +{ + unsigned char Data[500]; + u16 current=0; + + strcpy(Data+current,"\x01\x06\x04\x03\x94");current=current+5; + + strcpy(Data+current,"\x81\xEA\x00");current=current+3; + + strcpy(Data+current,"\x01\x00");current=current+2; + strcpy(Data+current,"\x45\xC6\x06");current=current+3; + + strcpy(Data+current,"\x01\x87\x12");current=current+3; + switch (settings->bearer) { + case WAPSETTINGS_BEARER_DATA:Data[current++]=0x45;break; + case WAPSETTINGS_BEARER_SMS :Data[current++]=0x41;break; + } + + strcpy(Data+current,"\x01\x87\x13\x11\x03");current=current+5; + strcpy(Data+current,settings->ipaddress);current=current+strlen(settings->ipaddress); + Data[current++]=0x00; + + strcpy(Data+current,"\x01\x87\x14");current=current+3; + if (settings->iscontinuous) { Data[current++]=0x61; } //continuous + else { Data[current++]=0x60; } //temporary + + strcpy(Data+current,"\x01\x87\x21\x11\x03");current=current+5; + strcpy(Data+current,settings->dialup);current=current+strlen(settings->dialup); + Data[current++]=0x00; + + strcpy(Data+current,"\x01\x87\x22");current=current+3; + if (settings->isnormalauthentication) { + Data[current++]=0x70;//OTA_CSD_AUTHTYPE_PAP. Correct ? + } else { + Data[current++]=0x71;//OTA_CSD_AUTHTYPE_CHAP. Correct ? + } + + strcpy(Data+current,"\x01\x87\x23\x11\x03");current=current+5; + strcpy(Data+current,settings->user);current=current+strlen(settings->user); + Data[current++]=0x00; + + strcpy(Data+current,"\x01\x87\x24\x11\x03");current=current+5; + strcpy(Data+current,settings->password);current=current+strlen(settings->password); + Data[current++]=0x00; + + strcpy(Data+current,"\x01\x87\x28");current=current+3; + if (settings->isISDNcall) { Data[current++]=0x73; } //ISDN + else { Data[current++]=0x72; } //analogue + + strcpy(Data+current,"\x01\x87\x29");current=current+3; +//use constant OTA_CSD_CALLSPEED_AUTO => '6A'; + if (settings->isspeed14400) { Data[current++]=0x6C; } //14400 + else { Data[current++]=0x6B; } //9600 + + Data[current++]=0x01; + strcpy(Data+current,"\x01\x86\x07\x11\x03");current=current+5; + strcpy(Data+current,settings->homepage);current=current+strlen(settings->homepage); + Data[current++]=0x00; + + strcpy(Data+current,"\x01\xC6\x08");current=current+3; + strcpy(Data+current,"\x01\x87\x15\x11\x03");current=current+5; + strcpy(Data+current,settings->title);current=current+strlen(settings->title); + Data[current++]=0x00; + + /* Mark of end */ + strcpy(Data+current,"\x01\x01\x01");current=current+3; + + GSM_MakeMultiPartSMS2(SMS, Data,current, GSM_WAPSettingsUDH, GSM_Coding_Default); + + return 0; +} diff --git a/common/links/fbus-3110.c b/common/links/fbus-3110.c new file mode 100644 index 0000000..5d8af0e --- /dev/null +++ b/common/links/fbus-3110.c @@ -0,0 +1,396 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Copyright (C) 2000 Hugh Blemings & Pavel Janík ml. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for accessing functions via fbus. + See README for more details on supported mobile phones. + + The various routines are called FBUS_(whatever). + + $Log$ + Revision 1.1.1.2 2001/11/27 22:01:16 short + :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Tue Nov 27 22:58 CET 2001 + + Revision 1.3 2001/11/27 12:19:01 pkot + Cleanup, indentation, ANSI complaint preprocesor symbols (Jan Kratochvil, me) + + Revision 1.2 2001/11/09 14:25:04 pkot + DEBUG cleanups + + Revision 1.1 2001/11/09 12:55:07 pkot + Forgot about fbus support for 3110. FIXME: is it really needed? + + +*/ + +/* System header files */ + +#include +#include +#include + +/* Various header file */ + +#include "config.h" +#include "misc.h" +#include "gsm-common.h" +#include "gsm-ringtones.h" +#include "gsm-networks.h" +#include "gsm-statemachine.h" +#include "links/utils.h" + +#ifndef WIN32 +# include "device.h" +#else +# include "win32/winserial.h" +# define device_write(a, b) WriteCommBlock(a, b) +# define device_read(a, b) ReadCommBlock(a, b) +# define sleep(x) Sleep((x) * 1000) +# define usleep(x) Sleep(((x) < 1000) ? 1 : ((x) / 1000)) +#endif + +#define __links_fbus_3110_c +#include "links/fbus-3110.h" + +/* FIXME - pass device_* the link stuff?? */ +/* FIXME - win32 stuff! */ + + +/* Some globals */ + +static GSM_Link *glink; +static GSM_Statemachine *statemachine; +static FB3110_Link flink; /* FBUS specific stuff, internal to this file */ + + +/*--------------------------------------------*/ + +bool FB3110_OpenSerial(void) +{ + /* Open device. */ +#ifdef WIN32 + if (OpenConnection(glink->PortDevice, FB3110_RX_StateMachine, NULL)) { +#else + if (!device_open(glink->PortDevice, false, false, false, GCT_Serial)) { +#endif + perror(_("Couldn't open FBUS device")); + return false; + } + device_changespeed(115200); + + return (true); +} + + +/* RX_State machine for receive handling. Called once for each character + received from the phone. */ + +void FB3110_RX_StateMachine(unsigned char rx_byte) +{ + FB3110_IncomingFrame *i = &flink.i; + int count; + + switch (i->State) { + + /* Phone is currently off. Wait for 0x55 before + restarting */ + case FB3110_RX_Discarding: + if (rx_byte != 0x55) + break; + + /* Seen 0x55, restart at 0x04 */ + i->State = FB3110_RX_Sync; + + dprintf("restarting.\n"); + + /* FALLTHROUGH */ + + /* Messages from the phone start with an 0x04 during + "normal" operation, 0x03 when in data/fax mode. We + use this to "synchronise" with the incoming data + stream. */ + case FB3110_RX_Sync: + if (rx_byte == 0x04 || rx_byte == 0x03) { + i->FrameType = rx_byte; + i->Checksum = rx_byte; + i->State = FB3110_RX_GetLength; + } + break; + + /* Next byte is the length of the message including + the message type byte but not including the checksum. */ + case FB3110_RX_GetLength: + i->FrameLength = rx_byte; + i->BufferCount = 0; + i->Checksum ^= rx_byte; + i->State = FB3110_RX_GetMessage; + break; + + /* Get each byte of the message. We deliberately + get one too many bytes so we get the checksum + here as well. */ + case FB3110_RX_GetMessage: + i->Buffer[i->BufferCount] = rx_byte; + i->BufferCount++; + + if (i->BufferCount > FB3110_MAX_FRAME_LENGTH) { + dprintf("FBUS: Message buffer overun - resetting\n"); + i->State = FB3110_RX_Sync; + break; + } + + /* If this is the last byte, it's the checksum. */ + if (i->BufferCount > i->FrameLength) { + + /* Is the checksum correct? */ + if (rx_byte == i->Checksum) { + + if (i->FrameType == 0x03) { + /* FIXME: modify Buffer[0] to code FAX frame types */ + } + + dprintf("--> %02x:%02x:", i->FrameType, i->FrameLength); + for (count = 0; count < i->BufferCount; count++) + dprintf("%02hhx:", i->Buffer[count]); + dprintf("\n"); + /* Transfer message to state machine */ + SM_IncomingFunction(statemachine, i->Buffer[0], i->Buffer, i->FrameLength); + + /* Send an ack */ + FB3110_TX_SendAck(i->Buffer, i->FrameLength); + + } else { + /* Checksum didn't match so ignore. */ + dprintf("Bad checksum!\n"); + } + i->State = FB3110_RX_Sync; + } + i->Checksum ^= rx_byte; + break; + } +} + + +/* This is the main loop function which must be called regularly */ +/* timeout can be used to make it 'busy' or not */ + +GSM_Error FB3110_Loop(struct timeval *timeout) +{ +#ifndef WIN32 + unsigned char buffer[255]; + int count, res; + + res = device_select(timeout); + if (res > 0) { + res = device_read(buffer, 255); + for (count = 0; count < res; count++) + FB3110_RX_StateMachine(buffer[count]); + } else + return GE_TIMEOUT; + + /* This traps errors from device_read */ + if (res > 0) + return GE_NONE; + else + return GE_INTERNALERROR; +#else + return GE_NONE; +#endif +} + + + +/* Prepares the message header and sends it, prepends the + message start byte (0x01) and other values according + the value specified when called. Calculates checksum + and then sends the lot down the pipe... */ + +GSM_Error FB3110_TX_SendFrame(u8 message_length, u8 message_type, u8 sequence_byte, u8 * buffer) +{ + + u8 out_buffer[FB3110_MAX_TRANSMIT_LENGTH]; + int count, current = 0; + unsigned char checksum; + + /* Check message isn't too long, once the necessary + header and trailer bytes are included. */ + if ((message_length + 5) > FB3110_MAX_TRANSMIT_LENGTH) { + fprintf(stderr, _("FB3110_TX_SendFrame - message too long!\n")); + return (GE_INTERNALERROR); + } + + /* Now construct the message header. */ + out_buffer[current++] = FB3110_FRAME_ID; /* Start of frame */ + out_buffer[current++] = message_length + 2; /* Length */ + out_buffer[current++] = message_type; /* Type */ + out_buffer[current++] = sequence_byte; /* Sequence number */ + + /* Copy in data if any. */ + if (message_length != 0) { + memcpy(out_buffer + current, buffer, message_length); + current += message_length; + } + + /* Now calculate checksum over entire message + and append to message. */ + checksum = 0; + for (count = 0; count < current; count++) + checksum ^= out_buffer[count]; + out_buffer[current++] = checksum; + + dprintf("<-- "); + for (count = 0; count < current; count++) + dprintf("%02hhx:", out_buffer[count]); + dprintf("\n"); + + /* Send it out... */ + if (device_write(out_buffer, current) != current) + return (GE_INTERNALERROR); + + return (GE_NONE); +} + + +/* Main function to send an fbus message */ + +GSM_Error FB3110_SendMessage(u16 messagesize, u8 messagetype, void *message) +{ + u8 seqnum; + + FB3110_UpdateSequenceNumber(); + seqnum = flink.RequestSequenceNumber; + + return FB3110_TX_SendFrame(messagesize, messagetype, seqnum, message); +} + + +/* Sends the "standard" acknowledge message back to the phone in + response to a message it sent automatically or in response to + a command sent to it. The ack. algorithm isn't 100% understood + at this time. */ + +void FB3110_TX_SendAck(u8 *message, int length) +{ + u8 t = message[0]; + + switch (t) { + case 0x0a: + /* We send 0x0a messages to make a call so don't ack. */ + case 0x0c: + /* We send 0x0c message to answer to incoming call + so don't ack */ + case 0x0f: + /* We send 0x0f message to hang up so don't ack */ + case 0x15: + /* 0x15 messages are sent by the phone in response to the + init sequence sent so we don't acknowledge them! */ + case 0x20: + /* We send 0x20 message to phone to send DTFM, so don't ack */ + case 0x23: + /* We send 0x23 messages to phone as a header for outgoing SMS + messages. So we don't acknowledge it. */ + case 0x24: + /* We send 0x24 messages to phone as a header for storing SMS + messages in memory. So we don't acknowledge it. :) */ + case 0x25: + /* We send 0x25 messages to phone to request an SMS message + be dumped. Thus we don't acknowledge it. */ + case 0x26: + /* We send 0x26 messages to phone to delete an SMS message + so it's not acknowledged. */ + case 0x3f: + /* We send an 0x3f message to the phone to request a different + type of status dump - this one seemingly concerned with + SMS message center details. Phone responds with an ack to + our 0x3f request then sends an 0x41 message that has the + actual data in it. */ + case 0x4a: + /* 0x4a message is a response to our 0x4a request, assumed to + be a keepalive message of sorts. No response required. */ + case 0x4c: + /* We send 0x4c to request IMEI, Revision and Model info. */ + break; + case 0x27: + /* 0x27 messages are a little different in that both ends of + the link send them. So, first we have to check if this + is an acknowledgement or a message to be acknowledged */ + if (length == 0x02) break; + default: + /* Standard acknowledge seems to be to return an empty message + with the sequence number set to equal the sequence number + sent minus 0x08. */ + if (FB3110_TX_SendFrame(0, t, (message[1] & 0x1f) - 0x08, NULL) != GE_NONE) + dprintf("Failed to acknowledge message type %02x.\n", t); + else + dprintf("Acknowledged message type %02x.\n", t); + } +} + + +/* Initialise variables and start the link */ +/* newlink is actually part of state - but the link code should not anything about state */ +/* state is only passed around to allow for muliple state machines (one day...) */ + +GSM_Error FB3110_Initialise(GSM_Link *newlink, GSM_Statemachine *state) +{ + unsigned char init_char = 0x55; + unsigned char count; + static int try = 0; + + try++; + if (try > 2) return GE_DEVICEOPENFAILED; + /* 'Copy in' the global structures */ + glink = newlink; + statemachine = state; + + /* Fill in the link functions */ + glink->Loop = &FB3110_Loop; + glink->SendMessage = &FB3110_SendMessage; + + /* Check for a valid init length */ + if (glink->InitLength == 0) + glink->InitLength = 100; + + /* Start up the link */ + + flink.RequestSequenceNumber = 0x10; + + if (!FB3110_OpenSerial()) return GE_DEVICEOPENFAILED; + + /* Send init string to phone, this is a bunch of 0x55 characters. + Timing is empirical. I believe that we need/can do this for any + phone to get the UART synced */ + for (count = 0; count < glink->InitLength; count++) { + usleep(1000); + device_write(&init_char, 1); + } + + /* Init variables */ + flink.i.State = FB3110_RX_Sync; + + return GE_NONE; +} + + +/* Any command we originate must have a unique SequenceNumber. + Observation to date suggests that these values startx at 0x10 + and cycle up to 0x17 before repeating again. Perhaps more + accurately, the numbers cycle 0,1,2,3..7 with bit 4 of the byte + premanently set. */ + +void FB3110_UpdateSequenceNumber(void) +{ + flink.RequestSequenceNumber++; + + if (flink.RequestSequenceNumber > 0x17 || flink.RequestSequenceNumber < 0x10) { + flink.RequestSequenceNumber = 0x10; + } +} diff --git a/common/newmodules/n3110.c b/common/newmodules/n3110.c new file mode 100644 index 0000000..21a4bb9 --- /dev/null +++ b/common/newmodules/n3110.c @@ -0,0 +1,191 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for accessing functions on the N3110 and similar + phones. + +*/ + +/* "Turn on" prototypes in n-3110.h */ + +#define __n_3110_c + +/* System header files */ +#include +#include +#include + +#ifdef WIN32 + #include "misc_win32.h" +#endif + +/* Various header file */ +#ifndef VC6 + #include "config.h" +#endif + +#include "misc.h" +#include "gsm-api.h" +#include "gsm-common.h" +#include "files/cfgreader.h" +#include "newmodules/n3110.h" +#include "newmodules/n6110.h" +#include "gsm-networks.h" + +/* Here we initialise model specific functions. */ + +GSM_Functions N3110_Functions = { + N3110_Initialise, + N3110_DispatchMessage, + NULL_Terminate, + NULL_KeepAlive, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED +}; + + + +/* for all these Phones we support N3110 */ + +GSM_Information N3110_Information = { + "", /* Supported models in FBUS */ + "",/* Supported models in MBUS */ + "",/* Supported models in FBUS over infrared */ + "",/* Supported models in FBUS over DLR3 */ + "", + "", /* Supported models in FBUS over Irda sockets */ + "", + "3110|3810|8110|8110i|8148|8148i", /* FBUS version 1 */ + 4, /* Max RF Level */ + 0, /* Min RF Level */ + GRF_Arbitrary, /* RF level units */ + 4, /* Max Battery Level */ + 0, /* Min Battery Level */ + GBU_Arbitrary, /* Battery level units */ + GDT_None, /* No date/time support */ + GDT_None, /* No alarm support */ + 0 /* Max alarms = 0 */ +}; + +/* Initialise variables and state machine. */ +GSM_Error N3110_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + u8 init[20]={0x02, 0x01, 0x07, 0xa2, 0x88, 0x81, 0x21, 0x55, 0x63, 0xa8, + 0x00, 0x00, 0x07, 0xa3, 0xb8, 0x81, 0x20, 0x15, 0x63, 0x80}; + + unsigned char init_char = N6110_SYNC_BYTE; + + int count; + int InitLength; + + GSM_Error error; + if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE) + { + return GE_NOTSUPPORTED; + } + + InitLength = atoi(initlength); + + if ((strcmp(initlength, "default") == 0) || (InitLength == 0)) { + InitLength = 250; /* This is the usual value, lower may work. */ + } + +#ifdef DEBUG + fprintf(stdout,_("Writing init chars....")); +#endif + + /* Initialise link with phone or what have you */ + /* Send init string to phone, this is a bunch of 0x55 characters. Timing is + empirical. */ + for (count = 0; count < InitLength; count ++) { + usleep(1000); + Protocol->WritePhone(1,&init_char); + } + +#ifdef DEBUG + fprintf(stdout,_("Done\n")); +#endif + + error=NULL_SendMessageSequence (200, &CurrentGetIMEIError, 20, 0x15, init); + if (error!=GE_NONE) return error; + + CurrentLinkOK = true; + + return (GE_NONE); +} + + +void N3110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ +} diff --git a/common/newmodules/n6110.c b/common/newmodules/n6110.c new file mode 100644 index 0000000..410808d --- /dev/null +++ b/common/newmodules/n6110.c @@ -0,0 +1,5636 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for accessing functions on the 6110 and similar + phones. + +*/ + +/* "Turn on" prototypes in n-6110.h */ + +#define __n_6110_c + +/* System header files */ +#include +#include +#include + +#ifdef WIN32 + #include "misc_win32.h" +#endif + +/* Various header file */ +#ifndef VC6 + #include "config.h" +#endif + +#include "gsm-api.h" +#include "gsm-coding.h" +#include "newmodules/n6110.h" +#include "newmodules/n7110.h" +#include "protocol/fbus.h" +#include "devices/device.h" +/* Global variables used by code in gsm-api.c to expose the functions + supported by this model of phone. */ + + + + + + + +/* Here we initialise model specific functions. */ +GSM_Functions N6110_Functions = { + N6110_Initialise, + N6110_DispatchMessage, + NULL_Terminate, + NULL_KeepAlive, + N6110_GetMemoryLocation, + N6110_WritePhonebookLocation, + N6110_GetSpeedDial, + N6110_SetSpeedDial, + N6110_GetMemoryStatus, + N6110_GetSMSStatus, + N6110_GetSMSCenter, + N6110_SetSMSCenter, + N6110_GetSMSMessage, + N6110_DeleteSMSMessage, + N6110_SendSMSMessage, + N6110_SaveSMSMessage, + N6110_GetRFLevel, + N6110_GetBatteryLevel, + N6110_GetPowerSource, + N6110_GetDisplayStatus, + N6110_EnterSecurityCode, + N6110_GetSecurityCodeStatus, + N6110_GetSecurityCode, + N6110_GetIMEI, + N6110_GetRevision, + N6110_GetModel, + N6110_GetDateTime, + N6110_SetDateTime, + N6110_GetAlarm, + N6110_SetAlarm, + N6110_DialVoice, + N6110_DialData, + N6110_GetIncomingCallNr, + N6110_GetNetworkInfo, + N6110_GetCalendarNote, + N6110_WriteCalendarNote, + N6110_DeleteCalendarNote, + N6110_NetMonitor, + N6110_SendDTMF, + N6110_GetBitmap, + N6110_SetBitmap, + N6110_SetRingTone, + N6110_SetBinRingTone, + N6110_GetBinRingTone, + N6110_Reset, + N6110_GetProfile, + N6110_SetProfile, + N6110_SendRLPFrame, + N6110_CancelCall, + N6110_PressKey, + N6110_EnableDisplayOutput, + N6110_DisableDisplayOutput, + N6110_EnableCellBroadcast, + N6110_DisableCellBroadcast, + N6110_ReadCellBroadcast, + N6110_PlayTone, + N6110_GetProductProfileSetting, + N6110_SetProductProfileSetting, + N6110_GetOperatorName, + N6110_SetOperatorName, + N6110_GetVoiceMailbox, N6110_Tests, + N6110_SimlockInfo, + UNIMPLEMENTED, //GetCalendarNotesInfo + N6110_GetSMSFolders, + N6110_ResetPhoneSettings, + N7110_GetWAPBookmark, + N7110_SetWAPBookmark, + N7110_GetWAPSettings, + N6110_CallDivert, + N6110_AnswerCall, + N6110_GetManufacturer +}; + +/* Mobile phone information */ + +GSM_Information N6110_Information = { + "3210|3310|3330|5110|5130|5190|6110|6130|6150|6190|8210|8850", + /* Supported models in FBUS */ + "3210|3310|3330|5110|5130|5190|6110|6130|6150|6190|8210|8850|9210", + /* Supported models in MBUS */ + "6110|6130|6150|8210|8850", + /* Supported models in FBUS over infrared */ + "", + /* Supported models in FBUS over DLR3 */ + "", + /* AT commands */ + "8210|8850", + /* infrared sockets */ + "6110|6130|6150|8210|8850", + /* Supported models in FBUS over infrared with Tekram device */ "", + 4, /* Max RF Level */ + 0, /* Min RF Level */ + GRF_Arbitrary, /* RF level units */ + 4, /* Max Battery Level */ + 0, /* Min Battery Level */ + GBU_Arbitrary, /* Battery level units */ + GDT_DateTime, /* Have date/time support */ + GDT_TimeOnly, /* Alarm supports time only */ + 1 /* Only one alarm available */ +}; + +const char *N6110_MemoryType_String [] = { + "", /* 0x00 */ + "MT", /* 0x01 */ + "ME", /* 0x02 */ + "SM", /* 0x03 */ + "FD", /* 0x04 */ + "ON", /* 0x05 */ + "EN", /* 0x06 */ + "DC", /* 0x07 */ + "RC", /* 0x08 */ + "MC", /* 0x09 */ +}; + +/* Magic bytes from the phone. */ +unsigned char MagicBytes[4] = { 0x00, 0x00, 0x00, 0x00 }; + +/* For DisplayOutput */ +char PhoneScreen[5+1][27+1]; +int OldX=1000,OldY=0,NewX=0,NewY=0; + +void N6110_ReplyEnableExtendedCommands(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: Answer for EnableExtendedSecurityCommands frame, meaning not known :-(\n")); +#endif /* DEBUG */ + + CurrentEnableExtendedCommandsError=GE_NONE; +} + +/* If you set make some things (for example, + change Security Code from phone's menu, disable and enable + phone), it won't answer for 0x40 frame - you won't be able + to play tones, get netmonitor, etc. + + This function do thing called "Enabling extended security commands" - + it enables 0x40 frame functions. + + This frame can also some other things - see below */ +GSM_Error N6110_EnableExtendedCommands (unsigned char status) +{ + unsigned char req[4] = { 0x00, + 0x01,0x64, /* Enable extended commands request */ + 0x01 }; /* 0x01 - on, 0x00 - off, + 0x03 & 0x04 - soft & hard reset, + 0x06 - CONTACT SERVICE */ + + /* 0x06 MAKES CONTACT SERVICE! BE CAREFULL! */ + /* When use 0x03 and had during session changed time & date + some phones (like 6150 or 6210) can ask for time & date after reset + or disable clock on the screen */ + if (status!=0x06) req[3] = status; + + return NULL_SendMessageSequence + (50, &CurrentEnableExtendedCommandsError, 4, 0x40, req); +} + +void N6110_ReplyIMEI(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#if defined WIN32 || !defined HAVE_SNPRINTF + sprintf(Current_IMEI, "%s", MessageBuffer+4); +#else + snprintf(Current_IMEI, GSM_MAX_IMEI_LENGTH, "%s", MessageBuffer+4); +#endif + +#ifdef DEBUG + fprintf(stdout, _("Message: IMEI %s received\n"),Current_IMEI); +#endif + + CurrentGetIMEIError=GE_NONE; +} + +GSM_Error N6110_SendIMEIFrame() +{ + unsigned char req[4] = {0x00, 0x01, 0x66, 0x00}; + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + return NULL_SendMessageSequence (20, &CurrentGetIMEIError, 4, 0x40, req); +} + +void N6110_ReplyHW(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i, j; + + if (MessageBuffer[3]==0x05) { + +#ifdef DEBUG + fprintf(stdout,_("Message: Hardware version received: ")); +#endif + + j=strlen(Current_Revision); + Current_Revision[j++]=','; + Current_Revision[j++]=' '; + Current_Revision[j++]='H'; + Current_Revision[j++]='W'; + + for (i=5;i<9;i++) { +#ifdef DEBUG + fprintf(stdout,_("%c"), MessageBuffer[i]); +#endif + Current_Revision[j++]=MessageBuffer[i]; + } + +#ifdef DEBUG + fprintf(stdout,_("\n")); +#endif + + CurrentGetHWError=GE_NONE; + } +} + +GSM_Error N6110_SendHWFrame() +{ + unsigned char req[4] = {0x00, 0x01, 0xc8, 0x05}; + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + return NULL_SendMessageSequence (20, &CurrentGetHWError, 4, 0x40, req); +} + +void N6110_ReplyID(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i, j; + +#ifdef DEBUG + fprintf(stdout, _("Message: Mobile phone model identification received:\n")); + fprintf(stdout, _(" Firmware: ")); +#endif + + strcpy(Current_Revision,"SW"); + + i=6;j=2; + while (MessageBuffer[i]!=0x0a) { + Current_Revision[j]=MessageBuffer[i]; +#ifdef DEBUG + fprintf(stdout, _("%c"),MessageBuffer[i]); +#endif + if (j==GSM_MAX_REVISION_LENGTH-1) { +#ifdef DEBUG + fprintf(stderr,_("ERROR: increase GSM_MAX_REVISION_LENGTH!\n")); +#endif + break; + } + j++; + i++; + } + Current_Revision[j+1]=0; + +#ifdef DEBUG + fprintf(stdout, _("\n Firmware date: ")); +#endif + + i++; + while (MessageBuffer[i]!=0x0a) { +#ifdef DEBUG + fprintf(stdout, _("%c"),MessageBuffer[i]); +#endif + i++; + } + +#ifdef DEBUG + fprintf(stdout, _("\n Model: ")); +#endif /* DEBUG */ + + i++;j=0; + while (MessageBuffer[i]!=0x0a) { + Current_Model[j]=MessageBuffer[i]; +#ifdef DEBUG + fprintf(stdout, _("%c"),MessageBuffer[i]); +#endif + if (j==GSM_MAX_MODEL_LENGTH-1) { +#ifdef DEBUG + fprintf(stderr,_("ERROR: increase GSM_MAX_MODEL_LENGTH!\n")); +#endif + break; + } + j++; + i++; + } + Current_Model[j+1]=0; + +#ifdef DEBUG + fprintf(stdout, _("\n")); +#endif /* DEBUG */ + + CurrentMagicError=GE_NONE; +} + +GSM_Error N6110_SendIDFrame() +{ + unsigned char req[5] = {N6110_FRAME_HEADER, 0x03, 0x00}; + + return NULL_SendMessageSequence (50, &CurrentMagicError, 5, 0xd1, req); +} + +/* This function send the status request to the phone. */ +/* Seems to be ignored in N3210 */ +GSM_Error N6110_SendStatusRequest(void) +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x01}; + + Protocol->SendMessage(4, 0x04, req); + + return (GE_NONE); +} + +void N6110_ReplyGetAuthentication(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#if defined WIN32 || !defined HAVE_SNPRINTF + sprintf(Current_IMEI, "%s", MessageBuffer+9); + sprintf(Current_Model, "%s", MessageBuffer+25); + sprintf(Current_Revision, "SW%s, HW%s", MessageBuffer+44, MessageBuffer+39); +#else + snprintf(Current_IMEI, GSM_MAX_IMEI_LENGTH, "%s", MessageBuffer+9); + snprintf(Current_Model, GSM_MAX_MODEL_LENGTH, "%s", MessageBuffer+25); + snprintf(Current_Revision, GSM_MAX_REVISION_LENGTH, "SW%s, HW%s", MessageBuffer+44, MessageBuffer+39); +#endif + +#ifdef DEBUG + fprintf(stdout, _("Message: Mobile phone identification received:\n")); + fprintf(stdout, _(" IMEI: %s\n"), Current_IMEI); + fprintf(stdout, _(" Model: %s\n"), Current_Model); + fprintf(stdout, _(" Production Code: %s\n"), MessageBuffer+31); + fprintf(stdout, _(" HW: %s\n"), MessageBuffer+39); + fprintf(stdout, _(" Firmware: %s\n"), MessageBuffer+44); + + /* These bytes are probably the source of the "Accessory not connected" + messages on the phone when trying to emulate NCDS... I hope.... + UPDATE: of course, now we have the authentication algorithm. */ + fprintf(stdout, _(" Magic bytes: %02x %02x %02x %02x\n"), MessageBuffer[50], MessageBuffer[51], MessageBuffer[52], MessageBuffer[53]); +#endif /* DEBUG */ + + MagicBytes[0]=MessageBuffer[50]; + MagicBytes[1]=MessageBuffer[51]; + MagicBytes[2]=MessageBuffer[52]; + MagicBytes[3]=MessageBuffer[53]; + + CurrentMagicError=GE_NONE; +} + +/* This function provides Nokia authentication protocol. + + This code is written specially for gnokii project by Odinokov Serge. + If you have some special requests for Serge just write him to + apskaita@post.omnitel.net or serge@takas.lt + + Reimplemented in C by Pavel Janík ml. + + Nokia authentication protocol is used in the communication between Nokia + mobile phones (e.g. Nokia 6110) and Nokia Cellular Data Suite software, + commercially sold by Nokia Corp. + + The authentication scheme is based on the token send by the phone to the + software. The software does it's magic (see the function + FB61_GetNokiaAuth()) and returns the result back to the phone. If the + result is correct the phone responds with the message "Accessory + connected!" displayed on the LCD. Otherwise it will display "Accessory not + supported" and some functions will not be available for use. + + The specification of the protocol is not publicly available, no comment. */ +void N6110_GetNokiaAuth(unsigned char *Imei, unsigned char *MagicBytes, unsigned char *MagicResponse) +{ + + int i, j, CRC=0; + + /* This is our temporary working area. */ + + unsigned char Temp[16]; + + /* Here we put FAC (Final Assembly Code) and serial number into our area. */ + + Temp[0] = Imei[6]; + Temp[1] = Imei[7]; + Temp[2] = Imei[8]; + Temp[3] = Imei[9]; + Temp[4] = Imei[10]; + Temp[5] = Imei[11]; + Temp[6] = Imei[12]; + Temp[7] = Imei[13]; + + /* And now the TAC (Type Approval Code). */ + + Temp[8] = Imei[2]; + Temp[9] = Imei[3]; + Temp[10] = Imei[4]; + Temp[11] = Imei[5]; + + /* And now we pack magic bytes from the phone. */ + + Temp[12] = MagicBytes[0]; + Temp[13] = MagicBytes[1]; + Temp[14] = MagicBytes[2]; + Temp[15] = MagicBytes[3]; + + for (i=0; i<=11; i++) + if (Temp[i + 1]& 1) + Temp[i]<<=1; + + switch (Temp[15] & 0x03) { + + case 1: + case 2: + j = Temp[13] & 0x07; + + for (i=0; i<=3; i++) + Temp[i+j] ^= Temp[i+12]; + + break; + + default: + j = Temp[14] & 0x07; + + for (i=0; i<=3; i++) + Temp[i + j] |= Temp[i + 12]; + } + + for (i=0; i<=15; i++) + CRC ^= Temp[i]; + + for (i=0; i<=15; i++) { + + switch (Temp[15 - i] & 0x06) { + + case 0: + j = Temp[i] | CRC; + break; + + case 2: + case 4: + j = Temp[i] ^ CRC; + break; + + case 6: + j = Temp[i] & CRC; + break; + } + + if (j == CRC) + j = 0x2c; + + if (Temp[i] == 0) + j = 0; + + MagicResponse[i] = j; + + } +} + +GSM_Error N6110_Authentication() +{ + unsigned char connect1[] = {N6110_FRAME_HEADER, 0x0d, 0x00, 0x00, 0x02}; + unsigned char connect2[] = {N6110_FRAME_HEADER, 0x20, 0x02}; + unsigned char connect3[] = {N6110_FRAME_HEADER, 0x0d, 0x01, 0x00, 0x02}; + unsigned char connect4[] = {N6110_FRAME_HEADER, 0x10}; + + unsigned char magic_connect[] = {N6110_FRAME_HEADER, + 0x12, + + /* The real magic goes here ... These bytes are filled in with the + function N6110_GetNokiaAuth(). */ + + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + + /* NOKIA&GNOKII Accessory */ + + 0x4e, 0x4f, 0x4b, 0x49, 0x41, 0x26, 0x4e, 0x4f, 0x4b, 0x49, 0x41, 0x20, + 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x6f, 0x72, 0x79, + + 0x00, 0x00, 0x00, 0x00}; + +#ifdef DEBUG + fprintf(stdout,_("Making authentication!\n")); +#endif + + usleep(100); Protocol->SendMessage(7, 0x02, connect1); + usleep(100); Protocol->SendMessage(5, 0x02, connect2); + usleep(100); Protocol->SendMessage(7, 0x02, connect3); + + CurrentMagicError = GE_BUSY; + + usleep(100); Protocol->SendMessage(4, 0x64, connect4); + if (NULL_WaitUntil(50,&CurrentMagicError)!=GE_NONE) return GE_TIMEOUT; + + N6110_GetNokiaAuth(Current_IMEI, MagicBytes, magic_connect+4); + + Protocol->SendMessage(45, 0x64, magic_connect); + +#ifdef DEBUG + fprintf(stdout,_("End of authentication!\n")); +#endif + + return GE_NONE; +} + +/* Initialise variables and state machine. */ +GSM_Error N6110_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + unsigned char init_char = N6110_SYNC_BYTE; + unsigned char end_init_char = N6110_IR_END_SYNC_BYTE; + + int count; + int InitLength; + + if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE) + { + return GE_NOTSUPPORTED; + } + + switch (CurrentConnectionType) { + case GCT_Irda: + case GCT_MBUS: + /* We don't think about authentication in Irda, because + AFAIK there are no phones working over sockets + and having authentication. In MBUS it doesn't work */ + usleep(100); + + if (N6110_SendIDFrame()!=GE_NONE) return GE_TIMEOUT; + + if (N6110_SendIMEIFrame()!=GE_NONE) return GE_TIMEOUT; + + if (N6110_SendHWFrame()!=GE_NONE) return GE_TIMEOUT; + + CurrentLinkOK = true; + break; + + case GCT_FBUS: + case GCT_Infrared: + case GCT_Tekram: + InitLength = atoi(initlength); + + if ((strcmp(initlength, "default") == 0) || (InitLength == 0)) { + InitLength = 250; /* This is the usual value, lower may work. */ + } + + if (CurrentConnectionType==GCT_Infrared || + CurrentConnectionType==GCT_Tekram) { +#ifdef DEBUG + fprintf(stdout,_("Setting infrared for FBUS communication...\n")); +#endif + device_changespeed(9600); + } + +#ifdef DEBUG + fprintf(stdout,_("Writing init chars....")); +#endif + + /* Initialise link with phone or what have you */ + /* Send init string to phone, this is a bunch of 0x55 characters. Timing is + empirical. */ + for (count = 0; count < InitLength; count ++) { + if (CurrentConnectionType!=GCT_Infrared && + CurrentConnectionType!=GCT_Tekram) usleep(100); + Protocol->WritePhone(1,&init_char); + } + + if (CurrentConnectionType==GCT_Infrared || + CurrentConnectionType==GCT_Tekram) { + Protocol->WritePhone(1,&end_init_char); + usleep(200000); + } + +#ifdef DEBUG + fprintf(stdout,_("Done\n")); +#endif + + if (CurrentConnectionType==GCT_Infrared || + CurrentConnectionType==GCT_Tekram) { + device_changespeed(115200); + } + + N6110_SendStatusRequest(); + + usleep(100); + + if (N6110_SendIDFrame()!=GE_NONE) return GE_TIMEOUT; + + /* N51xx/61xx have something called authentication. + After making it phone display "Accessory connected" + and probably give access to some function (I'm not too sure about it !) + Anyway, I make it now for N51xx/61xx */ + if (GetModelFeature (FN_AUTHENTICATION)!=0) { + if (N6110_Authentication()!=GE_NONE) return GE_TIMEOUT; + } else { /* No authentication */ + if (N6110_SendIMEIFrame()!=GE_NONE) return GE_TIMEOUT; + + if (N6110_SendHWFrame()!=GE_NONE) return GE_TIMEOUT; + } + + break; + default: +#ifdef DEBUG + fprintf(stdout,_("Unknown connection type in n6110.c!\n")); +#endif + break; + } + + return (GE_NONE); +} + +/* This function translates GMT_MemoryType to N6110_MEMORY_xx */ +int N6110_GetMemoryType(GSM_MemoryType memory_type) +{ + + int result; + + switch (memory_type) { + + case GMT_MT: result = N6110_MEMORY_MT; break; + case GMT_ME: result = N6110_MEMORY_ME; break; + case GMT_SM: result = N6110_MEMORY_SM; break; + case GMT_FD: result = N6110_MEMORY_FD; break; + case GMT_ON: result = N6110_MEMORY_ON; break; + case GMT_EN: result = N6110_MEMORY_EN; break; + case GMT_DC: result = N6110_MEMORY_DC; break; + case GMT_RC: result = N6110_MEMORY_RC; break; + case GMT_MC: result = N6110_MEMORY_MC; break; + default : result = N6110_MEMORY_XX; + + } + + return (result); +} + +void N6110_ReplyCallDivert(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + case 0x02: + +#ifdef DEBUG + fprintf(stdout, _("Message: Call divert status received\n")); + fprintf(stdout, _(" Divert type: ")); + switch (MessageBuffer[6]) { + case 0x43: fprintf(stdout, _("when busy"));break; + case 0x3d: fprintf(stdout, _("when not answered"));break; + case 0x3e: fprintf(stdout, _("when phone off or no coverage"));break; + case 0x15: fprintf(stdout, _("all types of diverts"));break; //? + case 0x02: fprintf(stdout, _("all types of diverts"));break; //? + default: fprintf(stdout, _("unknown %i"),MessageBuffer[6]);break; + } + fprintf(stdout, _("\n Calls type : ")); + if (MessageBuffer[6]==0x02) + fprintf(stdout, _("voice, fax & data")); //? + else { + switch (MessageBuffer[8]) { + case 0x0b: fprintf(stdout, _("voice"));break; + case 0x0d: fprintf(stdout, _("fax"));break; + case 0x19: fprintf(stdout, _("data"));break; + default: fprintf(stdout, _("unknown %i"),MessageBuffer[8]);break; + } + } + fprintf(stdout, _("\n")); + if (MessageBuffer[10]==0x01) { + fprintf(stdout, _(" Status : active\n")); + fprintf(stdout, _(" Timeout : %i seconds\n"),MessageBuffer[45]); + fprintf(stdout, _(" Number : %s\n"),GSM_UnpackSemiOctetNumber(MessageBuffer+12,true)); + } else { + fprintf(stdout, _(" Status : deactivated\n")); + } +#endif /* DEBUG */ + + if (CurrentCallDivert!=NULL) { + switch (MessageBuffer[6]) { + case 0x43: CurrentCallDivert->DType=GSM_CDV_Busy;break; + case 0x3d: CurrentCallDivert->DType=GSM_CDV_NoAnswer;break; + case 0x3e: CurrentCallDivert->DType=GSM_CDV_OutOfReach;break; + case 0x15: CurrentCallDivert->DType=GSM_CDV_AllTypes;break; //? + case 0x02: CurrentCallDivert->DType=GSM_CDV_AllTypes;break; //? + } + + if (MessageBuffer[6]==0x02) //? + CurrentCallDivert->CType=GSM_CDV_AllCalls; + else { + switch (MessageBuffer[8]) { + case 0x0b: CurrentCallDivert->CType=GSM_CDV_VoiceCalls;break; + case 0x0d: CurrentCallDivert->CType=GSM_CDV_FaxCalls; break; + case 0x19: CurrentCallDivert->CType=GSM_CDV_DataCalls; break; + } + } + + if (MessageBuffer[10]==0x01) { + CurrentCallDivert->Enabled=true; + CurrentCallDivert->Timeout=MessageBuffer[45]; + strcpy(CurrentCallDivert->Number,GSM_UnpackSemiOctetNumber(MessageBuffer+12,true)); + } else { + CurrentCallDivert->Enabled=false; + } + CurrentCallDivertError=GE_NONE; + } + break; + + case 0x03: +#ifdef DEBUG + fprintf(stdout, _("Message: Call divert status receiving error ?\n")); +#endif + CurrentCallDivertError=GE_UNKNOWN; + break; + } +} + +GSM_Error N6110_CallDivert(GSM_CallDivert *cd) +{ + char req[55] = { N6110_FRAME_HEADER, 0x01, + 0x00, /* operation */ + 0x00, + 0x00, /* divert type */ + 0x00, /* call type */ + 0x00 }; + GSM_Error error; + + int length = 0x09; + + switch (cd->Operation) { + case GSM_CDV_Register: + case GSM_CDV_Enable: + req[4] = 0x03; + req[8] = 0x01; + req[29]= GSM_PackSemiOctetNumber(cd->Number, req + 9, false); + req[52]= cd->Timeout; + length = 55; + break; + case GSM_CDV_Erasure: + case GSM_CDV_Disable: + req[4] = 0x04; + break; + case GSM_CDV_Query: + req[4] = 0x05; + break; + default: + return GE_NOTIMPLEMENTED; + } + + switch (cd->DType) { + case GSM_CDV_AllTypes : req[6] = 0x15; break; + case GSM_CDV_Busy : req[6] = 0x43; break; + case GSM_CDV_NoAnswer : req[6] = 0x3d; break; + case GSM_CDV_OutOfReach: req[6] = 0x3e; break; + default: return GE_NOTIMPLEMENTED; + } + + if ((cd->DType == GSM_CDV_AllTypes) && + (cd->CType == GSM_CDV_AllCalls)) + req[6] = 0x02; + + switch (cd->CType) { + case GSM_CDV_AllCalls : break; + case GSM_CDV_VoiceCalls: req[7] = 0x0b; break; + case GSM_CDV_FaxCalls : req[7] = 0x0d; break; + case GSM_CDV_DataCalls : req[7] = 0x19; break; + default: return GE_NOTIMPLEMENTED; + } + + CurrentCallDivert = cd; + + error=NULL_SendMessageSequence + (100, &CurrentCallDivertError, length, 0x06, req); + + CurrentCallDivert = NULL; + + return error; +} + +GSM_Error N6110_Tests() +{ + unsigned char buffer[3]={0x00,0x01,0xcf}; + unsigned char buffer3[8]={0x00,0x01,0xce,0x1d,0xfe,0x23,0x00,0x00}; + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + //make almost all tests + Protocol->SendMessage(8, 0x40, buffer3); + + while (GSM->Initialise(PortDevice, "50", CurrentConnectionType, CurrentRLP_RXCallback)!=GE_NONE) {}; + + sleep(2); + + return NULL_SendMessageSequence + (200, &CurrentNetworkInfoError, 3, 0x40, buffer); +} + +void N6110_DisplayTestsInfo(u8 *MessageBuffer) { + + int i; + + CurrentNetworkInfoError=GE_NONE; + + for (i=0;i> 4))); + j++; + } + if (j==5 || j==15) fprintf(stdout, _("\n")); + if (j!=15) { + if (j<24) { + fprintf(stdout,_("%c"), ('0' + (MessageBuffer[9+i] & 0x0f))); + j++; + } + } else j++; + if (j==20 || j==24) fprintf(stdout, _("\n")); + } + + if ((MessageBuffer[6] & 1) == 1) fprintf(stdout,_("lock 1 closed\n")); + if ((MessageBuffer[6] & 2) == 2) fprintf(stdout,_("lock 2 closed\n")); + if ((MessageBuffer[6] & 4) == 4) fprintf(stdout,_("lock 3 closed\n")); + if ((MessageBuffer[6] & 8) == 8) fprintf(stdout,_("lock 4 closed\n")); + + /* I'm not sure here at all */ + if ((MessageBuffer[5] & 1) == 1) fprintf(stdout,_("lock 1 - user\n")); + if ((MessageBuffer[5] & 2) == 2) fprintf(stdout,_("lock 2 - user\n")); + if ((MessageBuffer[5] & 4) == 4) fprintf(stdout,_("lock 3 - user\n")); + if ((MessageBuffer[5] & 8) == 8) fprintf(stdout,_("lock 4 - user\n")); + + fprintf(stdout,_("counter for lock1: %i\n"),MessageBuffer[21]); + fprintf(stdout,_("counter for lock2: %i\n"),MessageBuffer[22]); + fprintf(stdout,_("counter for lock3: %i\n"),MessageBuffer[23]); + fprintf(stdout,_("counter for lock4: %i\n"),MessageBuffer[24]); + +#endif + + j=0; + for (i=0; i < 12; i++) + { + if (j<24) { + uni[j]='0' + (MessageBuffer[9+i] >> 4); + j++; + } + if (j!=15) { + if (j<24) { + uni[j]='0' + (MessageBuffer[9+i] & 0x0f); + j++; + } + } else j++; + } + + strncpy(CurrentSimLock->simlocks[0].data,uni,5); + CurrentSimLock->simlocks[0].data[5]=0; + strncpy(CurrentSimLock->simlocks[3].data,uni+5,10); + CurrentSimLock->simlocks[3].data[10]=0; + strncpy(CurrentSimLock->simlocks[1].data,uni+16,4); + CurrentSimLock->simlocks[1].data[4]=0; + strncpy(CurrentSimLock->simlocks[2].data,uni+20,4); + CurrentSimLock->simlocks[2].data[4]=0; + + CurrentSimLock->simlocks[0].enabled=((MessageBuffer[6] & 1) == 1); + CurrentSimLock->simlocks[1].enabled=((MessageBuffer[6] & 2) == 2); + CurrentSimLock->simlocks[2].enabled=((MessageBuffer[6] & 4) == 4); + CurrentSimLock->simlocks[3].enabled=((MessageBuffer[6] & 8) == 8); + + CurrentSimLock->simlocks[0].factory=((MessageBuffer[5] & 1) != 1); + CurrentSimLock->simlocks[1].factory=((MessageBuffer[5] & 2) != 2); + CurrentSimLock->simlocks[2].factory=((MessageBuffer[5] & 4) != 4); + CurrentSimLock->simlocks[3].factory=((MessageBuffer[5] & 8) != 8); + + CurrentSimLock->simlocks[0].counter=MessageBuffer[21]; + CurrentSimLock->simlocks[1].counter=MessageBuffer[22]; + CurrentSimLock->simlocks[2].counter=MessageBuffer[23]; + CurrentSimLock->simlocks[3].counter=MessageBuffer[24]; + + CurrentSimlockInfoError=GE_NONE; +} + +GSM_Error N6110_SimlockInfo(GSM_AllSimlocks *siml) +{ + GSM_Error error; + unsigned char req[] = {0x00,0x01,0x8a,0x00}; + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + CurrentSimLock=siml; + + return NULL_SendMessageSequence (50, &CurrentSimlockInfoError, 4, 0x40, req); +} + +void N6110_ReplyResetPhoneSettings(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: Resetting phone settings\n")); +#endif /* DEBUG */ + + CurrentResetPhoneSettingsError=GE_NONE; +} + +GSM_Error N6110_ResetPhoneSettings() +{ + GSM_Error error; + unsigned char req[] = {0x00,0x01,0x65,0x08,0x00}; + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + return NULL_SendMessageSequence + (50, &CurrentResetPhoneSettingsError, 5, 0x40, req); +} +GSM_Error N6110_GetManufacturer(char *manufacturer) +{ + strcpy (manufacturer, "Nokia"); + return (GE_NONE); +} + +GSM_Error N6110_GetVoiceMailbox ( GSM_PhonebookEntry *entry) +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x01, 0x00, 0x00, 0x00}; + + GSM_Error error; + + CurrentPhonebookEntry = entry; + + req[4] = N6110_MEMORY_VOICE; + req[5] = 0x00; /* Location - isn't important, but... */ + + error=NULL_SendMessageSequence + (20, &CurrentPhonebookError, 7, 0x03, req); + + CurrentPhonebookEntry = NULL; + + return error; +} + +void N6110_ReplyGetOperatorName(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i, count; + + GSM_Bitmap NullBitmap; + + DecodeNetworkCode(MessageBuffer+5, NullBitmap.netcode); + + count=8; + +#ifdef DEBUG + fprintf(stdout, _("Message: Info about downloaded operator name received: %s network (for gnokii \"%s\", for phone \""), + NullBitmap.netcode, + GSM_GetNetworkName(NullBitmap.netcode)); +#endif + + i=count; + while (MessageBuffer[count]!=0) { +#ifdef DEBUG + fprintf(stdout,_("%c"),MessageBuffer[count]); +#endif + count++; + } + + strcpy(CurrentGetOperatorNameNetwork->Code, NullBitmap.netcode); + strncpy(CurrentGetOperatorNameNetwork->Name, MessageBuffer+i,count-i+1); + +#ifdef DEBUG + fprintf(stdout,_("\")\n")); +#endif + + CurrentGetOperatorNameError=GE_NONE; +} + +GSM_Error N6110_GetOperatorName (GSM_Network *operator) +{ + unsigned char req[] = { 0x00,0x01,0x8c,0x00}; + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + CurrentGetOperatorNameNetwork = operator; + + error=NULL_SendMessageSequence + (20, &CurrentGetOperatorNameError, 4, 0x40, req); + + CurrentGetOperatorNameNetwork = NULL; + + return error; +} + +void N6110_ReplySetOperatorName(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: Downloaded operator name changed\n")); +#endif + + CurrentSetOperatorNameError=GE_NONE; +} + +GSM_Error N6110_SetOperatorName (GSM_Network *operator) +{ + unsigned char req[256] = { 0x00,0x01,0x8b,0x00, + 0x00,0x00, /* MCC */ + 0x00}; /* MNC */ + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + EncodeNetworkCode(req+4,operator->Code); + + strncpy(req+7,operator->Name,200); + + return NULL_SendMessageSequence + (20, &CurrentSetOperatorNameError, 8+strlen(operator->Name), 0x40, req); +} + +void N6110_ReplyGetMemoryStatus(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + case 0x08: + +#ifdef DEBUG + fprintf(stdout, _("Message: Memory status received:\n")); + + fprintf(stdout, _(" Memory Type: %s\n"), N6110_MemoryType_String[MessageBuffer[4]]); + fprintf(stdout, _(" Used: %d\n"), MessageBuffer[6]); + fprintf(stdout, _(" Free: %d\n"), MessageBuffer[5]); +#endif /* DEBUG */ + + CurrentMemoryStatus->Used = MessageBuffer[6]; + CurrentMemoryStatus->Free = MessageBuffer[5]; + CurrentMemoryStatusError = GE_NONE; + + break; + + case 0x09: + +#ifdef DEBUG + switch (MessageBuffer[4]) { + case 0x6f: + fprintf(stdout, _("Message: Memory status error, phone is probably powered off.\n"));break; + case 0x7d: + fprintf(stdout, _("Message: Memory status error, memory type not supported by phone model.\n"));break; + case 0x8d: + fprintf(stdout, _("Message: Memory status error, waiting for security code.\n"));break; + default: + fprintf(stdout, _("Message: Unknown Memory status error, subtype (MessageBuffer[4]) = %02x\n"),MessageBuffer[4]);break; + } +#endif + + switch (MessageBuffer[4]) { + case 0x6f:CurrentMemoryStatusError = GE_TIMEOUT;break; + case 0x7d:CurrentMemoryStatusError = GE_INTERNALERROR;break; + case 0x8d:CurrentMemoryStatusError = GE_INVALIDSECURITYCODE;break; + default:break; + } + + break; + + } +} + +/* This function is used to get storage status from the phone. It currently + supports two different memory areas - internal and SIM. */ +GSM_Error N6110_GetMemoryStatus(GSM_MemoryStatus *Status) +{ + unsigned char req[] = { N6110_FRAME_HEADER, + 0x07, /* MemoryStatus request */ + 0x00 /* MemoryType */ + }; + + GSM_Error error; + + CurrentMemoryStatus = Status; + + req[4] = N6110_GetMemoryType(Status->MemoryType); + + error=NULL_SendMessageSequence + (20, &CurrentMemoryStatusError, 5, 0x03, req); + + CurrentMemoryStatus = NULL; + + return error; +} + +void N6110_ReplyGetNetworkInfo(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + GSM_NetworkInfo NullNetworkInfo; + + /* Make sure we are expecting NetworkInfo frame */ + if (CurrentNetworkInfo && CurrentNetworkInfoError == GE_BUSY) { +#ifdef DEBUG + fprintf(stdout, _("Message: Network informations:\n")); +#endif + } else { +#ifdef DEBUG + fprintf(stdout, _("Message: Network informations not requested, but received:\n")); +#endif + } + + sprintf(NullNetworkInfo.NetworkCode, "%x%x%x %x%x", MessageBuffer[14] & 0x0f, MessageBuffer[14] >>4, MessageBuffer[15] & 0x0f, MessageBuffer[16] & 0x0f, MessageBuffer[16] >>4); + + sprintf(NullNetworkInfo.CellID, "%02x%02x", MessageBuffer[10], MessageBuffer[11]); + + sprintf(NullNetworkInfo.LAC, "%02x%02x", MessageBuffer[12], MessageBuffer[13]); + +#ifdef DEBUG + fprintf(stdout, _(" CellID: %s\n"), NullNetworkInfo.CellID); + fprintf(stdout, _(" LAC: %s\n"), NullNetworkInfo.LAC); + fprintf(stdout, _(" Network code: %s\n"), NullNetworkInfo.NetworkCode); + fprintf(stdout, _(" Network name: %s (%s)\n"), + GSM_GetNetworkName(NullNetworkInfo.NetworkCode), + GSM_GetCountryName(NullNetworkInfo.NetworkCode)); + fprintf(stdout, _(" Status: ")); + + switch (MessageBuffer[8]) { + case 0x01: fprintf(stdout, _("home network selected")); break; + case 0x02: fprintf(stdout, _("roaming network")); break; + case 0x03: fprintf(stdout, _("requesting network")); break; + case 0x04: fprintf(stdout, _("not registered in the network")); break; + default: fprintf(stdout, _("unknown")); + } + + fprintf(stdout, "\n"); + + fprintf(stdout, _(" Network selection: %s\n"), MessageBuffer[9]==1?_("manual"):_("automatic")); +#endif /* DEBUG */ + + /* Make sure we are expecting NetworkInfo frame */ + if (CurrentNetworkInfo && CurrentNetworkInfoError == GE_BUSY) + *CurrentNetworkInfo=NullNetworkInfo; + + CurrentNetworkInfoError = GE_NONE; +} + +GSM_Error N6110_GetNetworkInfo(GSM_NetworkInfo *NetworkInfo) +{ + unsigned char req[] = { N6110_FRAME_HEADER, + 0x70 + }; + + GSM_Error error; + + CurrentNetworkInfo = NetworkInfo; + + error=NULL_SendMessageSequence + (20, &CurrentNetworkInfoError, 4, 0x0a, req); + + CurrentNetworkInfo = NULL; + + return error; +} + +void N6110_ReplyGetProductProfileSetting(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i; + +#ifdef DEBUG + fprintf(stdout, _("Message: Product Profile Settings received -")); + for (i=0;i<4;i++) fprintf(stdout, _(" %02x"),MessageBuffer[3+i]); + fprintf(stdout, _("\n")); +#endif + + for (i=0;i<4;i++) CurrentPPS[i]=MessageBuffer[3+i]; + + CurrentProductProfileSettingsError=GE_NONE; +} + +GSM_Error N6110_GetProductProfileSetting (GSM_PPS *PPS) +{ + unsigned char req[] = { 0x00, 0x01,0x6a }; + + int i,j; + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + error=NULL_SendMessageSequence + (20, &CurrentProductProfileSettingsError, 3, 0x40, req); + if (error!=GE_NONE) return error; + + switch (PPS->Name) { + case PPS_ALS : PPS->bool_value=(CurrentPPS[1]&32); break; + case PPS_GamesMenu: PPS->bool_value=(CurrentPPS[3]&64); break; + case PPS_HRData : PPS->bool_value=(CurrentPPS[0]&64); break; + case PPS_14400Data: PPS->bool_value=(CurrentPPS[0]&128);break; + case PPS_EFR : PPS->int_value =(CurrentPPS[0]&1) +(CurrentPPS[0]&2); break; + case PPS_FR : PPS->int_value =(CurrentPPS[0]&16)/16+(CurrentPPS[0]&32)/16;break; + case PPS_HR : PPS->int_value =(CurrentPPS[0]&4)/4 +(CurrentPPS[0]&8)/4; break; + case PPS_VibraMenu: PPS->bool_value=(CurrentPPS[4]&64); break; + case PPS_LCDContrast: + PPS->int_value=0; + j=1; + for (i=0;i<5;i++) { + if (CurrentPPS[3]&j) PPS->int_value=PPS->int_value+j; + j=j*2; + } + PPS->int_value=PPS->int_value*100/32; + break; + + } + + return (GE_NONE); +} + +void N6110_ReplySetProductProfileSetting(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + int i; + + fprintf(stdout, _("Message: Product Profile Settings set to")); + for (i=0;i<4;i++) fprintf(stdout, _(" %02x"),CurrentPPS[i]); + fprintf(stdout, _("\n")); +#endif + + CurrentProductProfileSettingsError=GE_NONE; +} + +GSM_Error N6110_SetProductProfileSetting (GSM_PPS *PPS) +{ + unsigned char req[] = { 0x00, 0x01,0x6b, + 0x00, 0x00, 0x00, 0x00 }; /* bytes with Product Profile Setings */ + unsigned char settings[32]; + + GSM_PPS OldPPS; + + int i,j,z; + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + OldPPS.Name=PPS_ALS; + error=N6110_GetProductProfileSetting(&OldPPS); + if (error!=GE_NONE) return error; + + j=128;z=0; + for (i=0;i<32;i++) { + if (CurrentPPS[z]&j) + settings[i]='1'; + else + settings[i]='0'; + if (j==1) { + j=128; + z++; + } else j=j/2; + } + +#ifdef DEBUG + fprintf(stdout,_("Current settings: ")); + for (i=0;i<32;i++) { + fprintf(stdout,_("%c"),settings[i]); + } + fprintf(stdout,_("\n")); +#endif + + switch (PPS->Name) { + case PPS_ALS :settings[10]=PPS->bool_value?'1':'0';break; + case PPS_HRData :settings[ 5]=PPS->bool_value?'1':'0';break; + case PPS_14400Data:settings[ 6]=PPS->bool_value?'1':'0';break; + default :break; + } + + j=128;z=0; + for (i=0;i<32;i++) { + if (settings[i]=='1') req[z+3]=req[z+3]+j; + if (j==1) { + j=128; + z++; + } else j=j/2; + } + +#ifdef DEBUG + fprintf(stdout,_("Current settings: ")); + for (i=0;i<4;i++) { + fprintf(stdout,_("%i "),req[i+3]); + } + fprintf(stdout,_("\n")); +#endif + + for (i=0;i<4;i++) { + CurrentPPS[i]=req[i+3]; + } + + return NULL_SendMessageSequence + (20, &CurrentProductProfileSettingsError, 7, 0x40, req); +} + +void N6110_ReplyPressKey(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + if (MessageBuffer[4]==CurrentPressKeyEvent) CurrentPressKeyError=GE_NONE; + else CurrentPressKeyError=GE_UNKNOWN; /* MessageBuffer[4] = 0x05 */ +#ifdef DEBUG + fprintf(stdout, _("Message: Result of key ")); + switch (MessageBuffer[4]) + { + case PRESSPHONEKEY: fprintf(stdout, _("press OK\n"));break; + case RELEASEPHONEKEY: fprintf(stdout, _("release OK\n"));break; + default: fprintf(stdout, _("press or release - error\n"));break; + } +#endif /* DEBUG */ +} + +GSM_Error N6110_PressKey(int key, int event) +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x42, 0x01, 0x00, 0x01}; + + req[4]=event; /* if we press or release key */ + req[5]=key; + + CurrentPressKeyEvent=event; + + return NULL_SendMessageSequence + (10, &CurrentPressKeyError, 7, 0x0c, req); +} + +void N6110_ReplyDisplayOutput(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + /* Hopefully is 64 larger as FB38_MAX* / N6110_MAX* */ + char model[64]; + + int i, j; + + char uni[100]; + + switch(MessageBuffer[3]) { + + /* Phone sends displayed texts */ + case 0x50: + NewX=MessageBuffer[6]; + NewY=MessageBuffer[5]; + + DecodeUnicode (uni, MessageBuffer+8, MessageBuffer[7]); + +#ifdef DEBUG + fprintf(stdout, _("New displayed text (%i %i): \"%s\"\n"),NewX,NewY,uni); +#endif /* DEBUG */ + + while (N6110_GetModel(model) != GE_NONE) + sleep(1); + + /* With these rules it works almost excellent with my N5110 */ + /* I don't have general rule :-(, that's why you must experiment */ + /* with your phone. Nokia could make it better. MW */ + /* It's almost OK for N5110*/ + /* FIX ME: it will be the same for N5130 and 3210 too*/ + if (!strcmp(model,"NSE-1")) + { + /* OldX==1000 means - it's first time */ + if (OldX==1000) { + + /* Clean table */ + for (i=0;i<5+1;i++) { + for (j=0;j<27+1;j++) {PhoneScreen[i][j]=' ';} + } + OldX=0; + } + + if ((OldX==0 && OldY==31 && NewX==29 && NewY==46) || + (OldX==0 && OldY==13 && NewX==23 && NewY==46)) { + /* Clean the line with current text */ + for (j=0;j<27+1;j++) {PhoneScreen[NewY/(47/5)][j]=' ';} + + /* Inserts text into table */ + for (i=0; iSendMessage(sizeof(req0), 0x01, req0); + sleep(1); + + return NULL_SendMessageSequence + (20, &CurrentMagicError, sizeof(req) , 0x01, req); +} + +void N6110_ReplyGetProfile(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + /* Profile feature */ + case 0x14: + + switch(GetModelFeature (FN_PROFILES)) { + case F_PROF33: + switch (MessageBuffer[6]) { + case 0x00: CurrentProfile->KeypadTone = MessageBuffer[8]; break; + case 0x01: CurrentProfile->CallAlert = MessageBuffer[8]; break; + case 0x02: CurrentProfile->Ringtone = MessageBuffer[8]; break; + case 0x03: CurrentProfile->Volume = MessageBuffer[8]; break; + case 0x04: CurrentProfile->MessageTone = MessageBuffer[8]; break; + case 0x05: CurrentProfile->Vibration = MessageBuffer[8]; break; + case 0x06: CurrentProfile->WarningTone = MessageBuffer[8]; break; + case 0x07: CurrentProfile->ScreenSaver = MessageBuffer[8]; break; + default: +#ifdef DEBUG + fprintf(stdout,_("feature %i = value %i\n\n"),MessageBuffer[6],MessageBuffer[8]); +#endif + break; + } + break; + default: + switch (MessageBuffer[6]) { + case 0x00: CurrentProfile->KeypadTone = MessageBuffer[8];break; + case 0x01: CurrentProfile->Lights = MessageBuffer[8];break; + case 0x02: CurrentProfile->CallAlert = MessageBuffer[8];break; + case 0x03: CurrentProfile->Ringtone = MessageBuffer[8];break; + case 0x04: CurrentProfile->Volume = MessageBuffer[8];break; + case 0x05: CurrentProfile->MessageTone = MessageBuffer[8];break; + case 0x06: CurrentProfile->Vibration = MessageBuffer[8];break; + case 0x07: CurrentProfile->WarningTone = MessageBuffer[8];break; + case 0x08: CurrentProfile->CallerGroups = MessageBuffer[8];break; + case 0x09: CurrentProfile->AutomaticAnswer = MessageBuffer[8];break; + default: +#ifdef DEBUG + fprintf(stdout,_("feature %i = value %i\n\n"),MessageBuffer[6],MessageBuffer[8]); +#endif + break; + } + break; + } + + CurrentProfileError = GE_NONE; + break; + + /* Incoming profile name */ + case 0x1b: + + if (MessageBuffer[9] == 0x00) { + CurrentProfile->DefaultName=MessageBuffer[8]; + } else { + CurrentProfile->DefaultName=-1; + + /* Here name is in Unicode */ + if (GetModelFeature (FN_PROFILES)==F_PROF33) { + DecodeUnicode (CurrentProfile->Name, MessageBuffer+10, MessageBuffer[9]/2); + } else { + /* ...here not */ + sprintf(CurrentProfile->Name, MessageBuffer + 10, MessageBuffer[9]); + CurrentProfile->Name[MessageBuffer[9]] = '\0'; + } + } + + CurrentProfileError = GE_NONE; + break; + + } +} + +/* Needs SIM card with PIN in phone */ +GSM_Error N6110_GetProfile(GSM_Profile *Profile) +{ + int i; + + unsigned char name_req[] = { N6110_FRAME_HEADER, 0x1a, 0x00}; + unsigned char feat_req[] = { N6110_FRAME_HEADER, 0x13, 0x01, 0x00, 0x00}; + + GSM_Error error; + + CurrentProfile = Profile; + + /* When after sending all frames feature==253, it means, that it is not + supported */ + CurrentProfile->KeypadTone=253; + CurrentProfile->Lights=253; + CurrentProfile->CallAlert=253; + CurrentProfile->Ringtone=253; + CurrentProfile->Volume=253; + CurrentProfile->MessageTone=253; + CurrentProfile->WarningTone=253; + CurrentProfile->Vibration=253; + CurrentProfile->CallerGroups=253; + CurrentProfile->ScreenSaver=253; + CurrentProfile->AutomaticAnswer=253; + + name_req[4] = Profile->Number; + + error=NULL_SendMessageSequence + (20, &CurrentProfileError, 5, 0x05, name_req); + if (error!=GE_NONE) return error; + + for (i = 0x00; i <= 0x09; i++) { + + feat_req[5] = Profile->Number; + + feat_req[6] = i; + + error=NULL_SendMessageSequence + (20, &CurrentProfileError, 7, 0x05, feat_req); + if (error!=GE_NONE) return error; + } + + if (Profile->DefaultName > -1) + { + switch(GetModelFeature (FN_PROFILES)) { + case F_PROF33: + switch (Profile->DefaultName) { + case 0x00: sprintf(Profile->Name, "General");break; + case 0x01: sprintf(Profile->Name, "Silent");break; + case 0x02: sprintf(Profile->Name, "Descreet");break; + case 0x03: sprintf(Profile->Name, "Loud");break; + case 0x04: sprintf(Profile->Name, "My style");break; + case 0x05: Profile->Name[0]=0;break; + default : sprintf(Profile->Name, "Unknown (%i)", Profile->DefaultName);break; + } + break; + case F_PROF51: + switch (Profile->DefaultName) { + case 0x00: sprintf(Profile->Name, "Personal");break; + case 0x01: sprintf(Profile->Name, "Car");break; + case 0x02: sprintf(Profile->Name, "Headset");break; + default : sprintf(Profile->Name, "Unknown (%i)", Profile->DefaultName);break; + } + break; + case F_PROF61: + switch (Profile->DefaultName) { + case 0x00: sprintf(Profile->Name, "General");break; + case 0x01: sprintf(Profile->Name, "Silent");break; + case 0x02: sprintf(Profile->Name, "Meeting");break; + case 0x03: sprintf(Profile->Name, "Outdoor");break; + case 0x04: sprintf(Profile->Name, "Pager");break; + case 0x05: sprintf(Profile->Name, "Car");break; + case 0x06: sprintf(Profile->Name, "Headset");break; + default : sprintf(Profile->Name, "Unknown (%i)", Profile->DefaultName);break; + } + break; + } + } + + return (GE_NONE); + +} + +void N6110_ReplySetProfile(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + /* Profile feature change result */ + case 0x11: +#ifdef DEBUG + fprintf(stdout, _("Message: Profile feature change result.\n")); +#endif /* DEBUG */ + CurrentProfileError = GE_NONE; + break; + + /* Profile name set result */ + case 0x1d: +#ifdef DEBUG + fprintf(stdout, _("Message: Profile name change result.\n")); +#endif /* DEBUG */ + CurrentProfileError = GE_NONE; + break; + + } +} + +GSM_Error N6110_SetProfileFeature(u8 profile, u8 feature, u8 value) +{ + unsigned char feat_req[] = { N6110_FRAME_HEADER, 0x10, 0x01, + 0x00, 0x00, 0x00}; + + feat_req[5]=profile; + feat_req[6]=feature; + feat_req[7]=value; + + return NULL_SendMessageSequence + (20, &CurrentProfileError, 8, 0x05, feat_req); +} + +GSM_Error N6110_SetProfile(GSM_Profile *Profile) +{ + int i,value; + + unsigned char name_req[40] = { N6110_FRAME_HEADER, 0x1c, 0x01, 0x03, + 0x00, 0x00, 0x00}; + + GSM_Error error; + + name_req[7] = Profile->Number; + name_req[8] = strlen(Profile->Name); + name_req[6] = name_req[8] + 2; + + for (i = 0; i < name_req[8]; i++) + name_req[9 + i] = Profile->Name[i]; + + error=NULL_SendMessageSequence + (20, &CurrentProfileError, name_req[8] + 9, 0x05, name_req); + if (error!=GE_NONE) return error; + + for (i = 0x00; i <= 0x09; i++) { + + switch (i) { + case 0x00: value = Profile->KeypadTone; break; + case 0x01: value = Profile->Lights; break; + case 0x02: value = Profile->CallAlert; break; + case 0x03: value = Profile->Ringtone; break; + case 0x04: value = Profile->Volume; break; + case 0x05: value = Profile->MessageTone; break; + case 0x06: value = Profile->Vibration; break; + case 0x07: value = Profile->WarningTone; break; + case 0x08: value = Profile->CallerGroups; break; + case 0x09: value = Profile->AutomaticAnswer; break; + default : value = 0; break; + } + + error=N6110_SetProfileFeature(Profile->Number,i,value); + if (error!=GE_NONE) return error; + } + + return (GE_NONE); +} + +bool N6110_SendRLPFrame(RLP_F96Frame *frame, bool out_dtx) +{ + u8 req[60] = { 0x00, 0xd9 }; + + /* Discontinuos transmission (DTX). See section 5.6 of GSM 04.22 version + 7.0.1. */ + + if (out_dtx) + req[1]=0x01; + + memcpy(req+2, (u8 *) frame, 32); + + return (Protocol->SendFrame(32, 0xf0, req)); +} + +void N6110_ReplyGetCalendarNote(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i, j; + + u8 mychar1; + + wchar_t wc; + + switch (MessageBuffer[4]) { + + case 0x01: + + CurrentCalendarNote->Type=MessageBuffer[8]; + + DecodeDateTime(MessageBuffer+9, &CurrentCalendarNote->Time); + + DecodeDateTime(MessageBuffer+16, &CurrentCalendarNote->Alarm); + + CurrentCalendarNote->Text[0]=0; + + if (GetModelFeature (FN_CALENDAR)==F_CAL33) { + i=0; + if (CurrentCalendarNote->Type == GCN_REMINDER) i=1; //first char is subset + switch (MessageBuffer[24]) { + case 3: +#ifdef DEBUG + fprintf(stdout,_("Subset 3 in reminder note !\n")); +#endif + while (i!=MessageBuffer[23]) { + j=0; + if (i!=MessageBuffer[23]-1) { + if (MessageBuffer[24+i]>=0xc2) { + DecodeWithUTF8Alphabet(MessageBuffer[24+i], MessageBuffer[24+i+1], &mychar1); + CurrentCalendarNote->Text[strlen(CurrentCalendarNote->Text)+1]=0; + CurrentCalendarNote->Text[strlen(CurrentCalendarNote->Text)]=mychar1; + j=-1; + i++; + } + } + if (j!=-1) { + CurrentCalendarNote->Text[strlen(CurrentCalendarNote->Text)+1]=0; + CurrentCalendarNote->Text[strlen(CurrentCalendarNote->Text)]=MessageBuffer[24+i]; + } + i++; + } + break; + case 2: +#ifdef DEBUG + fprintf(stdout,_("Subset 2 in reminder note !\n")); +#endif + while (i!=MessageBuffer[23]) { + wc = MessageBuffer[24+i] | (0x00 << 8); + CurrentCalendarNote->Text[strlen(CurrentCalendarNote->Text)+1]=0; + CurrentCalendarNote->Text[strlen(CurrentCalendarNote->Text)]= + DecodeWithUnicodeAlphabet(wc); + i++; + } + break; + case 1: +#ifdef DEBUG + fprintf(stdout,_("Subset 1 in reminder note !\n")); +#endif + memcpy(CurrentCalendarNote->Text,MessageBuffer+24+i,MessageBuffer[23]-i); + CurrentCalendarNote->Text[MessageBuffer[23]-i]=0; + break; + default: +#ifdef DEBUG + fprintf(stdout,_("Unknown subset in reminder note !\n")); +#endif + memcpy(CurrentCalendarNote->Text,MessageBuffer+24+i,MessageBuffer[23]-i); + CurrentCalendarNote->Text[MessageBuffer[23]-i]=0; + break; + } + } else { + memcpy(CurrentCalendarNote->Text,MessageBuffer+24,MessageBuffer[23]); + CurrentCalendarNote->Text[MessageBuffer[23]]=0; + } + + if (CurrentCalendarNote->Type == GCN_CALL) { + memcpy(CurrentCalendarNote->Phone,MessageBuffer+24+MessageBuffer[23]+1,MessageBuffer[24+MessageBuffer[23]]); + CurrentCalendarNote->Phone[MessageBuffer[24+MessageBuffer[23]]]=0; + } + + CurrentCalendarNote->Recurrance=0; + + CurrentCalendarNote->AlarmType=0; + +#ifdef DEBUG + fprintf(stdout, _("Message: Calendar note received.\n")); + + fprintf(stdout, _(" Date: %d-%02d-%02d\n"), CurrentCalendarNote->Time.Year, + CurrentCalendarNote->Time.Month, + CurrentCalendarNote->Time.Day); + + fprintf(stdout, _(" Time: %02d:%02d:%02d\n"), CurrentCalendarNote->Time.Hour, + CurrentCalendarNote->Time.Minute, + CurrentCalendarNote->Time.Second); + + /* Some messages do not have alarm set up */ + if (CurrentCalendarNote->Alarm.Year != 0) { + fprintf(stdout, _(" Alarm date: %d-%02d-%02d\n"), CurrentCalendarNote->Alarm.Year, + CurrentCalendarNote->Alarm.Month, + CurrentCalendarNote->Alarm.Day); + + fprintf(stdout, _(" Alarm time: %02d:%02d:%02d\n"), CurrentCalendarNote->Alarm.Hour, + CurrentCalendarNote->Alarm.Minute, + CurrentCalendarNote->Alarm.Second); + } + + fprintf(stdout, _(" Type: %d\n"), CurrentCalendarNote->Type); + fprintf(stdout, _(" Text: %s\n"), CurrentCalendarNote->Text); + + if (CurrentCalendarNote->Type == GCN_CALL) + fprintf(stdout, _(" Phone: %s\n"), CurrentCalendarNote->Phone); +#endif /* DEBUG */ + + CurrentCalendarNoteError=GE_NONE; + break; + + case 0x93: + +#ifdef DEBUG + fprintf(stdout, _("Message: Calendar note not available\n")); +#endif /* DEBUG */ + + CurrentCalendarNoteError=GE_INVALIDCALNOTELOCATION; + break; + + default: + +#ifdef DEBUG + fprintf(stdout, _("Message: Calendar note error\n")); +#endif /* DEBUG */ + + CurrentCalendarNoteError=GE_INTERNALERROR; + break; + + } +} + +GSM_Error N6110_GetCalendarNote(GSM_CalendarNote *CalendarNote) +{ + + unsigned char req[] = { N6110_FRAME_HEADER, + 0x66, 0x00 + }; + GSM_Error error; + + req[4]=CalendarNote->Location; + + CurrentCalendarNote = CalendarNote; + + error=NULL_SendMessageSequence + (20, &CurrentCalendarNoteError, 5, 0x13, req); + + CurrentCalendarNote = NULL; + + return error; +} + +void N6110_ReplyWriteCalendarNote(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + switch(MessageBuffer[4]) { + /* This message is also sent when the user enters the new entry on keypad */ + case 0x01: + fprintf(stdout, _("Message: Calendar note write succesfull!\n"));break; + case 0x73: + fprintf(stdout, _("Message: Calendar note write failed!\n"));break; + case 0x7d: + fprintf(stdout, _("Message: Calendar note write failed!\n"));break; + default: + fprintf(stdout, _("Unknown message of type 0x13 and subtype 0x65\n"));break; + } +#endif + + switch(MessageBuffer[4]) { + case 0x01: CurrentCalendarNoteError=GE_NONE; break; + case 0x73: CurrentCalendarNoteError=GE_INTERNALERROR; break; + case 0x7d: CurrentCalendarNoteError=GE_INTERNALERROR; break; + default : AppendLogText("Unknown msg\n",false); break; + } +} + +GSM_Error N6110_WriteCalendarNote(GSM_CalendarNote *CalendarNote) +{ + + unsigned char req[200] = { N6110_FRAME_HEADER, + 0x64, 0x01, 0x10, + 0x00, /* Length of the rest of the frame. */ + 0x00, /* The type of calendar note */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + }; + + typedef struct { + char *model; + unsigned char call; + unsigned char meeting; + unsigned char birthday; + unsigned char reminder; + } calendar_model_length; + + /* Length of entries */ + calendar_model_length calendar_lengths[] = + { + /*model,CallTo,Meeting,Birthday,Reminder*/ + {"NHM-5",0x24,0x24,0x24,0x24}, //Reminder from phone, other quesses + {"NHM-6",0x24,0x24,0x24,0x24}, //Reminder from phone, other quesses + {"NSE-3",0x1e,0x14,0x14,0x1e}, //from NCDS3 [HKEY_LOCAL_MACHINE\Software\Nokia\Data Suite\3.0\Calendar] + {"NSM-1",0x1e,0x18,0x18,0x24}, //from NCDS3 + {"NSK-3",0x1e,0x14,0x14,0x1e}, //from NCDS3 + {"NSB-3",0x20,0x14,0x14,0x1e}, //from NCDS3 + {"", 0, 0, 0, 0 } //end of table + }; + + int i, j, current; + + u8 mychar; + + u8 mychar1,mychar2; + + GSM_Error error; + + /* Hopefully is 64 larger as FB38_MAX* / N6110_MAX* */ + char model[64]; + + req[7]=CalendarNote->Type; + + EncodeDateTime(req+8, &CalendarNote->Time); + req[14] = CalendarNote->Time.Timezone; + + if (CalendarNote->Alarm.Year) { + EncodeDateTime(req+15, &CalendarNote->Alarm); + req[21] = CalendarNote->Alarm.Timezone; + } + + req[22]=strlen(CalendarNote->Text); + + current=23; + + if (GetModelFeature (FN_CALENDAR)==F_CAL33 && CalendarNote->Type==GCN_REMINDER) { + req[22]++; // one additional char + req[current++]=0x01; //we use now subset 1 + } + + for (i=0; iText); i++) { + j=0; + mychar=CalendarNote->Text[i]; + if (GetModelFeature (FN_CALENDAR)==F_CAL33 && CalendarNote->Type==GCN_REMINDER) { + if (EncodeWithUTF8Alphabet(mychar,&mychar1,&mychar2)) { + req[current++]=mychar1; + req[current++]=mychar2; + req[23]=0x03; //use subset 3 + req[22]++; // one additional char + j=-1; + } + } + if (j!=-1) { + /* Enables/disables blinking */ + if (mychar=='~') req[current++]=0x01; + else req[current++]=mychar; + } + } + + req[current++]=strlen(CalendarNote->Phone); + + for (i=0; iPhone); i++) + req[current++]=CalendarNote->Phone[i]; + + while (N6110_GetModel(model) != GE_NONE) + sleep(1); + + /* Checking maximal length */ + i=0; + while (strcmp(calendar_lengths[i].model,"")) { + if (!strcmp(calendar_lengths[i].model,model)) { + switch (CalendarNote->Type) { + case GCN_REMINDER:if (req[22]>calendar_lengths[i].reminder) return GE_TOOLONG;break; + case GCN_MEETING :if (req[22]>calendar_lengths[i].meeting) return GE_TOOLONG;break; + case GCN_BIRTHDAY:if (req[22]>calendar_lengths[i].birthday) return GE_TOOLONG;break; + case GCN_CALL :if (strlen(CalendarNote->Phone)>calendar_lengths[i].call) return GE_TOOLONG;break; + } + break; + } + i++; + } + + CurrentCalendarNote = CalendarNote; + + error=NULL_SendMessageSequence + (20, &CurrentCalendarNoteError, current, 0x13, req); + + CurrentCalendarNote = NULL; + + return error; +} + +void N6110_ReplyDeleteCalendarNote(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + switch (MessageBuffer[4]) { + /* This message is also sent when the user deletes an old entry on + keypad or moves an old entry somewhere (there is also `write' + message). */ + case 0x01:fprintf(stdout, _("Message: Calendar note deleted\n"));break; + case 0x93:fprintf(stdout, _("Message: Calendar note can't be deleted\n"));break; + default :fprintf(stdout, _("Message: Calendar note deleting error\n"));break; + } +#endif + + switch (MessageBuffer[4]) { + case 0x01:CurrentCalendarNoteError=GE_NONE;break; + case 0x93:CurrentCalendarNoteError=GE_INVALIDCALNOTELOCATION;break; + default :CurrentCalendarNoteError=GE_INTERNALERROR;break; + } +} + +GSM_Error N6110_DeleteCalendarNote(GSM_CalendarNote *CalendarNote) +{ + + unsigned char req[] = { N6110_FRAME_HEADER, + 0x68, 0x00 + }; + + req[4]=CalendarNote->Location; + + return NULL_SendMessageSequence (20, &CurrentCalendarNoteError, 5, 0x13, req); +} + +void N6110_ReplyRFBatteryLevel(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: Phone status received:\n")); + fprintf(stdout, _(" Mode: ")); + + switch (MessageBuffer[4]) { + + case 0x01: + + fprintf(stdout, _("registered within the network\n")); + break; + + /* I was really amazing why is there a hole in the type of 0x02, now I + know... */ + case 0x02: fprintf(stdout, _("call in progress\n")); break; /* ringing or already answered call */ + case 0x03: fprintf(stdout, _("waiting for security code\n")); break; + case 0x04: fprintf(stdout, _("powered off\n")); break; + default : fprintf(stdout, _("unknown\n")); + + } + + fprintf(stdout, _(" Power source: ")); + + switch (MessageBuffer[7]) { + + case 0x01: fprintf(stdout, _("AC/DC\n")); break; + case 0x02: fprintf(stdout, _("battery\n")); break; + default : fprintf(stdout, _("unknown\n")); + + } + + fprintf(stdout, _(" Battery Level: %d\n"), MessageBuffer[8]); + fprintf(stdout, _(" Signal strength: %d\n"), MessageBuffer[5]); +#endif /* DEBUG */ + + CurrentRFLevel=MessageBuffer[5]; + CurrentBatteryLevel=MessageBuffer[8]; + CurrentPowerSource=MessageBuffer[7]; +} + + +GSM_Error N6110_GetRFLevel(GSM_RFUnits *units, float *level) +{ + + /* FIXME - these values are from 3810 code, may be incorrect. Map from + values returned in status packet to the the values returned by the AT+CSQ + command. */ + float csq_map[5] = {0, 8, 16, 24, 31}; + + int timeout=10; + int rf_level; + + char screen[NM_MAX_SCREEN_WIDTH]; + + CurrentRFLevel=-1; + + if (GetModelFeature (FN_NOPOWERFRAME)==F_NOPOWER) { + + if (N6110_NetMonitor(1, screen)!=GE_NONE) + return GE_INTERNALERROR; + + rf_level=4; + + if (screen[4]!='-') { + if (screen[5]=='9' && screen[6]>'4') rf_level=1; + if (screen[5]=='9' && screen[6]<'5') rf_level=2; + if (screen[5]=='8' && screen[6]>'4') rf_level=3; + } else rf_level=0; + + /* Arbitrary units. */ + if (*units == GRF_Arbitrary) { + *level = rf_level; + return (GE_NONE); + } + + } else { + N6110_SendStatusRequest(); + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentRFLevel == -1 ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + /* Make copy in case it changes. */ + rf_level = CurrentRFLevel; + + if (rf_level == -1) + return (GE_NOLINK); + + /* Now convert between the different units we support. */ + + /* Arbitrary units. */ + if (*units == GRF_Arbitrary) { + *level = rf_level; + return (GE_NONE); + } + + /* CSQ units. */ + if (*units == GRF_CSQ) { + + if (rf_level <=4) + *level = csq_map[rf_level]; + else + *level = 99; /* Unknown/undefined */ + + return (GE_NONE); + } + } + + /* Unit type is one we don't handle so return error */ + return (GE_INTERNALERROR); +} + + +GSM_Error N6110_GetBatteryLevel(GSM_BatteryUnits *units, float *level) +{ + int timeout=10; + int batt_level; + + char screen[NM_MAX_SCREEN_WIDTH]; + + CurrentBatteryLevel=-1; + + if (GetModelFeature (FN_NOPOWERFRAME)==F_NOPOWER) { + + if (N6110_NetMonitor(23, screen)!=GE_NONE) + return GE_NOLINK; + + batt_level=4; + + if (screen[29]=='7') batt_level=3; + if (screen[29]=='5') batt_level=2; + if (screen[29]=='2') batt_level=1; + + /* Only units we handle at present are GBU_Arbitrary */ + if (*units == GBU_Arbitrary) { + *level = batt_level; + return (GE_NONE); + } + + return (GE_INTERNALERROR); + + } else { + N6110_SendStatusRequest(); + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentBatteryLevel == -1 ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + /* Take copy in case it changes. */ + batt_level = CurrentBatteryLevel; + + if (batt_level != -1) { + + /* Only units we handle at present are GBU_Arbitrary */ + if (*units == GBU_Arbitrary) { + *level = batt_level; + return (GE_NONE); + } + + return (GE_INTERNALERROR); + } + else + return (GE_NOLINK); + } +} + +GSM_Error N6110_GetPowerSource(GSM_PowerSource *source) +{ + + int timeout=10; + + char screen[NM_MAX_SCREEN_WIDTH]; + + CurrentPowerSource=-1; + + if (GetModelFeature (FN_NOPOWERFRAME)==F_NOPOWER) { + + if (N6110_NetMonitor(20, screen)!=GE_NONE) + return GE_NOLINK; + + CurrentPowerSource=GPS_ACDC; + + if (screen[6]=='x') CurrentPowerSource=GPS_BATTERY; + + *source=CurrentPowerSource; + + return GE_NONE; + } else { + N6110_SendStatusRequest(); + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentPowerSource == -1 ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + if (CurrentPowerSource != -1) { + *source=CurrentPowerSource; + return (GE_NONE); + } + else + return (GE_NOLINK); + } +} + +void N6110_ReplyGetDisplayStatus(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i; + + for (i=0; iSendMessage(sizeof(req3), 0x01, req3); + usleep(1000000); + Protocol->SendMessage(sizeof(req4), 0x01, req4); + usleep(1000000); + req_end = req_end1; + size = sizeof(req_end1); + break; + case -1: /* Just used to set the call passup */ + return GE_NONE; + break; + default: + req_end = req_end0; + size = sizeof(req_end0); + break; + } + + req[4] = strlen(Number); + + for(i = 0; i < strlen(Number) ; i++) + req[5+i] = Number[i]; + + memcpy(req + 5 + strlen(Number), req_end, size); + + Protocol->SendMessage(5 + size + strlen(Number), 0x01, req); + usleep(1000000); + + if (type != 1) { + Protocol->SendMessage(26, 0x01, req2); + usleep(1000000); + } + + return (GE_NONE); +} + +GSM_Error N6110_GetIncomingCallNr(char *Number) +{ + + if (*CurrentIncomingCall != ' ') { + strcpy(Number, CurrentIncomingCall); + return GE_NONE; + } + else + return GE_BUSY; +} + +GSM_Error N6110_CancelCall(void) +{ +// This frame & method works only on 61xx/51xx +// unsigned char req[] = { N6110_FRAME_HEADER, 0x08, 0x00, 0x85}; +// req[4]=CurrentCallSequenceNumber; +// Protocol->SendMessage(6, 0x01, req); +// return GE_NONE; + + GSM_Error error; + + unsigned char req[]={0x00,0x01,0x7c,0x03}; + + /* Checking */ + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + return NULL_SendMessageSequence (20, &CurrentDialVoiceError, 4, 0x40, req); +} + +void N6110_ReplyEnterSecurityCode(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch(MessageBuffer[3]) { + + case 0x0b: +#ifdef DEBUG + fprintf(stdout, _("Message: Security code accepted.\n")); +#endif /* DEBUG */ + CurrentSecurityCodeError = GE_NONE; + break; + + default: +#ifdef DEBUG + fprintf(stdout, _("Message: Security code is wrong. You're not my big owner :-)\n")); +#endif /* DEBUG */ + CurrentSecurityCodeError = GE_INVALIDSECURITYCODE; + } +} + +GSM_Error N6110_EnterSecurityCode(GSM_SecurityCode SecurityCode) +{ + + unsigned char req[15] = { N6110_FRAME_HEADER, + 0x0a, /* Enter code request. */ + 0x00 /* Type of the entered code. */ + }; + int i=0; + + req[4]=SecurityCode.Type; + + for (i=0; iType==MessageBuffer[3] /* We wanted this code */ + && MessageBuffer[4]==1) { /* It's allowed */ + if (MessageBuffer[3]==GSCT_SecurityCode) { + for (i=0;i<5;i++) {CurrentSecurityCode->Code[i]=MessageBuffer[5+i];} + CurrentSecurityCode->Code[5]=0; + } + if (MessageBuffer[3]==GSCT_Pin || MessageBuffer[3]==GSCT_Pin2 || + MessageBuffer[3]==GSCT_Puk || MessageBuffer[3]==GSCT_Puk2) { + for (i=0;i<4;i++) {CurrentSecurityCode->Code[i]=MessageBuffer[5+i];} + CurrentSecurityCode->Code[4]=0; + } + CurrentSecurityCodeError=GE_NONE; + } else + CurrentSecurityCodeError=GE_INVALIDSECURITYCODE; +} + +GSM_Error N6110_GetSecurityCode(GSM_SecurityCode *SecurityCode) +{ + + unsigned char req[4] = { 0x00, + 0x01,0x6e, /* Get code request. */ + 0x00 }; /* Type of the requested code. */ + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + req[3]=SecurityCode->Type; + + CurrentSecurityCode=SecurityCode; + + return NULL_SendMessageSequence + (20, &CurrentSecurityCodeError, 4, 0x40, req); +} + +void N6110_ReplyPlayTone(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: answer for PlayTone frame\n")); +#endif + + CurrentPlayToneError=GE_NONE; +} + +GSM_Error N6110_PlayTone(int Herz, u8 Volume) +{ + unsigned char req[6] = { 0x00,0x01,0x8f, + 0x00, /* Volume */ + 0x00, /* HerzLo */ + 0x00 }; /* HerzHi */ + + GSM_Error error; + + /* PlayTone wasn't used earlier */ + if (CurrentPlayToneError==GE_UNKNOWN) { + if (CurrentConnectionType!=GCT_MBUS) + CurrentDisableKeepAlive=true; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + } + + /* For Herz==255*255 we have silent */ + if (Herz!=255*255) { + req[3]=Volume; + + req[5]=Herz%256; + req[4]=Herz/256; + } else { + req[3]=0; + + req[5]=0; + req[4]=0; + } + +#ifdef WIN32 + /* For Herz==255*255 we have silent and additionaly + we wait for phone answer - it's important for MBUS */ + if (Herz==255*255) { + error=NULL_SendMessageSequence + (20, &CurrentPlayToneError, 6, 0x40, req); + + CurrentPlayToneError=GE_UNKNOWN; + CurrentDisableKeepAlive=false; + + if (error!=GE_NONE) return error; + } else { + Protocol->SendMessage(6,0x40,req); + } +#else + error=NULL_SendMessageSequence + (20, &CurrentPlayToneError, 6, 0x40, req); + + /* For Herz==255*255 we wait for phone answer - it's important for MBUS */ + if (Herz==255*255) { + CurrentPlayToneError=GE_UNKNOWN; + CurrentDisableKeepAlive=false; + } + + if (error!=GE_NONE) return error; + +#endif + + return(GE_NONE); +} + +void N6110_ReplyGetDateTime(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + if (MessageBuffer[4]==0x01) { + DecodeDateTime(MessageBuffer+8, CurrentDateTime); + +#ifdef DEBUG + fprintf(stdout, _("Message: Date and time\n")); + fprintf(stdout, _(" Time: %02d:%02d:%02d\n"), CurrentDateTime->Hour, CurrentDateTime->Minute, CurrentDateTime->Second); + fprintf(stdout, _(" Date: %4d/%02d/%02d\n"), CurrentDateTime->Year, CurrentDateTime->Month, CurrentDateTime->Day); +#endif /* DEBUG */ + + CurrentDateTime->IsSet=true; + } else { + +#ifdef DEBUG + fprintf(stdout, _("Message: Date and time not set in phone\n")); +#endif + + CurrentDateTime->IsSet=false; + } + + CurrentDateTimeError=GE_NONE; +} + +GSM_Error N6110_GetDateTime(GSM_DateTime *date_time) +{ + return N6110_PrivGetDateTime(date_time,0x11); +} + +GSM_Error N6110_PrivGetDateTime(GSM_DateTime *date_time, int msgtype) +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x62}; + + CurrentDateTime=date_time; + + return NULL_SendMessageSequence + (50, &CurrentDateTimeError, 4, msgtype, req); +} + +void N6110_ReplyGetAlarm(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: Alarm\n")); + fprintf(stdout, _(" Alarm: %02d:%02d\n"), MessageBuffer[9], MessageBuffer[10]); + fprintf(stdout, _(" Alarm is %s\n"), (MessageBuffer[8]==2) ? _("on"):_("off")); +#endif /* DEBUG */ + + CurrentAlarm->Hour=MessageBuffer[9]; + CurrentAlarm->Minute=MessageBuffer[10]; + CurrentAlarm->Second=0; + + CurrentAlarm->IsSet=(MessageBuffer[8]==2); + + CurrentAlarmError=GE_NONE; +} + +GSM_Error N6110_GetAlarm(int alarm_number, GSM_DateTime *date_time) +{ + return N6110_PrivGetAlarm(alarm_number,date_time,0x11); +} + +GSM_Error N6110_PrivGetAlarm(int alarm_number, GSM_DateTime *date_time, int msgtype) +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x6d}; + + CurrentAlarm=date_time; + + return NULL_SendMessageSequence + (50, &CurrentAlarmError, 4, msgtype, req); +} + +void N6110_ReplyGetSMSCenter(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + case 0x34: + + CurrentMessageCenter->No=MessageBuffer[4]; + CurrentMessageCenter->Format=MessageBuffer[6]; + CurrentMessageCenter->Validity=MessageBuffer[8]; + sprintf(CurrentMessageCenter->Name, "%s", MessageBuffer+33); + + sprintf(CurrentMessageCenter->DefaultRecipient, "%s", GSM_UnpackSemiOctetNumber(MessageBuffer+9,false)); + + sprintf(CurrentMessageCenter->Number, "%s", GSM_UnpackSemiOctetNumber(MessageBuffer+21,false)); + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Center received:\n")); + fprintf(stdout, _(" %d. SMS Center name is %s\n"), CurrentMessageCenter->No, CurrentMessageCenter->Name); + fprintf(stdout, _(" SMS Center number is %s\n"), CurrentMessageCenter->Number); + fprintf(stdout, _(" Default recipient number is %s\n"), CurrentMessageCenter->DefaultRecipient); + + fprintf(stdout, _(" SMS Center message format is ")); + + switch (CurrentMessageCenter->Format) { + + case GSMF_Text : fprintf(stdout, _("Text")); break; + case GSMF_Paging: fprintf(stdout, _("Paging")); break; + case GSMF_Fax : fprintf(stdout, _("Fax")); break; + case GSMF_Email : fprintf(stdout, _("Email")); break; + default : fprintf(stdout, _("Unknown")); + } + + fprintf(stdout, "\n"); + + fprintf(stdout, _(" SMS Center message validity is ")); + + switch (CurrentMessageCenter->Validity) { + + case GSMV_1_Hour : fprintf(stdout, _("1 hour")); break; + case GSMV_6_Hours : fprintf(stdout, _("6 hours")); break; + case GSMV_24_Hours: fprintf(stdout, _("24 hours")); break; + case GSMV_72_Hours: fprintf(stdout, _("72 hours")); break; + case GSMV_1_Week : fprintf(stdout, _("1 week")); break; + case GSMV_Max_Time: fprintf(stdout, _("Maximum time"));break; + default : fprintf(stdout, _("Unknown")); + } + + fprintf(stdout, "\n"); + +#endif /* DEBUG */ + + CurrentMessageCenterError=GE_NONE; + + break; + + case 0x35: + + /* Number of entries depends on SIM card */ + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Center error received:\n")); + fprintf(stdout, _(" The request for SMS Center failed.\n")); +#endif /* DEBUG */ + + /* FIXME: appropriate error. */ + CurrentMessageCenterError=GE_INTERNALERROR; + + break; + + } +} + +/* This function sends to the mobile phone a request for the SMS Center */ +GSM_Error N6110_GetSMSCenter(GSM_MessageCenter *MessageCenter) +{ + unsigned char req[] = { N6110_FRAME_HEADER, 0x33, 0x64, + 0x00 /* SMS Center Number. */ + }; + + req[5]=MessageCenter->No; + + CurrentMessageCenter=MessageCenter; + + return NULL_SendMessageSequence + (50, &CurrentMessageCenterError, 6, 0x02, req); +} + +void N6110_ReplySetSMSCenter(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Center correctly set.\n")); +#endif + CurrentMessageCenterError=GE_NONE; +} + +/* This function set the SMS Center profile on the phone. */ +GSM_Error N6110_SetSMSCenter(GSM_MessageCenter *MessageCenter) +{ + unsigned char req[64] = { N6110_FRAME_HEADER, 0x30, 0x64, + 0x00, /* SMS Center Number. */ + 0x00, /* Unknown. */ + 0x00, /* SMS Message Format. */ + 0x00, /* Unknown. */ + 0x00, /* Validity. */ + 0,0,0,0,0,0,0,0,0,0,0,0, /* Default recipient number */ + 0,0,0,0,0,0,0,0,0,0,0,0 /* Message Center Number. */ + /* Message Center Name. */ + }; + + req[5]=MessageCenter->No; + req[7]=MessageCenter->Format; + req[9]=MessageCenter->Validity; + + req[10]=GSM_PackSemiOctetNumber(MessageCenter->DefaultRecipient, req+11, false); + + req[22]=GSM_PackSemiOctetNumber(MessageCenter->Number, req+23, false); + + sprintf(req+34, "%s", MessageCenter->Name); + + CurrentMessageCenter=MessageCenter; + + return NULL_SendMessageSequence + (50, &CurrentMessageCenterError, 35+strlen(MessageCenter->Name), 0x02, req); +} + +void N6110_ReplyGetSMSStatus(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + case 0x37: + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Status Received\n")); + fprintf(stdout, _(" The number of messages: %d\n"), MessageBuffer[10]); + fprintf(stdout, _(" Unread messages: %d\n"), MessageBuffer[11]); +#endif /* DEBUG */ + + CurrentSMSStatus->UnRead = MessageBuffer[11]; + CurrentSMSStatus->Number = MessageBuffer[10]; + + CurrentSMSStatusError = GE_NONE; + break; + + case 0x38: + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Status error, probably not authorized by PIN\n")); +#endif /* DEBUG */ + + CurrentSMSStatusError = GE_INTERNALERROR; + break; + + } +} + +GSM_Error N6110_GetSMSStatus(GSM_SMSStatus *Status) +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x36, 0x64}; + + CurrentSMSStatus = Status; + + return NULL_SendMessageSequence + (10, &CurrentSMSStatusError, 5, 0x14, req); +} + +GSM_Error N6110_GetSMSFolders ( GSM_SMSFolders *folders) +{ + folders->number=2; + + strcpy(folders->Folder[0].Name,"Inbox"); + strcpy(folders->Folder[1].Name,"Outbox"); + + return GE_NONE; +} + +GSM_Error N6110_GetIMEI(char *imei) +{ + if (strlen(Current_IMEI)>0) { + strncpy (imei, Current_IMEI, GSM_MAX_IMEI_LENGTH); + return (GE_NONE); + } + else + return (GE_TRYAGAIN); +} + +GSM_Error N6110_GetRevision(char *revision) +{ + + if (strlen(Current_Revision)>0) { + strncpy (revision, Current_Revision, GSM_MAX_REVISION_LENGTH); + return (GE_NONE); + } + else + return (GE_TRYAGAIN); +} + +GSM_Error N6110_GetModel(char *model) +{ + if (strlen(Current_Model)>0) { + strncpy (model, Current_Model, GSM_MAX_MODEL_LENGTH); + return (GE_NONE); + } + else + return (GE_TRYAGAIN); +} + +void N6110_ReplySetDateTime(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[4]) { + + case 0x01: +#ifdef DEBUG + fprintf(stdout, _("Message: Date and time set correctly\n")); +#endif /* DEBUG */ + CurrentSetDateTimeError=GE_NONE; + break; + + default: +#ifdef DEBUG + fprintf(stdout, _("Message: Date and time setting error\n")); +#endif /* DEBUG */ + CurrentSetDateTimeError=GE_INVALIDDATETIME; + + } +} + +/* Needs SIM card with PIN in phone */ +GSM_Error N6110_SetDateTime(GSM_DateTime *date_time) +{ + return N6110_PrivSetDateTime(date_time,0x11); +} + +/* Needs SIM card with PIN in phone */ +GSM_Error N6110_PrivSetDateTime(GSM_DateTime *date_time, int msgtype) +{ + + unsigned char req[] = { N6110_FRAME_HEADER, + 0x60, /* set-time subtype */ + 0x01, 0x01, 0x07, /* unknown */ + 0x00, 0x00, /* Year (0x07cf = 1999) */ + 0x00, 0x00, /* Month Day */ + 0x00, 0x00, /* Hours Minutes */ + 0x00 /* Unknown, but not seconds - try 59 and wait 1 sec. */ + }; + + EncodeDateTime(req+7, date_time); + + return NULL_SendMessageSequence + (20, &CurrentSetDateTimeError, 14, msgtype, req); +} + +void N6110_ReplySetAlarm(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[4]) { + + case 0x01: +#ifdef DEBUG + fprintf(stdout, _("Message: Alarm set correctly\n")); +#endif /* DEBUG */ + CurrentSetAlarmError=GE_NONE; + break; + + default: +#ifdef DEBUG + fprintf(stdout, _("Message: Alarm setting error\n")); +#endif /* DEBUG */ + CurrentSetAlarmError=GE_INVALIDDATETIME; + + } +} + +/* FIXME: we should also allow to set the alarm off :-) */ +GSM_Error N6110_SetAlarm(int alarm_number, GSM_DateTime *date_time) +{ + return N6110_PrivSetAlarm(alarm_number,date_time, 0x11); +} + +/* FIXME: we should also allow to set the alarm off :-) */ +GSM_Error N6110_PrivSetAlarm(int alarm_number, GSM_DateTime *date_time, int msgtype) +{ + + unsigned char req[] = { N6110_FRAME_HEADER, + 0x6b, /* set-alarm subtype */ + 0x01, 0x20, 0x03, /* unknown */ + 0x02, /* should be alarm on/off, but it don't works */ + 0x00, 0x00, /* Hours Minutes */ + 0x00 /* Unknown, but not seconds - try 59 and wait 1 sec. */ + }; + + req[8] = date_time->Hour; + req[9] = date_time->Minute; + + return NULL_SendMessageSequence + (50, &CurrentSetAlarmError, 11, msgtype, req); +} + +void N6110_ReplyGetMemoryLocation(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + /* Hopefully is 64 larger as FB38_MAX* / N6110_MAX* */ + char model[64]; + + int i, tmp, count; + + switch (MessageBuffer[3]) { + + case 0x02: + + CurrentPhonebookEntry->Empty = true; + + count=MessageBuffer[5]; + +#ifdef DEBUG + fprintf(stdout, _("Message: Phonebook entry received:\n")); + fprintf(stdout, _(" Name: ")); + + for (tmp=0; tmp Name, MessageBuffer+6, count/2); + CurrentPhonebookEntry->Name[count/2] = 0x00; + } else { + memcpy(CurrentPhonebookEntry->Name, MessageBuffer + 6, count); + CurrentPhonebookEntry->Name[count] = 0x00; + } + + CurrentPhonebookEntry->Empty = false; + + for (tmp=0; tmp Name[tmp/2]='~'; //enables/disables blinking + if (tmp%2!=0 && MessageBuffer[6+tmp]==0) CurrentPhonebookEntry->Name[tmp/2]='`'; //hides rest ot contents + } else { + if (MessageBuffer[6+tmp]==1) CurrentPhonebookEntry->Name[tmp]='~'; //enables/disables blinking + if (MessageBuffer[6+tmp]==0) CurrentPhonebookEntry->Name[tmp]='`'; //hides rest ot contents + } + } + + i=7+count; + count=MessageBuffer[6+count]; + +#ifdef DEBUG + fprintf(stdout, _(" Number: ")); + + for (tmp=0; tmp Number, MessageBuffer + i, count); + CurrentPhonebookEntry->Number[count] = 0x00; + CurrentPhonebookEntry->Group = MessageBuffer[i+count]; + + /* Phone doesn't have entended phonebook */ + CurrentPhonebookEntry->SubEntriesCount = 0; + + /* But for these memories data is saved and we can save it using 7110/6210 style */ + if (CurrentPhonebookEntry->MemoryType==GMT_DC || + CurrentPhonebookEntry->MemoryType==GMT_RC || + CurrentPhonebookEntry->MemoryType==GMT_MC) { + CurrentPhonebookEntry->SubEntriesCount = 1; + CurrentPhonebookEntry->SubEntries[0].EntryType=N7110_ENTRYTYPE_DATE; + CurrentPhonebookEntry->SubEntries[0].NumberType=0; + CurrentPhonebookEntry->SubEntries[0].BlockNumber=1; + DecodeDateTime(MessageBuffer+(i+count+2),&CurrentPhonebookEntry->SubEntries[0].data.Date); + +#ifdef DEBUG + fprintf(stdout, _(" Date: ")); + fprintf(stdout, "%02u.%02u.%04u\n", + CurrentPhonebookEntry->SubEntries[0].data.Date.Day, + CurrentPhonebookEntry->SubEntries[0].data.Date.Month, + CurrentPhonebookEntry->SubEntries[0].data.Date.Year); + fprintf(stdout, _(" Time: ")); + fprintf(stdout, "%02u:%02u:%02u\n", + CurrentPhonebookEntry->SubEntries[0].data.Date.Hour, + CurrentPhonebookEntry->SubEntries[0].data.Date.Minute, + CurrentPhonebookEntry->SubEntries[0].data.Date.Second); +#endif /* DEBUG */ + + /* These values are set, when date and time unavailable in phone. + Values from 3310 - in other can be different */ + if (CurrentPhonebookEntry->SubEntries[0].data.Date.Day==20 && + CurrentPhonebookEntry->SubEntries[0].data.Date.Month==1 && + CurrentPhonebookEntry->SubEntries[0].data.Date.Year==2118 && + CurrentPhonebookEntry->SubEntries[0].data.Date.Hour==3 && + CurrentPhonebookEntry->SubEntries[0].data.Date.Minute==14 && + CurrentPhonebookEntry->SubEntries[0].data.Date.Second==7) + CurrentPhonebookEntry->SubEntriesCount = 0; + } + + /* Signal no error to calling code. */ + CurrentPhonebookError = GE_NONE; + + break; + + case 0x03: + +#ifdef DEBUG + fprintf(stdout, _("Message: Phonebook read entry error received:\n")); +#endif /* DEBUG */ + + switch (MessageBuffer[4]) { + + case 0x7d: +#ifdef DEBUG + fprintf(stdout, _(" Invalid memory type!\n")); +#endif /* DEBUG */ + CurrentPhonebookError = GE_INVALIDMEMORYTYPE; + break; + + default: +#ifdef DEBUG + fprintf(stdout, _(" Unknown error!\n")); +#endif /* DEBUG */ + CurrentPhonebookError = GE_INTERNALERROR; + } + + break; + + } +} + +/* Routine to get specifed phone book location. Designed to be called by + application. Will block until location is retrieved or a timeout/error + occurs. */ +GSM_Error N6110_GetMemoryLocation(GSM_PhonebookEntry *entry) +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x01, 0x00, 0x00, 0x00}; + + CurrentPhonebookEntry = entry; + + req[4] = N6110_GetMemoryType(entry->MemoryType); + req[5] = entry->Location; + + return NULL_SendMessageSequence + (50, &CurrentPhonebookError, 7, 0x03, req); +} + +void N6110_ReplyWritePhonebookLocation(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + case 0x05: + +#ifdef DEBUG + fprintf(stdout, _("Message: Phonebook written correctly.\n")); +#endif /* DEBUG */ + CurrentPhonebookError = GE_NONE; + break; + + case 0x06: + + switch (MessageBuffer[4]) { + /* FIXME: other errors? When I send the phonebook with index of 350 it + still report error 0x7d :-( */ + case 0x7d: +#ifdef DEBUG + fprintf(stdout, _("Message: Phonebook not written - name is too long.\n")); +#endif /* DEBUG */ + CurrentPhonebookError = GE_PHBOOKNAMETOOLONG; + break; + + default: +#ifdef DEBUG + fprintf(stdout, _(" Unknown error!\n")); +#endif /* DEBUG */ + CurrentPhonebookError = GE_INTERNALERROR; + } + } +} + +/* Routine to write phonebook location in phone. Designed to be called by + application code. Will block until location is written or timeout + occurs. */ +GSM_Error N6110_WritePhonebookLocation(GSM_PhonebookEntry *entry) +{ + unsigned char req[128] = { N6110_FRAME_HEADER, 0x04, 0x00, 0x00 }; + int i=0, current=0; + + req[4] = N6110_GetMemoryType(entry->MemoryType); + req[5] = entry->Location; + + current=7; + + if (GetModelFeature (FN_PHONEBOOK)==F_PBK33INT || + GetModelFeature (FN_PHONEBOOK)==F_PBK33SIM) { + + req[6] = strlen(entry->Name)*2; + + EncodeUnicode (req+current,entry->Name ,strlen(entry->Name)); + + for (i=0; iName); i++) + { + /* here we encode "special" chars */ + if (entry->Name[i]=='~') req[current+i*2]=1; //enables/disables blinking + if (entry->Name[i]=='`') req[current+i*2]=0; //hides rest ot contents + } + + current+=strlen(entry->Name)*2; + } else { + + req[6] = strlen(entry->Name); + + for (i=0; iName); i++) + { + req[current+i] = entry->Name[i]; + + /* here we encode "special" chars */ + if (entry->Name[i]=='~') req[current+i]=1; //enables/disables blinking + if (entry->Name[i]=='`') req[current+i]=0; //hides rest ot contents + } + + current+=strlen(entry->Name); + } + + req[current++]=strlen(entry->Number); + + for (i=0; iNumber); i++) + req[current+i] = entry->Number[i]; + + current+=strlen(entry->Number); + + /* Jano: This allow to save 14 characters name into SIM memory, when + No Group is selected. */ + if (entry->Group == 5) + req[current++]=0xff; + else + req[current++]=entry->Group; + + return NULL_SendMessageSequence + (50, &CurrentPhonebookError, current, 0x03, req); +} + +void N6110_ReplyNetmonitor(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch(MessageBuffer[3]) { + + case 0x00: +#ifdef DEBUG + fprintf(stdout, _("Message: Netmonitor correctly set.\n")); +#endif /* DEBUG */ + CurrentNetmonitorError=GE_NONE; + break; + + default: +#ifdef DEBUG + fprintf(stdout, _("Message: Netmonitor menu %d received:\n"), MessageBuffer[3]); + fprintf(stdout, "%s\n", MessageBuffer+4); +#endif /* DEBUG */ + + strcpy(CurrentNetmonitor, MessageBuffer+4); + + CurrentNetmonitorError=GE_NONE; + } +} + +GSM_Error N6110_NetMonitor(unsigned char mode, char *Screen) +{ + unsigned char req[] = { 0x00, 0x01, 0x7e, 0x00 }; + + GSM_Error error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + CurrentNetmonitor=Screen; + + req[3]=mode; + + return NULL_SendMessageSequence + (20, &CurrentNetmonitorError, 4, 0x40, req); +} + +/* Doesn't work in N3210. */ +/* In other allow to access phone menu without SIM card (just send any sequence) */ +GSM_Error N6110_SendDTMF(char *String) +{ + unsigned char req[64] = { N6110_FRAME_HEADER, 0x50, + 0x00 /* Length of DTMF string. */ + }; + + u8 length=strlen(String); + + if (length>59) length=59; + + req[4] = length; + + memcpy(req+5,String,length); + + return NULL_SendMessageSequence + (20, &CurrentSendDTMFError, 5+length, 0x01, req); +} + +void N6110_ReplyGetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + case 0x17: + + switch (MessageBuffer[4]) { + case 0x02: CurrentSpeedDialEntry->MemoryType = GMT_ME; + default : CurrentSpeedDialEntry->MemoryType = GMT_SM; + } + + CurrentSpeedDialEntry->Location = MessageBuffer[5]; + +#ifdef DEBUG + fprintf(stdout, _("Message: Speed dial entry received:\n")); + fprintf(stdout, _(" Location: %d\n"), CurrentSpeedDialEntry->Location); + fprintf(stdout, _(" MemoryType: %s\n"), N6110_MemoryType_String[CurrentSpeedDialEntry->MemoryType]); + fprintf(stdout, _(" Number: %d\n"), CurrentSpeedDialEntry->Number); +#endif /* DEBUG */ + + CurrentSpeedDialError=GE_NONE; + break; + + case 0x18: + +#ifdef DEBUG + fprintf(stdout, _("Message: Speed dial entry error\n")); +#endif /* DEBUG */ + CurrentSpeedDialError=GE_INVALIDSPEEDDIALLOCATION; + break; + + } +} + +GSM_Error N6110_GetSpeedDial(GSM_SpeedDial *entry) +{ + + unsigned char req[] = { N6110_FRAME_HEADER, + 0x16, + 0x00 /* The number of speed dial. */ + }; + + CurrentSpeedDialEntry = entry; + + req[4] = entry->Number; + + return NULL_SendMessageSequence + (20, &CurrentSpeedDialError, 5, 0x03, req); +} + +void N6110_ReplySetSpeedDial(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + case 0x1a: + +#ifdef DEBUG + fprintf(stdout, _("Message: Speed dial entry set.\n")); +#endif /* DEBUG */ + CurrentSpeedDialError=GE_NONE; + break; + + case 0x1b: + +#ifdef DEBUG + fprintf(stdout, _("Message: Speed dial entry setting error.\n")); +#endif /* DEBUG */ + CurrentSpeedDialError=GE_INVALIDSPEEDDIALLOCATION; + break; + + } +} + +GSM_Error N6110_SetSpeedDial(GSM_SpeedDial *entry) +{ + + unsigned char req[] = { N6110_FRAME_HEADER, + 0x19, + 0x00, /* Number */ + 0x00, /* Memory Type */ + 0x00 /* Location */ + }; + + req[4] = entry->Number; + + switch (entry->MemoryType) { + case GMT_ME: req[5] = 0x02; + default : req[5] = 0x03; + } + + req[6] = entry->Location; + + return NULL_SendMessageSequence + (20, &CurrentSpeedDialError, 7, 0x03, req); +} + +/* This function finds parts of SMS in frame used in new Nokia phones + in internal protocols (they're coded according to GSM 03.40), copies them + to GSM_ETSISMSMessage and calls GSM_DecodeETSISMS to decode + GSM_ETSISMSMessage to GSM_SMSMessage structure */ +GSM_Error GSM_DecodeNokiaSMSFrame(GSM_SMSMessage *SMS, unsigned char *req, int length) +{ + SMS_MessageType PDU=SMS_Deliver; + GSM_ETSISMSMessage ETSI; + int offset=0,i; + + ETSI.firstbyte=req[12]; + + /* See GSM 03.40 section 9.2.3.1 */ + if ((ETSI.firstbyte & 0x03) == 0x01) PDU=SMS_Submit; + if ((ETSI.firstbyte & 0x03) == 0x02) PDU=SMS_Status_Report; + + switch (PDU) { + case SMS_Submit : offset=5;break; + case SMS_Deliver : offset=4;break; + case SMS_Status_Report: offset=3;break; + default: break; + } + + for (i=0;iName[0]=0; + + return GE_NONE; +} + +void N6110_ReplyGetSMSMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int offset; + + switch (MessageBuffer[3]) { + + case 0x08: + + switch (MessageBuffer[7]) { + + case 0x00: + CurrentSMSMessage->Type = GST_SMS; + CurrentSMSMessage->folder=GST_INBOX; + offset=4; + break; + + case 0x01: + CurrentSMSMessage->Type = GST_DR; + CurrentSMSMessage->folder=GST_INBOX; + offset=3; + break; + + case 0x02: + CurrentSMSMessage->Type = GST_SMS; + CurrentSMSMessage->folder=GST_OUTBOX; + offset=5; + break; + + default: + CurrentSMSMessage->Type = GST_UN; + offset=4; + break; + + } + + /* Field Short Message Status - MessageBuffer[4] seems not to be + compliant with GSM 07.05 spec. + Meaning Nokia protocol GMS spec + ---------------------------------------------------- + MO Sent 0x05 0x07 or 0x01 + MO Not sent 0x07 0x06 or 0x00 + MT Read 0x01 0x05 or 0x01 + MT Not read 0x03 0x04 or 0x00 + ---------------------------------------------------- + See GSM 07.05 section 2.5.2.6 and correct me if I'm wrong. + + Pawel Kot */ + + if (MessageBuffer[4] & 0x02) CurrentSMSMessage->Status = GSS_NOTSENTREAD; + else CurrentSMSMessage->Status = GSS_SENTREAD; + +#ifdef DEBUG + fprintf(stdout, _("Number: %d\n"), MessageBuffer[6]); + + if (CurrentSMSMessage->folder!=1) { //GST_OUTBOX + fprintf(stdout, _("Message: Received SMS (mobile terminated)\n")); + } else { + fprintf(stdout, _("Message: Outbox message (mobile originated)\n")); + } + + if (CurrentSMSMessage->Type == GST_DR) fprintf(stdout, _(" Delivery Report\n")); + if (CurrentSMSMessage->Type == GST_UN) fprintf(stdout, _(" Unknown type\n")); + + if (CurrentSMSMessage->folder==1) { //GST_OUTBOX + if (CurrentSMSMessage->Status) fprintf(stdout, _(" Sent\n")); + else fprintf(stdout, _(" Not sent\n")); + } else { + if (CurrentSMSMessage->Status) fprintf(stdout, _(" Read\n")); + else fprintf(stdout, _(" Not read\n")); + } +#endif + + CurrentSMSPointer=GSM_DecodeNokiaSMSFrame(CurrentSMSMessage, MessageBuffer+8, MessageLength-8); + + CurrentSMSMessage->MemoryType = MessageBuffer[5]; + CurrentSMSMessage->MessageNumber = MessageBuffer[6]; + + /* Signal no error to calling code. */ + CurrentSMSMessageError = GE_NONE; + +#ifdef DEBUG + fprintf(stdout, "\n"); +#endif + + break; + + case 0x09: + + /* We have requested invalid or empty location. */ + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS reading failed\n")); + + switch (MessageBuffer[4]) { + case 0x02:fprintf(stdout, _(" Invalid location!\n"));break; + case 0x07:fprintf(stdout, _(" Empty SMS location.\n"));break; + case 0x0c:fprintf(stdout, _(" No access to memory (no PIN on card ?)\n"));break; + default :fprintf(stdout, _(" Error code %i - please report it \n"),MessageBuffer[4]);break; + } +#endif /* DEBUG */ + + switch (MessageBuffer[4]) { + case 0x02:CurrentSMSMessageError = GE_INVALIDSMSLOCATION;break; + case 0x07:CurrentSMSMessageError = GE_EMPTYSMSLOCATION;break; + case 0x0c:CurrentSMSMessageError = GE_NOACCESS;break; + default :CurrentSMSMessageError = GE_UNKNOWN;break; + } + + break; + + } +} + +GSM_Error N6110_GetSMSMessage(GSM_SMSMessage *message) +{ + + unsigned char req[] = { N6110_FRAME_HEADER, + 0x07, + 0x02, /* Unknown */ + 0x00, /* Location */ + 0x01, 0x64}; + + int timeout = 60; + + /* State machine code writes data to these variables when it comes in. */ + + CurrentSMSMessage = message; + CurrentSMSMessageError = GE_BUSY; + + req[5] = message->Location; + + /* Send request */ + Protocol->SendMessage(8, 0x02, req); + + /* Wait for timeout or other error. */ + while (timeout != 0 && (CurrentSMSMessageError == GE_BUSY || CurrentSMSMessageError == GE_SMSWAITING)) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + return (CurrentSMSMessageError); +} + +void N6110_ReplyDeleteSMSMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS deleted successfully.\n")); +#endif /* DEBUG */ + + CurrentSMSMessageError = GE_NONE; +} + +GSM_Error N6110_DeleteSMSMessage(GSM_SMSMessage *message) +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x0a, 0x02, 0x00}; + + req[5] = message->Location; + + return NULL_SendMessageSequence + (50, &CurrentSMSMessageError, 6, 0x14, req); +} + +/* FIXME: do we need more than SMS_Submit and SMS_Deliver ? */ +GSM_Error GSM_EncodeNokiaSMSFrame(GSM_SMSMessage *SMS, unsigned char *req, int *length, SMS_MessageType PDU) +{ + GSM_ETSISMSMessage ETSI; + int i,offset=0; + + GSM_EncodeETSISMS(SMS, &ETSI, PDU, length); + + /* Cleaning */ + for (i=0;i<36;i++) req[i]=0; + + req[12]=ETSI.firstbyte; + + for (i=0;iMessageNumber=MessageBuffer[5]; + + CurrentSMSMessageError = GE_NONE; + break; + + case 0x06: +#ifdef DEBUG + fprintf(stdout, _("SMS saving failed\n")); + switch (MessageBuffer[4]) { + case 0x02:fprintf(stdout, _(" All locations busy.\n"));break; + case 0x03:fprintf(stdout, _(" Invalid location!\n"));break; + default :fprintf(stdout, _(" Unknown error.\n"));break; + } +#endif + + switch (MessageBuffer[4]) { + case 0x02:CurrentSMSMessageError = GE_MEMORYFULL;break; + case 0x03:CurrentSMSMessageError = GE_INVALIDSMSLOCATION;break; + default :CurrentSMSMessageError = GE_UNKNOWN;break; + } + } +} + +/* GST_DR and GST_UN not supported ! */ +GSM_Error N6110_SaveSMSMessage(GSM_SMSMessage *SMS) +{ + unsigned char req[256] = { + N6110_FRAME_HEADER, 0x04, /* SMS save request*/ + 0x00, /* SMS Status. Different for Inbox and Outbox */ + 0x02, /* ?? */ + 0x00, /* SMS Location */ + 0x02, /* SMS Type */ + }; + + int length; + SMS_MessageType PDU; + GSM_Error error; + + if (SMS->Location) req[6] = SMS->Location; + + if (SMS->folder==0) { /*Inbox*/ + req[4]=1; /* SMS Status */ + req[7] = 0x00; /* SMS Type */ + PDU=SMS_Deliver; + } else { + req[4]=5; /* SMS Status */ + req[7] = 0x02; /* SMS Type */ + PDU=SMS_Submit; + } + + if (SMS->Status == GSS_NOTSENTREAD) req[4] |= 0x02; + + error=GSM_EncodeNokiaSMSFrame(SMS, req+8, &length, PDU); + if (error != GE_NONE) return error; + + CurrentSMSMessage = SMS; + + return NULL_SendMessageSequence + (70, &CurrentSMSMessageError, 39+length, 0x14, req); +} + +void N6110_ReplySetCellBroadcast(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: Cell Broadcast enabled/disabled successfully.\n")); fflush (stdout); +#endif + + CurrentCBError = GE_NONE; +} + +/* Enable and disable Cell Broadcasting */ +GSM_Error N6110_EnableCellBroadcast(void) +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x20, + 0x01, 0x01, 0x00, 0x00, 0x01, 0x01}; + +#ifdef DEBUG + fprintf (stdout,"Enabling CB\n"); +#endif + + CurrentCBMessage = (GSM_CBMessage *)malloc(sizeof (GSM_CBMessage)); + CurrentCBMessage->Channel = 0; + CurrentCBMessage->New = false; + strcpy (CurrentCBMessage->Message,""); + + return NULL_SendMessageSequence + (10, &CurrentCBError, 10, 0x02, req); +} + + +GSM_Error N6110_DisableCellBroadcast(void) +{ + /* Should work, but not tested fully */ + + unsigned char req[] = {N6110_FRAME_HEADER, 0x20, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; /*VERIFY*/ + + return NULL_SendMessageSequence + (10, &CurrentCBError, 10, 0x02, req); +} + +void N6110_ReplyReadCellBroadcast(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i, tmp; + unsigned char output[160]; + + CurrentCBMessage->Channel = MessageBuffer[7]; + CurrentCBMessage->New = true; + tmp=GSM_UnpackEightBitsToSeven(0, MessageBuffer[9], MessageBuffer[9], MessageBuffer+10, output); + +#ifdef DEBUG + fprintf(stdout, _("Message: CB received.\n")); fflush (stdout); + + fprintf(stdout, _("Message: channel number %i\n"),MessageBuffer[7]); + + fflush (stdout); + + for (i=0; iMessage[i] = DecodeWithDefaultAlphabet(output[i]); + } + CurrentCBMessage->Message[i]=0; +} + +GSM_Error N6110_ReadCellBroadcast(GSM_CBMessage *Message) +{ +#ifdef DEBUG + fprintf(stdout,"Reading CB\n"); +#endif + + if (CurrentCBMessage != NULL) + { + if (CurrentCBMessage->New == true) + { +#ifdef DEBUG + fprintf(stdout,"New CB received\n"); +#endif + Message->Channel = CurrentCBMessage->Channel; + strcpy(Message->Message,CurrentCBMessage->Message); + CurrentCBMessage->New = false; + return (GE_NONE); + } + } + return (GE_NONEWCBRECEIVED); +} + +int N6110_MakeCallerGroupFrame(unsigned char *req,GSM_Bitmap Bitmap) +{ + int count=0; + + req[count++]=Bitmap.number; + req[count++]=strlen(Bitmap.text); + memcpy(req+count,Bitmap.text,req[count-1]); + count+=req[count-1]; + req[count++]=Bitmap.ringtone; + + /* Setting for graphic: + 0x00 - Off + 0x01 - On + 0x02 - View Graphics + 0x03 - Send Graphics + 0x04 - Send via IR + You can even set it higher but Nokia phones (my + 6110 at least) will not show you the name of this + item in menu ;-)) Nokia is really joking here. */ + if (Bitmap.enabled) req[count++]=0x01; + else req[count++]=0x00; + + req[count++]=(Bitmap.size+4)>>8; + req[count++]=(Bitmap.size+4)%0xff; + req[count++]=0x00; /* Future extensions! */ + req[count++]=Bitmap.width; + req[count++]=Bitmap.height; + req[count++]=0x01; /* Just BW */ + memcpy(req+count,Bitmap.bitmap,Bitmap.size); + + return count+Bitmap.size; +} + +int N6110_MakeOperatorLogoFrame(unsigned char *req,GSM_Bitmap Bitmap) +{ + int count=0; + + EncodeNetworkCode(req+count, Bitmap.netcode); + count=count+3; + + req[count++]=(Bitmap.size+4)>>8; + req[count++]=(Bitmap.size+4)%0xff; + req[count++]=0x00; /* Infofield */ + req[count++]=Bitmap.width; + req[count++]=Bitmap.height; + req[count++]=0x01; /* Just BW */ + memcpy(req+count,Bitmap.bitmap,Bitmap.size); + + return count+Bitmap.size; +} + +int N6110_MakeStartupLogoFrame(unsigned char *req,GSM_Bitmap Bitmap) +{ + int count=0; + + req[count++]=0x01; + req[count++]=Bitmap.height; + req[count++]=Bitmap.width; + memcpy(req+count,Bitmap.bitmap,Bitmap.size); + + return count+Bitmap.size; +} + +/* Set a bitmap or welcome-note */ +GSM_Error N6110_SetBitmap(GSM_Bitmap *Bitmap) { + + unsigned char req[600] = { N6110_FRAME_HEADER }; + u16 count=3; + u8 textlen; + + int timeout=50; + + /* Direct uploading variables */ + GSM_MultiSMSMessage SMS; + unsigned char buffer[1000] = {0x0c,0x01}; + GSM_NetworkInfo NetworkInfo; + + GSM_Error error; + + /* Uploading with preview */ + if (Bitmap->number==255 && + (Bitmap->type==GSM_OperatorLogo || Bitmap->type==GSM_CallerLogo)) { + GSM_SaveBitmapToSMS(&SMS,Bitmap,false,false); + memcpy(buffer+2,SMS.SMS[0].UDH,SMS.SMS[0].UDH[0]+1); + + memcpy(buffer+2+SMS.SMS[0].UDH[0]+1,SMS.SMS[0].MessageText,SMS.SMS[0].Length); + + buffer[2+SMS.SMS[0].UDH[0]+1+SMS.SMS[0].Length]=0x00; + + Protocol->SendMessage(2+SMS.SMS[0].UDH[0]+1+SMS.SMS[0].Length+1, 0x12, buffer); + + GSM->GetNetworkInfo(&NetworkInfo); //need to make something + return GE_NONE; //no answer from phone + } + + CurrentSetBitmapError = GE_BUSY; + + switch (Bitmap->type) { + case GSM_WelcomeNoteText: + case GSM_DealerNoteText: + req[count++]=0x18; + req[count++]=0x01; /* Only one block */ + + if (Bitmap->type==GSM_WelcomeNoteText) + req[count++]=0x02; /* Welcome text */ + else + req[count++]=0x03; /* Dealer Welcome Note */ + + textlen=strlen(Bitmap->text); + req[count++]=textlen; + memcpy(req+count,Bitmap->text,textlen); + + count+=textlen; + + Protocol->SendMessage(count, 0x05, req); + + break; + + case GSM_StartupLogo: + if (Bitmap->number==0) { + + /* For 33xx we first set animated logo to default */ + if (GetModelFeature (FN_STARTUP)==F_STANIM) { + error=N6110_SetProfileFeature(0, 0x29, Bitmap->number); + if (error!=GE_NONE) return error; + } + + req[count++]=0x18; + req[count++]=0x01; /* Only one block */ + count=count+N6110_MakeStartupLogoFrame(req+5,*Bitmap); + Protocol->SendMessage(count, 0x05, req); + } else { + return N6110_SetProfileFeature(0, 0x29, Bitmap->number); + } + break; + + case GSM_OperatorLogo: + req[count++]=0x30; /* Store Op Logo */ + req[count++]=0x01; /* Location */ + count=count+N6110_MakeOperatorLogoFrame(req+5,*Bitmap); + Protocol->SendMessage(count, 0x05, req); + break; + + case GSM_CallerLogo: + req[count++]=0x13; + count=count+N6110_MakeCallerGroupFrame(req+4,*Bitmap); + Protocol->SendMessage(count, 0x03, req); + break; + + case GSM_PictureImage: + req[count++]=0x03; + req[count++]=Bitmap->number; + if (strcmp(Bitmap->Sender,"")) { + req[count]=GSM_PackSemiOctetNumber(Bitmap->Sender, req+count+1,true); + + /* Convert number of semioctets to number of chars and add count */ + textlen=req[count]; + if (textlen % 2) textlen++; + count+=textlen / 2 + 1; + + count++; + } else { + req[count++]=0x00; + req[count++]=0x00; + } + req[count++]=0x00; + req[count++]=strlen(Bitmap->text); + memcpy(req+count,Bitmap->text,strlen(Bitmap->text)); + count+=strlen(Bitmap->text); + req[count++]=0x00; + req[count++]=Bitmap->width; + req[count++]=Bitmap->height; + req[count++]=0x01; + memcpy(req+count,Bitmap->bitmap,Bitmap->size); + Protocol->SendMessage(count+Bitmap->size, 0x47, req); + break; + + case GSM_7110OperatorLogo: + case GSM_7110StartupLogo: + case GSM_6210StartupLogo: + return GE_NOTSUPPORTED; + + case GSM_None: + return GE_NONE; + } + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentSetBitmapError == GE_BUSY ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + return CurrentSetBitmapError; +} + +/* Get a bitmap from the phone */ +GSM_Error N6110_GetBitmap(GSM_Bitmap *Bitmap) { + + unsigned char req[10] = { N6110_FRAME_HEADER }; + u8 count=3; + + int timeout=100; + + CurrentGetBitmap=Bitmap; + CurrentGetBitmapError = GE_BUSY; + + switch (CurrentGetBitmap->type) { + case GSM_StartupLogo: + case GSM_WelcomeNoteText: + case GSM_DealerNoteText: + req[count++]=0x16; + Protocol->SendMessage(count, 0x05, req); + break; + case GSM_OperatorLogo: + req[count++]=0x33; + req[count++]=0x01; /* Location 1 */ + Protocol->SendMessage(count, 0x05, req); + break; + case GSM_CallerLogo: + req[count++]=0x10; + req[count++]=Bitmap->number; + Protocol->SendMessage(count, 0x03, req); + break; + case GSM_PictureImage: + req[count++]=0x01; + req[count++]=Bitmap->number; + Protocol->SendMessage(count, 0x47, req); + break; + case GSM_7110OperatorLogo: + case GSM_7110StartupLogo: + case GSM_6210StartupLogo: + default: + return GE_NOTSUPPORTED; + } + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentGetBitmapError == GE_BUSY ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + CurrentGetBitmap=NULL; + + return CurrentGetBitmapError; +} + +void N6110_ReplySetRingtone(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[3]) { + + /* Set ringtone OK */ + case 0x37: +#ifdef DEBUG + fprintf(stdout, _("Message: Ringtone set OK!\n")); +#endif + CurrentRingtoneError=GE_NONE; + break; + + /* Set ringtone error */ + case 0x38: +#ifdef DEBUG + fprintf(stdout, _("Message: Ringtone setting error !\n")); +#endif + CurrentRingtoneError=GE_NOTSUPPORTED; + break; + } +} + +GSM_Error N6110_SetRingTone(GSM_Ringtone *ringtone, int *maxlength) +{ + + char req[FB61_MAX_RINGTONE_FRAME_LENGTH+10] = + {N6110_FRAME_HEADER, + 0x36, + 0x00, /* Location */ + 0x00,0x78}; + + int size=FB61_MAX_RINGTONE_FRAME_LENGTH; + + /* Variables for preview uploading */ + unsigned char buffer[FB61_MAX_RINGTONE_FRAME_LENGTH+50]; + unsigned char buffer2[20]; + GSM_NetworkInfo NetworkInfo; + + /* Setting ringtone with preview */ + if (ringtone->location==255) { + buffer[0]=0x0c; + buffer[1]=0x01; + EncodeUDHHeader(buffer2, GSM_RingtoneUDH); + memcpy(buffer+2,buffer2,buffer2[0]+1); //copying UDH + *maxlength=GSM_PackRingtone(ringtone, buffer+2+buffer2[0]+1, &size); //packing ringtone + Protocol->SendMessage(2+buffer2[0]+1+size, 0x12, buffer); //sending frame + GSM->GetNetworkInfo(&NetworkInfo); //need to make something + sleep(1); + return GE_NONE; //no answer from phone + } + + *maxlength=GSM_PackRingtone(ringtone, req+7, &size); + + req[4]=ringtone->location-1; + + return NULL_SendMessageSequence + (50, &CurrentRingtoneError, (size+7), 0x05, req); +} + +void N6110_ReplyGetBinRingtone(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i; + + switch (MessageBuffer[4]) { + case 0x00: /* location supported. We have ringtone */ + + /* Binary format used in N6150 */ + if (MessageBuffer[5]==0x0c && MessageBuffer[6]==0x01 && MessageBuffer[7]==0x2c) { +#ifdef DEBUG + fprintf(stdout,_("Message: ringtone \"")); +#endif + + /* Copying name */ + i=8; + while (true) { +#ifdef DEBUG + if (MessageBuffer[i]!=0) + fprintf(stdout,_("%c"),MessageBuffer[i]); +#endif + CurrentGetBinRingtone->name[i-8]=MessageBuffer[i]; + if (MessageBuffer[i]==0) break; + i++; + } + +#ifdef DEBUG + fprintf(stdout,_("\" received from location %i\n"),MessageBuffer[3]+1); +#endif + + /* Looking for end */ + i=0; + while (true) { + if (MessageBuffer[i]==0x07 && MessageBuffer[i+1]==0x0b) { + i=i+2;break; + } + if (MessageBuffer[i]==0x0e && MessageBuffer[i+1]==0x0b) { + i=i+2;break; + } + i++; + if (i==MessageLength) break; + } + + /* Copying frame */ + memcpy(CurrentGetBinRingtone->frame,MessageBuffer+3,i-3); + CurrentGetBinRingtone->length=i-3; + + CurrentBinRingtoneError=GE_NONE; + break; + } + + /* Binary format used in N3210 */ + if (MessageBuffer[5]==0x10 && MessageBuffer[6]==0x01 && MessageBuffer[7]==0x2c) { + +#ifdef DEBUG + fprintf(stdout,_("Message: ringtone \"")); +#endif + + /* Copying name */ + i=8; + while (true) { +#ifdef DEBUG + if (MessageBuffer[i]!=0) + fprintf(stdout,_("%c"),MessageBuffer[i]); +#endif + CurrentGetBinRingtone->name[i-8]=MessageBuffer[i]; + if (MessageBuffer[i]==0) break; + i++; + } + +#ifdef DEBUG + fprintf(stdout,_("\" received from location %i\n"),MessageBuffer[3]+1); +#endif + + /* Here changes to get full compatibility with binary format used in N6150 */ + MessageBuffer[3]=0; + MessageBuffer[4]=0; + MessageBuffer[5]=0x0c; + MessageBuffer[6]=0x01; + MessageBuffer[7]=0x2c; + + /* Looking for end */ + i=0; + while (true) { + if (MessageBuffer[i]==0x07 && MessageBuffer[i+1]==0x0b) { + i=i+2;break; + } + if (MessageBuffer[i]==0x0e && MessageBuffer[i+1]==0x0b) { + i=i+2;break; + } + i++; + if (i==MessageLength) break; + } + + /* Copying frame */ + memcpy(CurrentGetBinRingtone->frame,MessageBuffer+3,i-3); + + CurrentGetBinRingtone->length=i-3; + + CurrentBinRingtoneError=GE_NONE; + break; + } + + /* Copying frame */ + memcpy(CurrentGetBinRingtone->frame,MessageBuffer,MessageLength); + + CurrentGetBinRingtone->length=MessageLength; + +#ifdef DEBUG + fprintf(stdout,_("Message: unknown binary format for ringtone received from location %i\n"),MessageBuffer[3]+1); +#endif + CurrentBinRingtoneError=GE_UNKNOWNMODEL; + break; + + default: + +#ifdef DEBUG + fprintf(stdout,_("Message: Phone doesn't support downloaded ringtones at location %i\n"),MessageBuffer[3]+1); +#endif + + CurrentBinRingtoneError=GE_INVALIDRINGLOCATION; + } +} + +GSM_Error N6110_GetBinRingTone(GSM_BinRingtone *ringtone) +{ + unsigned char req[] = { 0x00,0x01,0x9e, + 0x00 }; //location + + GSM_Error error; + + CurrentGetBinRingtone=ringtone; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + req[3]=ringtone->location-1; + + return NULL_SendMessageSequence + (50, &CurrentBinRingtoneError, 4, 0x40, req); +} + +void N6110_ReplySetBinRingtone(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + switch (MessageBuffer[4]) { + case 0x00: /* location supported. We set ringtone */ +#ifdef DEBUG + fprintf(stdout,_("Message: downloaded ringtone set at location %i\n"),MessageBuffer[3]+1); +#endif + CurrentBinRingtoneError=GE_NONE; + break; + + default: +#ifdef DEBUG + fprintf(stdout,_("Message: Phone doesn't support downloaded ringtones at location %i\n"),MessageBuffer[3]+1); +#endif + CurrentBinRingtoneError=GE_NOTSUPPORTED; + break; + } +} + +GSM_Error N6110_SetBinRingTone(GSM_BinRingtone *ringtone) +{ + unsigned char req[1000] = { 0x00,0x01,0xa0}; + + GSM_Error error; + + GSM_BinRingtone ring; + + /* Must be sure, that can upload ringtone to this phone */ + ring.location=ringtone->location; + error=N6110_GetBinRingTone(&ring); + if (error!=GE_NONE) return error; + + error=N6110_EnableExtendedCommands(0x01); + if (error!=GE_NONE) return error; + + memcpy(req+3,ringtone->frame,ringtone->length); + + req[3]=ringtone->location-1; + + return NULL_SendMessageSequence + (50, &CurrentBinRingtoneError, ringtone->length+3, 0x40, req); +} + +GSM_Error N6110_Reset(unsigned char type) +{ + return N6110_EnableExtendedCommands(type); +} + +void N6110_Dispatch0x01Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int tmp, count; + + switch (MessageBuffer[3]) { + + /* Unknown message - it has been seen after the 0x07 message (call + answered). Probably it has similar meaning. If you can solve + this - just mail me. Pavel Janík ml. + + The message looks like this: + + Msg Destination: PC + Msg Source: Phone + Msg Type: 01 + Msg Unknown: 00 + Msg Len: 0e + + Phone: [01 ][08 ][00 ] is the header of the frame + + [03 ] is the call message subtype + + [05 ] is the call sequence number + + [05 ] unknown + + [00 ][01 ][03 ][02 ][91][00] are unknown but has been + seen in the Incoming call message (just after the + caller's name from the phonebook). But never change + between phone calls :-( + */ + + /* This may mean sequence number of 'just made' call - CK */ + case 0x02: + +#ifdef DEBUG + fprintf(stdout, _("Message: Call message, type 0x02:")); + fprintf(stdout, _(" Exact meaning not known yet, sorry :-(\n")); +#endif /* DEBUG */ + + break; + + /* Possibly call OK */ + /* JD: I think that this means "call in progress" (incomming or outgoing) */ + case 0x03: + +#ifdef DEBUG + fprintf(stdout, _("Message: Call message, type 0x03:")); + fprintf(stdout, _(" Sequence nr. of the call: %d\n"), MessageBuffer[4]); + fprintf(stdout, _(" Exact meaning not known yet, sorry :-(\n")); +#endif /* DEBUG */ + + CurrentCallSequenceNumber=MessageBuffer[4]; + CurrentIncomingCall[0]='D'; + if (CurrentCallPassup) CurrentCallPassup('D'); + + break; + + /* Remote end has gone away before you answer the call. Probably your + mother-in-law or banker (which is worse?) ... */ + case 0x04: + +#ifdef DEBUG + fprintf(stdout, _("Message: Remote end hang up.\n")); + fprintf(stdout, _(" Sequence nr. of the call: %d, error: %i"), MessageBuffer[4],MessageBuffer[6]); + + switch (MessageBuffer[6]) { + case 28: fprintf(stdout,_(" (info \"Invalid phone number\")"));break; + case 34: fprintf(stdout,_(" (info \"Network busy\")"));break; + case 42: fprintf(stdout,_(" (info \"Network busy\")"));break; + case 47: fprintf(stdout,_(" (info \"Error in connection\")"));break; + case 50: fprintf(stdout,_(" (info \"Check operator services\")"));break; case 76: fprintf(stdout,_(" (info \"Check operator services\")"));break; + case 111: fprintf(stdout,_(" (info \"Error in connection\")"));break; + } + + fprintf(stdout,_("\n For more details with errors see netmonitor manual (test 39) on www.marcin-wiacek.topnet.pl")); + fprintf(stdout,_("\n If know their meaning, GSM specs decribing them, contact with me on marcin-wiacek@topnet.pl. THX\n")); +#endif /* DEBUG */ + + CurrentIncomingCall[0] = ' '; + if (CurrentCallPassup) CurrentCallPassup(' '); + + break; + + /* Incoming call alert */ + case 0x05: + +#ifdef DEBUG + fprintf(stdout, _("Message: Incoming call alert:\n")); + + /* We can have more then one call ringing - we can distinguish between + them */ + + fprintf(stdout, _(" Sequence nr. of the call: %d\n"), MessageBuffer[4]); + fprintf(stdout, _(" Number: ")); + + count=MessageBuffer[6]; + + for (tmp=0; tmp SendMessage(4, 0x04, connect5); */ + + /* Marcin-Wiacek@TopNet.PL */ + +#ifdef WIN32 + sprintf(Current_IMEI, "%s", MessageBuffer+5); + sprintf(Current_Model, "%s", MessageBuffer+21); + sprintf(Current_Revision, "SW%s, HW%s", MessageBuffer+41, MessageBuffer+35); +#else + snprintf(Current_IMEI, GSM_MAX_IMEI_LENGTH, "%s", MessageBuffer+5); + snprintf(Current_Model, GSM_MAX_MODEL_LENGTH, "%s", MessageBuffer+21); + snprintf(Current_Revision, GSM_MAX_REVISION_LENGTH, "SW%s, HW%s", MessageBuffer+41, MessageBuffer+35); +#endif + +#ifdef DEBUG + fprintf(stdout, _("Message: Mobile phone identification received:\n")); + fprintf(stdout, _(" IMEI: %s\n"), Current_IMEI); + fprintf(stdout, _(" Model: %s\n"), Current_Model); + fprintf(stdout, _(" Production Code: %s\n"), MessageBuffer+27); + fprintf(stdout, _(" HW: %s\n"), MessageBuffer+35); + fprintf(stdout, _(" Firmware: %s\n"), MessageBuffer+41); +#endif /* DEBUG */ + + break; + + /* Get group data */ + /* [ID],[name_len],[name].,[ringtone],[graphicon],[lenhi],[lenlo],[bitmap] */ + case 0x11: + + if (CurrentGetBitmap!=NULL) { + if (CurrentGetBitmap->number==MessageBuffer[4]) { + count=MessageBuffer[5]; + memcpy(CurrentGetBitmap->text,MessageBuffer+6,count); + CurrentGetBitmap->text[count]=0; + +#ifdef DEBUG + fprintf(stdout, _("Message: Caller group datas\n")); + fprintf(stdout, _("Caller group name: %s\n"),CurrentGetBitmap->text); +#endif /* DEBUG */ + + count+=6; + + CurrentGetBitmap->ringtone=MessageBuffer[count++]; +#ifdef DEBUG + fprintf(stdout, _("Caller group ringtone ID: %i"),CurrentGetBitmap->ringtone); + if (CurrentGetBitmap->ringtone==16) fprintf(stdout,_(" (default)")); + fprintf(stdout,_("\n")); +#endif /* DEBUG */ + + CurrentGetBitmap->enabled=(MessageBuffer[count++]==1); +#ifdef DEBUG + fprintf(stdout, _("Caller group logo ")); + if (CurrentGetBitmap->enabled) + fprintf(stdout, _("enabled \n")); + else + fprintf(stdout, _("disabled \n")); +#endif /* DEBUG */ + + CurrentGetBitmap->size=MessageBuffer[count++]<<8; + CurrentGetBitmap->size+=MessageBuffer[count++]; +#ifdef DEBUG + fprintf(stdout, _("Bitmap size=%i\n"),CurrentGetBitmap->size); +#endif /* DEBUG */ + + count++; + CurrentGetBitmap->width=MessageBuffer[count++]; + CurrentGetBitmap->height=MessageBuffer[count++]; + count++; + tmp=GSM_GetBitmapSize(CurrentGetBitmap); + if (CurrentGetBitmap->size>tmp) CurrentGetBitmap->size=tmp; + memcpy(CurrentGetBitmap->bitmap,MessageBuffer+count,CurrentGetBitmap->size); + CurrentGetBitmapError=GE_NONE; + } else { +#ifdef DEBUG + fprintf(stdout, _("Message: Caller group datas received, but group number does not match (%i is not %i)\n"),MessageBuffer[4],CurrentGetBitmap->number); +#endif + } + } else { +#ifdef DEBUG + fprintf(stdout, _("Message: Caller group data received but not requested!\n")); +#endif + } + break; + + /* Get group data error */ + case 0x12: + + CurrentGetBitmapError=GE_UNKNOWN; +#ifdef DEBUG + fprintf(stdout, _("Message: Error attempting to get caller group data.\n")); +#endif + break; + + /* Set group data OK */ + case 0x14: + + CurrentSetBitmapError=GE_NONE; +#ifdef DEBUG + fprintf(stdout, _("Message: Caller group data set correctly.\n")); +#endif + break; + + /* Set group data error */ + case 0x15: + + CurrentSetBitmapError=GE_UNKNOWN; +#ifdef DEBUG + fprintf(stdout, _("Message: Error attempting to set caller group data\n")); +#endif + break; + + default: + +#ifdef DEBUG + fprintf(stdout, _("Message: Unknown message of type 0x03\n")); +#endif /* DEBUG */ + AppendLogText("Unknown msg\n",false); + + break; /* Visual C Don't like empty cases */ + } +} + +void N6110_Dispatch0x05Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int tmp, count, length; + bool issupported; + +#ifdef DEBUG + int i; +#endif + + switch (MessageBuffer[3]) { + + /* Startup Logo */ + case 0x17: + +#ifdef DEBUG + fprintf(stdout, _("Message: Startup Logo, welcome note and dealer welcome note received.\n")); +#endif + + if (CurrentGetBitmap!=NULL) { + + issupported=false; + + count=5; + + for (tmp=0;tmptype==GSM_StartupLogo) { + CurrentGetBitmap->height=MessageBuffer[count++]; + CurrentGetBitmap->width=MessageBuffer[count++]; + CurrentGetBitmap->size=GSM_GetBitmapSize(CurrentGetBitmap); + length=CurrentGetBitmap->size; + memcpy(CurrentGetBitmap->bitmap,MessageBuffer+count,length); + } else { + //bitmap size + length=MessageBuffer[count++]; + length=length*MessageBuffer[count++]/8; + } + count+=length; +#ifdef DEBUG + fprintf(stdout, _("Startup logo supported - ")); + if (length!=0) { fprintf(stdout, _("currently set\n")); } + else { fprintf(stdout, _("currently empty\n")); } +#endif + if (CurrentGetBitmap->type==GSM_StartupLogo) issupported=true; + break; + case 0x02: + length=MessageBuffer[count]; + if (CurrentGetBitmap->type==GSM_WelcomeNoteText) { + memcpy(CurrentGetBitmap->text,MessageBuffer+count+1,length); + CurrentGetBitmap->text[length]=0; + } +#ifdef DEBUG + fprintf(stdout, _("Startup Text supported - ")); + if (length!=0) + { + fprintf(stdout, _("currently set to \"")); + for (i=0;itype==GSM_WelcomeNoteText) issupported=true; + break; + case 0x03: + length=MessageBuffer[count]; + if (CurrentGetBitmap->type==GSM_DealerNoteText) { + memcpy(CurrentGetBitmap->text,MessageBuffer+count+1,length); + CurrentGetBitmap->text[length]=0; + } +#ifdef DEBUG + fprintf(stdout, _("Dealer Welcome supported - ")); + if (length!=0) + { + fprintf(stdout, _("currently set to \"")); + for (i=0;itype==GSM_DealerNoteText) issupported=true; + break; + } + } + if (issupported) CurrentGetBitmapError=GE_NONE; + else CurrentGetBitmapError=GE_NOTSUPPORTED; + } else { +#ifdef DEBUG + fprintf(stdout, _("Message: Startup logo received but not requested!\n")); +#endif + } + break; + + /* Set startup OK */ + case 0x19: + + CurrentSetBitmapError=GE_NONE; +#ifdef DEBUG + fprintf(stdout, _("Message: Startup logo, welcome note or dealer welcome note correctly set.\n")); +#endif + break; + + /* Set Operator Logo OK */ + case 0x31: + +#ifdef DEBUG + fprintf(stdout, _("Message: Operator logo correctly set.\n")); +#endif + + CurrentSetBitmapError=GE_NONE; + break; + + /* Set Operator Logo Error */ + case 0x32: + +#ifdef DEBUG + fprintf(stdout, _("Message: Error setting operator logo!\n")); +#endif + + CurrentSetBitmapError=GE_UNKNOWN; + break; + + /* Operator Logo */ + /* [location],[netcode x 3],[lenhi],[lenlo],[bitmap] */ + case 0x34: + + if (CurrentGetBitmap!=NULL) { + + count=5; /* Location ignored. */ + + DecodeNetworkCode(MessageBuffer+count, CurrentGetBitmap->netcode); + count=count+3; + +#ifdef DEBUG + fprintf(stdout, _("Message: Operator Logo for %s (%s) network received.\n"), + CurrentGetBitmap->netcode, + GSM_GetNetworkName(CurrentGetBitmap->netcode)); +#endif + + CurrentGetBitmap->size=MessageBuffer[count++]<<8; + CurrentGetBitmap->size+=MessageBuffer[count++]; + count++; + CurrentGetBitmap->width=MessageBuffer[count++]; + CurrentGetBitmap->height=MessageBuffer[count++]; + count++; + tmp=GSM_GetBitmapSize(CurrentGetBitmap); + if (CurrentGetBitmap->size>tmp) CurrentGetBitmap->size=tmp; + memcpy(CurrentGetBitmap->bitmap,MessageBuffer+count,CurrentGetBitmap->size); + CurrentGetBitmapError=GE_NONE; + } else { +#ifdef DEBUG + fprintf(stdout, _("Message: Operator logo received but not requested!\n")); +#endif + } + + break; + + /* Get op logo error */ + case 0x35: + +#ifdef DEBUG + fprintf(stdout, _("Message: Error getting operator logo!\n")); +#endif + CurrentGetBitmapError=GE_UNKNOWN; + break; + + default: + +#ifdef DEBUG + fprintf(stdout, _("Message: Unknown message of type 0x05\n")); +#endif /* DEBUG */ + AppendLogText("Unknown msg\n",false); + + break; + } +} + +void N6110_Dispatch0x06Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int tmp; + unsigned char output[160]; + +#ifdef DEBUG + int i; +#endif + + switch (MessageBuffer[3]) { + + case 0x05: + + /* MessageBuffer[3] = 0x05 + MessageBuffer[4] = 0x00 + MessageBuffer[5] = 0x0f + MessageBuffer[6] = 0x03 + MessageBuffer[7] = length of packed message + + This is all I have seen - Gerry Anderson */ + + tmp=GSM_UnpackEightBitsToSeven(0, 82, 82, MessageBuffer+8, output); + +#ifdef DEBUG + + fprintf(stdout, _("Message from Network operator: ")); + + for (i=0; iSender,GSM_UnpackSemiOctetNumber(MessageBuffer+5,true)); + + while (MessageBuffer[count]!=0) { + count++; + } + + count++; + } else { + strcpy(CurrentGetBitmap->Sender,"\0"); + + count+=3; + } + + memcpy(CurrentGetBitmap->text,MessageBuffer+count+1,MessageBuffer[count]); + CurrentGetBitmap->text[MessageBuffer[count]]=0; + + if (MessageBuffer[count]!=0) + count+=MessageBuffer[count]; + + count++; + +#ifdef DEBUG + fprintf(stdout,_("Picture Image received, text \"%s\", sender %s\n"),CurrentGetBitmap->text,CurrentGetBitmap->Sender); +#endif + + CurrentGetBitmap->width=MessageBuffer[count+1]; + CurrentGetBitmap->height=MessageBuffer[count+2]; + CurrentGetBitmap->size=GSM_GetBitmapSize(CurrentGetBitmap); + + memcpy(CurrentGetBitmap->bitmap,MessageBuffer+count+4,CurrentGetBitmap->size); + + CurrentGetBitmapError=GE_NONE; + break; + + case 0x04: + +#ifdef DEBUG + fprintf(stdout,_("Getting or setting Picture Image - OK\n")); +#endif + CurrentSetBitmapError=GE_NONE; + CurrentGetBitmapError=GE_NONE; + break; + + case 0x05: + +#ifdef DEBUG + fprintf(stdout,_("Setting Picture Image - invalid location or other error\n")); +#endif + CurrentSetBitmapError=GE_UNKNOWN; + break; + + case 0x06: + +#ifdef DEBUG + fprintf(stdout,_("Getting Picture Image - invalid location or other error\n")); +#endif + CurrentGetBitmapError=GE_UNKNOWN; + break; + + default: + +#ifdef DEBUG + fprintf(stdout, _("Unknown message of type 0x47.\n")); +#endif /* DEBUG */ + AppendLogText("Unknown msg\n",false); + break; /* Visual C Don't like empty cases */ + } +} + +void N6110_DispatchACKMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + char buffer[50]; + + sprintf(buffer,"Received ACK %02x %02x\n",MessageBuffer[0],MessageBuffer[1]); + AppendLog(buffer,strlen(buffer),false); + +#ifdef DEBUG + fprintf(stdout, _("[Received Ack of type %02x, seq: %2x]\n"), MessageBuffer[0], + MessageBuffer[1]); +#endif /* DEBUG */ + + CurrentLinkOK = true; +} + +void N6110_Dispatch0xD0Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: The phone is powered on - seq 1.\n")); +#endif /* DEBUG */ + +} + +/* This function is used for parsing the RLP frame into fields. */ +void N6110_RX_HandleRLPMessage(u8 *MessageBuffer) +{ + + RLP_F96Frame frame; + int count; + int valid = true; + + /* We do not need RLP frame parsing to be done when we do not have callback + specified. */ + if (CurrentRLP_RXCallback == NULL) + exit; + + /* Anybody know the official meaning of the first two bytes? + Nokia 6150 sends junk frames starting D9 01, and real frames starting + D9 00. We'd drop the junk frames anyway because the FCS is bad, but + it's tidier to do it here. We still need to call the callback function + to give it a chance to handle timeouts and/or transmit a frame */ + if (MessageBuffer[0] == 0xd9 && MessageBuffer[1] == 0x01) + valid = false; + + /* Nokia uses 240 bit frame size of RLP frames as per GSM 04.22 + specification, so Header consists of 16 bits (2 bytes). See section 4.1 + of the specification. */ + + frame.Header[0] = MessageBuffer[2]; + frame.Header[1] = MessageBuffer[3]; + + /* Next 200 bits (25 bytes) contain the Information. We store the + information in the Data array. */ + + for (count = 0; count < 25; count ++) + frame.Data[count] = MessageBuffer[4 + count]; + + /* The last 24 bits (3 bytes) contain FCS. */ + + frame.FCS[0] = MessageBuffer[29]; + frame.FCS[1] = MessageBuffer[30]; + frame.FCS[2] = MessageBuffer[31]; + + /* Here we pass the frame down in the input stream. */ + CurrentRLP_RXCallback(valid ? &frame : NULL); +} + +void N6110_Dispatch0xF4Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: The phone is powered on - seq 2.\n")); +#endif /* DEBUG */ + +} + +void N6110_ReplyIncomingSMS(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + GSM_SMSMessage NullSMS; + + switch (MessageBuffer[6]) { + + case 0x00: NullSMS.Type = GST_SMS; NullSMS.folder = GST_INBOX; break; + case 0x01: NullSMS.Type = GST_DR; NullSMS.folder = GST_INBOX; break; + + /* Is it possible ? */ + case 0x02: NullSMS.Type = GST_SMS; NullSMS.folder = GST_OUTBOX; break; + default: NullSMS.Type = GST_UN; break; + } + +#ifdef DEBUG + if (NullSMS.Type == GST_DR) + fprintf(stdout, _("Message: SMS Message (Report) Received\n")); + else + fprintf(stdout, _("Message: SMS Message Received\n")); +#endif /* DEBUG */ + + GSM_DecodeNokiaSMSFrame(&NullSMS, MessageBuffer+7, MessageLength-7); + +#ifdef DEBUG + fprintf(stdout, _("\n")); +#endif /* DEBUG */ +} + +void N6110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + bool unknown=false; + + /* Switch on the basis of the message type byte */ + switch (MessageType) { + + /* Call information */ + case 0x01: + + N6110_Dispatch0x01Message(MessageLength, MessageBuffer, MessageType); + break; + + /* SMS handling */ + case 0x02: + switch (MessageBuffer[3]) { + case 0x02: + case 0x03:N6110_ReplySendSMSMessage(MessageLength,MessageBuffer,MessageType);break; + case 0x10:N6110_ReplyIncomingSMS(MessageLength,MessageBuffer,MessageType);break; + case 0x21:N6110_ReplySetCellBroadcast(MessageLength, MessageBuffer, MessageType);break; + case 0x23:N6110_ReplyReadCellBroadcast(MessageLength, MessageBuffer, MessageType);break; + case 0x31:N6110_ReplySetSMSCenter(MessageLength,MessageBuffer,MessageType);break; + case 0x34: + case 0x35:N6110_ReplyGetSMSCenter(MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Phonebook handling */ + case 0x03: + switch (MessageBuffer[3]) { + case 0x02: + case 0x03:N6110_ReplyGetMemoryLocation(MessageLength,MessageBuffer,MessageType);break; + case 0x05: + case 0x06:N6110_ReplyWritePhonebookLocation(MessageLength,MessageBuffer,MessageType);break; + case 0x08: + case 0x09:N6110_ReplyGetMemoryStatus(MessageLength,MessageBuffer,MessageType);break; + case 0x17: + case 0x18:N6110_ReplyGetSpeedDial(MessageLength,MessageBuffer,MessageType);break; + case 0x1a: + case 0x1b:N6110_ReplySetSpeedDial(MessageLength,MessageBuffer,MessageType);break; + default :N6110_Dispatch0x03Message(MessageLength,MessageBuffer,MessageType);break; + } + break; + + /* Phone status */ + case 0x04: + switch (MessageBuffer[3]) { + case 0x02:N6110_ReplyRFBatteryLevel(MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Startup Logo, Operator Logo and Profiles. */ + case 0x05: + switch (MessageBuffer[3]) { + case 0x11:N6110_ReplySetProfile (MessageLength,MessageBuffer,MessageType);break; + case 0x14:N6110_ReplyGetProfile (MessageLength,MessageBuffer,MessageType);break; + case 0x1b:N6110_ReplyGetProfile (MessageLength,MessageBuffer,MessageType);break; + case 0x1d:N6110_ReplySetProfile (MessageLength,MessageBuffer,MessageType);break; + case 0x37:N6110_ReplySetRingtone (MessageLength,MessageBuffer,MessageType);break; + case 0x38:N6110_ReplySetRingtone (MessageLength,MessageBuffer,MessageType);break; + default :N6110_Dispatch0x05Message(MessageLength,MessageBuffer,MessageType);break; + } + break; + + /* Network Operator Message to handset -> Gerry Anderson & prepaid info */ + /* Call diverts */ + case 0x06: + switch (MessageBuffer[3]) { + case 0x02: + case 0x03:N6110_ReplyCallDivert (MessageLength,MessageBuffer,MessageType);break; + default :N6110_Dispatch0x06Message(MessageLength,MessageBuffer,MessageType);break; + } + break; + + /* Security code requests */ + case 0x08: + switch (MessageBuffer[3]) { + case 0x08:N6110_ReplyGetSecurityCodeStatus(MessageLength,MessageBuffer,MessageType);break; + case 0x0b:N6110_ReplyEnterSecurityCode (MessageLength,MessageBuffer,MessageType);break; + default :N6110_ReplyEnterSecurityCode (MessageLength,MessageBuffer,MessageType);break; + } + break; + + /* SIM login */ + case 0x09: + + N6110_Dispatch0x09Message(MessageLength, MessageBuffer, MessageType); + break; + + /* Network info */ + case 0x0a: + switch (MessageBuffer[3]) { + case 0x71:N6110_ReplyGetNetworkInfo(MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Simulating key pressing */ + case 0x0c: + switch (MessageBuffer[3]) { + case 0x43:N6110_ReplyPressKey(MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Display */ + case 0x0d: + switch (MessageBuffer[3]) { + case 0x50:N6110_ReplyDisplayOutput (MessageLength,MessageBuffer,MessageType);break; + case 0x52:N6110_ReplyGetDisplayStatus(MessageLength,MessageBuffer,MessageType);break; + case 0x54:N6110_ReplyDisplayOutput (MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Phone Clock and Alarm */ + case 0x11: + switch (MessageBuffer[3]) { + case 0x61:N6110_ReplySetDateTime(MessageLength,MessageBuffer,MessageType);break; + case 0x63:N6110_ReplyGetDateTime(MessageLength,MessageBuffer,MessageType);break; + case 0x6c:N6110_ReplySetAlarm (MessageLength,MessageBuffer,MessageType);break; + case 0x6e:N6110_ReplyGetAlarm (MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Calendar notes handling */ + case 0x13: + switch (MessageBuffer[3]) { + case 0x65:N6110_ReplyWriteCalendarNote (MessageLength,MessageBuffer,MessageType);break; + case 0x67:N6110_ReplyGetCalendarNote (MessageLength,MessageBuffer,MessageType);break; + case 0x69:N6110_ReplyDeleteCalendarNote(MessageLength,MessageBuffer,MessageType);break; + default :N6110_Dispatch0x13Message (MessageLength,MessageBuffer,MessageType);break; + } + break; + + /* SMS Messages */ + case 0x14: + switch (MessageBuffer[3]) { + case 0x05: + case 0x06:N6110_ReplySaveSMSMessage (MessageLength,MessageBuffer,MessageType);break; + case 0x08: + case 0x09:N6110_ReplyGetSMSMessage (MessageLength,MessageBuffer,MessageType);break; + case 0x0b:N6110_ReplyDeleteSMSMessage(MessageLength,MessageBuffer,MessageType);break; + case 0x37: + case 0x38:N6110_ReplyGetSMSStatus (MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* WAP */ + case 0x3f: + switch (MessageBuffer[3]) { + case 0x01: + case 0x02:N7110_ReplyEnableWAPCommands(MessageLength,MessageBuffer,MessageType);break; + case 0x07: + case 0x08:N7110_ReplyGetWAPBookmark (MessageLength,MessageBuffer,MessageType);break; + case 0x0a: + case 0x0b:N7110_ReplySetWAPBookmark (MessageLength,MessageBuffer,MessageType);break; + case 0x16: + case 0x17: + case 0x1c:N7110_ReplyGetWAPSettings (MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Internal phone functions? */ + case 0x40: + switch (MessageBuffer[2]) { + case 0x64:N6110_ReplyEnableExtendedCommands (MessageLength,MessageBuffer,MessageType);break; + case 0x65:N6110_ReplyResetPhoneSettings (MessageLength,MessageBuffer,MessageType);break; + case 0x66:N6110_ReplyIMEI (MessageLength,MessageBuffer,MessageType);break; + case 0x6a:N6110_ReplyGetProductProfileSetting(MessageLength,MessageBuffer,MessageType);break; + case 0x6b:N6110_ReplySetProductProfileSetting(MessageLength,MessageBuffer,MessageType);break; + case 0x6e:N6110_ReplyGetSecurityCode (MessageLength,MessageBuffer,MessageType);break; + case 0x7e:N6110_ReplyNetmonitor (MessageLength,MessageBuffer,MessageType);break; + case 0x8a:N6110_ReplySimlockInfo (MessageLength,MessageBuffer,MessageType);break; + case 0x8b:N6110_ReplySetOperatorName (MessageLength,MessageBuffer,MessageType);break; + case 0x8c:N6110_ReplyGetOperatorName (MessageLength,MessageBuffer,MessageType);break; + case 0x8f:N6110_ReplyPlayTone (MessageLength,MessageBuffer,MessageType);break; + case 0x9e:N6110_ReplyGetBinRingtone (MessageLength,MessageBuffer,MessageType);break; + case 0xa0:N6110_ReplySetBinRingtone (MessageLength,MessageBuffer,MessageType);break; + case 0xc8:N6110_ReplyHW (MessageLength,MessageBuffer,MessageType);break; + default :N6110_Dispatch0x40Message (MessageLength,MessageBuffer,MessageType);break; + } + break; + + /* Picture Images */ + case 0x47: + + N6110_Dispatch0x47Message(MessageLength, MessageBuffer, MessageType); + break; + + /* Mobile phone identification */ + case 0x64: + + N6110_ReplyGetAuthentication(MessageLength, MessageBuffer, MessageType); + break; + + /***** Acknowlegment of our frames. *****/ + case FBUS_FRTYPE_ACK: + + N6110_DispatchACKMessage(MessageLength, MessageBuffer, MessageType); + break; + + /***** Power on message. *****/ + case 0xd0: + + N6110_Dispatch0xD0Message(MessageLength, MessageBuffer, MessageType); + break; + + case 0xd2: + + N6110_ReplyID(MessageLength, MessageBuffer, MessageType); + break; + + /***** RLP frame received. *****/ + case 0xf1: + + N6110_RX_HandleRLPMessage(MessageBuffer); + break; + + /***** Power on message. *****/ + case 0xf4: + + N6110_Dispatch0xF4Message(MessageLength, MessageBuffer, MessageType); + break; + + /***** Unknown message *****/ + /* If you think that you know the exact meaning of other messages - please + let us know. */ + default: + +#ifdef DEBUG + fprintf(stdout, _("Message: Unknown message type.\n")); +#endif /* DEBUG */ + AppendLogText("Unknown msg type\n",false); + + unknown=false; + break; + + } + + if (unknown) { +#ifdef DEBUG + fprintf(stdout, _("Unknown message of type %02x.\n"),MessageType); +#endif + AppendLogText("Unknown msg\n",false); + } +} diff --git a/common/newmodules/n7110.c b/common/newmodules/n7110.c new file mode 100644 index 0000000..9f0f205 --- /dev/null +++ b/common/newmodules/n7110.c @@ -0,0 +1,3718 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for accessing functions on the 7110 and similar + phones. + +*/ + +/* "Turn on" prototypes in n-7110.h */ + +#define __n_7110_c + +/* System header files */ +#include +#include +#include +#include + +#ifndef WIN32 + #include "devices/device.h" +#endif + +#ifdef WIN32 + #include "misc_win32.h" +#endif + +/* Various header file */ +#ifndef VC6 + #include "config.h" +#endif + +#include "gsm-api.h" +#include "gsm-coding.h" +#include "newmodules/n6110.h" +#include "newmodules/n7110.h" +#include "protocol/fbus.h" + +/* Global variables used by code in gsm-api.c to expose the functions + supported by this model of phone. */ + +/* Here we initialise model specific functions. */ + +GSM_Functions N7110_Functions = { + N7110_Initialise, + N7110_DispatchMessage, + NULL_Terminate, + NULL_KeepAlive, + N7110_GetMemoryLocation, + N7110_WritePhonebookLocation, + N7110_GetSpeedDial, + N7110_SetSpeedDial, + N7110_GetMemoryStatus, + N7110_GetSMSStatus, + N6110_GetSMSCenter, + N6110_SetSMSCenter, + N7110_GetSMSMessage, + N7110_DeleteSMSMessage, + N6110_SendSMSMessage, + N7110_SaveSMSMessage, + N7110_GetRFLevel, + N7110_GetBatteryLevel, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + N7110_GetSecurityCode, + N6110_GetIMEI, + N6110_GetRevision, + N6110_GetModel, + N7110_GetDateTime, + N7110_SetDateTime, + N7110_GetAlarm, + N7110_SetAlarm, + N6110_DialVoice, + N6110_DialData, + N6110_GetIncomingCallNr, + N6110_GetNetworkInfo, + N7110_GetCalendarNote, + N7110_WriteCalendarNote, + N7110_DeleteCalendarNote, + N6110_NetMonitor, + UNIMPLEMENTED, + N7110_GetBitmap, + N7110_SetBitmap, + N7110_SetRingTone, + N7110_SetBinRingTone, + N7110_GetBinRingTone, + N6110_Reset, + N7110_GetProfile, + UNIMPLEMENTED, + N6110_SendRLPFrame, + N6110_CancelCall, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + N6110_EnableCellBroadcast, + N6110_DisableCellBroadcast, + N6110_ReadCellBroadcast, + N6110_PlayTone, + N6110_GetProductProfileSetting, + N6110_SetProductProfileSetting, + UNIMPLEMENTED, + UNIMPLEMENTED, + N7110_GetVoiceMailbox, + N6110_Tests, + N6110_SimlockInfo, + N7110_GetCalendarNotesInfo, + N7110_GetSMSFolders, + UNIMPLEMENTED, + N7110_GetWAPBookmark, + N7110_SetWAPBookmark, + N7110_GetWAPSettings, + N6110_CallDivert, + UNIMPLEMENTED, + N6110_GetManufacturer +}; + +/* Mobile phone information */ + +GSM_Information N7110_Information = { + "6210|6250|7110", /* Supported models in FBUS */ + "6210|6250|7110", /* Supported models in MBUS */ + "", /* Supported models in FBUS over infrared */ + "6210|6250|7110", /* Supported models in FBUS over DLR3 */ + "", + "6210|6250|7110", /* Supported models in FBUS over Irda sockets */ + "", + "", + 5, /* Max RF Level */ + 0, /* Min RF Level */ + GRF_Arbitrary, /* RF level units */ + 5, /* Max Battery Level */ + 0, /* Min Battery Level */ + GBU_Arbitrary, /* Battery level units */ + GDT_DateTime, /* Have date/time support */ + GDT_TimeOnly, /* Alarm supports time only */ + 1 /* Only one alarm available */ +}; + +const char *N7110_MemoryType_String [] = { + "", /* 0x00 */ + "DC", /* 0x01 */ + "MC", /* 0x02 */ + "RC", /* 0x03 */ + "FD", /* 0x04 */ + "ME", /* 0x05 */ + "SM", /* 0x06 */ + "ON", /* 0x07 */ + "EN", /* 0x08 */ + "MT", /* 0x09 */ +}; + +int PictureImageNum; //required during reading Picture Images +int PictureImageIndex; +int PictureImageLoc; + +void N7110_ReplyEnableIncomingSMSInfo(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + switch (MessageBuffer[3]) { + case 0x0e: +#ifdef DEBUG + fprintf(stdout,_("Message: Enabled info for incoming SMS\n")); +#endif /* DEBUG */ + + CurrentMagicError=GE_NONE; + break; + case 0x0f: +#ifdef DEBUG + fprintf(stdout,_("Message: error enabling for incoming SMS\n")); + switch (MessageBuffer[4]) { + case 0x0c:fprintf(stdout,_(" No PIN\n"));break; + default :fprintf(stdout,_(" unknown\n"));break; + } +#endif /* DEBUG */ + + CurrentMagicError=GE_UNKNOWN; + break; + } +} + +GSM_Error N7110_EnableIncomingSMSInfo () +{ + unsigned char req[] = {N6110_FRAME_HEADER, 0x0d, 0x00, 0x00, 0x02}; + + return NULL_SendMessageSequence + (50, &CurrentMagicError, 8, 0x02, req); +} + +/* Initialise variables and state machine. */ +GSM_Error N7110_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + + unsigned char init_char = N6110_SYNC_BYTE; + int count; + int InitLength; + + if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE) + { + return GE_NOTSUPPORTED; + } + + if (connection!=GCT_MBUS && connection!=GCT_Irda) { + + InitLength = atoi(initlength); + + if ((strcmp(initlength, "default") == 0) || (InitLength == 0)) { + InitLength = 250; /* This is the usual value, lower may work. */ + } + +#ifdef DEBUG + fprintf(stdout,_("Writing init chars....")); +#endif + + /* Initialise link with phone or what have you */ + /* Send init string to phone, this is a bunch of 0x55 characters. Timing is + empirical. */ + for (count = 0; count < InitLength; count ++) { + usleep(100); + Protocol->WritePhone(1,&init_char); + } + +#ifdef DEBUG + fprintf(stdout,_("Done\n")); +#endif + + N6110_SendStatusRequest(); + + } + + usleep(100); + + if (N6110_SendIDFrame()!=GE_NONE) return GE_TIMEOUT; + + if (N6110_SendIMEIFrame()!=GE_NONE) return GE_TIMEOUT; + + if (N6110_SendHWFrame()!=GE_NONE) return GE_TIMEOUT; + +// N7110_EnableIncomingSMSInfo(); + + if (connection==GCT_MBUS || connection==GCT_Irda) { + /* In MBUS doesn't have any init strings, etc. Phone answered with frame, + so connection should be enabled ;-) */ + /* Similiar for Irda */ + CurrentLinkOK = true; + } + + CurrentSMSFoldersCount=1000; + + return (GE_NONE); +} + +/* This function translates GMT_MemoryType to N7110_MEMORY_xx */ +int N7110_GetMemoryType(GSM_MemoryType memory_type) +{ + + int result; + + switch (memory_type) { + +// case GMT_MT: +// result = N7110_MEMORY_MT; +// break; + + case GMT_ME: result = N7110_MEMORY_ME; break; + case GMT_SM: result = N7110_MEMORY_SM; break; + case GMT_FD: result = N7110_MEMORY_FD; break; + case GMT_ON: result = N7110_MEMORY_ON; break; + case GMT_EN: result = N7110_MEMORY_EN; break; + case GMT_DC: result = N7110_MEMORY_DC; break; + case GMT_RC: result = N7110_MEMORY_RC; break; + case GMT_MC: result = N7110_MEMORY_MC; break; + case GMT_CG: result = N7110_MEMORY_CG; break; + default : result = N6110_MEMORY_XX; + } + + return (result); +} + +GSM_Error N7110_GetVoiceMailbox ( GSM_PhonebookEntry *entry) +{ + unsigned char req[] = {N7110_FRAME_HEADER, 0x07, 0x01, 0x01, 0x00, 0x01, + 0x02, //memory type + 0x05, + 0x00, 0x00, //location + 0x00, 0x00}; + + CurrentPhonebookEntry = entry; + + req[9] = N7110_MEMORY_VM; + req[10] = (1>>8); + req[11] = 1 & 0xff; + + return NULL_SendMessageSequence + (50, &CurrentPhonebookError, 14, 0x03, req); +} + +void N7110_ReplyEnableWAPCommands(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + switch(MessageBuffer[3]) { + + case 0x01: +#ifdef DEBUG + fprintf(stdout, _("Message: WAP functions enabled\n")); +#endif /* DEBUG */ + CurrentGetWAPBookmarkError=GE_NONE; + break; + + case 0x02: +#ifdef DEBUG + fprintf(stdout, _("Message: WAP functions enabled\n")); +#endif /* DEBUG */ + CurrentGetWAPBookmarkError=GE_NONE; + break; + + } +} + +/* To enable WAP frames in phone */ +GSM_Error N7110_EnableWAPCommands () +{ + unsigned char req0[] = { N6110_FRAME_HEADER, 0x00 }; + + return NULL_SendMessageSequence + (50, &CurrentGetWAPBookmarkError, 4, 0x3f, req0); +} + +void N7110_ReplyGetWAPBookmark(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int tmp; + + switch(MessageBuffer[3]) { + + case 0x07: + +#ifdef DEBUG + fprintf(stdout, _("Message: WAP bookmark received OK\n")); +#endif /* DEBUG */ + + DecodeUnicode(WAPBookmark->title, MessageBuffer + 7, MessageBuffer[6] ); + +#ifdef DEBUG + fprintf(stdout, _(" Title: \"%s\"\n"),WAPBookmark->title); +#endif /* DEBUG */ + + tmp=MessageBuffer[6]*2+7; + + DecodeUnicode(WAPBookmark->address, MessageBuffer + tmp+1, MessageBuffer[tmp] ); + +#ifdef DEBUG + fprintf(stdout, _(" Address: \"%s\"\n"),WAPBookmark->address); +#endif /* DEBUG */ + + CurrentGetWAPBookmarkError=GE_NONE; + break; + + case 0x08: + +#ifdef DEBUG + fprintf(stdout, _("Message: WAP bookmark receiving error\n")); + switch (MessageBuffer[4]) { + case 0x01:fprintf(stdout, _(" Inside Bookmarks menu. Must leave it\n"));break; + case 0x02:fprintf(stdout, _(" Invalid or empty location\n"));break; + default :fprintf(stdout, _(" Unknown error. Please report it\n")); + } +#endif /* DEBUG */ + + switch (MessageBuffer[4]) { + case 0x01:CurrentGetWAPBookmarkError=GE_INSIDEBOOKMARKSMENU;break; + case 0x02:CurrentGetWAPBookmarkError=GE_INVALIDBOOKMARKLOCATION;break; + default:CurrentGetWAPBookmarkError=GE_UNKNOWN; + } + + break; + } +} + +GSM_Error N7110_GetWAPBookmark (GSM_WAPBookmark *bookmark) +{ + unsigned char req[] = { N6110_FRAME_HEADER, 0x06, 0x00, 0x00}; + + GSM_Error error; + + /* We have to enable WAP frames in phone */ + error=N7110_EnableWAPCommands (); + if (error!=GE_NONE) return error; + + req[2]=0x00; + req[5]=bookmark->location-1; + + WAPBookmark=bookmark; + + return NULL_SendMessageSequence + (50, &CurrentGetWAPBookmarkError, 6, 0x3f, req); +} + +void N7110_ReplySetWAPBookmark(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + switch(MessageBuffer[3]) { + + case 0x0a: + +#ifdef DEBUG + fprintf(stdout, _("Message: WAP bookmark set OK\n")); +#endif /* DEBUG */ + + CurrentSetWAPBookmarkError=GE_NONE; + break; + + case 0x0b: + +#ifdef DEBUG + fprintf(stdout, _("Message: Error setting WAP bookmark\n")); +#endif /* DEBUG */ + + CurrentSetWAPBookmarkError=GE_UNKNOWN; + break; + } +} + +GSM_Error N7110_SetWAPBookmark (GSM_WAPBookmark *bookmark) +{ + unsigned char req[64] = { N6110_FRAME_HEADER, 0x09 }; + GSM_Error error; + int count; + + /* We have to enable WAP frames in phone */ + error = N7110_EnableWAPCommands (); + if (error != GE_NONE) + return error; + + count = 4; + req[count++] = (bookmark->location & 0xff00) >> 8; + req[count++] = (bookmark->location & 0x00ff); + + req[count++] = strlen(bookmark->title); + EncodeUnicode (req+count,bookmark->title ,strlen(bookmark->title)); + count=count+2*strlen(bookmark->title); + + req[count++] = strlen(bookmark->address); + EncodeUnicode (req+count,bookmark->address ,strlen(bookmark->address)); + count=count+2*strlen(bookmark->address); + + /* ??? */ + req[count++] = 0x01; req[count++] = 0x80; req[count++] = 0x00; + req[count++] = 0x00; req[count++] = 0x00; req[count++] = 0x00; + req[count++] = 0x00; req[count++] = 0x00; req[count++] = 0x00; + + WAPBookmark = bookmark; + + return NULL_SendMessageSequence(50, &CurrentSetWAPBookmarkError, + count, 0x3f, req); +} + +void N7110_ReplyGetWAPSettings(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int tmp; + + switch(MessageBuffer[3]) { + + case 0x16: + +#ifdef DEBUG + fprintf(stdout, _("Message: WAP settings received OK\n")); +#endif /* DEBUG */ + + DecodeUnicode(WAPSettings->title, MessageBuffer + 5, MessageBuffer[4] ); + +#ifdef DEBUG + fprintf(stdout, _(" Title: \"%s\"\n"),WAPSettings->title); +#endif /* DEBUG */ + + tmp=5+MessageBuffer[4]*2; + + DecodeUnicode(WAPSettings->homepage, MessageBuffer + tmp+1, MessageBuffer[tmp] ); + +#ifdef DEBUG + fprintf(stdout, _(" Homepage: \"%s\"\n"),WAPSettings->homepage); +#endif /* DEBUG */ + + tmp=tmp+MessageBuffer[tmp]*2+1; + +#ifdef DEBUG + fprintf(stdout, _(" Connection type: ")); + switch (MessageBuffer[tmp]) { + case 0x00: fprintf(stdout,_("temporary"));break; + case 0x01: fprintf(stdout,_("continuous"));break; + default: fprintf(stdout,_("unknown")); + } + fprintf(stdout, _("\n")); + + fprintf(stdout, _(" Connection security: ")); + switch (MessageBuffer[tmp+13]) { + case 0x00: fprintf(stdout,_("off"));break; + case 0x01: fprintf(stdout,_("on"));break; + default: fprintf(stdout,_("unknown")); + } + fprintf(stdout, _("\n")); + +#endif /* DEBUG */ + + switch (MessageBuffer[tmp]) { + case 0x00: WAPSettings->iscontinuous=false;break; + case 0x01: WAPSettings->iscontinuous=true;break; + } + switch (MessageBuffer[tmp+13]) { + case 0x00: WAPSettings->issecurity=false;break; + case 0x01: WAPSettings->issecurity=true;break; + } + + WAPSettings->location=MessageBuffer[tmp+7];//location for second part + + CurrentGetWAPSettingsError=GE_NONE; + break; + + case 0x17: + +#ifdef DEBUG + fprintf(stdout, _("Message: WAP settings receiving error\n")); + switch (MessageBuffer[4]) { + case 0x01:fprintf(stdout, _(" Inside Settings menu. Must leave it\n"));break; + case 0x02:fprintf(stdout, _(" Invalid or empty location\n"));break; + default :fprintf(stdout, _(" Unknown error. Please report it\n")); + } +#endif /* DEBUG */ + + switch (MessageBuffer[4]) { + case 0x01:CurrentGetWAPSettingsError=GE_INSIDESETTINGSMENU;break; + case 0x02:CurrentGetWAPSettingsError=GE_INVALIDSETTINGSLOCATION;break; + default :CurrentGetWAPSettingsError=GE_UNKNOWN; + } + + break; + + case 0x1c: + +#ifdef DEBUG + fprintf(stdout, _("Message: WAP settings received OK\n")); +#endif /* DEBUG */ + + switch (MessageBuffer[5]) { + case 0x00: + + WAPSettings->bearer=WAPSETTINGS_BEARER_SMS; + +#ifdef DEBUG + fprintf(stdout, _(" Settings for SMS bearer:\n")); +#endif /* DEBUG */ + + tmp=6; + + DecodeUnicode(WAPSettings->service, MessageBuffer + tmp+1, + MessageBuffer[tmp] ); + +#ifdef DEBUG + fprintf(stdout, _(" Service number: \"%s\"\n"),WAPSettings->service); +#endif /* DEBUG */ + + tmp=tmp+MessageBuffer[tmp]*2+1; + + DecodeUnicode(WAPSettings->server, MessageBuffer + tmp+ 1, + MessageBuffer[tmp] ); + +#ifdef DEBUG + fprintf(stdout, _(" Server number: \"%s\"\n"),WAPSettings->server); +#endif /* DEBUG */ + + break; + + case 0x01: + + WAPSettings->bearer=WAPSETTINGS_BEARER_DATA; + +#ifdef DEBUG + fprintf(stdout, _(" Settings for data bearer:\n")); +#endif /* DEBUG */ + + tmp=10; + + DecodeUnicode(WAPSettings->ipaddress, MessageBuffer + tmp+ 1, + MessageBuffer[tmp] ); + +#ifdef DEBUG + fprintf(stdout, _(" IP address: \"%s\"\n"),WAPSettings->ipaddress); +#endif /* DEBUG */ + + tmp=tmp+MessageBuffer[tmp]*2+1; + + DecodeUnicode(WAPSettings->dialup, MessageBuffer + tmp+1, + MessageBuffer[tmp] ); + +#ifdef DEBUG + fprintf(stdout, _(" Dial-up number: \"%s\"\n"),WAPSettings->dialup); +#endif /* DEBUG */ + + tmp=tmp+MessageBuffer[tmp]*2+1; + + DecodeUnicode(WAPSettings->user, MessageBuffer + tmp+1, + MessageBuffer[tmp] ); + +#ifdef DEBUG + fprintf(stdout, _(" User name: \"%s\"\n"),WAPSettings->user); +#endif /* DEBUG */ + + tmp=tmp+MessageBuffer[tmp]*2+1; + + DecodeUnicode(WAPSettings->password, MessageBuffer + tmp+1, + MessageBuffer[tmp] ); + +#ifdef DEBUG + fprintf(stdout, _(" Password: \"%s\"\n"),WAPSettings->password); +#endif /* DEBUG */ + +#ifdef DEBUG + fprintf(stdout, _(" Authentication type: ")); + switch (MessageBuffer[6]) { + case 0x00: fprintf(stdout,_("normal"));break; + case 0x01: fprintf(stdout,_("secure"));break; + default: fprintf(stdout,_("unknown"));break; + } + fprintf(stdout, _("\n")); + + fprintf(stdout, _(" Data call type: ")); + switch (MessageBuffer[7]) { + case 0x00: fprintf(stdout,_("analogue"));break; + case 0x01: fprintf(stdout,_("IDSN"));break; + default: fprintf(stdout,_("unknown"));break; + } + fprintf(stdout, _("\n")); + + fprintf(stdout, _(" Data call speed: ")); + switch (MessageBuffer[9]) { + case 0x01: fprintf(stdout,_("9600"));break; + case 0x02: fprintf(stdout,_("14400"));break; + default: fprintf(stdout,_("unknown"));break; + } + fprintf(stdout, _("\n")); + +#endif /* DEBUG */ + + switch (MessageBuffer[6]) { + case 0x00: WAPSettings->isnormalauthentication=true;break; + case 0x01: WAPSettings->isnormalauthentication=false;break; + } + switch (MessageBuffer[7]) { + case 0x00: WAPSettings->isISDNcall=false;break; + case 0x01: WAPSettings->isISDNcall=true;break; + } + switch (MessageBuffer[9]) { + case 0x01: WAPSettings->isspeed14400=false;break; + case 0x02: WAPSettings->isspeed14400=true;break; + } + + break; + + case 0x02: + + WAPSettings->bearer=WAPSETTINGS_BEARER_USSD; + +#ifdef DEBUG + fprintf(stdout, _(" Settings for USSD bearer:\n")); +#endif /* DEBUG */ + + tmp=7; + + DecodeUnicode(WAPSettings->service, MessageBuffer + tmp+1, + MessageBuffer[tmp] ); + +#ifdef DEBUG + if (MessageBuffer[6]==0x01) + fprintf(stdout, _(" Service number: \"%s\"\n"),WAPSettings->service); + else + fprintf(stdout, _(" IP address: \"%s\"\n"),WAPSettings->service); +#endif /* DEBUG */ + + WAPSettings->isIP=true; + if (MessageBuffer[6]==0x01) WAPSettings->isIP=false; + + tmp=tmp+MessageBuffer[tmp]*2+1; + + DecodeUnicode(WAPSettings->code, MessageBuffer + tmp+1, + MessageBuffer[tmp] ); + +#ifdef DEBUG + fprintf(stdout, _(" Service code: \"%s\"\n"),WAPSettings->code); +#endif /* DEBUG */ + + } + + CurrentGetWAPSettingsError=GE_NONE; + break; + } +} + +GSM_Error N7110_GetWAPSettings (GSM_WAPSettings *settings) +{ + unsigned char req[] = { N6110_FRAME_HEADER, 0x15, 0x00}; + unsigned char req2[] = { N6110_FRAME_HEADER, 0x1b, 0x00}; + + GSM_Error error; + + /* We have to enable WAP frames in phone */ + error=N7110_EnableWAPCommands (); + if (error!=GE_NONE) return error; + + req[2]=0x00; + req[4]=settings->location-1; + + WAPSettings=settings; + + error=NULL_SendMessageSequence + (50, &CurrentGetWAPSettingsError, 6, 0x3f, req); + if (error!=GE_NONE) return error; + + req2[2]=0x00; + + req2[4]=settings->location; + + return NULL_SendMessageSequence + (50, &CurrentGetWAPSettingsError, 6, 0x3f, req2); +} + +void N7110_ReplyGetMemoryStatus(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ +#ifdef DEBUG + fprintf(stdout, _("Message: Memory status received:\n")); +#endif + + if (CurrentMemoryStatus && CurrentMemoryStatusError == GE_BUSY) { + /* first Loc. (MessageBuffer[10]<<8) + MessageBuffer[11]; */ + CurrentMemoryStatus->Free = (MessageBuffer[14]<<8) + MessageBuffer[15]; + CurrentMemoryStatus->Used = (MessageBuffer[16]<<8) + MessageBuffer[17]; + CurrentMemoryStatus->Free -= CurrentMemoryStatus->Used; + + CurrentMemoryStatusError = GE_NONE; + +#ifdef DEBUG + fprintf(stdout, _(" Memory Type: %s\n"), N7110_MemoryType_String[MessageBuffer[5]]); + fprintf(stdout, _(" Used: %d\n"), CurrentMemoryStatus->Used); + fprintf(stdout, _(" Free: %d\n"), CurrentMemoryStatus->Free); +#endif /* DEBUG */ + } +} + +/* This function is used to get storage status from the phone. It currently + supports two different memory areas - internal and SIM. */ +GSM_Error N7110_GetMemoryStatus(GSM_MemoryStatus *Status) +{ + unsigned char req[] = { N6110_FRAME_HEADER, + 0x03, /* MemoryStatus request */ + 0x02, + 0x05 /* MemoryType */ + }; + + switch (Status->MemoryType) { + + case GMT_ME: + case GMT_SM: + CurrentMemoryStatus = Status; + + req[5] = N7110_GetMemoryType(Status->MemoryType); + + return NULL_SendMessageSequence + (20, &CurrentMemoryStatusError, 6, 0x03, req); + break; + + case GMT_DC: + case GMT_RC: + case GMT_MC: + Status->Free = 0; + Status->Used = 20; + return GE_NONE; + + default: + return GE_NOTSUPPORTED; + } +} + +void N7110_ReplyGetProfile(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + switch(MessageBuffer[3]) { + + case 0x02: + +#ifdef DEBUG + fprintf(stdout,_("Profile feature %02x received\n"),MessageBuffer[6]); +#endif /* DEBUG */ + + switch (MessageBuffer[6]) { + case 0xff: /* Profile Name */ + DecodeUnicode (CurrentProfile->Name, MessageBuffer+10, MessageBuffer[9]); +#ifdef DEBUG + fprintf(stdout,_(" Name \"%s\"\n"),CurrentProfile->Name); +#endif /* DEBUG */ + + break; + + case 0x00: /* Keypad tone (Off, Level 1 ... Level 3) */ + switch( MessageBuffer[10] ) { + case 0: + CurrentProfile->KeypadTone = PROFILE_KEYPAD_OFF; break; + case 1: + case 2: + case 3: + CurrentProfile->KeypadTone = MessageBuffer[10]-1; break; + } + break; + + case 0x02: /* Call Alert type (Ringing, Ascending, ..., Off) */ + /* I make it compatible with GetProfileCallAlertString */ + switch( MessageBuffer[10] ) { + case 0: CurrentProfile->CallAlert = PROFILE_CALLALERT_RINGING; break; + case 1: CurrentProfile->CallAlert = PROFILE_CALLALERT_ASCENDING; break; + case 2: CurrentProfile->CallAlert = PROFILE_CALLALERT_RINGONCE; break; + case 3: CurrentProfile->CallAlert = PROFILE_CALLALERT_BEEPONCE; break; + case 5: CurrentProfile->CallAlert = PROFILE_CALLALERT_OFF; break; + } + break; + case 0x03: /* Ringtone number */ + CurrentProfile->Ringtone = MessageBuffer[10]; + break; + case 0x04: /* Ringtone volume (from level 1 to level 5) */ + CurrentProfile->Volume = MessageBuffer[10] + 6; + break; + case 0x05: /* MessageTone Type (Off,Standard,...,Ascending) */ + CurrentProfile->MessageTone = MessageBuffer[10]; + break; + case 0x06: /* Vibration (On/Off) */ + CurrentProfile->Vibration = MessageBuffer[10]; + break; + case 0x07: /* WarningTone (On/Off) */ + switch( MessageBuffer[10] ) { + case 0: + CurrentProfile->WarningTone = PROFILE_WARNING_OFF; break; + case 1: + CurrentProfile->WarningTone = PROFILE_WARNING_ON; break; + } + break; + case 0x08: /* Alert for (caller groups) */ + CurrentProfile->CallerGroups = MessageBuffer[10]; + break; + case 0x09: /* Auto Answer for Handsfree and Headset (On/Off) */ + CurrentProfile->AutomaticAnswer = MessageBuffer[10]; + break; + } + + CurrentProfileError=GE_NONE; + break; + default: + +#ifdef DEBUG + fprintf(stdout, _("Message: Unknown message of type 0x39\n")); +#endif /* DEBUG */ + AppendLogText("Unknown msg\n",false); + break; /* Visual C Don't like empty cases */ + + } +} + +GSM_Error N7110_GetProfile(GSM_Profile *Profile) +{ + int i; + + unsigned char req[] = { N6110_FRAME_HEADER, 0x01, 0x01, 0x01, 0x01, + 0x00, //profile number + 0xff}; //feature. Here 0xff=name + + unsigned char req2[11] = {0x03,0x04,0x05,0x06,0x07,0x08,0x0a,0x22, + 0x00,0x02,0x09 }; + + GSM_Error error; + + CurrentProfile = Profile; + + /* When after sending all frames feature==253, it means, that it is not + supported */ + CurrentProfile->KeypadTone=253; + CurrentProfile->Lights=253; + CurrentProfile->CallAlert=253; + CurrentProfile->Ringtone=253; + CurrentProfile->Volume=253; + CurrentProfile->MessageTone=253; + CurrentProfile->WarningTone=253; + CurrentProfile->Vibration=253; + CurrentProfile->CallerGroups=253; + CurrentProfile->ScreenSaver=253; + CurrentProfile->AutomaticAnswer=253; + + req[7] = Profile->Number+1; + + error=NULL_SendMessageSequence + (20, &CurrentProfileError, 9, 0x39, req); + if (error!=GE_NONE) return error; + + for (i = 0; i < 11; i++) { + + req[7] = Profile->Number+1; + + req[8] = req2[i]; + + error=NULL_SendMessageSequence + (20, &CurrentProfileError, 9, 0x39, req); + if (error!=GE_NONE) return error; + } + + return (GE_NONE); +} + +void N7110_ReplyGetCalendarNotesInfo(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int i; + + CurrentCalendarNotesInfo.HowMany = MessageBuffer[4]*256+MessageBuffer[5]; + CurrentCalendarNotesInfo2->HowMany = CurrentCalendarNotesInfo.HowMany; + + for(i=0;iLocation[i]=CurrentCalendarNotesInfo.Location[i]; + } + + CurrentCalendarNotesInfoError=GE_NONE; +} + +GSM_Error N7110_GetCalendarNotesInfo(GSM_NotesInfo *NotesInfo) +{ + unsigned char req[] = { N6110_FRAME_HEADER, + 0x3a, /* get notes info */ + 0xFF, 0xFE //fixed + }; + GSM_Error error; + + CurrentCalendarNotesInfo2=NotesInfo; + + error=NULL_SendMessageSequence(50, &CurrentCalendarNotesInfoError, 6, 0x13, req); + + return error; +} + +void P7110_GetNoteAlarm(int alarmdiff, GSM_DateTime *time, GSM_DateTime *alarm, int alarm2) +{ + time_t t_alarm; + struct tm tm_time; + struct tm *tm_alarm; + +#ifdef DEBUG + if (alarmdiff == 0xffff) fprintf(stdout," No alarm"); + else fprintf(stdout," Alarm is %i seconds before date", alarmdiff*alarm2); + fprintf(stdout,"\n"); +#endif + + if (alarmdiff != 0xffff) { + + memset(&tm_time, 0, sizeof(tm_time)); + tm_time.tm_year = time->Year - 1900; + tm_time.tm_mon = time->Month - 1; + tm_time.tm_mday = time->Day; + tm_time.tm_hour = time->Hour; + tm_time.tm_min = time->Minute; + tm_time.tm_sec = time->Second; + + tzset(); + t_alarm = mktime(&tm_time); + t_alarm -= alarmdiff*alarm2; + + tm_alarm = localtime(&t_alarm); + + alarm->Year = tm_alarm->tm_year + 1900; + alarm->Month = tm_alarm->tm_mon + 1; + alarm->Day = tm_alarm->tm_mday; + alarm->Hour = tm_alarm->tm_hour; + alarm->Minute = tm_alarm->tm_min; + alarm->Second = tm_alarm->tm_sec; + +#ifdef DEBUG + fprintf(stdout, " Alarm: %02i-%02i-%04i %02i:%02i:%02i\n", + alarm->Day,alarm->Month,alarm->Year, + alarm->Hour,alarm->Minute,alarm->Second); +#endif + } +} + +void P7110_GetNoteTimes(unsigned char *block, GSM_CalendarNote *c) +{ + time_t alarmdiff; + + c->Time.Year = block[8]*256+block[9]; + c->Time.Month = block[10]; + c->Time.Day = block[11]; + if (c->Type != GCN_REMINDER) { + c->Time.Hour = block[12]; + c->Time.Minute = block[13]; + } else { + c->Time.Hour = 0; + c->Time.Minute = 0; + } + c->Time.Second = 0; + +#ifdef DEBUG + fprintf(stdout, " Date: %02i-%02i-%04i %02i:%02i:%02i\n", + c->Time.Day,c->Time.Month,c->Time.Year, + c->Time.Hour,c->Time.Minute,c->Time.Second); +#endif + + if (c->Type != GCN_REMINDER) { + alarmdiff = block[14]*256 + block[15]; + P7110_GetNoteAlarm(alarmdiff, &(c->Time), &(c->Alarm), 60); + + c->Recurrance = block[16]*256 + block[17]; + DecodeUnicode(c->Text, block+20, block[18]); + } else { + c->Recurrance = block[12]*256 + block[13]; + DecodeUnicode(c->Text, block+16, block[14]); + } + + /* 0xffff -> 1 Year (8760 hours) */ + if (c->Recurrance == 0xffff) c->Recurrance=8760; + +#ifdef DEBUG + fprintf(stdout, " Recurrance: %i hours\n Text: \"%s\"\n", + c->Recurrance,c->Text); +#endif +} + +void N7110_ReplyGetCalendarNote(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int alarm; + + CurrentCalendarNote->YearOfBirth=0; //for other than birthday + CurrentCalendarNote->AlarmType=0x00;//for other than birthday + CurrentCalendarNote->Phone[0]=0; //for other than call + + CurrentCalendarNote->Alarm.Year = 0; + CurrentCalendarNote->Alarm.Month = 0; + CurrentCalendarNote->Alarm.Day = 0; + CurrentCalendarNote->Alarm.Hour = 0; + CurrentCalendarNote->Alarm.Minute = 0; + CurrentCalendarNote->Alarm.Second = 0; + +#ifdef DEBUG + fprintf(stdout, "Message: calendar note received\n"); +#endif + + switch (MessageBuffer[6]) /* entry type */ { + case 0x01: /* Meeting */ +#ifdef DEBUG + fprintf(stdout, " Note type: meeting\n"); +#endif + CurrentCalendarNote->Type = GCN_MEETING; + P7110_GetNoteTimes(MessageBuffer, CurrentCalendarNote); + CurrentCalendarNoteError=GE_NONE; + break; + + case 0x02: /* Call */ +#ifdef DEBUG + fprintf(stdout, " Note type: call\n"); +#endif + CurrentCalendarNote->Type = GCN_CALL; + P7110_GetNoteTimes(MessageBuffer, CurrentCalendarNote); + DecodeUnicode(CurrentCalendarNote->Phone, + MessageBuffer + 20 + MessageBuffer[18] * 2, MessageBuffer[19]); +#ifdef DEBUG + fprintf(stdout, " Phone number: \"%s\"\n",CurrentCalendarNote->Phone); +#endif + CurrentCalendarNoteError=GE_NONE; + break; + + case 0x04: /* Birthday */ +#ifdef DEBUG + fprintf(stdout, " Note type: birthday\n"); +#endif + CurrentCalendarNote->Type = GCN_BIRTHDAY; + + alarm = ((unsigned int)MessageBuffer[14]) << 24; + alarm += ((unsigned int)MessageBuffer[15]) << 16; + alarm += ((unsigned int)MessageBuffer[16]) << 8; + alarm += MessageBuffer[17]; + + /* CurrentCalendarNote->Time.Year is set earlier */ + CurrentCalendarNote->Time.Month = MessageBuffer[10]; + CurrentCalendarNote->Time.Day = MessageBuffer[11]; + CurrentCalendarNote->Time.Hour = 23; + CurrentCalendarNote->Time.Minute = 59; + CurrentCalendarNote->Time.Second = 58; + P7110_GetNoteAlarm(alarm, &(CurrentCalendarNote->Time), &(CurrentCalendarNote->Alarm) ,1); + + CurrentCalendarNote->YearOfBirth = MessageBuffer[18]*256 + MessageBuffer[19]; + CurrentCalendarNote->Time.Year = CurrentCalendarNote->YearOfBirth; + + CurrentCalendarNote->AlarmType = MessageBuffer[20]; + +#ifdef DEBUG + fprintf(stdout,_(" Alarm type: %s\n"), + (CurrentCalendarNote->AlarmType==0x00) ? "Tone " : "Silent"); + + fprintf(stdout, " Birthday date: %02i-%02i-%04i (age %d)\n",CurrentCalendarNote->Time.Day, + CurrentCalendarNote->Time.Month,CurrentCalendarNote->Time.Year, + CurrentCalendarNote->Alarm.Year - CurrentCalendarNote->Time.Year); +#endif + + DecodeUnicode( CurrentCalendarNote->Text,MessageBuffer+22,MessageBuffer[21]); +#ifdef DEBUG + fprintf(stdout, " Text: \"%s\"\n",CurrentCalendarNote->Text); +#endif + + CurrentCalendarNote->Recurrance = 0; + CurrentCalendarNoteError=GE_NONE; + break; + + case 0x08: /* Reminder */ +#ifdef DEBUG + fprintf(stdout, " Note type: reminder\n"); +#endif + CurrentCalendarNote->Type = GCN_REMINDER; + P7110_GetNoteTimes(MessageBuffer, CurrentCalendarNote); + CurrentCalendarNoteError=GE_NONE; + break; + + default: /* unknown */ +#ifdef DEBUG + fprintf(stdout, " Note type: UNKNOWN\n"); +#endif + break; + } +} + +GSM_Error N7110_GetCalendarNote(GSM_CalendarNote *CalendarNote) +{ + unsigned char req[] = { N6110_FRAME_HEADER, + 0x19, /* get calendar note */ + 0x00, 0x00 //location + }; + + GSM_Error error; + GSM_DateTime date_time; + struct tm *now; + time_t nowh; + + if (CalendarNote->ReadNotesInfo || CurrentCalendarNotesInfo.HowMany==2000) { + error=N7110_GetCalendarNotesInfo(&CurrentCalendarNotesInfo); + if (error!=GE_NONE) return error; + } + +#ifdef DEBUG + fprintf(stdout, _("Calendar Notes Location Logical = %d.\n"), + CalendarNote->Location); + fprintf(stdout, _("Calendar Notes Location Phisical = %d.\n"), + CurrentCalendarNotesInfo.Location[CalendarNote->Location-1]); +#endif + + /* this is for making xgnokii work.. */ + if (CalendarNote->Location > CurrentCalendarNotesInfo.HowMany ) + return GE_INVALIDCALNOTELOCATION; + + req[4] = CurrentCalendarNotesInfo.Location[CalendarNote->Location-1]>>8; + req[5] = CurrentCalendarNotesInfo.Location[CalendarNote->Location-1]&0xff; + CurrentCalendarNote = CalendarNote; + + /* We have to get current year. It's NOT written in frame for Birthday */ + error=N7110_GetDateTime(&date_time); + if (error!=GE_NONE) return error; + if (!date_time.IsSet) { + nowh=time(NULL); + now=localtime(&nowh); + + /* I have 100 (for 2000) Year now :-) */ + if (now->tm_year>99 && now->tm_year<1900) { + now->tm_year=now->tm_year+1900; + } + date_time.Year=now->tm_year; + } + CurrentCalendarNote->Time.Year = date_time.Year; + + error=NULL_SendMessageSequence(50, &CurrentCalendarNoteError, 6, 0x13, req); + + CurrentCalendarNote = NULL; + + return error; +} + +void N7110_ReplyWriteCalendarNote(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ +#ifdef DEBUG + char kz_types[][6] = { "MEET", "CALL", "BIRTH", "REM" }; + + fprintf(stdout, + "Succesfully written Calendar Note Type %s on location %d\n", + kz_types[(MessageBuffer[3]/2)-1], + MessageBuffer[4]*256+MessageBuffer[5] ); + + fprintf(stdout, "--> Exit Status is %d (maybe is the size of buffer written to phone)\n", + MessageBuffer[6]*256+MessageBuffer[7] ); +#endif + CurrentCalendarNoteError=GE_NONE; +} + +long P7110_GetNoteAlarmDiff(GSM_DateTime *time, GSM_DateTime *alarm) +{ + time_t t_alarm; + time_t t_time; + struct tm tm_alarm; + struct tm tm_time; + + tzset(); + + tm_alarm.tm_year=alarm->Year-1900; + tm_alarm.tm_mon=alarm->Month-1; + tm_alarm.tm_mday=alarm->Day; + tm_alarm.tm_hour=alarm->Hour; + tm_alarm.tm_min=alarm->Minute; + tm_alarm.tm_sec=alarm->Second; + tm_alarm.tm_isdst=0; + t_alarm = mktime(&tm_alarm); + + tm_time.tm_year=time->Year-1900; + tm_time.tm_mon=time->Month-1; + tm_time.tm_mday=time->Day; + tm_time.tm_hour=time->Hour; + tm_time.tm_min=time->Minute; + tm_time.tm_sec=time->Second; + tm_time.tm_isdst=0; + t_time = mktime(&tm_time); + +#ifdef DEBUG + fprintf(stdout, " Alarm: %02i-%02i-%04i %02i:%02i:%02i\n", + alarm->Day,alarm->Month,alarm->Year, + alarm->Hour,alarm->Minute,alarm->Second); + fprintf(stdout, " Date: %02i-%02i-%04i %02i:%02i:%02i\n", + time->Day,time->Month,time->Year, + time->Hour,time->Minute,time->Second); + fprintf(stdout,_("Difference in alarm time is %f\n"),difftime( t_time, t_alarm )+3600); +#endif + + return difftime( t_time ,t_alarm )+3600; +} + +GSM_Error N7110_WriteCalendarNote(GSM_CalendarNote *CalendarNote) +{ + unsigned char req[200] = { N6110_FRAME_HEADER, + 0x01, /* note type ... */ + 0x00, 0x00, /* location */ + 0x00, /* entry type */ + 0x00, //fixed + 0x00, 0x00, 0x00, 0x00, /* Year(2bytes), Month, Day */ + /* here starts block */ + 0x00, 0x00, 0x00, 0x00,0x00, 0x00 /* ... depends on note type ... */ + }; + + int count=0; + long seconds, minutes; + + GSM_Error error; + int firstFreeLocation; + + /* + * 6210/7110 needs to seek the first free pos to inhabit with next note + */ + error=N7110_FirstCalendarFreePos(&firstFreeLocation); + if (error!=GE_NONE) return error; + +#ifdef DEBUG + fprintf(stdout, _("First free calendar location is = %d.\n"), + firstFreeLocation); +#endif + + /* Location */ + req[4]=0x00; + req[5]=0x00; + + switch( CalendarNote->Type ) { + case GCN_MEETING : req[6]=0x01; req[3]=0x01; break; + case GCN_CALL : req[6]=0x02; req[3]=0x03; break; + case GCN_BIRTHDAY: req[6]=0x04; req[3]=0x05; break; + case GCN_REMINDER: req[6]=0x08; req[3]=0x07; break; + } + + req[8]=CalendarNote->Time.Year>>8; + req[9]=CalendarNote->Time.Year&0xff; + req[10]=CalendarNote->Time.Month; + req[11]=CalendarNote->Time.Day; + + /* From here starts BLOCK */ + count=12; + switch( CalendarNote->Type ) { + + case GCN_MEETING: + req[count++]=CalendarNote->Time.Hour; // 12 + req[count++]=CalendarNote->Time.Minute; // 13 + /* Alarm .. */ + req[count++]=0xff; // 14 + req[count++]=0xff; // 15 + if( CalendarNote->Alarm.Year ) + { + seconds= P7110_GetNoteAlarmDiff(&CalendarNote->Time, + &CalendarNote->Alarm); + if( seconds>=0L ) { /* Otherwise it's an error condition.... */ + minutes=seconds/60L; + count-=2; + req[count++]=minutes>>8; + req[count++]=minutes&0xff; + } + } + /* Recurrance */ + if( CalendarNote->Recurrance >= 8760 ) + CalendarNote->Recurrance = 0xffff; /* setting 1 Year repeat */ + req[count++]=CalendarNote->Recurrance>>8; // 16 + req[count++]=CalendarNote->Recurrance&0xff; // 17 + /* len of text */ + req[count++]=strlen(CalendarNote->Text); // 18 + /* fixed 0x00 */ + req[count++]=0x00; // 19 + /* Text */ +#ifdef DEBUG + fprintf(stdout, "Count before encode = %d\n", count ); + fprintf(stdout, "Meeting Text is = \"%s\"\n", CalendarNote->Text ); +#endif + + EncodeUnicode (req+count,CalendarNote->Text ,strlen(CalendarNote->Text));// 20->N + count=count+2*strlen(CalendarNote->Text); + break; + + case GCN_CALL: + req[count++]=CalendarNote->Time.Hour; // 12 + req[count++]=CalendarNote->Time.Minute; // 13 + /* Alarm .. */ + req[count++]=0xff; // 14 + req[count++]=0xff; // 15 + if( CalendarNote->Alarm.Year ) + { + seconds= P7110_GetNoteAlarmDiff(&CalendarNote->Time, + &CalendarNote->Alarm); + if( seconds>=0L ) { /* Otherwise it's an error condition.... */ + minutes=seconds/60L; + count-=2; + req[count++]=minutes>>8; + req[count++]=minutes&0xff; + } + } + /* Recurrance */ + if( CalendarNote->Recurrance >= 8760 ) + CalendarNote->Recurrance = 0xffff; /* setting 1 Year repeat */ + req[count++]=CalendarNote->Recurrance>>8; // 16 + req[count++]=CalendarNote->Recurrance&0xff; // 17 + /* len of text */ + req[count++]=strlen(CalendarNote->Text); // 18 + /* fixed 0x00 */ + req[count++]=strlen(CalendarNote->Phone); // 19 + /* Text */ + EncodeUnicode (req+count,CalendarNote->Text ,strlen(CalendarNote->Text));// 20->N + count=count+2*strlen(CalendarNote->Text); + EncodeUnicode (req+count,CalendarNote->Phone ,strlen(CalendarNote->Phone));// (N+1)->n + count=count+2*strlen(CalendarNote->Phone); + break; + + case GCN_BIRTHDAY: + req[count++]=0x00; // 12 Fixed + req[count++]=0x00; // 13 Fixed + + /* Alarm .. */ + req[count++]=0x00; req[count++]=0x00; // 14, 15 + req[count++]=0xff; // 16 + req[count++]=0xff; // 17 + if( CalendarNote->Alarm.Year ) { + // I try with Time.Year = Alarm.Year. If negative, I increase 1 year, + // but only once ! This thing, because I may have Alarm period across + // a year. (eg. Birthday on 2001-01-10 and Alarm on 2000-12-27) + + CalendarNote->Time.Year = CalendarNote->Alarm.Year; + if( (seconds= P7110_GetNoteAlarmDiff(&CalendarNote->Time, + &CalendarNote->Alarm)) < 0L ) { + CalendarNote->Time.Year++; + seconds= P7110_GetNoteAlarmDiff(&CalendarNote->Time, + &CalendarNote->Alarm); + } + if( seconds>=0L ) { /* Otherwise it's an error condition.... */ + count-=4; + req[count++]=seconds>>24; // 14 + req[count++]=(seconds>>16) & 0xff; // 15 + req[count++]=(seconds>>8) & 0xff; // 16 + req[count++]=seconds&0xff; // 17 + } + } + + req[count++]=CalendarNote->AlarmType; // 18 + + /* len of text */ + req[count++]=strlen(CalendarNote->Text); // 19 + + /* Text */ +#ifdef DEBUG + fprintf(stdout, "Count before encode = %d\n", count ); + fprintf(stdout, "Meeting Text is = \"%s\" Altype is 0x%02x \n", CalendarNote->Text , CalendarNote->AlarmType ); +#endif + EncodeUnicode (req+count,CalendarNote->Text ,strlen(CalendarNote->Text));// 22->N + count=count+2*strlen(CalendarNote->Text); + break; + + case GCN_REMINDER: + /* Recurrance */ + if( CalendarNote->Recurrance >= 8760 ) + CalendarNote->Recurrance = 0xffff; /* setting 1 Year repeat */ + req[count++]=CalendarNote->Recurrance>>8; // 12 + req[count++]=CalendarNote->Recurrance&0xff; // 13 + /* len of text */ + req[count++]=strlen(CalendarNote->Text); // 14 + /* fixed 0x00 */ + req[count++]=0x00; // 15 + /* Text */ + EncodeUnicode (req+count,CalendarNote->Text ,strlen(CalendarNote->Text));// 16->N + count=count+2*strlen(CalendarNote->Text); + break; + } + + /* padding */ + req[count]=0x00; +#ifdef DEBUG + fprintf(stdout, "Count after padding = %d\n", count ); +#endif + + CurrentCalendarNote = CalendarNote; + + error=NULL_SendMessageSequence(50, &CurrentCalendarNoteError, count, 0x13, req); + + CurrentCalendarNote = NULL; + + return error; +} + +void N7110_ReplyFirstCalendarFreePos(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + *CurrentFirstCalendarFreePos = MessageBuffer[4]*256+MessageBuffer[5]; + CurrentFirstCalendarFreePosError=GE_NONE; +} + +GSM_Error N7110_FirstCalendarFreePos(int *FreePos) +{ + unsigned char req[] = { N6110_FRAME_HEADER, 0x31 }; + + GSM_Error error; + + CurrentFirstCalendarFreePos = FreePos; + + error=NULL_SendMessageSequence(50, &CurrentFirstCalendarFreePosError, + 4, 0x13, req); + + CurrentFirstCalendarFreePos = NULL; + + return error; +} + +void N7110_ReplyDeleteCalendarNote(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ +#ifdef DEBUG + fprintf(stdout, + "Succesfully Delete Calendar Note on location %d\n", + MessageBuffer[4]*256+MessageBuffer[5] ); + + fprintf(stdout, "--> Other data are :\n" ); + fprintf(stdout, " '%c'[0x%02x](%3d), '%c'[0x%02x](%3d), '%c'[0x%02x](%3d), '%c'[0x%02x](%3d)\n", + MessageBuffer[6], MessageBuffer[6], MessageBuffer[6], + MessageBuffer[7], MessageBuffer[7], MessageBuffer[7], + MessageBuffer[8], MessageBuffer[8], MessageBuffer[8], + MessageBuffer[9], MessageBuffer[9], MessageBuffer[9] ); +#endif + CurrentCalendarNoteError=GE_NONE; +} + +GSM_Error N7110_DeleteCalendarNote(GSM_CalendarNote *CalendarNote) +{ + unsigned char req[] = { N6110_FRAME_HEADER, + 0x0b, /* delete calendar note */ + 0x00, 0x00 //location + }; + + GSM_Error error; + + if (CalendarNote->ReadNotesInfo || CurrentCalendarNotesInfo.HowMany==2000) { + error=N7110_GetCalendarNotesInfo(&CurrentCalendarNotesInfo); + if (error!=GE_NONE) return error; + } + + /* this is for making xgnokii work.. */ + if (CalendarNote->Location > CurrentCalendarNotesInfo.HowMany ) + return GE_INVALIDCALNOTELOCATION; + + req[4] = CurrentCalendarNotesInfo.Location[CalendarNote->Location-1]>>8; + req[5] = CurrentCalendarNotesInfo.Location[CalendarNote->Location-1]&0xff; + + CurrentCalendarNote = CalendarNote; + + error=NULL_SendMessageSequence(50, &CurrentCalendarNoteError, 6, 0x13, req); + + CurrentCalendarNote = NULL; + + return error; +} + +void N7110_ReplyGetSMSFolders(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + wchar_t wc; + + int i, j, tmp; + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Folders received:\n")); +#endif /* DEBUG */ + + i=5; + + CurrentSMSFoldersCount=MessageBuffer[4]; + + for (j=0;jFolder[j].Name," "); +#ifdef DEBUG + fprintf(stdout, _(" Folder Index: %d"),MessageBuffer[i]); +#endif /* DEBUG */ + CurrentSMSFolders->FoldersID[j]=MessageBuffer[i]; + + i=i+2; + +#ifdef DEBUG + fprintf(stdout, _(", folder name: ")); +#endif /* DEBUG */ + tmp=0; + while ((MessageBuffer[i]!=0x00) & (MessageBuffer[i+1]==0x00)) { + + wc = MessageBuffer[i] | (MessageBuffer[i+1] << 8); + + CurrentSMSFolders->Folder[j].Name[tmp]=DecodeWithUnicodeAlphabet(wc); +#ifdef DEBUG + fprintf(stdout, _("%c"),CurrentSMSFolders->Folder[j].Name[tmp]); +#endif /* DEBUG */ + tmp++; + i=i+2; + } +#ifdef DEBUG + fprintf(stdout, _("\n")); +#endif /* DEBUG */ + tmp=0; + i=i+1; + } + + CurrentSMSFoldersError=GE_NONE; +} + +GSM_Error N7110_GetSMSFolders ( GSM_SMSFolders *folders) +{ + unsigned char req[] = { N6110_FRAME_HEADER, 0x7A, 0x00, 0x00}; + + GSM_Error error; + + CurrentSMSFolders=folders; + + error=NULL_SendMessageSequence(20, &CurrentSMSFoldersError, 6, 0x14, req); + + folders->number=CurrentSMSFoldersCount; + + return error; +} + +void N7110_ReplyGetSMSFolderStatus(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int i; + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Folder status received\n")); + fprintf(stdout, _(" Number of Entries: %i"),MessageBuffer[4]*256+MessageBuffer[5]); +#endif /* DEBUG */ + CurrentSMSFolder.number=MessageBuffer[4]*256+MessageBuffer[5]; +#ifdef DEBUG + fprintf(stdout, _(" (indexes ")); +#endif /* DEBUG */ + + for (i=0;iLocation; + /* We made "fake" SMS numbering for SMS in 7110/6210/etc. */ + if ((error = N7110_HandleSMSLocation(smsnum, &folderid, &location, NULL, GSH_DELETE))!=GE_NONE) + return(error); + + req[4]=folderid; + req[5]=location / 256; + req[6]=location; + +#ifdef DEBUG + printf("delete sms: folder %d, location %d\n",folderid,location); +#endif + + return NULL_SendMessageSequence + (50, &CurrentSMSMessageError, 8, 0x14, req); +} + +GSM_Error N7110_GetSMSMessage(GSM_SMSMessage *message) +{ + + unsigned char req[] = { N6110_FRAME_HEADER, + 0x07, + 0x08, // folder ID + 0x00, 0x05, // location + 0x01, + 0x65, + 0x01}; + + int smsnum, location; + u8 folderid; + + GSM_Error error; + CurrentSMSMessage = message; + CurrentSMSMessageError = GE_BUSY; + + + smsnum = message->Location; + + /* we make central handling of real location */ + error = N7110_HandleSMSLocation(smsnum, &folderid, &location, message, GSH_GET); + /* if smsnum is 0 (next sms) we need real smsnum */ + N7110_SMS2FakeLocation( &smsnum, folderid, location); + message->Location = smsnum; + switch(error) + { + case GE_SMSISINMEM: /* future use: get already reed sms from mem */ + return GE_NONE; + break; + case GE_NONE: req[4]=folderid; + req[5]=location / 256; + req[6]=location; +#ifdef DEBUG + fprintf(stdout, _("GetSMSMessage: read folder %d, location %d\n"),folderid,location); +#endif + return NULL_SendMessageSequence(100, &CurrentSMSMessageError, 10, 0x14, req); + break; + default: break; + } + + return(error); +} + +void N7110_ReplySaveSMSMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int smsnum; + + switch (MessageBuffer[3]) { + + /* save sms */ + case 0x05: +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Message stored at folder %d, location %d\n"), MessageBuffer[4], MessageBuffer[6]); +#endif + + if (CurrentSMSMessage!=NULL) { + N7110_SMS2FakeLocation(&smsnum, (u8) MessageBuffer[4], (int) MessageBuffer[6]); + CurrentSMSMessage->MessageNumber=smsnum; + } + + CurrentSMSMessageError = GE_NONE; + break; + + /* save sms failed */ + case 0x06: + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Message save failed\n")); +#endif + CurrentSMSMessageError = GE_SMSSAVEFAILED; + break; + + case 0x84: +#ifdef DEBUG + fprintf(stdout, _("Message: Changed name for SMS Message\n")); +#endif + CurrentSMSMessageError = GE_NONE; + break; + + } +} + +GSM_Error N7110_SaveSMSMessage(GSM_SMSMessage *SMS) +{ + unsigned char req[256] = { + N6110_FRAME_HEADER, 0x04, /* SMS save request*/ + 0x03, /* default: mark sms as GSS_NOTSENTREAD */ + 0x10, /* folder (req[5])*/ + 0x00, /* location */ + 0x00, /* location (req[7])*/ + 0x00 /* ??? */ + }; + + unsigned char req2[200] = {N6110_FRAME_HEADER, 0x83}; + + int length,smsnum,location; + u8 folderid; + GSM_Error error; + SMS_MessageType PDU; + + smsnum = SMS->Location; + +#ifdef DEBUG + printf("save sms: smsnum is :%d\n",smsnum); +#endif + + if ( SMS->Status == GSS_SENTREAD) req[4] = 0x01; + + folderid = SMS->folder; + + PDU=SMS_Deliver; + + error=GSM_EncodeNokiaSMSFrame(SMS, req+9, &length, PDU); + if (error != GE_NONE) return error; + + CurrentSMSMessage = SMS; + + error=N7110_HandleSMSLocation(smsnum, &folderid, &location, SMS, GSH_SAVE); + switch (error) + { + + case GE_BUSYSMSLOCATION: /* delete old sms before save */ + error = N7110_DeleteSMSMessage(SMS); + if (error != GE_NONE) return error; + break; + case GE_NONE: + break; + default: + return error; + break; + } + +#ifdef DEBUG + printf("save sms: want to save at folder:%d , location:%d\n",folderid,location); +#endif + + req[5]=folderid; + req[6]=location / 256; + req[7]=location; + + error=NULL_SendMessageSequence + (70, &CurrentSMSMessageError, 40+length, 0x14, req); + + if (error==GE_NONE && SMS->Name[0]!=0) { + length=4; + N7110_Fake2SMSLocation(SMS->MessageNumber, &folderid, &location); + req2[length++]=folderid; + req2[length++]=location / 256; + req2[length++]=location; + EncodeUnicode(req2+length, SMS->Name, strlen(SMS->Name)); + length=length+strlen(SMS->Name)*2; + req2[length++]=0; + req2[length++]=0; + error=NULL_SendMessageSequence + (70, &CurrentSMSMessageError, length, 0x14, req2); + } + + return error; +} + +/* handling for 7110 folders */ +GSM_Error N7110_HandleSMSLocation(int smsnum, u8 *folder, int *location, GSM_SMSMessage *message, GSM_SMSHandleAction action) +{ + /* remember me */ + static int nextSMSmessage = -1; + static GSM_SMSStatus Status; + + bool found = false; + int folderid; + GSM_OneSMSFolder onefolder; + GSM_Error error; + int ismsnum; + int i; + + switch (action) { + case GSH_DELETE: /* future use: delete sms in mem -> free memory */ + /* for now we make same as in GSH_GET */ + case GSH_GET: /* if smsnum == 0 user wants to read next sms */ + if (smsnum == 0 ) + { + /* first time we read folderstatus */ + if ( nextSMSmessage == -1) + { + nextSMSmessage = 0; + error = N7110_GetSMSStatus( &Status); + if (error!=GE_NONE) return error; + } + ismsnum = Status.foldertable[nextSMSmessage].smsnum; + N7110_Fake2SMSLocation( ismsnum, folder, location); + nextSMSmessage++; + if(nextSMSmessage >= Status.Number) + { + nextSMSmessage = -1; +#ifdef DEBUG + printf("HandleSMS: setting nextSMSmessage to -1\n"); +#endif + } + } else /* user give location -> make fake location */ + { + /* future use: get already read sms from mem */ + N7110_Fake2SMSLocation( smsnum, folder, location); + } + break; + case GSH_SAVE: /* if smsnum == 0 user wants to save in specific folder */ + if (smsnum == 0 ) + { + /* calculate correct folderid */ + *folder = ( *folder + 1) * 8; + + *location = 0; + } else /* user give location -> make fake location */ + { + N7110_Fake2SMSLocation( smsnum, folder, location); + folderid = *folder; + + error=N7110_GetSMSFolderStatus(&onefolder, folderid ); + if (error!=GE_NONE) return error; + + /* is there a sms at that location ? */ + for (i=0; iSendMessage(4, 0x0a, request); + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentRFLevel == -1 ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + /* Make copy in case it changes. */ + rf_level = CurrentRFLevel; + + if (rf_level == -1) + return (GE_NOLINK); + + /* Now convert between the different units we support. */ + + /* Arbitrary units. */ + *units = GRF_Percentage; + *level = rf_level; + return (GE_NONE); +} + +GSM_Error N7110_GetBatteryLevel(GSM_BatteryUnits *units, float *level) +{ + unsigned char request[] = {N6110_FRAME_HEADER, 0x02}; + + int timeout=10; + int batt_level; + + CurrentBatteryLevel=-1; + + Protocol->SendMessage(4, 0x17, request); + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentBatteryLevel == -1 ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + /* Take copy in case it changes. */ + batt_level = CurrentBatteryLevel; + + if (batt_level == -1) + return (GE_NOLINK); + + /* Only units we handle at present are GBU_Arbitrary */ + *units = GBU_Percentage; + *level = batt_level; + return (GE_NONE); +} + +GSM_Error N7110_GetSecurityCode(GSM_SecurityCode *SecurityCode) +{ + unsigned char req[] = {0x00, 0x01, 0x01, 0xee, 0x1c}; + + if (SecurityCode->Type!=GSCT_SecurityCode) return GE_NOTSUPPORTED; + + CurrentSecurityCode=SecurityCode; + + return NULL_SendMessageSequence + (50, &CurrentSecurityCodeError, 5, 0x7a, req); +} + +GSM_Error N7110_GetDateTime(GSM_DateTime *date_time) +{ + return N6110_PrivGetDateTime(date_time,0x19); +} + +/* Needs SIM card with PIN in phone */ +GSM_Error N7110_SetDateTime(GSM_DateTime *date_time) +{ + return N6110_PrivSetDateTime(date_time,0x19); +} + +GSM_Error N7110_GetAlarm(int alarm_number, GSM_DateTime *date_time) +{ + return N6110_PrivGetAlarm(alarm_number,date_time,0x19); +} + +/* FIXME: we should also allow to set the alarm off :-) */ +GSM_Error N7110_SetAlarm(int alarm_number, GSM_DateTime *date_time) +{ + return N6110_PrivSetAlarm(alarm_number,date_time, 0x19); +} + +void N7110_ReplyGetSMSStatus(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + switch (MessageBuffer[3]) { + + /* sms status */ + case 0x37: + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Status Received\n")); + fprintf(stdout, _(" Used msg in phone memory: %i\n"),MessageBuffer[10]*256+MessageBuffer[11]); + fprintf(stdout, _(" Unread msg in phone memory: %i\n"),MessageBuffer[12]*256+MessageBuffer[13]); + fprintf(stdout, _(" Used msg in SIM: %i\n"),MessageBuffer[14]*256+MessageBuffer[15]); + fprintf(stdout, _(" Unread msg in SIM: %i\n"),MessageBuffer[16]*256+MessageBuffer[17]); +#endif /* DEBUG */ + CurrentSMSStatus->UnRead = MessageBuffer[13]; + CurrentSMSStatusError = GE_NONE; + break; + + case 0x38: + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Status error, probably not authorized by PIN\n")); +#endif /* DEBUG */ + CurrentSMSStatusError = GE_INTERNALERROR; + break; + + } +} + +GSM_Error N7110_GetSMSStatus(GSM_SMSStatus *Status) +{ + /* RTH FIXME: what is exact meaning of 0x0037 answer ? */ + /* we check all folders, but get sum of unread sms via 0x0036 request */ + unsigned char req[] = {N6110_FRAME_HEADER, 0x36, 0x64}; + + GSM_SMSFolders folders; + GSM_OneSMSFolder folder; + GSM_Error error; + u8 ifolder; + int ismsnum,ilocation; + int i,j,smsmaxnum; + + CurrentSMSStatus = Status; + + /* read all SMS folders */ + /* check for unread messages in folder 0xf8 */ + error = N7110_GetSMSFolderStatus(&folder, 0xf8); + if (error != GE_NONE) return error; + + smsmaxnum=0; + for(j=0; jfoldertable[smsmaxnum].smsnum = ismsnum; + CurrentSMSStatus->foldertable[smsmaxnum].folder = ifolder; + CurrentSMSStatus->foldertable[smsmaxnum].location = ilocation; + smsmaxnum++; + } + + /* read standard folders */ + N7110_GetSMSFolders (&folders); + for(i=0; iFolder[i], CurrentSMSFolders->FoldersID[i]); + if (error != GE_NONE) return error; + + for(j=0; jFolder[i].number; j++) + { + ifolder = CurrentSMSFolders->FoldersID[i]; + ilocation = CurrentSMSFolders->Folder[i].locations[j]; + N7110_SMS2FakeLocation( &ismsnum, ifolder, ilocation); + CurrentSMSStatus->foldertable[smsmaxnum].smsnum = ismsnum; + CurrentSMSStatus->foldertable[smsmaxnum].folder = ifolder; + CurrentSMSStatus->foldertable[smsmaxnum].location = ilocation; + smsmaxnum++; + } + } + CurrentSMSStatus->Number = smsmaxnum; + + return NULL_SendMessageSequence(10, &CurrentSMSStatusError, 5, 0x14, req); +} + +void N7110_DecodePhonebookFrame(GSM_PhonebookEntry *entry,u8 *MessageBuffer,u16 MessageLength) +{ + int blockcount=0; + unsigned char *pBlock; + int length=0; + +#ifdef DEBUG + int j; +#endif + + pBlock = &MessageBuffer[0]; + + while (length!=MessageLength) { + GSM_SubPhonebookEntry* pEntry = &entry->SubEntries[blockcount]; + +#ifdef DEBUG + fprintf(stdout,_(" ")); + for (j=5;j<(pBlock[3]-6)+5;j++) fprintf(stdout,_("%02x "),pBlock[j]); + fprintf(stdout,_("\n")); +#endif + + switch( pBlock[0] ) { + case N7110_ENTRYTYPE_SPEEDDIAL: + + CurrentSpeedDialEntry->MemoryType = GMT_SM; + if (pBlock[4]==0x02) CurrentSpeedDialEntry->MemoryType = GMT_ME; + + CurrentSpeedDialEntry->Location = pBlock[7]+pBlock[6]*256; + +#ifdef DEBUG + fprintf(stdout, _(" Speed dial\n")); + fprintf(stdout, _(" Location: %d\n"), CurrentSpeedDialEntry->Location); + fprintf(stdout, _(" MemoryType: %i\n"), CurrentSpeedDialEntry->MemoryType); + fprintf(stdout, _(" Number: %d\n"), CurrentSpeedDialEntry->Number); +#endif /* DEBUG */ + + CurrentSpeedDialError=GE_NONE; + break; + + case N7110_ENTRYTYPE_NAME: + DecodeUnicode (entry->Name, pBlock+6, pBlock[5]/2); + if (CurrentGetBitmap && CurrentGetBitmapError == GE_BUSY) + strncpy(CurrentGetBitmap->text,entry->Name,sizeof(CurrentGetBitmap->text)); + entry->Empty = false; +#ifdef DEBUG + fprintf(stdout, _(" Name:\n")); + fprintf(stdout, _(" Name: %s\n"), entry->Name); +#endif /* DEBUG */ + break; + + case N7110_ENTRYTYPE_NUMBER: + pEntry->EntryType = pBlock[0]; + pEntry->NumberType = pBlock[5]; + pEntry->BlockNumber = pBlock[4]; + + DecodeUnicode (pEntry->data.Number, pBlock+10, pBlock[9]/2); + +#ifdef DEBUG + fprintf(stdout, _(" Number:\n")); + fprintf(stdout, _(" Type: %d (%02x)\n"),pEntry->NumberType,pEntry->NumberType); + fprintf(stdout, _(" Number: %s\n"),pEntry->data.Number); +#endif /* DEBUG */ + if( pEntry->EntryType == GSM_Number && + ((pEntry->NumberType == GSM_General && !strcmp(entry->Number,"")) + || pEntry->NumberType == GSM_SIM)) { + strcpy( entry->Number, pEntry->data.Number ); + *pEntry->data.Number = 0; + } else + blockcount++; + break; + case N7110_ENTRYTYPE_DATE: + pEntry->EntryType = pBlock[0]; + pEntry->NumberType = pBlock[5]; + pEntry->BlockNumber = pBlock[4]; + DecodeDateTime(pBlock+6, &pEntry->data.Date); +#ifdef DEBUG + fprintf(stdout, _(" Date:\n")); + fprintf(stdout, _(" Date: %02u.%02u.%04u\n"), pEntry->data.Date.Day, + pEntry->data.Date.Month, pEntry->data.Date.Year ); + fprintf(stdout, _(" Time: %02u:%02u:%02u\n"), pEntry->data.Date.Hour, + pEntry->data.Date.Minute, pEntry->data.Date.Second); +#endif /* DEBUG */ + blockcount++; + break; + case N7110_ENTRYTYPE_NOTE: + case N7110_ENTRYTYPE_POSTAL: + case N7110_ENTRYTYPE_EMAIL: + pEntry->EntryType = pBlock[0]; + pEntry->NumberType = 0; + pEntry->BlockNumber = pBlock[4]; + + DecodeUnicode (pEntry->data.Number, pBlock+6, pBlock[5]/2); + +#ifdef DEBUG + fprintf(stdout, _(" Email or note or postal:\n")); + fprintf(stdout, _(" Type: %d (%02x)\n"),pEntry->EntryType,pEntry->EntryType); + fprintf(stdout, _(" Text: %s\n"),pEntry->data.Number); +#endif /* DEBUG */ + blockcount++; + break; + case N7110_ENTRYTYPE_GROUP: + entry->Group = pBlock[5]-1; /* 0 = family as for 6110 */ + if (CurrentGetBitmap && CurrentGetBitmapError == GE_BUSY) + CurrentGetBitmap->number = entry->Group; +#ifdef DEBUG + fprintf(stdout, _(" Group: %d\n"), entry->Group); +#endif /* DEBUG */ + break; + case N7110_ENTRYTYPE_RINGTONE: + if (CurrentGetBitmap && CurrentGetBitmapError == GE_BUSY) + CurrentGetBitmap->ringtone = pBlock[5]; +#ifdef DEBUG + fprintf(stdout, _(" Group ringtone number %d received.\n"), pBlock[5]); +#endif /* DEBUG */ + break; + case N7110_ENTRYTYPE_LOGOON: + if (CurrentGetBitmap && CurrentGetBitmapError == GE_BUSY) + CurrentGetBitmap->enabled = pBlock[5]; +#ifdef DEBUG + fprintf(stdout, _(" Logo enabled = %d received.\n"), pBlock[5]); +#endif /* DEBUG */ + break; + case N7110_ENTRYTYPE_GROUPLOGO: +#ifdef DEBUG + fprintf(stdout, _(" Caller group logo received.\n")); +#endif /* DEBUG */ + if (CurrentGetBitmap && CurrentGetBitmapError == GE_BUSY) { + CurrentGetBitmap->width = pBlock[5]; + CurrentGetBitmap->height= pBlock[6]; + CurrentGetBitmap->size = pBlock[9]; + if (CurrentGetBitmap->size > sizeof(CurrentGetBitmap->bitmap)) + CurrentGetBitmap->size = CurrentGetBitmap->size; + memcpy(CurrentGetBitmap->bitmap,pBlock+10,CurrentGetBitmap->size); + } + break; + + default: +#ifdef DEBUG + fprintf(stdout, _(" Unknown Entry Code (%u) received.\n"), pBlock[0] ); +#endif /* DEBUG */ + break; + } + +#ifdef DEBUG + fprintf(stdout, _(" Blocksize was: %d (%02x)\n"), (int) pBlock[3], pBlock[3]); +#endif + length=length+pBlock[3]; + + pBlock = &pBlock[(int) pBlock[3]]; + } + + entry->SubEntriesCount = blockcount; + +#ifdef DEBUG + fprintf(stdout, _(" SubBlocks: %d\n"),entry->SubEntriesCount); +#endif /* DEBUG */ +} + +void N7110_ReplyGetMemoryLocation(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + + CurrentPhonebookEntry->Empty = true; + CurrentPhonebookEntry->Group = 5; /* 5 = no group as 6110 */ + CurrentPhonebookEntry->Name[0] = '\0'; + CurrentPhonebookEntry->Number[0] = '\0'; + CurrentPhonebookEntry->SubEntriesCount = 0; + +#ifdef DEBUG + fprintf(stdout, _("Message: Phonebook entry received:\n")); +#endif + + if( MessageBuffer[6] == 0x0f ) // not found + { +#ifdef DEBUG + fprintf(stdout, _(" Error %i\n"),MessageBuffer[10]); + switch (MessageBuffer[10]) { + case 0x34:fprintf(stdout,_(" Invalid phonebook location\n"));break; + case 0x3b:fprintf(stdout,_(" Speed dial not assigned\n"));break; + default :fprintf(stdout,_(" Unknown.Please report\n"));break; + } +#endif + switch (MessageBuffer[10]) { + case 0x34:CurrentPhonebookError = GE_INVALIDPHBOOKLOCATION;break; + case 0x3b:CurrentPhonebookError = GE_INVALIDSPEEDDIALLOCATION;break; + default :CurrentPhonebookError = GE_UNKNOWN; + } + CurrentSpeedDialError=GE_INVALIDSPEEDDIALLOCATION; + + } else { + CurrentPhonebookEntry->Location=MessageBuffer[13]+MessageBuffer[12]*256; + +#ifdef DEBUG + fprintf(stdout,_(" Location: %i\n"),CurrentPhonebookEntry->Location); +#endif + + N7110_DecodePhonebookFrame(CurrentPhonebookEntry,MessageBuffer+18,MessageLength-18); + + CurrentPhonebookError = GE_NONE; + } +} + +/* Routine to get specifed phone book location. Designed to be called by + application. Will block until location is retrieved or a timeout/error + occurs. */ +GSM_Error N7110_GetMemoryLocation(GSM_PhonebookEntry *entry) { + + unsigned char req[] = {N7110_FRAME_HEADER, 0x07, 0x01, 0x01, 0x00, 0x01, + 0x02, //memory type + 0x05, + 0x00, 0x00, //location + 0x00, 0x00}; + + CurrentPhonebookEntry = entry; + + req[9] = N7110_GetMemoryType(entry->MemoryType); + req[10] = (entry->Location>>8); + req[11] = entry->Location & 0xff; + + return NULL_SendMessageSequence + (50, &CurrentPhonebookError, 14, 0x03, req); +} + +void N7110_ReplyWritePhonebookLocation(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + // [12,13] = Location + // [14] = Memory + + if( MessageBuffer[6] == 0x0f ) // ERROR + { +#ifdef DEBUG + /* I didn't find any error when the Text,Name or Number was too long + My Phone 7110; NSE-5; SW 04.84 */ + switch( MessageBuffer[10] ) { + case 0x3d: fprintf(stdout, _("Error: Wrong Entry Type.\n")); break; + case 0x3e: fprintf(stdout, _("Error: Too much entries.\n")); break; + default : fprintf(stdout, _("Error: Unknown error (%u).\n"), MessageBuffer[10]); break; + } +#endif /* DEBUG */ + CurrentPhonebookError = GE_NONE; + } else { +#ifdef DEBUG + fprintf(stdout, _("Message: Phonebook written correctly.\n")); +#endif /* DEBUG */ + + CurrentPhonebookError = GE_NONE; + } +} + +int N7110_PackPBKBlock(int id, int size, int no, unsigned char *buf, unsigned char *block) +{ +#ifdef DEBUG + fprintf(stdout,_("Adding block id:%i,number:%i,length:%i\n"),id,no+1,size+6); +#endif + + *(block++) = id; + *(block++) = 0; + *(block++) = 0; + *(block++) = size + 6; + *(block++) = no + 1; + + memcpy(block, buf, size); + block += size; + + *(block++) = 0; + + return (size + 6); +} + +int N7110_EncodePhonebookFrame(unsigned char *req, GSM_PhonebookEntry entry, int *block2) +{ + int count=0, len, i, block=0; + + char string[500]; + + /* Name */ + len = strlen(entry.Name); + string[0] = len * 2; // Length ot the string (without Termination) + EncodeUnicode((string + 1), entry.Name, len); + string[len * 2 + 1] = 0; // Terminating 0 + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_NAME, len * 2 + 2, block++, string, req + count); + + if (*entry.Number) { + len = strlen(entry.Number); + string[0] = N7110_ENTRYTYPE_NUMBER; + string[1] = string[2] = string[3] = 0; + string[4] = len * 2; // length (without Termination) + EncodeUnicode((string + 5), entry.Number, len); + string[len * 2 + 5] = 0; // Terminating 0 + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_NUMBER, len * 2 + 6, block++, string, req + count); + } + + /* Rest of the subentries */ + for (i = 0; i < entry.SubEntriesCount; i++) { + len = strlen(entry.SubEntries[i].data.Number); + if (entry.SubEntries[i].EntryType != GSM_Number) { + string[0] = len * 2; // length (without Termination) + EncodeUnicode((string + 1), entry.SubEntries[i].data.Number, len); + string[len * 2 + 1] = 0; // Terminating 0 + count += N7110_PackPBKBlock(entry.SubEntries[i].EntryType, len * 2 + 2, block++, string, req + count); + } else { + string[0] = entry.SubEntries[i].NumberType; + string[1] = string[2] = string[3] = 0; + string[4] = len * 2; //length (without Termination) + EncodeUnicode((string + 5), entry.SubEntries[i].data.Number, len); + string[len * 2 + 5] = 0; // Terminating 0 + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_NUMBER, len * 2 + 6, block++, string, req + count); + } + } + + if (entry.Group != 5) { + /* Group */ + string[0] = entry.Group + 1; + string[1] = 0; + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_GROUP, 2, block++, string, req + count); + } + + *block2=block; + + return count; +} + +/* Routine to write phonebook location in phone. */ +GSM_Error N7110_WritePhonebookLocation(GSM_PhonebookEntry *entry) +{ + unsigned char req[500] = {N7110_FRAME_HEADER, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0c, + 0x00, 0x00, /* memory type */ + 0x00, 0x00, /* location */ + 0x00, 0x00, 0x00}; + int count = 18, blocks; + + if (entry->Name[0] != '\0' || entry->Number[0] != '\0') { + req[11] = N7110_GetMemoryType(entry->MemoryType); + req[12] = (entry->Location >> 8); + req[13] = entry->Location & 0xff; + +// if (entry->MemoryType == GMT_SM) entry->SubEntriesCount = 0; + + count=count+N7110_EncodePhonebookFrame(req+18, *entry, &blocks); + + req[17]=blocks; + +#ifdef DEBUG + fprintf(stdout, _("Writing phonebook entry %s...\n"),entry->Name); +#endif + + return NULL_SendMessageSequence(50, &CurrentPhonebookError, count, 0x03, req); + + } else { + + /* empty name & number => we have to delete the phonebook record! */ + return N7110_DeletePhonebookLocation( entry ); + + } +} + +void N7110_ReplyDeletePhonebookLocation(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ +#ifdef DEBUG + fprintf(stdout, _("Message: Phonebook entry deleted correctly\n")); +#endif /* DEBUG */ + CurrentPhonebookError = GE_NONE; +} + +/* delete phonebookentry */ +/* Not used in this moment */ +GSM_Error N7110_DeletePhonebookLocation(GSM_PhonebookEntry *entry) +{ + unsigned char req[256] = { + N7110_FRAME_HEADER, 0x0f, 0x00, 0x01, 0x04, + 0x00, 0x00, 0x0c, 0x01, 0xff, + 0x00, /* location low*/ + 0x01, /* location high*/ + 0x05, /* mem location low*/ + 0x00, /* mem location high*/ + 0x00, 0x00 + }; + + req[12] = (entry->Location >> 8); + req[13] = entry->Location & 0xff; + req[14] = N7110_GetMemoryType(entry->MemoryType); + +#ifdef DEBUG + fprintf(stdout, _("Deleting phonebook entry at location %d...\n"),entry->Location); +#endif + + return NULL_SendMessageSequence(50, &CurrentPhonebookError, 18, 0x03, req); +} + +/* for saving group logos only */ +GSM_Error N7110_WriteGroupDataLocation(GSM_Bitmap *bitmap) +{ + unsigned char req[500] = {N6110_FRAME_HEADER, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0c, + 0x00, 0x10, /* memory type */ + 0x00, 0x00, /* location */ + 0x00, 0x00, 0x00}; + char string[500]; + int block=0, i; + unsigned int count = 18; + + req[13] = bitmap->number + 1; + + /* Logo on/off */ + string[0] = bitmap->enabled?1:0; + string[1] = 0; + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_LOGOON, 2, block++, string, req + count); + + /* Ringtone */ + string[0] = bitmap->ringtone; + string[1] = 0; + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_RINGTONE, 2, block++, string, req + count); + + /* Number of group */ + string[0] = bitmap->number+1; + string[1] = 0; + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_GROUP, 2, block++, string, req + count); + + /* Name */ + if (*bitmap->text) { + i = strlen(bitmap->text); + string[0] = i * 2 + 2; + EncodeUnicode((string + 1), bitmap->text, i); + string[i * 2 + 1] = 0; // Terminating 0 + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_NAME, i * 2 + 2, block++, string, req + count); + } + + /* Logo */ + string[0] = bitmap->width; + string[1] = bitmap->height; + string[2] = 0; + string[3] = 0; + string[4] = bitmap->size; + memcpy(string + 5, bitmap->bitmap, bitmap->size); + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_GROUPLOGO, bitmap->size + 5, block++, string, req + count); + + req[17] = block; //number of blocks + + return NULL_SendMessageSequence + (50, &CurrentPhonebookError, count, 0x03, req); +} + +GSM_Error N7110_GetSpeedDial(GSM_SpeedDial *entry) +{ + unsigned char req[] = {N7110_FRAME_HEADER, 0x07, 0x01, 0x01, 0x00, 0x01, + 0x02, //memory type + 0x05, + 0x00, 0x00, //location + 0x00, 0x00}; + + GSM_PhonebookEntry entry2; + GSM_Error error; + + CurrentPhonebookEntry = &entry2; + + CurrentSpeedDialEntry = entry; + + req[9] = N7110_MEMORY_SD; + req[10] = (entry->Number>>8); + req[11] = entry->Number & 0xff; + + error=NULL_SendMessageSequence + (50, &CurrentSpeedDialError, 14, 0x03, req); + + /* Full compatibility with 6110 */ + if (error==GE_INVALIDSPEEDDIALLOCATION) { + entry->Location=0; + entry->MemoryType=GMT_MT; + return GE_NONE; + } else return error; +} + +/* Experimental ! */ +GSM_Error N7110_SetSpeedDial(GSM_SpeedDial *entry) +{ + unsigned char req[500] = {N6110_FRAME_HEADER, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0c, + 0x00, 0x0e, /* memory type */ + 0x00, 0x00, /* location */ + 0x00, 0x00, 0x00}; + char string[500]; + int block=1; + unsigned int count = 18; + + req[13] = entry->Number; + + string[0]= 0xff; + string[1]= entry->Location/256; + string[2]= entry->Location%256; + string[3]= 0x05; + string[4]= string[5] = 0; + count += N7110_PackPBKBlock(N7110_ENTRYTYPE_SPEEDDIAL, 6, block++, string, req + count); + + req[17] = block - 1; //number of blocks + + return NULL_SendMessageSequence + (50, &CurrentPhonebookError, count, 0x03, req); +} + +/* Set a bitmap or welcome-note */ +GSM_Error N7110_SetBitmap(GSM_Bitmap *Bitmap) +{ + unsigned char reqStartup[1000] = { N7110_FRAME_HEADER, + 0xec, 0x15, // Startup Logo + 0x00, 0x00, 0x00, 0x04, + 0xc0, 0x02, 0x00, + 0x00, // Bitmap height + 0xc0, 0x03, 0x00, + 0x00, // Bitmap width + 0xc0, 0x04, 0x03, 0x00 + }; // Bitmap following + unsigned char reqOp[1000] = { N7110_FRAME_HEADER, + 0xa3, 0x01, + 0x00, // logo disabled + 0x00, 0xf0, 0x00, // network code (000 00) + 0x00 ,0x04, + 0x08, // length of rest + 0x00, 0x00, // Bitmap width / height + 0x00, + 0x00, // Bitmap size + 0x00, 0x00 + }; // Bitmap following + + /* Picture Images */ + unsigned char req2[7] = { N6110_FRAME_HEADER, 0x96,0x00,0x0f,0x07 }; + unsigned char req3[9] = { 0x09, 0x11, 0x19, 0x21, 0x29, 0x31, 0x39, 0x41, 0x49 }; + unsigned char req4[500] = { N6110_FRAME_HEADER, 0x50, 0x07, + 0x00, //location + 0x00,0x00, //index + 0x07}; + + unsigned char req5[120] = {0x00, 0x01, 0x01, 0xec, 0x02,0x00}; + + unsigned char req6[]= {0x00,0x01,0x00,0xaf,0x00}; + + u16 count,i; + + int timeout=60; + + GSM_Error error; + + CurrentSetBitmapError=GE_BUSY; + + switch (Bitmap->type) { + case GSM_WelcomeNoteText: + + EncodeUnicode (req5+5, Bitmap->text, strlen(Bitmap->text)); + count=5+strlen(Bitmap->text)*2; + req5[count++]=0x00; + req5[count++]=0x00; + Protocol->SendMessage(count, 0x7a, req5); + break; + + case GSM_DealerNoteText: + CurrentSetBitmapError = GE_NOTIMPLEMENTED; + break; + + case GSM_StartupLogo: + case GSM_7110StartupLogo: + case GSM_6210StartupLogo: + reqStartup[12] = Bitmap->height; + reqStartup[16] = Bitmap->width; + count = 21; + memcpy(reqStartup+count,Bitmap->bitmap,Bitmap->size); + Protocol->SendMessage(count+Bitmap->size, 0x7a, reqStartup); + break; + + case GSM_OperatorLogo: + case GSM_7110OperatorLogo: + count = 18; + + /* set logo */ + if (strcmp(Bitmap->netcode,"000 00")) { + reqOp[5] = 0x01; // Logo enabled + EncodeNetworkCode(reqOp+6, Bitmap->netcode); + reqOp[11] = 8+GSM_GetBitmapSize(Bitmap); + reqOp[12]=Bitmap->width; + reqOp[13]=Bitmap->height; + reqOp[15]=GSM_GetBitmapSize(Bitmap); + memcpy(reqOp+count,Bitmap->bitmap,Bitmap->size); + count += Bitmap->size; + } else { + for (i=0;i<5;i++) { + req6[4]=i; + error=NULL_SendMessageSequence + (50, &CurrentSetBitmapError, 5, 0x0a, req6); + if (error!=GE_NONE) return error; + } + } + Protocol->SendMessage(count, 0x0a, reqOp); + break; + + case GSM_CallerLogo: + CurrentSetBitmapError = N7110_WriteGroupDataLocation(Bitmap); + break; + + case GSM_PictureImage: + CurrentGetBitmap=Bitmap; + PictureImageNum=0; + count=0; + while (count!=9) { + req2[4]=req3[count]; + PictureImageLoc=req3[count]; + count++; + if (NULL_SendMessageSequence (50, &CurrentGetBitmapError, 7, 0x14, req2)!=GE_NONE) break; + if (PictureImageNum==Bitmap->number+1) break; + } + if (PictureImageNum!=Bitmap->number+1) { + req4[5]=0x21; + req4[6]=0; + req4[7]=0; + } else { + req4[5]=PictureImageLoc; + req4[6]=PictureImageIndex/256; + req4[7]=PictureImageIndex%256; + } + + /* Cleaning */ + for (i=0;i<36;i++) req4[i+9]=0; + + count=8; + if (strlen(Bitmap->text)==0) { + count+=2 ;req4[count]=0x0c; + count+=2 ;req4[count]=0x0d; + count+=2 ;req4[count]=0x0e; + count+=2 ;req4[count]=0x0f; + count+=2 ;req4[count]=0x10; + count+=2 ;req4[count]=0x11; + count+=23;req4[count]=0x02; + count++ ;req4[count]=0x01; + count+=2; + } else { + count+=2 ;req4[count]=0x54; + count++ ;req4[count]=0xd4; + count++ ;req4[count]=0x0d; + count+=2 ;req4[count]=0x0e; + count+=2 ;req4[count]=0x0f; + count+=2 ;req4[count]=0x10; + count+=2 ;req4[count]=0x11; + count+=21;req4[count]=0x01; + count+=3 ;req4[count]=0x01; + count+=2; + } + + req4[count++]=0x01; + req4[count++]=Bitmap->width; + req4[count++]=Bitmap->height; + req4[count++]=Bitmap->size/256; + req4[count++]=Bitmap->size%256; + memcpy(req4+count,Bitmap->bitmap,Bitmap->size); + count += Bitmap->size; + + if (strlen(Bitmap->text)!=0) { + req4[count] = strlen(Bitmap->text); + GSM_PackSevenBitsToEight(0, Bitmap->text, req4+count+1); + count=count+req4[count]; + } else { + req4[count++]=0x00; + } + req4[count++]=0x00; + + CurrentSetBitmapError = GE_BUSY; + + Protocol->SendMessage(count, 0x14, req4); + + case GSM_None: + return GE_NONE; + } + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentSetBitmapError == GE_BUSY ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + if ((Bitmap->type==GSM_OperatorLogo || Bitmap->type==GSM_7110OperatorLogo) + && CurrentSetBitmapError==GE_NONE && !strcmp(Bitmap->netcode,"000 00")) { + return N6110_Reset(0x03); + } + + return CurrentSetBitmapError; +} + +/* Get a bitmap from the phone */ +GSM_Error N7110_GetBitmap(GSM_Bitmap *Bitmap) +{ + unsigned char req[10] = { N6110_FRAME_HEADER }; + + /* Picture Images */ + unsigned char req2[7] = { N6110_FRAME_HEADER, 0x96,0x00,0x0f,0x07 }; + unsigned char req3[9] = { 0x09, 0x11, 0x19, 0x21, 0x29, 0x31, 0x39, 0x41, 0x49 }; + unsigned char req4[9] = { N6110_FRAME_HEADER, 0x07, + 0x00, //location + 0x00,0x00, //index + 0x00, 0x64}; + + /* Welcome note */ + unsigned char req5[] = {0x00, 0x01, 0x01, 0xee, 0x02}; + + u8 count=3; + int timeout; + GSM_PhonebookEntry entry; + + CurrentGetBitmapError = GE_BUSY; + + CurrentGetBitmap=Bitmap; + + switch (CurrentGetBitmap->type) { + case GSM_StartupLogo: + case GSM_7110StartupLogo: + case GSM_6210StartupLogo: + req[count-1]=0x01; /* change FRAME_HEADER */ + req[count++]=0xee; /* to get 0x01ee */ + req[count++]=0x15; + Protocol->SendMessage(count, 0x7a, req); + break; + + case GSM_WelcomeNoteText: + + Protocol->SendMessage(5, 0x7a, req5); + break; + + case GSM_DealerNoteText: + + return GE_NOTIMPLEMENTED; + + case GSM_OperatorLogo: + case GSM_7110OperatorLogo: + req[count++]=0x70; /* NetworkStatus */ + Protocol->SendMessage(count, 0x0a, req); + break; + + case GSM_CallerLogo: + entry.MemoryType = GMT_CG; + entry.Location = Bitmap->number+1; + *Bitmap->text=0; + Bitmap->ringtone=0xFF; + Bitmap->enabled=true; + CurrentGetBitmapError = N7110_GetMemoryLocation(&entry); + CurrentGetBitmap=NULL; + if (entry.Location!=Bitmap->number+1) return GE_UNKNOWN; + if (!strcmp(Bitmap->text,"")) { + switch(Bitmap->number) { + case 0:strcpy(Bitmap->text,"Family\0");break; + case 1:strcpy(Bitmap->text,"VIP\0");break; + case 2:strcpy(Bitmap->text,"Friends\0");break; + case 3:strcpy(Bitmap->text,"Colleagues\0");break; + case 4:strcpy(Bitmap->text,"Other\0");break; + } + } + break; + + case GSM_PictureImage: + + PictureImageNum=0; + count=0; + while (count!=9) { + req2[4]=req3[count]; + PictureImageLoc=req3[count]; + count++; + if (NULL_SendMessageSequence (50, &CurrentGetBitmapError, 7, 0x14, req2)!=GE_NONE) + return CurrentGetBitmapError; + if (PictureImageNum==Bitmap->number+1) break; + } + if (CurrentGetBitmapError!=GE_NONE) return CurrentGetBitmapError; + + req4[4]=PictureImageLoc; + req4[5]=PictureImageIndex/256; + req4[6]=PictureImageIndex%256; + + CurrentGetBitmapError = GE_BUSY; + + Protocol->SendMessage(9, 0x14, req4); + + break; + + default: + return GE_NOTSUPPORTED; + } + + timeout=150; + + while (timeout != 0 && CurrentGetBitmapError == GE_BUSY) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + CurrentGetBitmap=NULL; + + return (CurrentGetBitmapError); +} + +int ReturnBinRingLocation() +{ + char model[64]; + + while (GSM->GetModel(model) != GE_NONE) sleep(1); + + if (strcmp(model,"NSE-5") == 0) return 0x74; //first 0x74 //7110 + if (strcmp(model,"NPE-3") == 0) return 0x89; //first is 0x89; //6210 + if (strcmp(model,"NHM-3") == 0) return 0x89; //quess for 6250 + + return 0; +} + +/* +this works only for 6210, the 7110 needs upload to a location ? +*/ +GSM_Error N7110_SetRingTone(GSM_Ringtone *ringtone, int *maxlength) +{ + + /* Buffer for preview uploading */ + unsigned char buffer[1000] = {0x7C, 0x01, 0x00, 0x0D, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, + 0x00 // Length + }; + int size=FB61_MAX_RINGTONE_FRAME_LENGTH; + + GSM_NetworkInfo NetworkInfo; + + char req[4000] = {N7110_FRAME_HEADER, 0x1F, 0x00, + 0x87, // Location + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x02, 0xFC, 0x09, 0x00, 0x0A, 0x01 + }; + + /* Info from Till Toenshoff [till@uni.de] + + One improvement - for looping you can use an alternative header + normal + 0x02, 0xFC, 0x09, 0x00, 0x0A, 0x01 + + loop + 0x02, 0xFC, 0x09, 0x00, 0x05, 0xLL, 0x0A, 0x01 + + LL=0x01-0x10 + + 0x01=loop once + [...] + 0x10=loop infinite + */ + char tail[] = {0x40, 0x7D, 0x40, 0x5C, 0x0A, 0xFE, 0x40, + 0x20, 0x40, 0x7D, 0x40, 0x37, 0x0A, 0xFE, + 0x0A, 0x0A, 0x40, 0x32, 0x07, 0x0B // 20 Bytes tail + }; + +//{ "c", "c#", "d", "d#", "e", "f", "f#", "g", "g#", "a", "a#", "h" }; + char N7110_notes[14] = + { 0, 1, 2, 3, 4, 4, 5, 6, 7, 8, 9, 10 , 11, 11 }; + + int current = 6, i, note, lastnote = 0, duration; + + /* Preview uploading */ + if (ringtone->location==255) { + *maxlength=GSM_PackRingtone(ringtone, buffer+11, &size); + buffer[10] = size; + Protocol->SendMessage(size+11, 0x00, buffer); + GSM->GetNetworkInfo(&NetworkInfo); //need to make something + sleep(1); + return GE_NONE; //no answer from phone + } + + req[5]=ReturnBinRingLocation()+ringtone->location; + + EncodeUnicode (req+current,ringtone->name ,strlen(ringtone->name)); + + current = 43; + + for (i=0; iNrNotes; i++) { + + if (ringtone->notes[i].note == 255) + note = 0x40; + else + note = 114+12*((ringtone->notes[i].note/14)%4) + N7110_notes[ringtone->notes[i].note%14]; + + duration = 60000*ringtone->notes[i].duration/ringtone->notes[i].tempo/256; // in 8 ms ticks of 7110 + + switch (ringtone->notes[i].style) { + case StaccatoStyle: + if (duration) { + req[current++] = note; // note only for one tick + req[current++] = 1; + duration--; + } + note = 0x40; // rest pause + case NaturalStyle: + if (note != 0x40 && duration) { + req[current++] = 0x40; + req[current++] = 1; // small pause between notes + duration--; + } + default: + if (note != 0x40 && note == lastnote && duration) { + req[current++] = 0x40; + req[current++] = 1; // small pause between same notes + duration--; + } + + while (duration > 125) { + req[current++] = note; + req[current++] = 125; + duration -= 125; + } + req[current++] = note; + req[current++] = duration; + } + lastnote = note; + } + + for (i = 0; i < sizeof(tail); i++) + req[current++] = tail[i]; + + Protocol->SendMessage(current, 0x1F, req); + + sleep(1); + + return GE_NONE; //no answer from phone +} + +void N7110_ReplyGetBinRingtone(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int i, tmp; + + switch (MessageBuffer[3]) { + + case 0x23: + + tmp=0;i=4; + while (MessageBuffer[i]!=0 || MessageBuffer[i+1]!=0) { + tmp++; + i=i+2; + } + + DecodeUnicode(CurrentGetBinRingtone->name,MessageBuffer+6,tmp); + +#ifdef DEBUG + fprintf(stdout, _("Message: Received ringtone \"%s\"\n"),CurrentGetBinRingtone->name); +#endif /* DEBUG */ + + CurrentGetBinRingtone->frame[0]=0x00; + CurrentGetBinRingtone->frame[1]=0x00; + CurrentGetBinRingtone->frame[2]=0x0c; + CurrentGetBinRingtone->frame[3]=0x01; + CurrentGetBinRingtone->frame[4]=0x2c; + + memcpy(CurrentGetBinRingtone->frame+5,CurrentGetBinRingtone->name,strlen(CurrentGetBinRingtone->name)); + + CurrentGetBinRingtone->length=5+strlen(CurrentGetBinRingtone->name); + + CurrentGetBinRingtone->frame[CurrentGetBinRingtone->length++]=0x00; + CurrentGetBinRingtone->frame[CurrentGetBinRingtone->length++]=0x00; + + /* Looking for end */ + i=37; + while (true) { + if (MessageBuffer[i]==0x07 && MessageBuffer[i+1]==0x0b) { + i=i+2;break; + } + if (MessageBuffer[i]==0x0e && MessageBuffer[i+1]==0x0b) { + i=i+2;break; + } + i++; + if (i==MessageLength) break; + } + + /* Copying frame */ + memcpy(CurrentGetBinRingtone->frame+CurrentGetBinRingtone->length,MessageBuffer+37,i-37); + CurrentGetBinRingtone->length=CurrentGetBinRingtone->length+i-37; + + CurrentBinRingtoneError=GE_NONE; + break; + + case 0x24: + +#ifdef DEBUG + fprintf(stdout, _("Message: Received empty ringtone\n")); +#endif /* DEBUG */ + + CurrentBinRingtoneError=GE_INVALIDRINGLOCATION; + break; + } +} + +GSM_Error N7110_GetBinRingTone(GSM_BinRingtone *ringtone) +{ + + unsigned char req[6] = { N6110_FRAME_HEADER, 0x22, 0x00, 0x00 }; + + req[2]=0x01; + + req[5]=ReturnBinRingLocation()+ringtone->location; + + CurrentGetBinRingtone=ringtone; + + return NULL_SendMessageSequence + (50, &CurrentBinRingtoneError, 6, 0x1f, req); + +} + +GSM_Error N7110_SetBinRingTone(GSM_BinRingtone *ringtone) +{ + unsigned char req[1000] = { N6110_FRAME_HEADER, 0x1f, 0x00, 0x00 }; + + GSM_NetworkInfo NetworkInfo; + + int i; + + req[2]=0x01; + + req[5]=ReturnBinRingLocation()+ringtone->location; + + for (i=6;i<35;i++) req[i]=0x00; + + i=6; + + EncodeUnicode (req+i,ringtone->frame+5 ,strlen(ringtone->frame+5)); + + i=5; + + while (ringtone->frame[i]!=0 || ringtone->frame[i+1]!=0) i++; + + memcpy(req+35,ringtone->frame+i,ringtone->length-i); + + Protocol->SendMessage(35+ringtone->length-i, 0x1f, req); + + GSM->GetNetworkInfo(&NetworkInfo); //need to make something + + return GE_NONE; //no answer from phone +} + +void N7110_ReplyIncomingSMS(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + GSM_SMSMessage NullSMS; + +#ifdef DEBUG + fprintf(stdout,_("Message: Incoming SMS\n")); +#endif /* DEBUG */ + + GSM_DecodeNokiaSMSFrame(&NullSMS, MessageBuffer+5, MessageLength-5); + +#ifdef DEBUG + fprintf(stdout, _("\n")); +#endif /* DEBUG */ +} + +void N7110_Dispatch0x0AMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int count; + +#ifdef DEBUG + char name[100]; +#endif + + GSM_NetworkInfo NullNetworkInfo; + + switch (MessageBuffer[3]) { + + case 0xb0: + +#ifdef DEBUG + fprintf(stdout, _("Message: Clearing operator logo msg\n")); +#endif + CurrentSetBitmapError=GE_NONE; + break; + + case 0x71: + + /* Make sure we are expecting NetworkInfo frame */ + if ((CurrentNetworkInfo && CurrentNetworkInfoError == GE_BUSY) || + (CurrentGetBitmap && CurrentGetBitmapError == GE_BUSY)) { +#ifdef DEBUG + fprintf(stdout, _("Message: Network informations and operator logo:\n")); +#endif + } else { +#ifdef DEBUG + fprintf(stdout, _("Message: Network informations not requested, but received:\n")); +#endif + } + + sprintf(NullNetworkInfo.NetworkCode, "%x%x%x %x%x", MessageBuffer[14] & 0x0f, MessageBuffer[14] >>4, MessageBuffer[15] & 0x0f, MessageBuffer[16] & 0x0f, MessageBuffer[16] >>4); + + sprintf(NullNetworkInfo.CellID, "%02x%02x", MessageBuffer[10], MessageBuffer[11]); + + sprintf(NullNetworkInfo.LAC, "%02x%02x", MessageBuffer[12], MessageBuffer[13]); + +#ifdef DEBUG + fprintf(stdout, _(" CellID: %s\n"), NullNetworkInfo.CellID); + fprintf(stdout, _(" LAC: %s\n"), NullNetworkInfo.LAC); + fprintf(stdout, _(" Network code: %s\n"), NullNetworkInfo.NetworkCode); + fprintf(stdout, _(" Network name for gnokii: %s (%s)\n"), + GSM_GetNetworkName(NullNetworkInfo.NetworkCode), + GSM_GetCountryName(NullNetworkInfo.NetworkCode)); + + DecodeUnicode(name,MessageBuffer+18,MessageBuffer[17]); + fprintf(stdout, _(" Network name for phone: %s\n"),name); + + fprintf(stdout, _(" Status: ")); + switch (MessageBuffer[8]) { + case 0x01: fprintf(stdout, _("home network selected")); break; + case 0x02: fprintf(stdout, _("roaming network")); break; + case 0x03: fprintf(stdout, _("requesting network")); break; + case 0x04: fprintf(stdout, _("not registered in the network")); break; + default: fprintf(stdout, _("unknown")); + } + + fprintf(stdout, "\n"); + + fprintf(stdout, _(" Network selection: %s\n"), MessageBuffer[9]==1?_("manual"):_("automatic")); +#endif /* DEBUG */ + + /* Make sure we are expecting NetworkInfo frame */ + if (CurrentNetworkInfo && CurrentNetworkInfoError == GE_BUSY) { + *CurrentNetworkInfo=NullNetworkInfo; + CurrentNetworkInfoError = GE_NONE; + } + + /* Make sure we are expecting an operator logo */ + if (CurrentGetBitmap && CurrentGetBitmapError == GE_BUSY) { + + strcpy(CurrentGetBitmap->netcode,NullNetworkInfo.NetworkCode); + +#ifdef DEBUG + if (MessageBuffer[4] == 0x02) + fprintf(stdout, _("Message: Operator Logo for %s (%s) network received.\n"), + CurrentGetBitmap->netcode, + GSM_GetNetworkName(CurrentGetBitmap->netcode)); + else + fprintf(stdout, _("Message: No Operator Logo for %s (%s) network received.\n"), + CurrentGetBitmap->netcode, + GSM_GetNetworkName(CurrentGetBitmap->netcode)); +#endif + + CurrentGetBitmap->type=GSM_7110OperatorLogo; + if (MessageBuffer[4] == 0x02) { /* logo present */ + count = 7; + count += MessageBuffer[count]; /* skip network info */ + count ++; + CurrentGetBitmap->width=MessageBuffer[count++]; /* 78 */ + CurrentGetBitmap->height=MessageBuffer[count++]; /* 21 */ + count+=4; + CurrentGetBitmap->size=GSM_GetBitmapSize(CurrentGetBitmap); /* packed size */ + memcpy(CurrentGetBitmap->bitmap,MessageBuffer+count,CurrentGetBitmap->size); + } else { + CurrentGetBitmap->width=78; + CurrentGetBitmap->height=21; + CurrentGetBitmap->size=GSM_GetBitmapSize(CurrentGetBitmap); /* packed size */ + memset(CurrentGetBitmap->bitmap,0,CurrentGetBitmap->size); + } + CurrentGetBitmapError=GE_NONE; + } + + break; + + case 0x82: +#ifdef DEBUG + fprintf(stdout, _("Message: Network Level received:\n")); + + fprintf(stdout, _(" Network Level: %d\n"), MessageBuffer[4]); +#endif /* DEBUG */ + + CurrentRFLevel=MessageBuffer[4]; + break; + + case 0xa4: + +#ifdef DEBUG + fprintf(stdout, _("Message: Operator logo set correctly.\n")); +#endif + CurrentSetBitmapError = GE_NONE; + break; + + default: +#ifdef DEBUG + fprintf(stdout, _("Message: Unknown message of type 0x0a\n")); +#endif /* DEBUG */ + AppendLogText("Unknown msg\n",false); + break; /* Visual C Don't like empty cases */ + } +} + +void N7110_Dispatch0x14Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int i, tmp; + GSM_ETSISMSMessage ETSI; + + switch (MessageBuffer[3]) { + + /* We have requested invalid or empty location. */ + case 0x09: + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS reading failed\n")); +#endif /* DEBUG */ + + CurrentSMSMessageError = GE_INVALIDSMSLOCATION; + CurrentGetBitmapError=GE_UNKNOWN; + break; + + /* getsms or picture image */ + case 0x08: + + if (MessageBuffer[8]==0x07) { + + if (CurrentGetBitmap!=NULL) { + + for (i=0;iSender,GSM_UnpackSemiOctetNumber(ETSI.Number,true)); + + CurrentGetBitmap->width=MessageBuffer[47]; + CurrentGetBitmap->height=MessageBuffer[48]; + CurrentGetBitmap->size=GSM_GetBitmapSize(CurrentGetBitmap); + + memcpy(CurrentGetBitmap->bitmap,MessageBuffer+51,CurrentGetBitmap->size); + + tmp=GSM_UnpackEightBitsToSeven(0, 121, 121, MessageBuffer+52+CurrentGetBitmap->size, + CurrentGetBitmap->text); + + CurrentGetBitmap->text[MessageBuffer[51+CurrentGetBitmap->size]]=0; + + CurrentGetBitmapError=GE_NONE; + + } else { +#ifdef DEBUG + fprintf(stdout, _("Message: Picture Image received, but not reqested\n")); +#endif /* DEBUG */ + + CurrentSMSMessageError = GE_SMSTOOLONG; + } + + break; + } else { + /* sms message */ + /* status in byte 4 */ + CurrentSMSMessage->Status = MessageBuffer[4]; + + CurrentSMSMessage->Type = GST_SMS; + if (MessageBuffer[8]==0x01) CurrentSMSMessage->Type = GST_DR; + + CurrentSMSMessage->MessageNumber = CurrentSMSMessage->Location; + + /* RTH FIXME: old folder stuff for xgnokii */ + CurrentSMSMessage->folder = (MessageBuffer[5] / 8)-1; + /* if unreadMessage from folder 0, set INBOX folder */ + if (CurrentSMSMessage->folder==-1) CurrentSMSMessage->folder = 0; +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Message received: Type: %i Folder: %i Location: %i\n") + ,CurrentSMSMessage->Type, CurrentSMSMessage->folder, MessageBuffer[7]); +#endif /* DEBUG */ + + GSM_DecodeNokiaSMSFrame(CurrentSMSMessage, MessageBuffer+9, MessageLength-9); + + /* Signal no error to calling code. */ + CurrentSMSMessageError = GE_NONE; + break; + } + case 0x51: +#ifdef DEBUG + fprintf(stdout, _("Message: Picture Image saved OK\n")); + fprintf(stdout, _(" folder : %02x\n"),MessageBuffer[4]); + fprintf(stdout, _(" location: %02x\n"),MessageBuffer[5]*256+MessageBuffer[6]); +#endif /* DEBUG */ + CurrentSetBitmapError=GE_NONE; + break; + + case 0x97: + +#ifdef DEBUG + fprintf(stdout, _("Message: Received index for Picture Images\n")); +#endif /* DEBUG */ + + for (i=1;inumber+1) { + PictureImageIndex=MessageBuffer[4+i*2]*256+MessageBuffer[5+i*2]; + break; + } + } + + CurrentGetBitmapError=GE_NONE; + CurrentSetBitmapError=GE_NONE; + + break; + + default: + +#ifdef DEBUG + fprintf(stdout, _("Message: Unknown message of type 14\n")); +#endif /* DEBUG */ + AppendLogText("Unknown msg\n",false); + break; /* Visual C Don't like empty cases */ + } +} + +void N7110_Dispatch0x17Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + switch (MessageBuffer[3]) { + + case 0x03: + +#ifdef DEBUG + fprintf(stdout, _("Message: Battery status received:\n")); + + fprintf(stdout, _(" Battery Level: %d\n"), MessageBuffer[5]); +#endif /* DEBUG */ + + CurrentBatteryLevel=MessageBuffer[5]; + break; + + default: + +#ifdef DEBUG + fprintf(stdout, _("Message: Unknown message of type 0x17\n")); +#endif /* DEBUG */ + AppendLogText("Unknown msg\n",false); + break; /* Visual C Don't like empty cases */ + } +} + +void N7110_Dispatch0x7AMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + int i, tmp; + + switch (MessageBuffer[3]) { + + /* Setting setting request */ + case 0xeb: + + switch (MessageBuffer[4]) { + case 0x02: + +#ifdef DEBUG + fprintf(stdout, _("Message: Startup text set correctly.\n")); +#endif + CurrentSetBitmapError = GE_NONE; + break; + + case 0x15: +#ifdef DEBUG + fprintf(stdout, _("Message: Startup logo set correctly.\n")); +#endif + CurrentSetBitmapError = GE_NONE; + break; + } + + break; + + /* Setting received */ + case 0xed: + + switch (MessageBuffer[4]) { + case 0x02: + +#ifdef DEBUG + fprintf(stdout, _("Message: Startup text received.\n")); +#endif + + tmp=0;i=6; + while (MessageBuffer[i]!=0||MessageBuffer[i+1]!=0) { + i=i+2; + tmp++; + } + + DecodeUnicode (CurrentGetBitmap->text, MessageBuffer+6, tmp); + +#ifdef DEBUG + fprintf(stdout, _(" Text: \"%s\"\n"),CurrentGetBitmap->text); +#endif + + CurrentGetBitmapError = GE_NONE; + break; + + case 0x15: +#ifdef DEBUG + if (CurrentGetBitmap && CurrentGetBitmapError == GE_BUSY) + fprintf(stdout, _("Message: Startup logo received.\n")); + else + fprintf(stdout, _("Message: Startup logo not requested, but received.\n")); +#endif + + /* Make sure we are expecting a startup logo */ + if (CurrentGetBitmap && CurrentGetBitmapError == GE_BUSY) { + CurrentGetBitmap->height=MessageBuffer[13]; /* 96 */ + CurrentGetBitmap->width=MessageBuffer[17]; /* 60/65 */ + CurrentGetBitmap->type=GSM_7110StartupLogo; + if (CurrentGetBitmap->width==60) CurrentGetBitmap->type=GSM_6210StartupLogo; + CurrentGetBitmap->size=GSM_GetBitmapSize(CurrentGetBitmap); /* unpacked size */ + if (CurrentGetBitmap->size > sizeof(CurrentGetBitmap->bitmap)) + CurrentGetBitmap->size=sizeof(CurrentGetBitmap->bitmap); + memcpy(CurrentGetBitmap->bitmap,MessageBuffer+22,CurrentGetBitmap->size); + CurrentGetBitmapError=GE_NONE; + } + break; + case 0x1c: +#ifdef DEBUG + fprintf(stdout, _("Message: security code \"")); + + for (i=6;i<11;i++) { + fprintf(stdout, _("%c"),MessageBuffer[i]); + } + + fprintf(stdout,_("\"received.\n")); +#endif + strncpy(CurrentSecurityCode->Code,MessageBuffer+6,6); + + CurrentSecurityCodeError=GE_NONE; + break; + } + break; + + default: +#ifdef DEBUG + fprintf(stdout, _("Unknown message of type 0x7a.\n")); +#endif + AppendLogText("Unknown msg\n",false); + break; /* Visual C Don't like empty cases */ + } +} + +void N7110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + bool unknown=false; + + /* Switch on the basis of the message type byte */ + switch (MessageType) { + + /* Call information */ + /* Note, we use N6110_Dispatch0x40Message, but only some of 0x01 + old msg are available in new phones - other returns generally only + errors */ + case 0x01: + + N6110_Dispatch0x01Message(MessageLength, MessageBuffer, MessageType); + break; + + /* SMS handling */ + case 0x02: + switch (MessageBuffer[3]) { + case 0x02: + case 0x03:N6110_ReplySendSMSMessage(MessageLength,MessageBuffer,MessageType);break; + case 0x0e: + case 0x0f:N7110_ReplyEnableIncomingSMSInfo(MessageLength,MessageBuffer,MessageType);break; + case 0x11:N7110_ReplyIncomingSMS (MessageLength,MessageBuffer,MessageType);break; + case 0x21:N6110_ReplySetCellBroadcast (MessageLength, MessageBuffer, MessageType);break; + case 0x23:N6110_ReplyReadCellBroadcast (MessageLength, MessageBuffer, MessageType);break; + case 0x31:N6110_ReplySetSMSCenter (MessageLength,MessageBuffer,MessageType);break; + case 0x34: + case 0x35:N6110_ReplyGetSMSCenter(MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Phonebook and speed dials */ + case 0x03: + switch (MessageBuffer[3]) { + case 0x04:N7110_ReplyGetMemoryStatus (MessageLength,MessageBuffer,MessageType);break; + case 0x08:N7110_ReplyGetMemoryLocation (MessageLength,MessageBuffer,MessageType);break; + case 0x10:N7110_ReplyDeletePhonebookLocation(MessageLength,MessageBuffer,MessageType);break; + case 0x0C:N7110_ReplyWritePhonebookLocation (MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* This is call forwarding stuff */ + case 0x06: + switch (MessageBuffer[3]) { + case 0x02: + case 0x03:N6110_ReplyCallDivert (MessageLength,MessageBuffer,MessageType);break; + default :N6110_Dispatch0x06Message(MessageLength,MessageBuffer,MessageType);break; + } + break; + + /* Network and operator logo */ + case 0x0a: + + N7110_Dispatch0x0AMessage(MessageLength, MessageBuffer, MessageType); + break; + + /* Calendar notes handling */ + case 0x13: + switch (MessageBuffer[3]) { + case 0x02: + case 0x04: + case 0x06: + case 0x08:N7110_ReplyWriteCalendarNote (MessageLength,MessageBuffer,MessageType);break; + case 0x0c:N7110_ReplyDeleteCalendarNote (MessageLength,MessageBuffer,MessageType);break; + case 0x1A:N7110_ReplyGetCalendarNote (MessageLength,MessageBuffer,MessageType);break; + case 0x32:N7110_ReplyFirstCalendarFreePos(MessageLength,MessageBuffer,MessageType);break; + case 0x3b:N7110_ReplyGetCalendarNotesInfo(MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* SMS stuff */ + case 0x14: + switch (MessageBuffer[3]) { + case 0x05: + case 0x06:N7110_ReplySaveSMSMessage (MessageLength,MessageBuffer,MessageType);break; + case 0x0b:N7110_ReplyDeleteSMSMessage (MessageLength,MessageBuffer,MessageType);break; + case 0x37: + case 0x38:N7110_ReplyGetSMSStatus (MessageLength,MessageBuffer,MessageType);break; + case 0x6C:N7110_ReplyGetSMSFolderStatus(MessageLength,MessageBuffer,MessageType);break; + case 0x7B:N7110_ReplyGetSMSFolders (MessageLength,MessageBuffer,MessageType);break; + case 0x84:N7110_ReplySaveSMSMessage (MessageLength,MessageBuffer,MessageType);break; + default :N7110_Dispatch0x14Message (MessageLength, MessageBuffer, MessageType);break; + } + break; + + /* Battery status */ + case 0x17: + + N7110_Dispatch0x17Message(MessageLength, MessageBuffer, MessageType); + break; + + /* Date and time */ + case 0x19: + switch (MessageBuffer[3]) { + case 0x61:N6110_ReplySetDateTime(MessageLength,MessageBuffer,MessageType);break; + case 0x63:N6110_ReplyGetDateTime(MessageLength,MessageBuffer,MessageType);break; + case 0x6c:N6110_ReplySetAlarm (MessageLength,MessageBuffer,MessageType);break; + case 0x6e:N6110_ReplyGetAlarm (MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Ringtones */ + case 0x1f: + switch (MessageBuffer[3]) { + case 0x23: + case 0x24:N7110_ReplyGetBinRingtone(MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Profiles */ + case 0x39: + + N7110_ReplyGetProfile(MessageLength, MessageBuffer, MessageType); + break; + + /* WAP */ + case 0x3f: + switch (MessageBuffer[3]) { + case 0x01: + case 0x02:N7110_ReplyEnableWAPCommands(MessageLength,MessageBuffer,MessageType);break; + case 0x07: + case 0x08:N7110_ReplyGetWAPBookmark (MessageLength,MessageBuffer,MessageType);break; + case 0x0a: + case 0x0b:N7110_ReplySetWAPBookmark (MessageLength,MessageBuffer,MessageType);break; + case 0x16: + case 0x17: + case 0x1c:N7110_ReplyGetWAPSettings (MessageLength,MessageBuffer,MessageType);break; + default :unknown=true;break; + } + break; + + /* Internal phone functions ? */ + /* Note, we use N6110_Dispatch0x40Message, but only some of 0x40 + old msg are available in new phones - other returns generally only + errors */ + case 0x40: + switch (MessageBuffer[2]) { + case 0x64:N6110_ReplyEnableExtendedCommands (MessageLength,MessageBuffer,MessageType);break; + case 0x65:N6110_ReplyResetPhoneSettings (MessageLength,MessageBuffer,MessageType);break; + case 0x66:N6110_ReplyIMEI (MessageLength,MessageBuffer,MessageType);break; + case 0x6a:N6110_ReplyGetProductProfileSetting(MessageLength,MessageBuffer,MessageType);break; + case 0x6b:N6110_ReplySetProductProfileSetting(MessageLength,MessageBuffer,MessageType);break; + case 0x7e:N6110_ReplyNetmonitor (MessageLength,MessageBuffer,MessageType);break; + case 0x8a:N6110_ReplySimlockInfo (MessageLength,MessageBuffer,MessageType);break; + case 0x8f:N6110_ReplyPlayTone (MessageLength,MessageBuffer,MessageType);break; + case 0xc8:N6110_ReplyHW (MessageLength,MessageBuffer,MessageType);break; + default :N6110_Dispatch0x40Message (MessageLength,MessageBuffer,MessageType);break; + } + break; + + /* Settings */ + case 0x7a: + + N7110_Dispatch0x7AMessage(MessageLength, MessageBuffer, MessageType); + break; + + /***** Acknowlegment of our frames. *****/ + case FBUS_FRTYPE_ACK: + + N6110_DispatchACKMessage(MessageLength, MessageBuffer, MessageType); + break; + + case 0xd2: + + N6110_ReplyID(MessageLength, MessageBuffer, MessageType); + break; + + /***** Unknown message *****/ + /* If you think that you know the exact meaning of other messages - please + let us know. */ + default: + +#ifdef DEBUG + fprintf(stdout, _("Message: Unknown message type.\n")); +#endif /* DEBUG */ + AppendLogText("Unknown msg type\n",false); + break; + + } + + if (unknown) { +#ifdef DEBUG + fprintf(stdout, _("Unknown message of type %02x.\n"),MessageType); +#endif + AppendLogText("Unknown msg\n",false); + } +} diff --git a/common/newmodules/newat.c b/common/newmodules/newat.c new file mode 100644 index 0000000..01e051f --- /dev/null +++ b/common/newmodules/newat.c @@ -0,0 +1,2050 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for accessing functions on the at and similar + phones. + +*/ + +/* "Turn on" prototypes in n-at.h */ + +#define __n_at_c + +/* System header files */ +#include +#include +#include + +#ifndef WIN32 + #include "devices/device.h" +#endif + +#ifdef WIN32 + #include "misc_win32.h" +#endif + +/* Various header file */ +#ifndef VC6 + #include "config.h" +#endif + +#include "gsm-api.h" +#include "gsm-coding.h" +#include "newmodules/newat.h" +#include "newmodules/n6110.h" +/* Global variables used by code in gsm-api.c to expose the functions + supported by this model of phone. */ + + + + + + +/* Here we initialise model specific functions. */ + +GSM_Functions Nat_Functions = { + Nat_Initialise, + Nat_DispatchMessage, + NULL_Terminate, + NULL_KeepAlive, + Nat_GetMemoryLocation, + Nat_WritePhonebookLocation, + UNIMPLEMENTED, + UNIMPLEMENTED, + Nat_GetMemoryStatus, + Nat_GetSMSStatus, + Nat_GetSMSCenter, + Nat_SetSMSCenter, + Nat_GetSMSMessage, + Nat_DeleteSMSMessage, + Nat_SendSMSMessage, + Nat_SaveSMSMessage, + Nat_GetRFLevel, + Nat_GetBatteryLevel, + Nat_GetPowerSource, + Nat_GetDisplayStatus, //fill it + Nat_EnterSecurityCode, + Nat_GetSecurityCodeStatus, + UNIMPLEMENTED, + N6110_GetIMEI, + N6110_GetRevision, + N6110_GetModel, + Nat_GetDateTime, + Nat_SetDateTime, + Nat_GetAlarm, + Nat_SetAlarm, //doesn't work correctly... + Nat_DialVoice, + UNIMPLEMENTED, + UNIMPLEMENTED, + Nat_GetNetworkInfo, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + Nat_SendDTMF, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + Nat_CancelCall, + Nat_PressKey, //fill it + UNIMPLEMENTED, //DisplayOutput= AT+CDIS + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + N6110_GetSMSFolders, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + UNIMPLEMENTED, + Nat_CallDivert, + UNIMPLEMENTED, + Nat_GetManufacturer +}; + +/* Mobile phone information */ + +GSM_Information Nat_Information = { + "", /* Supported models in FBUS */ + "at", /* Supported models in MBUS */ + "", /* Supported models in FBUS over infrared */ + "", /* Supported models in FBUS over DLR3 */ + "at", /* Supported models in AT commands mode */ + "", + "", + "", + 4, /* Max RF Level */ + 0, /* Min RF Level */ + GRF_Arbitrary, /* RF level units */ + 4, /* Max Battery Level */ + 0, /* Min Battery Level */ + GBU_Arbitrary, /* Battery level units */ + GDT_None, /* No date/time support */ + GDT_None, /* No alarm support */ + 0 /* Max alarms = 0 */ +}; + +/* Type of SMS mode. 0=PDU mode; 1=text mode */ +int SMSATCMGF=-1; //-1 when not used earlier +#define SMS_AT_PDU 0 +#define SMS_AT_TEXT 1 + +/* Type of charset for phonebook 0=GSM; 1=HEX */ +int PBKATCSCS=-1; //-1 when not used earlier +#define PBK_AT_GSM 0 +#define PBK_AT_HEX 1 + +/* Manufacturer of connected AT compatible phone */ +int ATMan=-1; // -1 when not used earlier +#define AT_MAN_NOKIA 0 +#define AT_MAN_SIEMENS 1 + +int ExtractOneParameter(unsigned char *input, unsigned char *output) +{ + int position=0; + + while (*input!=',' && *input!=0x0d) { + *output=*input; + input++; + output++; + position++; + } + *output=0; + position++; + return position; +} + +void ATDecodeDateTime(GSM_DateTime *dt, unsigned char *input) +{ + dt->Year=2000+(*input-'0')*10; input++; + dt->Year=dt->Year+(*input-'0'); input++; + + input++; + dt->Month=(*input-'0')*10; input++; + dt->Month=dt->Month+(*input-'0'); input++; + + input++; + dt->Day=(*input-'0')*10; input++; + dt->Day=dt->Day+(*input-'0'); input++; + + input++; + dt->Hour=(*input-'0')*10; input++; + dt->Hour=dt->Hour+(*input-'0'); input++; + + input++; + dt->Minute=(*input-'0')*10; input++; + dt->Minute=dt->Minute+(*input-'0');input++; + + input++; + dt->Second=(*input-'0')*10; input++; + dt->Second=dt->Second+(*input-'0');input++; + + if (input!=NULL) { + input++; + dt->Timezone=(*input-'0')*10; input++; + dt->Timezone=dt->Timezone+(*input-'0');input++; + input=input-2; + if (*input=='-') dt->Timezone=-dt->Timezone; + } +} + +void Nat_ReplyGetIMEI(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + strncpy(Current_IMEI,MessageBuffer+10,15); + +#ifdef DEBUG + fprintf(stdout, _("Message: IMEI %s received\n"),Current_IMEI); +#endif + + CurrentGetIMEIError=GE_NONE; +} + +GSM_Error Nat_SendIMEIFrame() +{ + unsigned char req[8] = {"AT+CGSN\r"}; + + return NULL_SendMessageSequence + (50, &CurrentGetIMEIError, 8, 0x00, req); +} + +void Nat_ReplyGetID(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i; + + i=10; + if (strncmp("Nokia Communicator GSM900/1800",MessageBuffer+i,30)==0) { +#ifdef DEBUG + fprintf(stdout, _("Message: Mobile phone model identification received:\n")); + fprintf(stdout, _(" Model: RAE-3\n")); +#endif + strcpy(Current_Model,"RAE-3"); + CurrentMagicError=GE_NONE; + return; + } + if (strncmp("Nokia 6210",MessageBuffer+i,10)==0) { +#ifdef DEBUG + fprintf(stdout, _("Message: Mobile phone model identification received:\n")); + fprintf(stdout, _(" Model: NPE-3\n")); +#endif + strcpy(Current_Model,"NPE-3"); + CurrentMagicError=GE_NONE; + return; + } + + while (MessageBuffer[i]!=0x0d && MessageBuffer[i]!=0x0a) { + Current_Model[i-10]=MessageBuffer[i]; + i++; + } + Current_Model[i-9]=0; + +#ifdef DEBUG + fprintf(stdout, _("Message: Mobile phone model identification received:\n")); + fprintf(stdout, _(" Model: %s\n"),Current_Model); +#endif + + CurrentMagicError=GE_NONE; +} + +GSM_Error Nat_SendIDFrame() +{ + unsigned char req[8] = {"AT+CGMM\r"}; + + return NULL_SendMessageSequence + (50, &CurrentMagicError, 8, 0x00, req); +} + +void Nat_ReplyGetHW(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + int i,current; + +#ifdef DEBUG + fprintf(stdout, _("Message: Mobile phone model identification received:\n")); +#endif + + switch (ATMan) { + case AT_MAN_NOKIA: +#ifdef DEBUG + fprintf(stdout, _(" Firmware: ")); + for (i=12;i<17;i++) fprintf(stdout,_("%c"),MessageBuffer[i]); + fprintf(stdout, _("\n")); + /* Some Nokia phones like 9210 return only firmware */ + if (MessageLength>24) { + fprintf(stdout, _(" Hardware: ")); + for (i=21;i<25;i++) fprintf(stdout,_("%c"),MessageBuffer[i]); + fprintf(stdout, _("\n")); + } +#endif + + strcpy(Current_Revision,"SW");current=2; + for (i=12;i<17;i++) Current_Revision[current++]=MessageBuffer[i]; + Current_Revision[current++]=','; + Current_Revision[current++]=' '; + Current_Revision[current++]='H'; + Current_Revision[current++]='W'; + if (MessageLength>24) { + for (i=21;i<25;i++) Current_Revision[current++]=MessageBuffer[i]; + } else { + /* Some Nokia phones like 9210 return only firmware */ + /* Here we copy firmware as hardware */ + for (i=12;i<17;i++) Current_Revision[current++]=MessageBuffer[i]; + } + break; + case AT_MAN_SIEMENS: + current=0;i=18; + strcpy(Current_Revision,"SW");current=2; + while (MessageBuffer[i]!=0x0d && MessageBuffer[i]!=0x0a) { + Current_Revision[current++]=MessageBuffer[i]; + i++; + } + Current_Revision[current++]=','; + Current_Revision[current++]=' '; + Current_Revision[current++]='H'; + Current_Revision[current++]='W'; + i=18; + while (MessageBuffer[i]!=0x0d && MessageBuffer[i]!=0x0a) { + Current_Revision[current++]=MessageBuffer[i]; + i++; + } + + break; + default: + strcpy(Current_Revision,"SWxx.xx, HWxxxx"); + break; + } + + CurrentGetHWError=GE_NONE; +} + +GSM_Error Nat_SendHWFrame() +{ + unsigned char req[8] = {"AT+CGMR\r"}; + + return NULL_SendMessageSequence + (50, &CurrentGetHWError, 8, 0x00, req); +} + +void Nat_ReplyGetManufacturer(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: phone manufacturer received\n")); +#endif + + if (strstr(MessageBuffer,"Nokia")) { +#ifdef DEBUG + fprintf(stdout, _(" Nokia\n")); +#endif + ATMan=AT_MAN_NOKIA; + } + + if (strstr(MessageBuffer,"SIEMENS")) { +#ifdef DEBUG + fprintf(stdout, _(" Siemens\n")); +#endif + ATMan=AT_MAN_SIEMENS; + } + + CurrentMagicError=GE_NONE; +} + +GSM_Error Nat_SendManufacturerFrame() +{ + unsigned char req[8] = {"AT+CGMI\r"}; + + return NULL_SendMessageSequence + (50, &CurrentMagicError, 8, 0x00, req); +} + +/* Initialise variables and state machine. */ +GSM_Error Nat_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE) + { + return GE_NOTSUPPORTED; + } + + + /* We try to escape AT+CMGS mode, at least Siemens M20 then needs to get some rest + */ +// WRITEPHONE(PortFD,"\x1B\r",2); +// usleep(500000); + + usleep(100); + + if (Nat_SendManufacturerFrame()!=GE_NONE) return GE_TIMEOUT; + + if (Nat_SendIMEIFrame()!=GE_NONE) return GE_TIMEOUT; + + if (Nat_SendIDFrame()!=GE_NONE) return GE_TIMEOUT; + + if (Nat_SendHWFrame()!=GE_NONE) return GE_TIMEOUT; + + /* In AT doesn't have any init strings, etc. Phone answered with frame, + so connection should be enabled ;-) */ + CurrentLinkOK = true; + + return (GE_NONE); +} + +GSM_Error Nat_GetManufacturer(char* manufacturer) +{ + switch (ATMan) { + case AT_MAN_NOKIA :strcpy (manufacturer, "Nokia"); break; + case AT_MAN_SIEMENS:strcpy (manufacturer, "Siemens");break; + default :strcpy (manufacturer, "unknown");break; + } + + return GE_NONE; +} + +void Nat_ReplyPBKSetMemoryTypeError(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: memory setting error\n")); +#endif + + CurrentPhonebookError=GE_UNKNOWN; +} + +void Nat_ReplyPBKSetMemoryType(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: memory type set OK\n")); +#endif + + CurrentPhonebookError=GE_NONE; +} + +static GSM_Error PBKSetMemoryType(GSM_MemoryType type) +{ + char req[] = "AT+CPBS=\"XX\"\r"; + char req2[10]; + + GetMemoryTypeString(req2, &type); + + req[9]=req2[0]; + req[10]=req2[1]; + + return NULL_SendMessageSequence + (50, &CurrentPhonebookError, strlen(req), 0x00, req); +} + +void Nat_ReplySetCharset(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + if (strncmp("AT+CSCS=\"HEX\"",MessageBuffer,13)==0) { +#ifdef DEBUG + fprintf(stdout, _("Message: charset set to HEX\n")); +#endif + CurrentPhonebookError=GE_NONE; + } + if (strncmp("AT+CSCS=\"GSM\"",MessageBuffer,13)==0) { +#ifdef DEBUG + fprintf(stdout, _("Message: charset set to GSM\n")); +#endif + CurrentPhonebookError=GE_NONE; + } +} + +GSM_Error SetCharset() +{ + unsigned char req [14] = {"AT+CSCS=\"HEX\"\r"}; // HEX charset + unsigned char req2[14] = {"AT+CSCS=\"GSM\"\r"}; // GSM charset + GSM_Error error; + + error=NULL_SendMessageSequence + (50, &CurrentPhonebookError, 14, 0x00, req); + if (error==GE_NONE) { + PBKATCSCS=PBK_AT_HEX; + return GE_NONE; + } + + error=NULL_SendMessageSequence + (50, &CurrentPhonebookError, 14, 0x00, req2); + if (error==GE_NONE) { + PBKATCSCS=PBK_AT_GSM; + return GE_NONE; + } + + return error; +} + +void Nat_ReplyGetMemoryLocationError(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: phonebook entry receiving error\n")); +#endif + + CurrentPhonebookError=GE_UNKNOWN; +} + +/* FIXME: M20 can have " inside name. We can't get endpos by finding first " */ +void Nat_ReplyGetMemoryLocation(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + char *pos, *endpos; + int l; + +#ifdef DEBUG + fprintf(stdout, _("Message: phonebook entry received\n")); +#endif + + CurrentPhonebookEntry->Empty = true; + *(CurrentPhonebookEntry->Name) = '\0'; + *(CurrentPhonebookEntry->Number) = '\0'; + CurrentPhonebookEntry->SubEntriesCount=0; + CurrentPhonebookEntry->Group = 0; + + pos = strchr(MessageBuffer, '\"'); + endpos = NULL; + if (pos) { + endpos = strchr(++pos, '\"'); + if (endpos) { + *endpos = '\0'; + strcpy(CurrentPhonebookEntry->Number, pos); + } + pos = NULL; + if (endpos) pos = strchr(++endpos, '\"'); + endpos = NULL; + if (pos) { + pos++; + l = pos - (char *)MessageBuffer; + endpos = memchr(pos, '\"', MessageLength - l); + } + if (endpos) { + l = endpos - pos; + switch (PBKATCSCS) { + case PBK_AT_GSM: + DecodeDefault(CurrentPhonebookEntry->Name, pos, l); + break; + case PBK_AT_HEX: + DecodeHexBin(CurrentPhonebookEntry->Name, pos, l); + break; + } + } + } + + CurrentPhonebookError=GE_NONE; +} + +GSM_Error Nat_GetMemoryLocation(GSM_PhonebookEntry *entry) +{ + GSM_Error error; + char req[] = "AT+CPBR=00000\r"; + + if (PBKATCSCS==-1) { + error=SetCharset(); + if (error!=GE_NONE) return error; + } + + error = PBKSetMemoryType(entry->MemoryType); + if (error != GE_NONE) return error; + + CurrentPhonebookEntry = entry; + + sprintf(req + 8, "%5d\r", entry->Location); + + return NULL_SendMessageSequence + (50, &CurrentPhonebookError, strlen(req), 0x00, req); +} + +void Nat_ReplyWritePhonebookLocation(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: phonebook entry set OK\n")); +#endif + + CurrentPhonebookError=GE_NONE; +} + +GSM_Error Nat_WritePhonebookLocation(GSM_PhonebookEntry * entry) +{ + GSM_Error error; + char req[128]; + char Name[128]; + char Number[100]; + u8 i; + + switch (entry->MemoryType) { + case GMT_ME: + /* FIXME: the 7110, 6210... supports long phonebookentries. in lack + of documentation we only support SIM memory */ + if(GetModelFeature (FN_PHONEBOOK)==F_PBK71INT) return GE_NOTIMPLEMENTED; + + break; + default: + break; + } + + if (PBKATCSCS==-1) { + error=SetCharset(); + if (error!=GE_NONE) return error; + } + + error = PBKSetMemoryType(entry->MemoryType); + if (error != GE_NONE) return error; + + switch (PBKATCSCS) { + case PBK_AT_HEX: + EncodeHexBin (Name, entry->Name, strlen(entry->Name)); + Name[strlen(entry->Name)*2]=0; + break; + case PBK_AT_GSM: + EncodeDefault (Name, entry->Name, strlen(entry->Name)); + Name[strlen(entry->Name)]=0; + break; + } + + GSM_PackSemiOctetNumber(entry->Number,Number,false); + i=Number[0]; + + sprintf(req, "AT+CPBW=%d, \"%s\", %i, \"%s\"\r", + entry->Location, entry->Number, i, Name); + + return NULL_SendMessageSequence + (50, &CurrentPhonebookError, strlen(req), 0x00, req); +} + +void Nat_ReplyGetMemoryStatusCPBS(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + char *start; + +#ifdef DEBUG + fprintf(stdout, _("Message: memory status received\n")); +#endif + + CurrentMemoryStatus->Used = 0; + CurrentMemoryStatus->Free = 0; + + start = strchr(MessageBuffer, ','); + + if (start) { + start++; + CurrentMemoryStatus->Used = atoi(start); + start = strchr(start, ','); + if (start) { + start++; + CurrentMemoryStatus->Free = atoi(start) - CurrentMemoryStatus->Used; + CurrentMemoryStatusError=GE_NONE; + } else CurrentMemoryStatusError=GE_UNKNOWN; + } else CurrentMemoryStatusError=GE_UNKNOWN; +} + +void Nat_ReplyGetMemoryStatusCPBSError(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { +#ifdef DEBUG + fprintf(stdout, _("Message: memory status receiving error\n")); +#endif + CurrentMemoryStatusError=GE_UNKNOWN; +} + +void Nat_ReplyGetMemoryStatusCPBR(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + char *start; + +#ifdef DEBUG + fprintf(stdout, _("Message: memory size received\n")); +#endif + + CurrentMemoryStatus->Used = 0; + CurrentMemoryStatus->Free = 0; + + start = strchr(MessageBuffer, '-'); + + if (start) { + start++; + /* Parse +CPBR: (first-last),max_number_len,max_name_len */ + /* We cannot get Used/Free info. We can get only size of memory + we don't have size in memory status and because of it + we make assigment used=size_of_memory, free=0. + It's better than nothing */ + CurrentMemoryStatus->Used = atoi(start); + CurrentMemoryStatusError=GE_NONE; + } else CurrentMemoryStatusError=GE_UNKNOWN; +} + +GSM_Error Nat_GetMemoryStatus(GSM_MemoryStatus *Status) +{ + GSM_Error error; + char req [] ="AT+CPBS?\r"; /* in some phones doesn't work or doesn't return + memory status inside */ + char req2[] ="AT+CPBR=?\r"; + + error = PBKSetMemoryType(Status->MemoryType); + if (error != GE_NONE) return error; + + CurrentMemoryStatus = Status; + + error=NULL_SendMessageSequence + (20, &CurrentMemoryStatusError, strlen(req), 0x00, req); + if (error==GE_NONE) { + CurrentMemoryStatus = NULL; + return error; + } + + error=NULL_SendMessageSequence + (20, &CurrentMemoryStatusError, strlen(req2), 0x00, req2); + + CurrentMemoryStatus = NULL; + + return error; +} + +void Nat_ReplyCallDivert(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + int current; + +#ifdef DEBUG + fprintf(stdout, _("Message: call forwarding info\n")); +#endif + if (MessageLength>0x20) { + current=27; + while (MessageBuffer[current]!='"') { + CurrentCallDivert->Number[current-27]=MessageBuffer[current]; + current++; + } + CurrentCallDivert->Enabled=true; + CurrentCallDivert->Number[current-27]=0x00; + CurrentCallDivert->Timeout=999;//where is it in frame ? + } else { + CurrentCallDivert->Enabled=false; + } + CurrentCallDivertError=GE_NONE; +} + +GSM_Error Nat_CallDivert(GSM_CallDivert *cd) +{ + char req[64]; + GSM_Error error; + char Number[100]; + int i; + + sprintf(req, "AT+CCFC="); + + switch (cd->DType) { + case GSM_CDV_AllTypes : strcat(req, "4"); break; + case GSM_CDV_Busy : strcat(req, "1"); break; + case GSM_CDV_NoAnswer : strcat(req, "2"); break; + case GSM_CDV_OutOfReach: strcat(req, "3"); break; + default : return GE_NOTIMPLEMENTED; + } + + if (cd->Operation == GSM_CDV_Register) { + GSM_PackSemiOctetNumber(cd->Number,Number,false); + i=Number[0]; + + sprintf(req, "%s,%d,\"%s\",%i,,,%d", req, + cd->Operation,cd->Number,i,cd->Timeout); + } else + sprintf(req, "%s,%d", req, cd->Operation); + + strcat(req, "\r\n"); + + CurrentCallDivert = cd; + + error=NULL_SendMessageSequence + (100, &CurrentCallDivertError, strlen(req), 0x00, req); + + CurrentCallDivert = NULL; + + return error; +} + +void Nat_ReplyGetNetworkInfo(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + int i,current; + GSM_NetworkInfo NullNetworkInfo; + + if (!strncmp(MessageBuffer,"AT+CREG=",8)) return; + + /* TODO: checking if phone really registered to network */ + + current=23; + + /* Make sure we are expecting NetworkInfo frame */ + if (CurrentNetworkInfo && CurrentNetworkInfoError == GE_BUSY) { +#ifdef DEBUG + fprintf(stdout, _("Message: network info received\n")); +#endif + + NullNetworkInfo.NetworkCode[0]=0; //no exist + + for (i=0;i<4;i++) NullNetworkInfo.CellID[i]=MessageBuffer[i+current]; + + NullNetworkInfo.CellID[4]=0; + + current=current+7; + + for (i=0;i<4;i++) NullNetworkInfo.LAC[i]=MessageBuffer[i+current]; + + NullNetworkInfo.LAC[4]=0; + +#ifdef DEBUG + fprintf(stdout, _(" CellID: %s\n"), NullNetworkInfo.CellID); + fprintf(stdout, _(" LAC: %s\n"), NullNetworkInfo.LAC); +#endif + + } + + /* Make sure we are expecting NetworkInfo frame */ + if (CurrentNetworkInfo && CurrentNetworkInfoError == GE_BUSY) + *CurrentNetworkInfo=NullNetworkInfo; + + CurrentNetworkInfoError = GE_NONE; +} + +void Nat_ReplyGetNetworkInfoCOPS(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + /* Make sure we are expecting NetworkInfo frame */ + if (CurrentNetworkInfo && CurrentNetworkInfoError == GE_BUSY) { +#ifdef DEBUG + fprintf(stdout, _("Message: network info received\n")); +#endif + if (MessageBuffer[20]=='2') { + CurrentNetworkInfo->NetworkCode[0]=MessageBuffer[23]; + CurrentNetworkInfo->NetworkCode[1]=MessageBuffer[24]; + CurrentNetworkInfo->NetworkCode[2]=MessageBuffer[25]; + CurrentNetworkInfo->NetworkCode[3]=' '; + CurrentNetworkInfo->NetworkCode[4]=MessageBuffer[26]; + CurrentNetworkInfo->NetworkCode[5]=MessageBuffer[27]; + CurrentNetworkInfo->NetworkCode[6]=0; + + CurrentNetworkInfoError = GE_NONE; + } + } +} + +GSM_Error Nat_GetNetworkInfo(GSM_NetworkInfo *NetworkInfo) +{ + GSM_Error error; + + Protocol->SendMessage(10, 0x00, "AT+CREG=2\r"); + + CurrentNetworkInfo = NetworkInfo; + + error=NULL_SendMessageSequence + (20, &CurrentNetworkInfoError, 9, 0x00, "AT+CREG?\r"); + if (error!=GE_NONE) return error; + + error=NULL_SendMessageSequence + (20, &CurrentNetworkInfoError, 9, 0x00, "AT+COPS?\r"); + + CurrentNetworkInfo = NULL; + + return error; +} + +void Nat_ReplyGetBatteryLevel(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: power source and battery info received\n")); +#endif + + CurrentPowerSource=atoi(MessageBuffer+15); + CurrentBatteryLevel=atoi(MessageBuffer+17); +} + +GSM_Error Nat_GetBatteryLevel(GSM_BatteryUnits *units, float *level) +{ + int timeout=10; + int batt_level; + + CurrentBatteryLevel=-1; + + Protocol->SendMessage(7, 0x00, "AT+CBC\r"); + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentBatteryLevel == -1 ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + /* Take copy in case it changes. */ + batt_level = CurrentBatteryLevel; + + if (batt_level != -1) { + + /* Only units we handle at present are GBU_Arbitrary */ + if (*units == GBU_Arbitrary) { + if (batt_level >= 70) { *level = 4; return (GE_NONE); } + if (batt_level >= 50) { *level = 3; return (GE_NONE); } + if (batt_level >= 30) { *level = 2; return (GE_NONE); } + if (batt_level >= 10) { *level = 1; return (GE_NONE); } + *level = 0; + return (GE_NONE); + } + + return (GE_INTERNALERROR); + } + else + return (GE_NOLINK); +} + +GSM_Error Nat_GetPowerSource(GSM_PowerSource * source) +{ + *source = CurrentPowerSource; + return (GE_NONE); +} + +void Nat_ReplyGetRFLevel(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: RF level info received\n")); +#endif + CurrentRFLevel=atoi(MessageBuffer+15); +} + +GSM_Error Nat_GetRFLevel(GSM_RFUnits *units, float *level) +{ + int timeout=10; + int rf_level; + + CurrentRFLevel=-1; + + Protocol->SendMessage(7, 0x00, "AT+CSQ\r"); + + /* Wait for timeout or other error. */ + while (timeout != 0 && CurrentRFLevel == -1 ) { + + if (--timeout == 0) + return (GE_TIMEOUT); + + usleep (100000); + } + + /* Make copy in case it changes. */ + rf_level = CurrentRFLevel; + + if (rf_level == -1) + return (GE_NOLINK); + + /* Now convert between the different units we support. */ + + if (*units == GRF_Arbitrary) { + if (CurrentRFLevel == 99) { *level = 0;return (GE_NONE); } + if (CurrentRFLevel > 23) { *level = 4;return (GE_NONE); } + if (CurrentRFLevel > 17) { *level = 3;return (GE_NONE); } + if (CurrentRFLevel > 11) { *level = 2;return (GE_NONE); } + if (CurrentRFLevel > 5) { *level = 1;return (GE_NONE); } + *level = 0; + return (GE_NONE); + } + + /* CSQ units. */ + if (*units == GRF_CSQ) { + if ((CurrentRFLevel <= 31) || (CurrentRFLevel >= 0)) + *level = CurrentRFLevel; + else + *level = 99; /* Unknown/undefined */ + return (GE_NONE); + } + + /* Unit type is one we don't handle so return error */ + return (GE_INTERNALERROR); +} + +GSM_Error Nat_GetDisplayStatus(int *Status) { + char req[128]; + + sprintf(req, "AT+CIND?\r"); + + return NULL_SendMessageSequence + (50, &CurrentDisplayStatusError, strlen(req), 0x00, req); +} + +GSM_Error Nat_PressKey(int key, int event) +{ + char req[128]; + + sprintf(req, "AT+CKPD=\"1\",\"20\"\r"); + + return NULL_SendMessageSequence + (50, &CurrentPressKeyError, strlen(req), 0x00, req); +// return GE_NOTSUPPORTED; +} + +GSM_Error Nat_DialVoice(char *Number) { + char req[39] = "ATDT"; + + if (strlen(Number) > 32) + return (GE_INTERNALERROR); + + strcat(req, Number); + strcat(req, ";\r"); + + return NULL_SendMessageSequence + (50, &CurrentDialVoiceError, 4+2+strlen(Number), 0x00, req); +} + +void Nat_ReplyCancelCall(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: call hangup OK\n")); +#endif + + CurrentDialVoiceError=GE_NONE; +} + +GSM_Error Nat_CancelCall(void) +{ + char req[] = "AT+CHUP\r"; + + return NULL_SendMessageSequence + (50, &CurrentDialVoiceError, strlen(req), 0x00, req); +} + +GSM_Error Nat_SendDTMF(char *String) +{ + int n; + char req[80] = "AT+VTS="; + + for (n = 0; n < 32; n++) { + if (String[n] == '\0') break; + if (n != 0) req[6 + 2 * n] = ','; + req[7 + 2 * n] = String[n]; + } + + strcat(req, ";\r"); + + return NULL_SendMessageSequence + (50, &CurrentSendDTMFError,7+2+2*strlen(String) , 0x00, req); +} + +GSM_Error Nat_EnterSecurityCode(GSM_SecurityCode SecurityCode) +{ + char req[128]; + + if ((SecurityCode.Type != GSCT_Pin) + && (SecurityCode.Type != GSCT_Pin2)) return (GE_NOTIMPLEMENTED); + + sprintf(req, "AT+CPIN=\"%s\"\r", SecurityCode.Code); + + return NULL_SendMessageSequence + (20, &CurrentSecurityCodeError, strlen(req), 0x00, req); +} + +void Nat_ReplyGetSecurityCodeStatus(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + char *start; + +#ifdef DEBUG + fprintf(stdout, _("Message: security code status received\n")); +#endif + + start = strchr(MessageBuffer, ':'); + start+=2; + + *CurrentSecurityCodeStatus = 0; + + if (!strncmp(start, "READY", 5)) *CurrentSecurityCodeStatus = GSCT_None; + + if (!strncmp(start, "SIM ", 4)) { + start += 4; + if (!strncmp(start, "PIN2", 4)) *CurrentSecurityCodeStatus = GSCT_Pin2; + if (!strncmp(start, "PUK2", 4)) *CurrentSecurityCodeStatus = GSCT_Puk2; + if (!strncmp(start, "PIN", 3)) *CurrentSecurityCodeStatus = GSCT_Pin; + if (!strncmp(start, "PUK", 3)) *CurrentSecurityCodeStatus = GSCT_Puk; + } + + CurrentSecurityCodeError=GE_NONE; +} + +GSM_Error Nat_GetSecurityCodeStatus(int *Status) +{ + CurrentSecurityCodeStatus = Status; + + return NULL_SendMessageSequence + (20, &CurrentSecurityCodeError, 9, 0x00, "AT+CPIN?\r"); +} + +void Nat_ReplyGetDateTime(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + int current; + + current=19; + +#ifdef DEBUG + fprintf(stdout,_("Message: date/time received\n")); +#endif + + if (MessageBuffer[current]==0x0d) { + CurrentDateTime->IsSet=false; + } else { + CurrentDateTime->IsSet=true; + + ATDecodeDateTime(CurrentDateTime, MessageBuffer+(current)); + +#ifdef DEBUG + fprintf(stdout,_(" %i/%i/%i %i:%i:%i\n"), + CurrentDateTime->Day,CurrentDateTime->Month,CurrentDateTime->Year, + CurrentDateTime->Hour,CurrentDateTime->Minute,CurrentDateTime->Second); +#endif + } + CurrentDateTimeError=GE_NONE; +} + +GSM_Error Nat_GetDateTime(GSM_DateTime *date_time) +{ + unsigned char req[9] = {"AT+CCLK?\r"}; + + CurrentDateTime=date_time; + + return NULL_SendMessageSequence + (50, &CurrentDateTimeError, 9, 0x00, req); +} + +void Nat_ReplySetDateTime(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout,_("Message: date/time set OK\n")); +#endif + CurrentSetDateTimeError=GE_NONE; +} + +void Nat_ReplyDateTimeError(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { +#ifdef DEBUG + fprintf(stdout,_("Message: date & time functions error\n")); +#endif + CurrentSetDateTimeError=GE_UNKNOWN; + CurrentDateTimeError=GE_UNKNOWN; +} + +GSM_Error Nat_SetDateTime(GSM_DateTime *date_time) +{ + char req[128]; + + sprintf(req, "AT+CCLK=\"%02i/%02i/%02i,%02i:%02i:%02i+00\"\r", + date_time->Year-2000,date_time->Month,date_time->Day, + date_time->Hour,date_time->Minute,date_time->Second); + + return NULL_SendMessageSequence + (20, &CurrentSetDateTimeError, strlen(req), 0x00, req); +} + +void Nat_ReplyGetAlarm(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + int current; + + current=19; +#ifdef DEBUG + fprintf(stdout,_("Message: alarm info received\n")); +#endif + if (MessageBuffer[current-1]==0x0d) { + CurrentAlarm->IsSet=false; + CurrentAlarm->Hour=0; + CurrentAlarm->Minute=0; + } else { + CurrentAlarm->IsSet=true; + + ATDecodeDateTime(CurrentAlarm, MessageBuffer+(current)); + +#ifdef DEBUG + fprintf(stdout,_(" %i:%i\n"),CurrentAlarm->Hour,CurrentAlarm->Minute); +#endif + } + CurrentAlarmError=GE_NONE; +} + +GSM_Error Nat_GetAlarm(int alarm_number, GSM_DateTime *date_time) +{ + unsigned char req[9] = {"AT+CALA?\r"}; + + CurrentAlarm=date_time; + + return NULL_SendMessageSequence + (50, &CurrentAlarmError, 9, 0x00, req); +} + +/* FIXME: we should also allow to set the alarm off :-) */ +/* Doesn't work ? */ +GSM_Error Nat_SetAlarm(int alarm_number, GSM_DateTime *date_time) +{ + char req[128]; + int i=0; + + sprintf(req, "AT+CALA=\"%02i/%02i/%02i,%02i:%02i:%02i+00\",0,1\r", + i,i,i,date_time->Hour,date_time->Minute,i); + + return NULL_SendMessageSequence + (50, &CurrentSetAlarmError, strlen(req), 0x00, req); +} + +void Nat_ReplyAlarmError(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { +#ifdef DEBUG + fprintf(stdout,_("Message: alarm functions error\n")); +#endif + CurrentSetAlarmError=GE_UNKNOWN; + CurrentAlarmError=GE_UNKNOWN; +} + +void Nat_ReplyGetSMSCenter(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + int i,start; + unsigned char buffer[300]; + + start=18; + +#ifdef DEBUG + fprintf(stdout, _("Message: SMSC data received\n")); +#endif + + /* FIXME: support for all formats */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + for (i=1;iNumber,buffer); + + /* Some default values. Is it possible to get them ? */ + CurrentMessageCenter->Name[0]=0; + CurrentMessageCenter->DefaultRecipient[0]=0; + CurrentMessageCenter->Format=GSMF_Text; + CurrentMessageCenter->Validity=GSMV_Max_Time; + +#ifdef DEBUG + fprintf(stdout, _(" Number: '%s'\n"),buffer); +#endif + + CurrentMessageCenterError=GE_NONE; + } +} + +/* We only get SMSC number */ +/* Is it possible to get more ? */ +GSM_Error Nat_GetSMSCenter(GSM_MessageCenter *MessageCenter) +{ + unsigned char req[] = {"AT+CSCA?\r"}; + + if (MessageCenter->No!=1) return GE_NOTSUPPORTED; + + CurrentMessageCenter=MessageCenter; + + return NULL_SendMessageSequence + (50, &CurrentMessageCenterError, strlen(req), 0x00, req); +} + +void Nat_ReplySetSMSCenter(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: SMSC number set OK\n")); +#endif + + CurrentMessageCenterError=GE_NONE; +} + +GSM_Error Nat_SetSMSCenter(GSM_MessageCenter *MessageCenter) +{ + unsigned char req[50]; + + if (MessageCenter->No!=1) return GE_NOTSUPPORTED; + + sprintf(req, "AT+CSCA=\"%s\"\r",MessageCenter->Number); + + return NULL_SendMessageSequence + (50, &CurrentMessageCenterError, strlen(req), 0x00, req); +} + +void Nat_ReplySMSGetPDUType(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + if (strncmp("AT+CSDH=1\r",MessageBuffer,10)==0) { +#ifdef DEBUG + fprintf(stdout, _("Message: all SMS parameters will be displayed in text mode\n")); +#endif + CurrentSMSMessageError=GE_NONE; + } + if (strncmp("AT+CMGF=0\r",MessageBuffer,10)==0) { +#ifdef DEBUG + fprintf(stdout, _("Message: set PDU mode for SMS\n")); +#endif + CurrentSMSMessageError=GE_NONE; + } + if (strncmp("AT+CMGF=1\r",MessageBuffer,10)==0) { +#ifdef DEBUG + fprintf(stdout, _("Message: set text mode for SMS\n")); +#endif + CurrentSMSMessageError=GE_NONE; + } +} + +GSM_Error SMSGetPDUType() +{ + unsigned char req [10] = {"AT+CMGF=0\r"}; //sets PDU mode + + unsigned char req2[10] = {"AT+CMGF=1\r"}; //sets text mode + unsigned char req3[10] = {"AT+CSDH=1\r"}; //shows all parameters in text mode + + GSM_Error error; + + error=NULL_SendMessageSequence (50, &CurrentSMSMessageError, 10, 0x00, req); + if (error==GE_NONE) { + SMSATCMGF=SMS_AT_PDU; + return GE_NONE; + } + + error=NULL_SendMessageSequence (50, &CurrentSMSMessageError, 10, 0x00, req2); + if (error==GE_NONE) { + SMSATCMGF=SMS_AT_TEXT; + + error=NULL_SendMessageSequence (50, &CurrentSMSMessageError, 10, 0x00, req3); + } + + return error; +} + +GSM_Error GSM_DecodeETSISMSFrame(GSM_SMSMessage *SMS, unsigned char *req, int length) +{ + SMS_MessageType PDU=SMS_Deliver; + GSM_ETSISMSMessage ETSI; + int i,current=0,current2=0; + GSM_Error error; + + for(i=0;iType = GST_SMS; + SMS->folder= GST_OUTBOX; + current++; //TPMR is ignored now + current2=((req[current])+1)/2+1; + for(i=0;iType = GST_SMS; + SMS->folder= GST_INBOX; + current2=((req[current])+1)/2+1; + for(i=0;iType = GST_DR; + SMS->folder= GST_INBOX; + current++; //TPMR is ignored now + current2=((req[current])+1)/2+1; + for(i=0;iStatus=GSS_NOTSENTREAD; + if (MessageBuffer[start]=='1' || MessageBuffer[start]=='3') + CurrentSMSMessage->Status=GSS_SENTREAD; + + while(true) { + if (MessageBuffer[start]==0x0a) break; + start++; + } + start++; + + /* We need to find last char of PDU text. We can't use MessageLength, + because sometimes some phones (like Siemens M20) return + some strange things after main PDU */ + end=start+1; + while(true) { + if (MessageBuffer[end]==0x0a) break; + end++; + } + + DecodeHexBin (buffer, MessageBuffer+start, end-start-1); + + GSM_DecodeETSISMSFrame(CurrentSMSMessage,buffer,(end-start-1)/2); + + CurrentSMSMessageError=GE_NONE; + break; + case SMS_AT_TEXT: + start=19; + + start+=ExtractOneParameter(MessageBuffer+start, buffer); + + if (!strcmp(buffer,"\"0\"") || !strcmp(buffer,"\"REC UNREAD\"")) { + CurrentSMSMessage->Type=GST_SMS; + CurrentSMSMessage->folder=GST_INBOX; + CurrentSMSMessage->SMSData=true; + CurrentSMSMessage->Status=GSS_NOTSENTREAD; + } else if (!strcmp(buffer,"\"1\"") || !strcmp(buffer,"\"REC READ\"")) { + CurrentSMSMessage->Type=GST_SMS; + CurrentSMSMessage->folder=GST_INBOX; + CurrentSMSMessage->SMSData=true; + CurrentSMSMessage->Status=GSS_SENTREAD; + } else if (!strcmp(buffer,"\"2\"") || !strcmp(buffer,"\"STO UNSENT\"")) { + CurrentSMSMessage->Type=GST_SMS; + CurrentSMSMessage->folder=GST_OUTBOX; + CurrentSMSMessage->SMSData=false; + CurrentSMSMessage->Status=GSS_NOTSENTREAD; + } else if (!strcmp(buffer,"\"3\"") || !strcmp(buffer,"\"STO SENT\"")) { + CurrentSMSMessage->Type=GST_SMS; + CurrentSMSMessage->folder=GST_OUTBOX; + CurrentSMSMessage->SMSData=false; + CurrentSMSMessage->Status=GSS_SENTREAD; + } + + start+=ExtractOneParameter(MessageBuffer+start, buffer); + + /* It's delivery report according to Nokia AT standards */ + if (CurrentSMSMessage->folder==0 && buffer[0]!=0 && //GST_INBOX + buffer[0]!='"') { + + /* ??? */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + + /* Sender number */ + /* FIXME: support for all formats */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + for (i=1;iSender,buffer); + + /* ??? */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + + /* Sending datetime */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + start+=ExtractOneParameter(MessageBuffer+start, buffer2); + + for (i=1;iTime, buffer); + + /* Date of SMSC response */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + start+=ExtractOneParameter(MessageBuffer+start, buffer2); + + for (i=1;i=0;i--) { + ETSISMS.TPStatus=ETSISMS.TPStatus+(buffer[i]-'0')*j; + j=j*10; + } + + GSM_DecodeETSISMSStatusReportData(CurrentSMSMessage, &ETSISMS); + + /* NO SMSC number */ + CurrentSMSMessage->MessageCenter.Number[0]=0; + + CurrentSMSMessage->Type = GST_DR; + + /* FIXME: make support for it */ + CurrentSMSMessage->ReplyViaSameSMSC=false; + } else { + /* Sender number */ + /* FIXME: support for all formats */ + for (i=1;iSender,buffer); + + /* Sender number in alphanumeric format ? */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + if (strlen(buffer)!=0) strcpy(CurrentSMSMessage->Sender,buffer); + + /* Sending datetime */ + if (CurrentSMSMessage->folder==0) { //GST_INBOX + start+=ExtractOneParameter(MessageBuffer+start, buffer); + start+=ExtractOneParameter(MessageBuffer+start, buffer2); + + for (i=1;iTime, buffer); + } + + /* Sender number format */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + + /* First byte */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + ETSISMS.firstbyte=0; + j=1; + for (i=strlen(buffer)-1;i>=0;i--) { + ETSISMS.firstbyte=ETSISMS.firstbyte+(buffer[i]-'0')*j; + j=j*10; + } + + CurrentSMSMessage->ReplyViaSameSMSC=false; + /* GSM 03.40 section 9.2.3.17 (TP-Reply-Path) */ + if ((ETSISMS.firstbyte & 128)==128) + CurrentSMSMessage->ReplyViaSameSMSC=true; + + /* TP PID.No support now */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + + /* TP DCS */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + ETSISMS.TPDCS=0; + j=1; + for (i=strlen(buffer)-1;i>=0;i--) { + ETSISMS.TPDCS=ETSISMS.TPDCS+(buffer[i]-'0')*j; + j=j*10; + } + + if (CurrentSMSMessage->folder==1) { //GST_OUTBOX + /*TP VP */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + } + + /* SMSC number */ + /* FIXME: support for all formats */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + for (i=1;iMessageCenter.Number,buffer); + + /* Format of SMSC number */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + + /* TPUDL */ + start+=ExtractOneParameter(MessageBuffer+start, buffer); + ETSISMS.TPUDL=0; + j=1; + for (i=strlen(buffer)-1;i>=0;i--) { + ETSISMS.TPUDL=ETSISMS.TPUDL+(buffer[i]-'0')*j; + j=j*10; + } + + start++; + + CurrentSMSMessage->Coding = GSM_Coding_Default; + + /* GSM 03.40 section 9.2.3.10 (TP-Data-Coding-Scheme) and GSM 03.38 section 4 */ + if ((ETSISMS.TPDCS & 0xf4) == 0xf4) CurrentSMSMessage->Coding=GSM_Coding_8bit; + if ((ETSISMS.TPDCS & 0x08) == 0x08) CurrentSMSMessage->Coding=GSM_Coding_Unicode; + + switch (CurrentSMSMessage->Coding) { + case GSM_Coding_Default: + /* GSM 03.40 section 9.2.3.23 (TP-User-Data-Header-Indicator) */ + /* If not SMS with UDH, it's coded normal */ + /* If UDH available, treat it as Unicode or 8 bit */ + if ((ETSISMS.firstbyte & 0x40)!=0x40) { + CurrentSMSMessage->UDHType=GSM_NoUDH; + for (i=0;iGSM_MAX_SMS_LENGTH) break; + CurrentSMSMessage->MessageText[i]=MessageBuffer[i+start]; + } + CurrentSMSMessage->Length=ETSISMS.TPUDL; + break; + } + case GSM_Coding_Unicode: + case GSM_Coding_8bit: + DecodeHexBin (ETSISMS.MessageText, MessageBuffer+start, ETSISMS.TPUDL*2); + GSM_DecodeETSISMSSubmitData(CurrentSMSMessage, &ETSISMS); + break; + } + CurrentSMSMessage->MessageText[CurrentSMSMessage->Length]=0; + } + + CurrentSMSMessageError=GE_NONE; + } +} + +GSM_Error Nat_GetSMSMessage(GSM_SMSMessage *message) +{ + unsigned char req2[20]; + GSM_Error error; + + if (SMSATCMGF==-1) { + error=SMSGetPDUType(); + if (error!=GE_NONE) return error; + } + + CurrentSMSMessage = message; + + sprintf(req2, "AT+CMGR=%i\r",message->Location); //gets SMS + + CurrentSMSMessage->MessageNumber=CurrentSMSMessage->Location; + + return NULL_SendMessageSequence + (50, &CurrentSMSMessageError, strlen(req2), 0x00, req2); +} + +/* FIXME: do we need more than SMS_Submit and SMS_Deliver ? */ +GSM_Error GSM_EncodeETSISMSFrame(GSM_SMSMessage *SMS, unsigned char *req, int *length, SMS_MessageType PDU) +{ + GSM_ETSISMSMessage ETSI; + GSM_Error error; + int i,current=0; + + error=GSM_EncodeETSISMS(SMS, &ETSI, PDU, length); + if (error!=GE_NONE) return error; + + for (i=0;ifolder==0x00) { //GST_INBOX + PDU=SMS_Deliver; + stat=1; + if (message->Status==GSS_NOTSENTREAD) stat=0; + } else { + PDU=SMS_Submit; + stat=3; + if (message->Status==GSS_NOTSENTREAD) stat=2; + } + + endchar[0]=26; //ctrl+z; + + switch (SMSATCMGF) { + case SMS_AT_PDU: /* PDU mode */ + error=GSM_EncodeETSISMSFrame(message, req3, &length, PDU); + if (error!=GE_NONE) return error; + + if (savesms) + sprintf(req2, "AT+CMGW=%i,%i\r",(length-(req3[0]+1)),stat); //saves SMS + else + sprintf(req2, "AT+CMGS=%i\r",(length-(req3[0]+1))); //sends SMS + + EncodeHexBin (req4, req3, length); + current=length*2; + + Protocol->SendMessage(strlen(req2), 0x00, req2); usleep(500); + + break; + case SMS_AT_TEXT: + + if (ATMan!=AT_MAN_NOKIA) { + switch (CurrentSMSMessage->Coding) { + case GSM_Coding_Unicode: + case GSM_Coding_8bit: + return GE_NOTSUPPORTED; + default: + break; + } + } + + error=GSM_EncodeETSISMS(message, &ETSISMS, PDU, &length); + if (error!=GE_NONE) return error; + + sprintf(req4, "AT+CSMP=%i,%i,%i,%i\r", + ETSISMS.firstbyte, ETSISMS.TPVP, + ETSISMS.TPPID, ETSISMS.TPDCS); + + error=NULL_SendMessageSequence + (50, &CurrentSMSMessageError, strlen(req4), 0x00, req4); + if (error!=GE_NONE) return error; + + strcpy(SMSC.Number,message->MessageCenter.Number); + SMSC.No=1; + error=Nat_SetSMSCenter(&SMSC); + if (error!=GE_NONE) return error; + + if (savesms) { + /* Tested AT implementations don't support alphanumeric numbers */ + if ((CurrentSMSMessage->Destination[0]<'0' || + CurrentSMSMessage->Destination[0]>'9') && + CurrentSMSMessage->Destination[0]!='+') + { + CurrentSMSMessage->Destination[0]='1'; + CurrentSMSMessage->Destination[1]=0; + } + + sprintf(req4, "AT+CMGW=\"%s\"\r",CurrentSMSMessage->Destination); + } else { + /* Tested AT implementations don't support alphanumeric numbers */ + if ((CurrentSMSMessage->Destination[0]<'0' || + CurrentSMSMessage->Destination[0]>'9') && + CurrentSMSMessage->Destination[0]!='+') + return GE_NOTSUPPORTED; + + sprintf(req4, "AT+CMGS=\"%s\"\r",CurrentSMSMessage->Destination); + } + + Protocol->SendMessage(strlen(req4), 0x00, req4); usleep(500); + + switch (CurrentSMSMessage->Coding) { + case GSM_Coding_Default: + /* If not SMS with UDH, it's as normal text */ + if (CurrentSMSMessage->UDHType==GSM_NoUDH) { + strcpy(req4,CurrentSMSMessage->MessageText); + current=strlen(req4); + break; + } + case GSM_Coding_Unicode: + case GSM_Coding_8bit: + + EncodeHexBin (req4, ETSISMS.MessageText, length); + current=length*2; + break; + } + + break; + } + + Protocol->SendMessage(current, 0x00, req4); usleep(500); + + return NULL_SendMessageSequence + (500, &CurrentSMSMessageError, 1, 0x00, endchar); +} + +void Nat_ReplySaveSMSMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + int i; + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Message saved\n")); +#endif + + i=MessageLength-10; + while(MessageBuffer[i]!=0x20) { i++; } + + i++; + CurrentSMSMessage->MessageNumber=MessageBuffer[i]-'0'; + + i++; + if (MessageBuffer[i]!=0x0d) + CurrentSMSMessage->MessageNumber= + CurrentSMSMessage->MessageNumber*10+MessageBuffer[i]-'0'; + +#ifdef DEBUG + fprintf(stdout, _(" location: %i\n"),CurrentSMSMessage->MessageNumber); +#endif + + CurrentSMSMessageError=GE_NONE; +} + +GSM_Error Nat_SaveSMSMessage(GSM_SMSMessage *message) +{ + return Nat_SendSaveSMSMessage(message,true); +} + +void Nat_ReplySendSMSMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS Message sent OK\n")); +#endif + + CurrentSMSMessageError=GE_SMSSENDOK; +} + +GSM_Error Nat_SendSMSMessage(GSM_SMSMessage *message) +{ + return Nat_SendSaveSMSMessage(message,false); +} + +void Nat_ReplyDeleteSMSMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS deleted OK\n")); +#endif + + CurrentSMSMessageError=GE_NONE; +} + +GSM_Error Nat_DeleteSMSMessage(GSM_SMSMessage * message) +{ + char req[128]; + + sprintf(req, "AT+CMGD=%d\r", message->Location); + + return NULL_SendMessageSequence + (50, &CurrentSMSMessageError, strlen(req), 0x00, req); +} + +void Nat_ReplyGetSMSStatus(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + char *start2; + +#ifdef DEBUG + fprintf(stdout, _("Message: SMS status received\n")); +#endif + + CurrentSMSStatus->UnRead=0; + CurrentSMSStatus->Number=0; + + start2 = strstr(MessageBuffer, "+CPMS: "); + start2 += 7; + + CurrentSMSStatus->Number=atoi(start2); + + CurrentSMSStatusError=GE_NONE; +} + +GSM_Error Nat_GetSMSStatus(GSM_SMSStatus *Status) +{ + CurrentSMSStatus=Status; + + return NULL_SendMessageSequence + (10, &CurrentSMSStatusError, 13, 0x00, "AT+CPMS=\"SM\"\r"); +} + +struct AT_OneReply ATRepliesError[] = { + +{"AT+CALA" ,Nat_ReplyAlarmError }, +{"AT+CCLK" ,Nat_ReplyDateTimeError }, +{"AT+CMGR=" ,Nat_ReplyGetSMSMessageError }, +{"AT+CPBR=" ,Nat_ReplyGetMemoryLocationError }, +{"AT+CPBS?" ,Nat_ReplyGetMemoryStatusCPBSError}, +{"AT+CPBS=" ,Nat_ReplyPBKSetMemoryTypeError }, + +{"",NULL} +}; + +struct AT_OneReply ATRepliesOK[] = { + +{"AT+CCFC=" ,Nat_ReplyCallDivert }, +{"AT+CGMI\r",Nat_ReplyGetManufacturer }, +{"AT+CPBS?" ,Nat_ReplyGetMemoryStatusCPBS }, +{"AT+CPBS=" ,Nat_ReplyPBKSetMemoryType }, +{"AT+CPBR=?",Nat_ReplyGetMemoryStatusCPBR }, +{"AT+CPBR=" ,Nat_ReplyGetMemoryLocation }, +{"AT+CPBW=" ,Nat_ReplyWritePhonebookLocation}, +{"AT+CSCS=\"HEX\"",Nat_ReplySetCharset }, +{"AT+CSCS=\"GSM\"",Nat_ReplySetCharset }, +{"AT+CSCA?" ,Nat_ReplyGetSMSCenter }, +{"AT+CSCA=" ,Nat_ReplySetSMSCenter }, +{"AT+CSDH=1\r",Nat_ReplySMSGetPDUType }, +{"AT+CMGF=0\r",Nat_ReplySMSGetPDUType }, +{"AT+CMGF=1\r",Nat_ReplySMSGetPDUType }, +{"AT+CMGR=" ,Nat_ReplyGetSMSMessage }, +{"AT+CSMP=" ,Nat_ReplyCSMP }, +{"AT+CMGW=" ,Nat_ReplySaveSMSMessage }, +{"AT+CMGS=" ,Nat_ReplySendSMSMessage }, +{"AT+CMGD=" ,Nat_ReplyDeleteSMSMessage }, +{"AT+CPMS=\"SM\"",Nat_ReplyGetSMSStatus }, +{"AT+CPIN?\r",Nat_ReplyGetSecurityCodeStatus}, +{"AT+CCLK?" ,Nat_ReplyGetDateTime }, +{"AT+CCLK=" ,Nat_ReplySetDateTime }, +{"AT+CALA?" ,Nat_ReplyGetAlarm }, +{"AT+CGMM\r",Nat_ReplyGetID }, +{"AT+CGMR\r",Nat_ReplyGetHW }, +{"AT+CREG" ,Nat_ReplyGetNetworkInfo }, +{"AT+COPS?" ,Nat_ReplyGetNetworkInfoCOPS }, +{"AT+CGSN\r",Nat_ReplyGetIMEI }, +{"AT+CHUP" ,Nat_ReplyCancelCall }, +{"AT+CBC" ,Nat_ReplyGetBatteryLevel }, +{"AT+CSQ" ,Nat_ReplyGetRFLevel }, + +{"",NULL} +}; + +void Nat_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) { + + bool AnswerOK,AnswerError; //if last part is OK or ERROR + + int i,start=0; + + /* In 9210 first answer start with different, random bytes. + Here we try to find first AT to find start byte */ + for (i=0;i +#include +#include + +#ifndef WIN32 + + #include "devices/device.h" + +#endif + +/* Various header file */ +#ifndef VC6 + #include "config.h" +#endif +#include "misc.h" +#include "gsm-api.h" +#include "gsm-common.h" +#include "files/cfgreader.h" +#include "newmodules/sniff/sniff.h" +#include "newmodules/n6110.h" +#include "newmodules/n7110.h" +#include "gsm-networks.h" + +/* Global variables used by code in gsm-api.c to expose the functions + supported by this model of phone. */ + + +static char *realmodel; /* Model from .gnokiirc file. */ +static char *Port; /* Port from .gnokiirc file */ +static char *Initlength; /* Init length from .gnokiirc file */ +static char *Connection; /* Connection type from .gnokiirc file */ +static char *SynchronizeTime; /* If we set date and time from computer to phone (from .gnokiirc file) */ +static char *BinDir; /* Binaries directory from .gnokiirc file - not used here yet */ +static GSM_ConnectionType connectiontype; + + + + + + + +/* Here we initialise model specific functions. */ + +GSM_Functions Nsniff_Functions = { + Nsniff_Initialise, + Nsniff_DispatchMessage, + NULL_Terminate, + NULL_KeepAlive, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED, + NOTSUPPORTED +}; + + + +/* for all these Phones we support sniff */ + +GSM_Information Nsniff_Information = { + "3210sniff|3310sniff|3330sniff|5110sniff|5130sniff|5190sniff|6110sniff|6130sniff|6150sniff|6190sniff|8210sniff|8850sniff|6210sniff|6250sniff|7110sniff", + /* Supported models in FBUS */ + "3210sniff|3310sniff|3330sniff|5110sniff|5130sniff|5190sniff|6110sniff|6130sniff|6150sniff|6190sniff|8210sniff|8850sniff|6210sniff|6250sniff|7110sniff", + /* Supported models in MBUS */ + "", + /* Supported models in FBUS over infrared */ + "", + /* Supported models in FBUS over DLR3 */ + "", + "6210decode|6250decode|7110decode", /* Supported models in FBUS over Irda sockets */ + "", + "", + 4, /* Max RF Level */ + 0, /* Min RF Level */ + GRF_Arbitrary, /* RF level units */ + 4, /* Max Battery Level */ + 0, /* Min Battery Level */ + GBU_Arbitrary, /* Battery level units */ + GDT_None, /* No date/time support */ + GDT_None, /* No alarm support */ + 0 /* Max alarms = 0 */ +}; + +/* Initialise variables and state machine. */ +GSM_Error Nsniff_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + + GSM_PhonebookEntry phonebook; + GSM_SpeedDial speed; + GSM_SMSMessage sms; + GSM_MemoryStatus status; + GSM_NetworkInfo netinfo; + GSM_SMSStatus smsstatus; + GSM_SMSFolders folders; + GSM_MessageCenter smsc; + int secstatus; + GSM_SecurityCode seccode; + GSM_DateTime date; + GSM_DateTime alarm; + GSM_CalendarNote note; + char netmon; + GSM_Bitmap logo; + GSM_Profile profile; + GSM_CBMessage cb; + GSM_Network netname; + GSM_BinRingtone binring; + GSM_AllSimlocks siml; if (Protocol->Initialise(port_device,initlength,connection,rlp_callback)!=GE_NONE) + { + return GE_NOTSUPPORTED; + } + + CurrentLinkOK = true; + + CurrentPhonebookEntry=&phonebook; + CurrentSpeedDialEntry=&speed; + CurrentSMSMessage=&sms; + CurrentMemoryStatus=&status; + CurrentNetworkInfo=&netinfo; + CurrentSMSStatus=&smsstatus; + CurrentSMSFolders=&folders; + CurrentMessageCenter=&smsc; + CurrentSecurityCodeStatus=&secstatus; + CurrentSecurityCode=&seccode; + CurrentDateTime=&date; + CurrentAlarm=&alarm; + CurrentCalendarNote=¬e; + CurrentNetmonitor=&netmon; + CurrentGetBitmap=&logo; + CurrentProfile=&profile; + CurrentCBMessage=&cb; + CurrentGetOperatorNameNetwork=&netname; + CurrentGetBinRingtone=&binring; + CurrentSimLock=⪝ + + /* Read config file, once again to get real model */ + if (CFG_ReadConfig(&realmodel, &Port, &Initlength, &Connection, &BinDir, &SynchronizeTime,false) < 0) { + exit(-1); + } + + connectiontype = GetConnectionTypeFromString(Connection); + return (GE_NONE); +} + + +void Nsniff_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType) +{ + +/* switch to real Model */ + if (CheckModel (N6110_Information, realmodel, connectiontype)) + N6110_DispatchMessage( MessageLength, MessageBuffer, MessageType); + + if (CheckModel (N7110_Information, realmodel, connectiontype)) + N7110_DispatchMessage( MessageLength, MessageBuffer, MessageType); +} diff --git a/common/phones/ateric.c b/common/phones/ateric.c new file mode 100644 index 0000000..edd48c7 --- /dev/null +++ b/common/phones/ateric.c @@ -0,0 +1,83 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for mobile phones. + + Copyright 2001 Manfred Jonsson + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides functions specific to at commands on ericsson + phones. See README for more details on supported mobile phones. + + $Log$ + Revision 1.1.1.1 2001/11/25 21:59:14 short + :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 + + Revision 1.1 2001/11/19 13:03:18 pkot + nk3110.c cleanup + +*/ + +#include +#include +#include + +#include "misc.h" +#include "gsm-common.h" +#include "gsm-statemachine.h" +#include "phones/generic.h" +#include "phones/atgen.h" +#include "phones/ateric.h" +#include "links/atbus.h" +#include "links/cbus.h" + + +static GSM_Error GetMemoryStatus(GSM_Data *data, GSM_Statemachine *state) +{ + char req[128]; + GSM_Error ret; + + ret = AT_SetMemoryType(data->MemoryStatus->MemoryType, state); + if (ret != GE_NONE) + return ret; + sprintf(req, "AT+CPBR=?\r\n"); + if (SM_SendMessage(state, 11, GOP_GetMemoryStatus, req) != GE_NONE) + return GE_NOTREADY; + ret = SM_Block(state, data, GOP_GetMemoryStatus); + return ret; +} + + +static GSM_Error ReplyMemoryStatus(int messagetype, unsigned char *buffer, int length, GSM_Data *data) +{ + AT_LineBuffer buf; + char *pos; + + buf.line1 = buffer; + buf.length= length; + splitlines(&buf); + if (buf.line1 == NULL) + return GE_INVALIDMEMORYTYPE; + if (data->MemoryStatus) { + if (strstr(buf.line2,"+CPBR")) { + pos = strchr(buf.line2, '-'); + if (pos) { + data->MemoryStatus->Used = atoi(++pos); + data->MemoryStatus->Free = 0; + } else { + return GE_NOTSUPPORTED; + } + } + } + return GE_NONE; +} + + +void AT_InitEricsson(GSM_Statemachine *state, char *foundmodel, char *setupmodel) { + AT_InsertRecvFunction(GOP_GetMemoryStatus, ReplyMemoryStatus); + AT_InsertSendFunction(GOP_GetMemoryStatus, GetMemoryStatus); +} diff --git a/common/phones/atnok.c b/common/phones/atnok.c new file mode 100644 index 0000000..150d89a --- /dev/null +++ b/common/phones/atnok.c @@ -0,0 +1,58 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for mobile phones. + + Copyright 2001 Manfred Jonsson + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides functions specific to at commands on nokia + phones. See README for more details on supported mobile phones. + + $Log$ + Revision 1.1.1.1 2001/11/25 21:59:14 short + :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 + + Revision 1.1 2001/11/19 13:03:18 pkot + nk3110.c cleanup + +*/ + +#include +#include +#include + +#include "misc.h" +#include "gsm-common.h" +#include "gsm-statemachine.h" +#include "phones/generic.h" +#include "phones/atgen.h" +#include "phones/atnok.h" +#include "links/atbus.h" +#include "links/cbus.h" + + +AT_SendFunctionType writephonebook; + + +static GSM_Error WritePhonebook(GSM_Data *data, GSM_Statemachine *state) +{ + if (writephonebook == NULL) + return GE_UNKNOWN; + if (data->MemoryStatus->MemoryType == GMT_ME) + return GE_NOTSUPPORTED; + return (*writephonebook)(data, state); +} + + +void AT_InitNokia(GSM_Statemachine *state, char *foundmodel, char *setupmodel) { + /* block writing of phone memory on nokia phones other than */ + /* 8210. if you write to the phonebook of a eg 7110 all extended */ + /* information will be lost. */ + if (strncasecmp("8210", foundmodel, 4)) + writephonebook = AT_InsertSendFunction(GOP_WritePhonebook, WritePhonebook); +} diff --git a/common/phones/atsie.c b/common/phones/atsie.c new file mode 100644 index 0000000..9694b23 --- /dev/null +++ b/common/phones/atsie.c @@ -0,0 +1,65 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for mobile phones. + + Copyright 2001 Manfred Jonsson + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides functions specific to at commands on siemens + phones. See README for more details on supported mobile phones. + + $Log$ + Revision 1.1.1.1 2001/11/25 21:59:14 short + :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 + + Revision 1.1 2001/11/19 13:03:18 pkot + nk3110.c cleanup + +*/ + +#include +#include +#include + +#include "misc.h" +#include "gsm-common.h" +#include "gsm-statemachine.h" +#include "phones/generic.h" +#include "phones/atgen.h" +#include "phones/atsie.h" +#include "links/atbus.h" +#include "links/cbus.h" + + +AT_SendFunctionType writephonebook; + + +static GSM_Error WritePhonebook(GSM_Data *data, GSM_Statemachine *state) +{ + GSM_PhonebookEntry newphone; + char *rptr, *wptr; + + if (writephonebook == NULL) + return GE_UNKNOWN; + if (data->PhonebookEntry != NULL) { + memcpy(&newphone, data->PhonebookEntry, sizeof(GSM_PhonebookEntry)); + rptr = data->PhonebookEntry->Name; + wptr = newphone.Name; + data->PhonebookEntry = &newphone; + } + return (*writephonebook)(data, state); +} + + +void AT_InitSiemens(GSM_Statemachine *state, char *foundmodel, char *setupmodel) { + /* names for s35 etc must be escaped */ +/* + if (foundmodel && !strncasecmp("35", foundmodel + 1, 2)) + writephonebook = AT_InsertSendFunction(GOP_WritePhonebook, WritePhonebook); +*/ +} diff --git a/common/protocol/at.c b/common/protocol/at.c new file mode 100644 index 0000000..6afbb18 --- /dev/null +++ b/common/protocol/at.c @@ -0,0 +1,195 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for support for AT protocol + +*/ + +/* "Turn on" prototypes in AT.h */ +#define __AT_c + +/* System header files */ +#include +#include +#include + +#ifdef WIN32 + #include + #include "misc_win32.h" +#else + #include +#endif + +/* Various header file */ +#include "devices/device.h" +#include "gsm-api.h" +#include "protocol/at.h" + +GSM_Protocol AT_Functions = { + AT_Initialise, + AT_SendMessage, + AT_SendFrame, + AT_WritePhone, + AT_Terminate, + AT_RX_StateMachine +}; + +/* Local variables */ +u16 BufferCount; + +u16 MessageLength; + +u8 MessageBuffer[AT_MAX_RECEIVE_LENGTH * 6]; + +static bool wascrlf = false; +static char *linestart = MessageBuffer; + +/* N61_RX_DisplayMessage is called when a message we don't know about is + received so that the user can see what is going back and forth, and perhaps + shed some more light/explain another message type! */ + +#ifdef DEBUG +void AT_RX_DisplayMessage() +{ + fprintf(stdout, _("Phone\n")); + + hexdump(MessageLength,MessageBuffer); +} +#endif /* DEBUG */ + +/* Prepares the message header and sends it, prepends the message start byte + (0x1e) and other values according the value specified when called. + Calculates checksum and then sends the lot down the pipe... */ +int AT_SendFrame(u16 message_length, u8 message_type, u8 *buffer) { + +#ifdef DEBUG + int count; +#endif + + /* FIXME - we should check for the message length ... */ + +#ifdef DEBUG + fprintf(stdout, _("PC: ")); + + for (count = 0; count < message_length-1; count++) + fprintf(stdout, "%c", buffer[count]); + + fprintf(stdout, "\n"); +#endif /* DEBUG */ + + /* Send it out... */ + if (!AT_WritePhone(message_length,buffer)) + return (false); + + return (true); +} + +int AT_SendMessage(u16 message_length, u8 message_type, u8 *buffer) { + + AT_SendFrame(message_length, message_type, buffer); + + return (true); +} + +int AT_SendAck(u8 message_type, u8 message_seq) { + + return true; +} + +/* Applications should call AT_Terminate to shut down the AT thread and + close the serial port. */ +void AT_Terminate(void) +{ + /* Request termination of thread */ + CurrentRequestTerminate = true; + + /* Close serial port. */ + device_close(); +} + +/* RX_State machine for receive handling. Called once for each character + received from the phone/phone. */ + +void AT_RX_StateMachine(unsigned char rx_byte) { + + /* FIXME: Check for overflow */ + MessageBuffer[BufferCount] = rx_byte; + MessageBuffer[BufferCount + 1] = '\0'; + +// fprintf(stdout,_("%02x %c\n"),rx_byte,rx_byte); + + if (wascrlf && (rx_byte != 10 && rx_byte != 13)) { + linestart = MessageBuffer + BufferCount; + wascrlf = false; + } + + if ((rx_byte== 10 || rx_byte==13)) wascrlf = true; + + if ((BufferCount > 0) && (10 == MessageBuffer[BufferCount]) + && (13 == MessageBuffer[BufferCount-1]) + && ((0 == strncmp("OK", linestart, 2)) + || (0 == strncmp("ERROR", linestart, 5)) + || (0 == strncmp("+CME ERROR:", linestart, 11)) + || (0 == strncmp("+CMS ERROR:", linestart, 11)))) { + + MessageLength=BufferCount; + +#ifdef DEBUG + AT_RX_DisplayMessage(); +#endif + + GSM->DispatchMessage(MessageLength,MessageBuffer, 0x00); + + BufferCount = 0; + linestart = MessageBuffer; + wascrlf = false; + + } else BufferCount++; +} + +/* Called by initialisation code to open comm port in asynchronous mode. */ +bool AT_OpenSerial(void) +{ +// device_changespeed(115200); + + device_changespeed(19200); + + return (true); +} + +/* Initialise variables and state machine. */ +GSM_Error AT_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + + if (!StartConnection (port_device,false,connection)) + return GE_INTERNALERROR; + + CurrentConnectionType = connection; + + if (AT_OpenSerial() != true) return GE_INTERNALERROR; + + BufferCount=0; + + return (GE_NONE); +} + +bool AT_WritePhone (u16 length, u8 *buffer) { + int i; + + for (i=0;i +#include +#include + +#ifdef WIN32 + #include + #include "misc_win32.h" +#else + #include +#endif + +/* Various header file */ +#include "devices/device.h" +#include "gsm-api.h" +#include "protocol/fbus.h" +#include "protocol/at.h" +#include "newmodules/newat.h" +#include "newmodules/n6110.h" +#include "misc.h" + +GSM_Protocol FBUS_Functions = { + FBUS_Initialise, + FBUS_SendMessage, + FBUS_SendFrame, + NULL_WritePhone, + FBUS_Terminate, + FBUS_RX_StateMachine +}; + +/* Local variables */ +enum FBUS_RX_States RX_State; + +u8 MessageDestination, MessageSource; + +u16 BufferCount, MultiBufferCount; + +u16 MessageLength, MultiMessageLength; + +bool RX_Multiple = false; + +u8 MessageType,MultiMessageType; + +u8 MessageBuffer[FBUS_MAX_RECEIVE_LENGTH * 6],MultiMessageBuffer[FBUS_MAX_RECEIVE_LENGTH * 6]; + +u8 RequestSequenceNumber = 0x00; + +#ifdef DEBUG +char *N61_PrintDevice(int Device) +{ + switch (Device) { + + case FBUS_DEVICE_PHONE:return _("Phone"); + case FBUS_DEVICE_PC :return _("PC"); + default :return _("Unknown"); + } +} +#endif /* DEBUG */ + +/* N61_RX_DisplayMessage is called when a message we don't know about is + received so that the user can see what is going back and forth, and perhaps + shed some more light/explain another message type! */ +void N61_RX_DisplayMessage() +{ +#ifdef DEBUG + fprintf(stdout, _("Msg Dest: %s\n"), N61_PrintDevice(MessageDestination)); + fprintf(stdout, _("Msg Source: %s\n"), N61_PrintDevice(MessageSource)); + fprintf(stdout, _("Msg Type: %02x\n"), MessageType); + + hexdump(MessageLength-2,MessageBuffer); +#endif + + AppendLog(MessageBuffer,MessageLength-2,true); +} + +/* Prepares the message header and sends it, prepends the message start byte + (0x1e) and other values according the value specified when called. + Calculates checksum and then sends the lot down the pipe... */ +int FBUS_SendFrame(u16 message_length, u8 message_type, u8 *buffer) { + + /* Originally out_buffer[FBUS_MAX_CONTENT_LENGTH + 2], + but it made problems with MBUS */ + u8 out_buffer[1000]; + + int count, current=0; + unsigned char checksum; + + /* FIXME - we should check for the message length ... */ + + /* Now construct the message header. */ + + if (CurrentConnectionType==GCT_FBUS) + out_buffer[current++] = FBUS_FRAME_ID; /* Start of the frame indicator */ + else + out_buffer[current++] = FBUS_IR_FRAME_ID; /* Start of the frame indicator */ + + out_buffer[current++] = FBUS_DEVICE_PHONE; /* Destination */ + + out_buffer[current++] = FBUS_DEVICE_PC; /* Source */ + + out_buffer[current++] = message_type; /* Type */ + + out_buffer[current++] = 0; /* Length1 */ + out_buffer[current++] = message_length; /* Length2 */ + + /* Copy in data if any. */ + if (message_length != 0) { + memcpy(out_buffer + current, buffer, message_length); + current+=message_length; + } + + /* If the message length is odd we should add pad byte 0x00 */ + if (message_length % 2) + out_buffer[current++]=0x00; + + /* Now calculate checksums over entire message and append to message. */ + + /* Odd bytes */ + checksum = 0; + for (count = 0; count < current; count+=2) + checksum ^= out_buffer[count]; + + out_buffer[current++] = checksum; + + /* Even bytes */ + checksum = 0; + for (count = 1; count < current; count+=2) + checksum ^= out_buffer[count]; + + out_buffer[current++] = checksum; + +#ifdef DEBUG + NULL_TX_DisplayMessage(current, out_buffer); +#endif /* DEBUG */ + + /* Send it out... */ + if (!NULL_WritePhone(current,out_buffer)) + return (false); + + return (true); +} + +int FBUS_SendMessage(u16 message_length, u8 message_type, u8 *buffer) { + + u8 seqnum; + + u8 frame_buffer[FBUS_MAX_CONTENT_LENGTH + 2]; + + u8 nom, lml; /* number of messages, last message len */ + int i; + + seqnum = 0x40 + RequestSequenceNumber; + RequestSequenceNumber = (RequestSequenceNumber + 1) & 0x07; + + if (message_length > FBUS_MAX_CONTENT_LENGTH) { + + nom = (message_length + FBUS_MAX_CONTENT_LENGTH - 1) + / FBUS_MAX_CONTENT_LENGTH; + lml = message_length - ((nom - 1) * FBUS_MAX_CONTENT_LENGTH); + + for (i = 0; i < nom - 1; i++) { + + memcpy(frame_buffer, buffer + (i * FBUS_MAX_CONTENT_LENGTH), + FBUS_MAX_CONTENT_LENGTH); + frame_buffer[FBUS_MAX_CONTENT_LENGTH] = nom - i; + frame_buffer[FBUS_MAX_CONTENT_LENGTH + 1] = seqnum; + + FBUS_SendFrame(FBUS_MAX_CONTENT_LENGTH + 2, message_type, + frame_buffer); + + seqnum = RequestSequenceNumber; + RequestSequenceNumber = (RequestSequenceNumber + 1) & 0x07; + } + + memcpy(frame_buffer, buffer + ((nom - 1) * FBUS_MAX_CONTENT_LENGTH), lml); + frame_buffer[lml] = 0x01; + frame_buffer[lml + 1] = seqnum; + FBUS_SendFrame(lml + 2, message_type, frame_buffer); + + } else { + + memcpy(frame_buffer, buffer, message_length); + frame_buffer[message_length] = 0x01; + frame_buffer[message_length + 1] = seqnum; + FBUS_SendFrame(message_length + 2, message_type, frame_buffer); + } + + return (true); +} + +int FBUS_SendAck(u8 message_type, u8 message_seq) { + + unsigned char request[6]; + + request[0] = message_type; + request[1] = message_seq; + +#ifdef DEBUG + fprintf(stdout, _("[Sending Ack of type %02x, seq: %x]\n"), message_type, message_seq); +#endif /* DEBUG */ + + return FBUS_SendFrame(2, FBUS_FRTYPE_ACK, request); +} + +/* Applications should call FBUS_Terminate to shut down the FBUS thread and + close the serial port. */ +void FBUS_Terminate(void) +{ + /* Request termination of thread */ + CurrentRequestTerminate = true; + + /* Close serial port. */ + device_close(); +} + +/* RX_State machine for receive handling. Called once for each character + received from the phone/phone. */ + +void FBUS_RX_StateMachine(unsigned char rx_byte) { + + static struct timeval time_now, time_last, time_diff; + + static int checksum[2]; + + int i=0; + +#ifdef DEBUG + /* For model sniff only display received bytes */ + if (strcmp(GSM_Info->FBUSModels, "sniff")) + { +#endif + + /* XOR the byte with the current checksum */ + checksum[BufferCount&1] ^= rx_byte; + + switch (RX_State) { + + /* Messages from the phone start with an 0x1e (FBUS) or 0x1c (IR) or 0x1f (MBUS). + We use this to "synchronise" with the incoming data stream. However, + if we see something else, we assume we have lost sync and we require + a gap of at least 5ms before we start looking again. This is because + the data part of the frame could contain a byte which looks like the + sync byte */ + + case FBUS_RX_Discarding: + +#ifndef VC6 + gettimeofday(&time_now, NULL); + timersub(&time_now, &time_last, &time_diff); + if (time_diff.tv_sec == 0 && time_diff.tv_usec < 5000) { + time_last = time_now; /* no gap seen, continue discarding */ + break; + } + /* else fall through to... */ +#endif + + case FBUS_RX_Sync: + + if ((CurrentConnectionType==GCT_FBUS && rx_byte == FBUS_FRAME_ID) || + ((CurrentConnectionType==GCT_Infrared || + CurrentConnectionType==GCT_Tekram) && rx_byte == FBUS_IR_FRAME_ID)) { + + BufferCount = 0; + + RX_State = FBUS_RX_GetDestination; + + /* Initialize checksums. */ + checksum[0] = rx_byte; + checksum[1] = 0; + } else { + /* Lost frame sync */ + RX_State = FBUS_RX_Discarding; +#ifndef VC6 + gettimeofday(&time_last, NULL); +#endif + } + break; + + case FBUS_RX_GetDestination: + + MessageDestination=rx_byte; + RX_State = FBUS_RX_GetSource; + + /* When there is a checksum error and things get out of sync we have to manage to resync */ + /* If doing a data call at the time, finding a 0x1e etc is really quite likely in the data stream */ + /* Then all sorts of horrible things happen because the packet length etc is wrong... */ + /* Therefore we test here for a destination of 0x0c and return to the top if it is not */ + if (rx_byte!=FBUS_DEVICE_PC && strstr(GSM_Info->FBUSModels, "sniff")==NULL) { + RX_State=FBUS_RX_Sync; +#ifdef DEBUG + fprintf(stdout,"The fbus stream is out of sync - expected 0x0c, got %2x\n",rx_byte); +#endif + AppendLogText("SYNC\n",false); + } + + break; + + case FBUS_RX_GetSource: + + MessageSource=rx_byte; + RX_State = FBUS_RX_GetType; + + /* Source should be 0x00 */ + if (rx_byte!=FBUS_DEVICE_PHONE && strstr(GSM_Info->FBUSModels, "sniff")==NULL) { + RX_State=FBUS_RX_Sync; +#ifdef DEBUG + fprintf(stdout,"The fbus stream is out of sync - expected 0x00, got %2x\n",rx_byte); +#endif + AppendLogText("SYNC\n",false); + } + + break; + + case FBUS_RX_GetType: + + MessageType=rx_byte; + + RX_State = FBUS_RX_GetLength1; + + break; + + case FBUS_RX_GetLength1: + + MessageLength = 0; + + RX_State = FBUS_RX_GetLength2; + + break; + + case FBUS_RX_GetLength2: + + /* MW:Here are problems with conversion. For chars 0-127 it's OK, for + higher not (probably because rx_byte is char type) - improtant + for MBUS. So, I make it double and strange - generally it should be + more simple and make simple convert rx_byte into MessageLength */ +#if defined(__svr4__) || defined(__FreeBSD__) + if (rx_byte!=0) { + for (i=0;iFBUS_MAX_RECEIVE_LENGTH*6) { +#ifdef DEBUG + fprintf(stdout, "FB61: Message buffer overun - resetting\n"); +#endif + AppendLogText("OVERUN\n",false); + RX_Multiple=false; + RX_State = FBUS_RX_Sync; + break; + } + + /* If this is the last byte, it's the checksum. */ + if (BufferCount == MessageLength+(MessageLength%2)+2) { + + /* Is the checksum correct? */ + if (checksum[0] == checksum[1]) { + + if (RX_Multiple) { + + if (MessageType==MultiMessageType) { + + if (MessageLength+MultiMessageLength>FBUS_MAX_RECEIVE_LENGTH*6) { +#ifdef DEBUG + fprintf(stdout, "FB61: Message buffer overun - resetting\n"); +#endif + AppendLogText("OVERUN\n",false); + RX_Multiple=false; + RX_State = FBUS_RX_Sync; + break; + } + + /* We copy next part of multiframe message into special buffer */ + for (i=0;i 1) && (MessageBuffer[MessageLength-2] != 0x01)) + { + } else { + for (i=0;iDispatchMessage(MessageLength-2, MessageBuffer, MessageType); + } + + } else { + + /* We do not want to send ACK of ACKs and ACK of RLP frames. */ + if (MessageType != FBUS_FRTYPE_ACK && MessageType != 0xf1) { + FBUS_SendAck(MessageType, MessageBuffer[MessageLength-1] & 0x0f); + + if ((MessageLength > 1) && (MessageBuffer[MessageLength-2] != 0x01)) + { +#ifdef DEBUG + fprintf(stdout,_("Multiframe message in multiframe message !\n")); + fprintf(stdout,_("Please report it !\n")); +#endif + RX_State = FBUS_RX_Sync; + } + } + } + } else { + + /* We do not want to send ACK of ACKs and ACK of RLP frames. */ + if (MessageType != FBUS_FRTYPE_ACK && MessageType != 0xf1) { + FBUS_SendAck(MessageType, MessageBuffer[MessageLength-1] & 0x0f); + + if ((MessageLength > 1) && (MessageBuffer[MessageLength-2] != 0x01)) + { + /* We copy previous part of multiframe message into special buffer */ + RX_Multiple = true; + for (i=0;iDispatchMessage(MessageLength-2, MessageBuffer, MessageType); + } + +#ifdef DEBUG + /* When make debug and message is to phone display it */ + if (MessageDestination==FBUS_DEVICE_PHONE) { + for (i=MessageLength;i>=0;i--) + MessageBuffer[i+6]=MessageBuffer[i]; + MessageBuffer[0]=FBUS_FRAME_ID; + MessageBuffer[1]=FBUS_DEVICE_PHONE; + MessageBuffer[2]=FBUS_DEVICE_PC; + MessageBuffer[3]=MessageType; + MessageBuffer[4]=0; + MessageBuffer[5]=MessageLength; + MessageLength=MessageLength+8; + if (MessageLength % 2) MessageLength++; + NULL_TX_DisplayMessage(MessageLength, MessageBuffer); + } +#endif + } + } else { +#ifdef DEBUG + fprintf(stdout, _("Bad checksum %02x (should be %02x), msg len=%i !\n"),checksum[0],checksum[1],MessageLength); +#endif /* DEBUG */ + AppendLogText("CHECKSUM\n",false); + + /* Just to be sure! */ + RX_Multiple=false; + } + RX_State = FBUS_RX_Sync; + } + break; + } + +#ifdef DEBUG + } else { + if (isprint(rx_byte)) + fprintf(stdout, "[%02x%c]", rx_byte, rx_byte); + else + fprintf(stdout, "[%02x ]", rx_byte); + + } +#endif +} + +/* Called by initialisation code to open comm port in asynchronous mode. */ +bool FBUS_OpenSerial(void) +{ + /* Uncomment, if want to test first method for DLR3 */ + unsigned char req[3] = {"AT\r"}; + unsigned char req2[5] = {"AT&F\r"}; + unsigned char req3[13] = {"AT*NOKIAFBUS\r"}; + + switch (CurrentConnectionType) { + case GCT_FBUS: + +#ifdef DEBUG + fprintf(stdout, _("Setting cable for FBUS communication...\n")); +#endif /* DEBUG */ + + device_changespeed(115200); + + /* Colin wrote: + The data suite cable has some electronics built into the connector. This of + course needs a power supply of some sorts to operate properly. + + In this case power is drawn off the handshaking lines of the PC. DTR has to + be set and RTS have to be cleared, thus if you use a terminal program (that + does not set the handshaking lines to these conditions) you will get weird + results. It will not set them like this since if Request To Send (RTS) is + not set the other party will not send any data (in hardware handshaking) + and if DTS is not set (handshaking = none) the cable will not receive + power. */ + /* clearing the RTS bit and setting the DTR bit*/ + device_setdtrrts(1, 0); + + break; + case GCT_DLR3: + +#ifdef DEBUG + fprintf(stdout, _("Setting DLR3 cable for FBUS communication...\n")); +#endif /* DEBUG */ + + /* There are 2 ways to init DLR in FBUS: Here is first described by + Reuben Harris [reuben.harris@snowvalley.com] and used in Logo Manager, + 1. Firstly set the connection baud to 19200, DTR off, RTS off, + Parity on, one stop bit, + 2. Send "AT\r\n". The response should be "AT\r\n\r\nOK\r\n". + 3. Send "AT&F\r\n". The response should be "AT&F\r\n\r\nOK\r\n". + 4. Send "AT*NOKIAFBUS\r\n". The response should be + "AT*NOKIAFBUS\r\n\r\nOK\r\n". + 5. Set speed to 115200 + This seems to be compatible with more phones*/ + + device_changespeed(19200); + + /*leave RTS low, DTR low for duration of session.*/ + device_setdtrrts(0, 0); + + Protocol->WritePhone (3,req );usleep(300); + Protocol->WritePhone (5,req2);usleep(300); + Protocol->WritePhone(13,req3);usleep(300); + + device_changespeed(115200); + +// /* Second method for DLR3: +// Used by some 7110 soft, but not compatible with some other +// phones supporting DLR3 - 7160, NCP2.0*/ +// device_changespeed(115200); +// /*leave RTS low, DTR low for duration of session.*/ +// device_setdtrrts(0, 0); +// usleep(100000); + + CurrentConnectionType=GCT_FBUS; + + break; + case GCT_Infrared: + /* It's more complicated and not done here */ + break; + + case GCT_Tekram: + /* It's more complicated and not done here */ + break; + + default: +#ifdef DEBUG + fprintf(stdout,_("Wrong connection type for fbus module. Inform marcin-wiacek@topnet.pl about it\n")); +#endif + break; + } + + return (true); +} + +/* Initialise variables and state machine. */ +GSM_Error FBUS_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + + if (!StartConnection (port_device,false,connection)) + return GE_INTERNALERROR; + + CurrentConnectionType = connection; + + if (FBUS_OpenSerial() != true) return GE_INTERNALERROR; + + return (GE_NONE); +} diff --git a/common/protocol/fbus3110.c b/common/protocol/fbus3110.c new file mode 100644 index 0000000..64d9985 --- /dev/null +++ b/common/protocol/fbus3110.c @@ -0,0 +1,261 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for support for FBUS3110 protocol + +*/ + +/* "Turn on" prototypes in FBUS3110.h */ +#define __fbus3110_c + +/* System header files */ +#include +#include +#include + +#ifdef WIN32 + #include + #include "misc_win32.h" +#else + #include +#endif + +/* Various header file */ +#include "devices/device.h" +#include "gsm-api.h" +#include "protocol/fbus3110.h" +#include "protocol/fbus.h" +#include "newmodules/n6110.h" +#include "misc.h" + +GSM_Protocol FBUS3110_Functions = { + FBUS3110_Initialise, + FBUS3110_SendMessage, + FBUS3110_SendFrame, + NULL_WritePhone, + FBUS3110_Terminate, + FBUS3110_RX_StateMachine +}; + +/* Local variables */ +enum FBUS_RX_States RX_State; + +u8 MessageDestination, MessageSource; + +u16 BufferCount; + +u16 MessageLength; + +u8 MessageType; + +u8 MessageBuffer[FBUS3110_MAX_RECEIVE_LENGTH * 6]; + +u8 RequestSequenceNumber3110=0x10; + +#ifdef DEBUG +char *N31_PrintDevice(int Device) +{ + switch (Device) { + +// case FBUS3110_DEVICE_PHONE:return _("Phone"); +// case FBUS3110_DEVICE_PC :return _("PC"); + default :return _("Unknown"); + } +} +#endif /* DEBUG */ + +/* N61_RX_DisplayMessage is called when a message we don't know about is + received so that the user can see what is going back and forth, and perhaps + shed some more light/explain another message type! */ +void N31_RX_DisplayMessage() +{ +#ifdef DEBUG + fprintf(stdout, _("Msg Dest: %s\n"), N31_PrintDevice(MessageDestination)); + fprintf(stdout, _("Msg Source: %s\n"), N31_PrintDevice(MessageSource)); + fprintf(stdout, _("Msg Type: %02x\n"), MessageType); + + hexdump(MessageLength-2,MessageBuffer); +#endif + + AppendLog(MessageBuffer,MessageLength-2,true); +} + +/* Prepares the message header and sends it, prepends the message start byte + (0x1e) and other values according the value specified when called. + Calculates checksum and then sends the lot down the pipe... */ +int FBUS3110_SendFrame(u16 message_length, u8 message_type, u8 *buffer) { + + /* Originally out_buffer[FBUS3110_MAX_CONTENT_LENGTH + 2], + but it made problems with MBUS */ + u8 out_buffer[1000]; + + int count, current=0; + unsigned char checksum; + + /* Now construct the message header. */ + out_buffer[current++] = FBUS3110_FRAME_TO_PHONE; /* Start of frame */ + out_buffer[current++] = message_length + 2; /* Length */ + out_buffer[current++] = message_type; /* Type */ + out_buffer[current++] = RequestSequenceNumber3110; /* Sequence number */ + + /* Copy in data if any. */ + if (message_length != 0) { + memcpy(out_buffer + current, buffer, message_length); + current += message_length; + } + + /* Now calculate checksum over entire message and append to message. */ + checksum = 0; + for (count = 0; count < current; count++) checksum ^= out_buffer[count]; + out_buffer[current++] = checksum; + +#ifdef DEBUG + NULL_TX_DisplayMessage(current, out_buffer); +#endif /* DEBUG */ + + /* Send it out... */ + if (!NULL_WritePhone(current,out_buffer)) return (false); + + return (true); +} + +/* Any command we originate must have a unique SequenceNumber. + Observation to date suggests that these values startx at 0x10 + and cycle up to 0x17 before repeating again. Perhaps more + accurately, the numbers cycle 0,1,2,3..7 with bit 4 of the byte + premanently set. */ + +void FBUS3110_UpdateSequenceNumber(void) +{ + RequestSequenceNumber3110++; + + if (RequestSequenceNumber3110 > 0x17 || RequestSequenceNumber3110 < 0x10) + RequestSequenceNumber3110 = 0x10; +} + +int FBUS3110_SendMessage(u16 message_length, u8 message_type, u8 *buffer) { + + FBUS3110_UpdateSequenceNumber(); + + return FBUS3110_SendFrame(message_length, message_type, buffer); +} + +int FBUS3110_SendAck(u8 message_type, u8 message_seq) { + + return 0; +} + +/* Applications should call FBUS3110_Terminate to shut down the FBUS3110 thread and + close the serial port. */ +void FBUS3110_Terminate(void) +{ + /* Request termination of thread */ + CurrentRequestTerminate = true; + + /* Close serial port. */ + device_close(); +} + +/* RX_State machine for receive handling. Called once for each character + received from the phone/phone. */ + +void FBUS3110_RX_StateMachine(unsigned char rx_byte) { + + static int checksum; + + /* XOR the byte with the current checksum */ + checksum ^= rx_byte; + + switch (RX_State) { + + case FBUS_RX_Discarding: + if (rx_byte != 0x55) break; + + case FBUS_RX_Sync: + + if (rx_byte == 0x04 || rx_byte == 0x03) { + MessageDestination=rx_byte; + RX_State = FBUS_RX_GetLength1; + } + break; + + case FBUS_RX_GetLength1: + + MessageLength = rx_byte; + RX_State = FBUS_RX_GetType; + + break; + + case FBUS_RX_GetType: + + MessageType=rx_byte; + RX_State = FBUS_RX_GetMessage; + + break; + + case FBUS_RX_GetMessage: + + MessageBuffer[BufferCount] = rx_byte; + BufferCount ++; + + if (BufferCount>FBUS3110_MAX_RECEIVE_LENGTH) { +#ifdef DEBUG + fprintf(stdout, "FB31: Message buffer overun - resetting\n"); +#endif + AppendLogText("OVERUN\n",false); + RX_State = FBUS_RX_Sync; + break; + } + + /* If this is the last byte, it's the checksum. */ + if (BufferCount == MessageLength) { + + RX_State = FBUS_RX_Sync; + } + break; + default: + break; + } +} + +/* Called by initialisation code to open comm port in asynchronous mode. */ +bool FBUS3110_OpenSerial(void) +{ + switch (CurrentConnectionType) { + case GCT_FBUS3110: + +#ifdef DEBUG + fprintf(stdout, _("Setting cable for FBUS3110 communication...\n")); +#endif /* DEBUG */ + + device_changespeed(115200); + break; + default: +#ifdef DEBUG + fprintf(stdout,_("Wrong connection type for FBUS3110 module. Inform marcin-wiacek@topnet.pl about it\n")); +#endif + break; + } + + return (true); +} + +/* Initialise variables and state machine. */ +GSM_Error FBUS3110_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + if (!StartConnection (port_device,false,connection)) + return GE_INTERNALERROR; + + CurrentConnectionType = connection; + + if (FBUS3110_OpenSerial() != true) return GE_INTERNALERROR; + + return (GE_NONE); +} diff --git a/common/protocol/fbusirda.c b/common/protocol/fbusirda.c new file mode 100644 index 0000000..b84ae9d --- /dev/null +++ b/common/protocol/fbusirda.c @@ -0,0 +1,362 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for support for fbusirda protocol + +*/ + +/* "Turn on" prototypes in fbusirda.h */ +#define __fbusirda_c + +/* System header files */ + +#include +#include +#include + +#ifdef WIN32 + #include + #include "misc_win32.h" +#else + #include +#endif + +/* Various header file */ +#include "devices/device.h" +#include "gsm-api.h" +#include "protocol/fbusirda.h" +#include "protocol/fbus.h" +#include "misc.h" + +GSM_Protocol FBUSIRDA_Functions = { + FBUSIRDA_Initialise, + FBUSIRDA_SendMessage, + FBUSIRDA_SendFrame, + FBUSIRDA_WritePhone, + FBUSIRDA_Terminate, + FBUSIRDA_RX_StateMachine +}; + +/* Local variables */ +enum FBUS_RX_States RX_State; + +u8 MessageDestination, MessageSource; + +u16 BufferCount; + +u16 MessageLength; + +u8 MessageType; + +u8 MessageBuffer[FBUS_MAX_RECEIVE_LENGTH * 6]; + +#ifdef DEBUG +char *FBUSIRDA_PrintDevice(int Device) +{ + switch (Device) { + + case FBUS_DEVICE_PHONE: + return _("Phone"); + + case FBUS_DEVICE_PC: + return _("PC"); + + default: + return _("Unknown"); + + } +} + +/* FBUSIRDA_RX_DisplayMessage is called when a message we don't know about is + received so that the user can see what is going back and forth, and perhaps + shed some more light/explain another message type! */ +void FBUSIRDA_RX_DisplayMessage() +{ + fprintf(stdout, _("Msg Source: %s\n"), FBUSIRDA_PrintDevice(MessageSource)); + fprintf(stdout, _("Msg Dest: %s\n"), FBUSIRDA_PrintDevice(MessageDestination)); + fprintf(stdout, _("Msg Type: %02x\n"), MessageType); + + hexdump( MessageLength, MessageBuffer); +} +#endif /* DEBUG */ + +/* Prepares the message header and sends it, prepends the message start byte + (0x1e) and other values according the value specified when called. + Calculates checksum and then sends the lot down the pipe... */ +int FBUSIRDA_SendFrame(u16 message_length, u8 message_type, u8 *buffer) { + u8 out_buffer[FBUSIRDA_MAX_CONTENT_LENGTH + 2]; + + int current=0; + int header=0; + + /* FIXME - we should check for the message length ... */ + + /* Now construct the message header. */ + + out_buffer[current++] = FBUSIRDA_FRAME_ID; /* Start of the frame indicator */ + + out_buffer[current++] = FBUS_DEVICE_PHONE; /* Destination */ + + out_buffer[current++] = FBUS_DEVICE_PC; /* Source */ + + out_buffer[current++] = message_type; /* Type */ + + out_buffer[current++] = message_length/256; /* Length1 */ + out_buffer[current++] = message_length%256; /* Length2 */ + + /* Copy in data if any. */ + + if (message_length != 0) { + memcpy(out_buffer + current, buffer, message_length); + header = current; + current+=message_length; + } + +#ifdef DEBUG + NULL_TX_DisplayMessage( current, out_buffer); +#endif /* DEBUG */ + + /* Send it out... */ + return ( FBUSIRDA_WritePhone(current,out_buffer) - header); + +} + +int FBUSIRDA_SendMessage(u16 message_length, u8 message_type, u8 *buffer) { + + u8 frame_buffer[FBUSIRDA_MAX_CONTENT_LENGTH + 2]; + u16 ret; + + memcpy(frame_buffer, buffer, message_length); + ret = FBUSIRDA_SendFrame(message_length, message_type, frame_buffer); + + if (ret != message_length) + { + printf("CAUTION: FBUSIRDA_SendFrame return written %d bytes of %d !\n",ret, message_length); + return(false); + } + else + return (true); +} + +int FBUSIRDA_SendAck(u8 message_type, u8 message_seq) { + return(true); +} + +/* Applications should call MBUS_Terminate to shut down the MBUS thread and + close the serial port. */ +void FBUSIRDA_Terminate(void) +{ + /* Request termination of thread */ + CurrentRequestTerminate = true; + + /* Close serial port. */ + device_close(); +} + +/* RX_State machine for receive handling. Called once for each character + received from the phone/phone. */ +void FBUSIRDA_RX_StateMachine(unsigned char rx_byte) { + + unsigned char max; + + int i; + + i=0; + + switch (RX_State) { + + case FBUS_RX_Discarding: + break; + + /* Messages from the phone start with an 0x14 (IRDA, Nokia:PhoNet). + We use this to "synchronise" with the incoming data stream. */ + + case FBUS_RX_Sync: + + if (rx_byte == FBUSIRDA_FRAME_ID) { + BufferCount = 0; + RX_State = FBUS_RX_GetDestination; + } + + break; + + case FBUS_RX_GetDestination: + + MessageDestination=rx_byte; + RX_State = FBUS_RX_GetSource; + + /* When there is a checksum error and things get out of sync we have to manage to resync */ + /* If doing a data call at the time, finding a 0x1e etc is really quite likely in the data stream */ + /* Then all sorts of horrible things happen because the packet length etc is wrong... */ + /* Therefore we test here for a destination of 0x0c and return to the top if it is not */ + +#ifdef DEBUG + if (strstr(GSM_Info->IrdaModels,"decode")!=NULL) + { + if (rx_byte!=FBUS_DEVICE_PC && rx_byte!=FBUS_DEVICE_PHONE ) + { + RX_State=FBUS_RX_Sync; + fprintf(stdout,"decode: expected FBUS_DEVICE_PC/FBUS_DEVICE_PHONE, got %2x\n",rx_byte); + } + }//decode Model + else + { +#endif + if (rx_byte!=FBUS_DEVICE_PC) + { + RX_State=FBUS_RX_Sync; +#ifdef DEBUG + fprintf(stdout,"The FBUSIRDA stream is out of sync - expected FBUS_DEVICE_PC, got %2x\n",rx_byte); +#endif + } +#ifdef DEBUG + }//not decode Model +#endif + + break; + + case FBUS_RX_GetSource: + + MessageSource=rx_byte; + RX_State = FBUS_RX_GetType; + +#ifdef DEBUG + if (strstr(GSM_Info->IrdaModels,"decode")!=NULL) + { + if (rx_byte!=FBUS_DEVICE_PC && rx_byte!=FBUS_DEVICE_PHONE ) + { + RX_State=FBUS_RX_Sync; + fprintf(stdout,"decode: expected FBUS_DEVICE_PC/FBUS_DEVICE_PHONE, got %2x\n",rx_byte); + } + }//decode Model + else + { +#endif + if (rx_byte!=FBUS_DEVICE_PHONE) + { + RX_State=FBUS_RX_Sync; +#ifdef DEBUG + fprintf(stdout,"The FBUSIRDA stream is out of sync - expected FBUS_DEVICE_PHONE, got %2x\n",rx_byte); +#endif + } +#ifdef DEBUG + }//not decode Model +#endif + + break; + + case FBUS_RX_GetType: + + MessageType=rx_byte; + RX_State = FBUS_RX_GetLength1; + + break; + + case FBUS_RX_GetLength1: + + MessageLength=0; + + /* MW:Here are problems with conversion. For chars 0-127 it's OK, for + higher not (probably because rx_byte is char type) - improtant + for MBUS. So, I make it double and strange - generally it should be + more simple and make simple convert rx_byte into MessageLength */ + if (rx_byte!=0) { + max=rx_byte; + MessageLength=max*256; + } + + RX_State = FBUS_RX_GetLength2; + + break; + + case FBUS_RX_GetLength2: + + /* MW:Here are problems with conversion. For chars 0-127 it's OK, for + higher not (probably because rx_byte is char type) - important + for MBUS. So, I make it double and strange - generally it should be + more simple and make simple convert rx_byte into MessageLength */ +#if defined(__svr4__) || defined(__FreeBSD__) + if (rx_byte!=0) { + for (i=0;iDispatchMessage(MessageLength, MessageBuffer, MessageType); + } + else + { +#ifdef DEBUG + /* for --decodefile */ + fprintf(stdout, _("Msg Source: %s\n"), FBUSIRDA_PrintDevice(MessageSource)); + fprintf(stdout, _("Msg Dest: %s\n"), FBUSIRDA_PrintDevice(MessageDestination)); + fprintf(stdout, _("Msg Type: %02x\n"), MessageType); + hexdump( MessageLength, MessageBuffer); +#endif /* DEBUG */ + } + + RX_State = FBUS_RX_Sync; + } + break; + } +} + +/* Called by initialisation code to open comm port in asynchronous mode. */ +bool FBUSIRDA_OpenSerial(void) +{ +#ifdef DEBUG + fprintf(stdout, _("Setting FBUS Irda communication...\n")); +#endif /* DEBUG */ + + return (true); + +} + +/* Initialise variables and state machine. */ +GSM_Error FBUSIRDA_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + CurrentConnectionType = connection; + + if (!StartConnection(port_device,false,connection)) { + return GE_INTERNALERROR; + } + RX_State=FBUS_RX_Sync; + + return (GE_NONE); +} + +bool FBUSIRDA_WritePhone (u16 length, u8 *buffer) { + + if (!CurrentDisableKeepAlive) + usleep(150); + + return (device_write(buffer,length)); +} diff --git a/common/protocol/mbus.c b/common/protocol/mbus.c new file mode 100644 index 0000000..48b4562 --- /dev/null +++ b/common/protocol/mbus.c @@ -0,0 +1,480 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for support for MBUS protocol + +*/ + +/* "Turn on" prototypes in MBUS.h */ +#define __MBUS_c + +/* System header files */ + +#include +#include +#include + +#ifdef WIN32 + #include + #include "misc_win32.h" +#else + #include +#endif + +/* Various header file */ +#include "devices/device.h" +#include "gsm-api.h" +#include "protocol/mbus.h" +#include "protocol/fbus.h" + +GSM_Protocol MBUS_Functions = { + MBUS_Initialise, + MBUS_SendMessage, + MBUS_SendFrame, + MBUS_WritePhone, + MBUS_Terminate, + MBUS_RX_StateMachine +}; + +/* Local variables */ +enum FBUS_RX_States RX_State; + +u8 MessageDestination, MessageSource; + +u16 BufferCount; + +u16 MessageLength; + +u8 MessageType; + +u8 MessageBuffer[MBUS_MAX_RECEIVE_LENGTH * 6]; + +static u8 RequestSequenceNumber = 0x00; + +#ifdef DEBUG +char *MBUS_PrintDevice(int Device) +{ + switch (Device) { + + case FBUS_DEVICE_PHONE: + return _("Phone"); + + case MBUS_DEVICE_PC1: + return _("PC"); + + case MBUS_DEVICE_PC2: + return _("PC"); + + default: + return _("Unknown"); + + } +} + +/* N61_RX_DisplayMessage is called when a message we don't know about is + received so that the user can see what is going back and forth, and perhaps + shed some more light/explain another message type! */ +void MBUS_RX_DisplayMessage() +{ + fprintf(stdout, _("Msg Dest: %s\n"), MBUS_PrintDevice(MessageDestination)); + fprintf(stdout, _("Msg Source: %s\n"), MBUS_PrintDevice(MessageSource)); + fprintf(stdout, _("Msg Type: %02x\n"), MessageType); + + hexdump(MessageLength,MessageBuffer); +} + +#endif /* DEBUG */ + +/* Prepares the message header and sends it, prepends the message start byte + (0x1e) and other values according the value specified when called. + Calculates checksum and then sends the lot down the pipe... */ +int MBUS_SendFrame(u16 message_length, u8 message_type, u8 *buffer) { + u8 out_buffer[MBUS_MAX_CONTENT_LENGTH + 2]; + + int count, current=0; + unsigned char checksum; + + /* FIXME - we should check for the message length ... */ + + /* Now construct the message header. */ + + out_buffer[current++] = MBUS_FRAME_ID; /* Start of the frame indicator */ + + out_buffer[current++] = FBUS_DEVICE_PHONE; /* Destination */ + + out_buffer[current++] = MBUS_DEVICE_PC1; /* Source */ + + out_buffer[current++] = message_type; /* Type */ + + out_buffer[current++] = (message_length-1)/256; /* Length1 */ + out_buffer[current++] = (message_length-1)%256; /* Length2 */ + + /* Copy in data if any. */ + + if (message_length != 0) { + memcpy(out_buffer + current, buffer, message_length); + current+=message_length; + } + + /* Now calculate checksum over entire message and append to message. */ + + /* All bytes */ + checksum = 0; + for (count = 0; count < current; count++) + checksum ^= out_buffer[count]; + + out_buffer[current++] = checksum; + +#ifdef DEBUG + NULL_TX_DisplayMessage(current, out_buffer); +#endif /* DEBUG */ + + /* Send it out... */ + if (!MBUS_WritePhone(current,out_buffer)) + return (false); + + return (true); +} + +int MBUS_SendMessage(u16 message_length, u8 message_type, u8 *buffer) { + + u8 frame_buffer[MBUS_MAX_CONTENT_LENGTH + 2]; + + RequestSequenceNumber++; + + memcpy(frame_buffer, buffer, message_length); + frame_buffer[message_length] = RequestSequenceNumber; + MBUS_SendFrame(message_length + 1, message_type, frame_buffer); + + return (true); +} + +int MBUS_SendAck(u8 message_type, u8 message_seq) { + + unsigned char request[6]; + + int count; + + request[0]=MBUS_FRAME_ID; + request[1]=FBUS_DEVICE_PHONE; + request[2]=MBUS_DEVICE_PC1; + request[3]=FBUS_FRTYPE_ACK; + request[4] = message_seq; + request[5]=0; + + /* Checksum */ + for (count = 0; count < 5; count++) + request[5] ^= request[count]; + +#ifdef DEBUG + fprintf(stdout, _("[Sending Ack of type %02x, seq: %x]\n"), message_type, message_seq); + + NULL_TX_DisplayMessage(5, request); +#endif /* DEBUG */ + + if (!MBUS_WritePhone(6, request)) { +#ifdef DEBUG + fprintf(stdout,_("Sending ACK failed %i !\n"),count); +#endif + return (false); + } + + return(true); +} + +/* Applications should call MBUS_Terminate to shut down the MBUS thread and + close the serial port. */ +void MBUS_Terminate(void) +{ + /* Request termination of thread */ + CurrentRequestTerminate = true; + + /* RTS low */ + device_setdtrrts(0, 0); + + /* Close serial port. */ + device_close(); +} + +/* RX_State machine for receive handling. Called once for each character + received from the phone/phone. */ +void MBUS_RX_StateMachine(unsigned char rx_byte) { + + static struct timeval time_now, time_last, time_diff; + + unsigned char max; + + static int checksum[2]; + +#if defined(__svr4__) || defined(__FreeBSD__) || defined(DEBUG) + int i=0; +#endif + +#ifdef DEBUG + if (strcmp(GSM_Info->MBUSModels, "mbussniff")) + { +#endif + + checksum[0]=checksum[1]; + checksum[1] ^= rx_byte; + + switch (RX_State) { + + /* Messages from the phone start with an 0x1f (MBUS). + We use this to "synchronise" with the incoming data stream. However, + if we see something else, we assume we have lost sync and we require + a gap of at least 5ms before we start looking again. This is because + the data part of the frame could contain a byte which looks like the + sync byte */ + case FBUS_RX_Discarding: +#ifndef VC6 + gettimeofday(&time_now, NULL); + timersub(&time_now, &time_last, &time_diff); + if (time_diff.tv_sec == 0 && time_diff.tv_usec < 5000) { + time_last = time_now; /* no gap seen, continue discarding */ + break; + } + /* else fall through to... */ +#endif + + case FBUS_RX_Sync: + + if (rx_byte == MBUS_FRAME_ID) { + + BufferCount = 0; + + RX_State = FBUS_RX_GetDestination; + + /* Initialize checksum. */ + checksum[1] = MBUS_FRAME_ID; + } else { + /* Lost frame sync */ + RX_State = FBUS_RX_Discarding; +#ifndef VC6 + gettimeofday(&time_last, NULL); +#endif + } + + break; + + case FBUS_RX_GetDestination: + + MessageDestination=rx_byte; + RX_State = FBUS_RX_GetSource; + + /* When there is a checksum error and things get out of sync we have to manage to resync */ + /* If doing a data call at the time, finding a 0x1e etc is really quite likely in the data stream */ + /* Then all sorts of horrible things happen because the packet length etc is wrong... */ + /* Therefore we test here for a destination of 0x0c and return to the top if it is not */ + /* The same testing for MBUS. Only one change: MBUS returns, what we send. + So, the byte can be 0x10 (destination MBUS) or 0x00 (phone) */ + if (rx_byte!=MBUS_DEVICE_PC1 && rx_byte!=MBUS_DEVICE_PC2 && rx_byte!=FBUS_DEVICE_PHONE) { + RX_State=FBUS_RX_Sync; +#ifdef DEBUG + fprintf(stdout,"The mbus stream is out of sync - expected 0x10 or 0x00, got %2x\n",rx_byte); +#endif + } + + break; + + case FBUS_RX_GetSource: + + MessageSource=rx_byte; + RX_State = FBUS_RX_GetType; + + /* Source should be 0x00 or 0x10 */ + if (rx_byte!=FBUS_DEVICE_PHONE && rx_byte!=MBUS_DEVICE_PC1 && rx_byte!=MBUS_DEVICE_PC2) { + RX_State=FBUS_RX_Sync; +#ifdef DEBUG + fprintf(stdout,"The mbus stream is out of sync - expected 0x00 or 0x10, got %2x\n",rx_byte); +#endif + } + + break; + + case FBUS_RX_GetType: + + MessageType=rx_byte; + + RX_State = FBUS_RX_GetLength1; + + break; + + case FBUS_RX_GetLength1: + + MessageLength=0; + + /* MW:Here are problems with conversion. For chars 0-127 it's OK, for + higher not (probably because rx_byte is char type) - improtant + for MBUS. So, I make it double and strange - generally it should be + more simple and make simple convert rx_byte into MessageLength */ + if (rx_byte!=0) { + max=rx_byte; + MessageLength=max*256; + } + + RX_State = FBUS_RX_GetLength2; + + break; + + case FBUS_RX_GetLength2: + + /* MW:Here are problems with conversion. For chars 0-127 it's OK, for + higher not (probably because rx_byte is char type) - improtant + for MBUS. So, I make it double and strange - generally it should be + more simple and make simple convert rx_byte into MessageLength */ +#if defined(__svr4__) || defined(__FreeBSD__) + if (rx_byte!=0) { + for (i=0;iDispatchMessage(MessageLength, MessageBuffer, MessageType); + + } else { +#ifdef DEBUG + if (strstr(GSM_Info->MBUSModels, "sniff") != NULL) { + fprintf(stdout, _("PC: ")); + + fprintf(stdout, "%02x:", MBUS_FRAME_ID); + fprintf(stdout, "%02x:", MBUS_DEVICE_PC1); + fprintf(stdout, "%02x:", FBUS_DEVICE_PHONE); + fprintf(stdout, "%02x:", MessageType); + fprintf(stdout, "%02x:", MessageLength/256); + fprintf(stdout, "%02x:", MessageLength%256); + +// NULL_TX_DisplayMessage(current, out_buffer); + + for (i = 0; i < BufferCount; i++) + fprintf(stdout, "%02x:", MessageBuffer[i]); + + fprintf(stdout, "\n"); + } +#endif /* DEBUG */ + } + } else { +#ifdef DEBUG + fprintf(stdout, _("Bad checksum %02x (should be %02x), msg len=%i !\n"),rx_byte,checksum[0],MessageLength); +#endif /* DEBUG */ + } + RX_State = FBUS_RX_Sync; + } + break; + } + +#ifdef DEBUG + + } else { + if (isprint(rx_byte)) + fprintf(stdout, "[%02x%c]", rx_byte, rx_byte); + else + fprintf(stdout, "[%02x ]", rx_byte); + + } + +#endif +} + +/* Called by initialisation code to open comm port in asynchronous mode. */ +bool MBUS_OpenSerial(void) +{ +#ifdef DEBUG + fprintf(stdout, _("Setting MBUS communication...\n")); +#endif /* DEBUG */ + + device_changespeed(9600); + + usleep(100); + + if (strstr(GSM_Info->MBUSModels, "sniff") == NULL) { + + /* leave RTS high, DTR low for duration of session. */ + device_setdtrrts(0, 1); + + usleep(100); + } + + return (true); + +} + +/* Initialise variables and state machine. */ +GSM_Error MBUS_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)) +{ + if (!StartConnection (port_device,true,connection)) + return GE_INTERNALERROR; + + CurrentConnectionType = connection; + + if (MBUS_OpenSerial() != true) { + /* Fail so sit here till calling code works out there is a problem. */ +// while (!CurrentRequestTerminate) +// usleep (100000); + + return GE_INTERNALERROR; + } + + return (GE_NONE); +} + +bool MBUS_WritePhone (u16 length, u8 *buffer) { + + if (!CurrentDisableKeepAlive) + usleep(150); + + if (device_write(buffer,length)!=length) + return false; + else + return true; +} diff --git a/configure b/configure new file mode 100755 index 0000000..54b4344 --- /dev/null +++ b/configure @@ -0,0 +1,6379 @@ +#! /bin/sh +# Guess values for system-dependent variables and create Makefiles. +# Generated by Autoconf 2.52. +# +# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +# Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +ac_unique_file="gnokii/gnokii.c" +ac_default_prefix="/usr/local" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/lib' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='/var/lib' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/share/info' +mandir='${prefix}/man' + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: should be removed in autoconf 3.0. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_prog=$0 + ac_confdir=`echo "$ac_prog" | sed 's%[\\/][^\\/][^\\/]*$%%'` + test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat < if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +EOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue + cd $ac_subdir + # A "../" for each directory in /$ac_subdir. + ac_dots=`echo $ac_subdir | + sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` + + case $srcdir in + .) # No --srcdir option. We are building in place. + ac_sub_srcdir=$srcdir ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_sub_srcdir=$srcdir/$ac_subdir ;; + *) # Relative path. + ac_sub_srcdir=$ac_dots$srcdir/$ac_subdir ;; + esac + + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_sub_srcdir/configure.gnu; then + echo + $SHELL $ac_sub_srcdir/configure.gnu --help=recursive + elif test -f $ac_sub_srcdir/configure; then + echo + $SHELL $ac_sub_srcdir/configure --help=recursive + elif test -f $ac_sub_srcdir/configure.ac || + test -f $ac_sub_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\EOF +configure +generated by GNU Autoconf 2.52 + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +EOF + exit 0 +fi +exec 5>config.log +cat >&5 </dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +PATH = $PATH + +_ASUNAME +} >&5 + +cat >&5 <\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + *) ac_configure_args="$ac_configure_args$ac_sep$ac_arg" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + echo >&5 + echo "## ----------------- ##" >&5 + echo "## Cache variables. ##" >&5 + echo "## ----------------- ##" >&5 + echo >&5 + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} >&5 + sed "/^$/d" confdefs.h >conftest.log + if test -s conftest.log; then + echo >&5 + echo "## ------------ ##" >&5 + echo "## confdefs.h. ##" >&5 + echo "## ------------ ##" >&5 + echo >&5 + cat conftest.log >&5 + fi + (echo; echo) >&5 + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" >&5 + echo "$as_me: exit $exit_status" >&5 + rm -rf conftest* confdefs* core core.* *.core conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:888: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + cat "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:899: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:907: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:923: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:927: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:933: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:935: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:937: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. It doesn't matter if + # we pass some twice (in addition to the command line arguments). + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` + ac_configure_args="$ac_configure_args '$ac_arg'" + ;; + *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" + ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:956: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:958: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac +echo "#! $SHELL" >conftest.sh +echo "exit 0" >>conftest.sh +chmod +x conftest.sh +if { (echo "$as_me:978: PATH=\".;.\"; conftest.sh") >&5 + (PATH=".;."; conftest.sh) 2>&5 + ac_status=$? + echo "$as_me:981: \$? = $ac_status" >&5 + (exit $ac_status); }; then + ac_path_separator=';' +else + ac_path_separator=: +fi +PATH_SEPARATOR="$ac_path_separator" +rm -f conftest.sh + +ac_aux_dir= +for ac_dir in config $srcdir/config; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:1007: error: cannot find install-sh or install.sh in config $srcdir/config" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in config $srcdir/config" >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Make sure we can run config.sub. +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:1017: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} + { (exit 1); exit 1; }; } + +echo "$as_me:1021: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 +if test "${ac_cv_build+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && + { { echo "$as_me:1030: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { (exit 1); exit 1; }; } +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:1034: error: $ac_config_sub $ac_cv_build_alias failed." >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1039: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 +build=$ac_cv_build +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:1046: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 +if test "${ac_cv_host+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:1055: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1060: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 +host=$ac_cv_host +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +echo "$as_me:1067: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 +if test "${ac_cv_target+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:1076: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + { (exit 1); exit 1; }; } + +fi +echo "$as_me:1081: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 +target=$ac_cv_target +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +# The aliases save the names the user supplied, while $host etc. +# will get canonicalized. +test -n "$target_alias" && + test "$program_prefix$program_suffix$program_transform_name" = \ + NONENONEs,x,x, && + program_prefix=${target_alias}- + +CFLAGS="-O2 -Wall" +ALL_LINGUAS="cs de et fi nl sk pl it" + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:1106: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}gcc" +echo "$as_me:1121: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1129: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1132: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:1141: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="gcc" +echo "$as_me:1156: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1164: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1167: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:1180: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="${ac_tool_prefix}cc" +echo "$as_me:1195: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1203: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1206: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1215: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="cc" +echo "$as_me:1230: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1238: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1241: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:1254: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue +fi +ac_cv_prog_CC="cc" +echo "$as_me:1274: found $ac_dir/$ac_word" >&5 +break +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $# != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$ac_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1296: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1299: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:1310: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +echo "$as_me:1325: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:1333: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:1336: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1349: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_CC="$ac_prog" +echo "$as_me:1364: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:1372: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:1375: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + +test -z "$CC" && { { echo "$as_me:1387: error: no acceptable cc found in \$PATH" >&5 +echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:1392:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:1395: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:1398: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1400: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:1403: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:1405: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:1408: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line 1412 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:1428: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:1431: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:1434: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. +for ac_file in `ls a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1457: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:1463: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1468: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:1474: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1477: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:1484: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:1492: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:1499: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:1501: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:1504: checking for executable suffix" >&5 +echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 +if { (eval echo "$as_me:1506: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:1509: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:1525: error: cannot compute EXEEXT: cannot compile and link" >&5 +echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:1531: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:1537: checking for object suffix" >&5 +echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1543 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:1555: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1558: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:1570: error: cannot compute OBJEXT: cannot compile" >&5 +echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:1577: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:1581: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1587 "configure" +#include "confdefs.h" + +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1602: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1605: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1608: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1611: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:1623: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:1629: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 1635 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1647: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1650: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1653: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1656: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:1666: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1693: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1696: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1699: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1702: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line 1714 "configure" +#include "confdefs.h" +#include +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1727: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1730: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1733: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1736: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line 1746 "configure" +#include "confdefs.h" +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:1758: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:1761: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:1764: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:1767: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:1799: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 1820 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1825: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1831: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 1854 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1858: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1864: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:1901: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line 1911 "configure" +#include "confdefs.h" +#include + Syntax error +_ACEOF +if { (eval echo "$as_me:1916: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1922: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line 1945 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:1949: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:1955: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:1983: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +for ac_prog in flex lex +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:1998: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_LEX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$LEX"; then + ac_cv_prog_LEX="$LEX" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_LEX="$ac_prog" +echo "$as_me:2013: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +LEX=$ac_cv_prog_LEX +if test -n "$LEX"; then + echo "$as_me:2021: result: $LEX" >&5 +echo "${ECHO_T}$LEX" >&6 +else + echo "$as_me:2024: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$LEX" && break +done +test -n "$LEX" || LEX=":" + +if test -z "$LEXLIB" +then + echo "$as_me:2034: checking for yywrap in -lfl" >&5 +echo $ECHO_N "checking for yywrap in -lfl... $ECHO_C" >&6 +if test "${ac_cv_lib_fl_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lfl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 2042 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2061: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2064: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2067: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2070: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_fl_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_fl_yywrap=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:2081: result: $ac_cv_lib_fl_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_fl_yywrap" >&6 +if test $ac_cv_lib_fl_yywrap = yes; then + LEXLIB="-lfl" +else + echo "$as_me:2086: checking for yywrap in -ll" >&5 +echo $ECHO_N "checking for yywrap in -ll... $ECHO_C" >&6 +if test "${ac_cv_lib_l_yywrap+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ll $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 2094 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char yywrap (); +int +main () +{ +yywrap (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2113: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2116: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2119: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2122: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_l_yywrap=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_l_yywrap=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:2133: result: $ac_cv_lib_l_yywrap" >&5 +echo "${ECHO_T}$ac_cv_lib_l_yywrap" >&6 +if test $ac_cv_lib_l_yywrap = yes; then + LEXLIB="-ll" +fi + +fi + +fi + +if test "x$LEX" != "x:"; then + echo "$as_me:2144: checking lex output file root" >&5 +echo $ECHO_N "checking lex output file root... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_root+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # The minimal lex program is just a single line: %%. But some broken lexes +# (Solaris, I think it was) want two %% lines, so accommodate them. +echo '%% +%%' | $LEX +if test -f lex.yy.c; then + ac_cv_prog_lex_root=lex.yy +elif test -f lexyy.c; then + ac_cv_prog_lex_root=lexyy +else + { { echo "$as_me:2158: error: cannot find output from $LEX; giving up" >&5 +echo "$as_me: error: cannot find output from $LEX; giving up" >&2;} + { (exit 1); exit 1; }; } +fi +fi +echo "$as_me:2163: result: $ac_cv_prog_lex_root" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_root" >&6 +LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root + +echo "$as_me:2167: checking whether yytext is a pointer" >&5 +echo $ECHO_N "checking whether yytext is a pointer... $ECHO_C" >&6 +if test "${ac_cv_prog_lex_yytext_pointer+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # POSIX says lex can declare yytext either as a pointer or an array; the +# default is implementation-dependent. Figure out which it is, since +# not all implementations provide the %pointer and %array declarations. +ac_cv_prog_lex_yytext_pointer=no +echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c +ac_save_LIBS=$LIBS +LIBS="$LIBS $LEXLIB" +cat >conftest.$ac_ext <<_ACEOF +`cat $LEX_OUTPUT_ROOT.c` +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2183: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2186: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2189: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2192: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_lex_yytext_pointer=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_save_LIBS +rm -f "${LEX_OUTPUT_ROOT}.c" + +fi +echo "$as_me:2204: result: $ac_cv_prog_lex_yytext_pointer" >&5 +echo "${ECHO_T}$ac_cv_prog_lex_yytext_pointer" >&6 +if test $ac_cv_prog_lex_yytext_pointer = yes; then + +cat >>confdefs.h <<\EOF +#define YYTEXT_POINTER 1 +EOF + +fi + +fi +# Extract the first word of "rm", so it can be a program name with args. +set dummy rm; ac_word=$2 +echo "$as_me:2217: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_RM+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $RM in + [\\/]* | ?:[\\/]*) + ac_cv_path_RM="$RM" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_RM="$ac_dir/$ac_word" + echo "$as_me:2234: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_RM" && ac_cv_path_RM="no" + ;; +esac +fi +RM=$ac_cv_path_RM + +if test -n "$RM"; then + echo "$as_me:2246: result: $RM" >&5 +echo "${ECHO_T}$RM" >&6 +else + echo "$as_me:2249: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +# Extract the first word of "find", so it can be a program name with args. +set dummy find; ac_word=$2 +echo "$as_me:2255: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_FIND+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $FIND in + [\\/]* | ?:[\\/]*) + ac_cv_path_FIND="$FIND" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_FIND="$ac_dir/$ac_word" + echo "$as_me:2272: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_FIND" && ac_cv_path_FIND="no" + ;; +esac +fi +FIND=$ac_cv_path_FIND + +if test -n "$FIND"; then + echo "$as_me:2284: result: $FIND" >&5 +echo "${ECHO_T}$FIND" >&6 +else + echo "$as_me:2287: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +for ac_prog in gmake make +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:2295: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_MAKE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$MAKE"; then + ac_cv_prog_MAKE="$MAKE" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_MAKE="$ac_prog" +echo "$as_me:2310: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +MAKE=$ac_cv_prog_MAKE +if test -n "$MAKE"; then + echo "$as_me:2318: result: $MAKE" >&5 +echo "${ECHO_T}$MAKE" >&6 +else + echo "$as_me:2321: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$MAKE" && break +done + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:2340: checking for a BSD compatible install" >&5 +echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_save_IFS=$IFS; IFS=$ac_path_separator + for ac_dir in $PATH; do + IFS=$ac_save_IFS + # Account for people who put trailing slashes in PATH elements. + case $ac_dir/ in + / | ./ | .// | /cC/* \ + | /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* \ + | /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + if $as_executable_p "$ac_dir/$ac_prog"; then + if test $ac_prog = install && + grep dspmsg "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$ac_dir/$ac_prog -c" + break 2 + fi + fi + done + ;; + esac + done + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:2389: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +test x"$prefix" = xNONE && prefix="$ac_default_prefix" + +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + CFLAGS="-g -Wall" + cat >>confdefs.h <<\EOF +#define DEBUG 1 +EOF + + debug="yes" +else + debug="no" + +fi; + +# Check whether --enable-xdebug or --disable-xdebug was given. +if test "${enable_xdebug+set}" = set; then + enableval="$enable_xdebug" + cat >>confdefs.h <<\EOF +#define XDEBUG 1 +EOF + + xdebug="yes" +else + xdebug="no" + +fi; + +# Check whether --enable-rlpdebug or --disable-rlpdebug was given. +if test "${enable_rlpdebug+set}" = set; then + enableval="$enable_rlpdebug" + cat >>confdefs.h <<\EOF +#define RLP_DEBUG 1 +EOF + + rlpdebug="yes" +else + rlpdebug="no" + +fi; + +LIBS="" +NLS_LIBS="" +NLS_CFLAGS="" + +# Check whether --with-libintl or --without-libintl was given. +if test "${with_libintl+set}" = set; then + withval="$with_libintl" + if test "x$withval" = "xyes"; then + { echo "$as_me:2450: WARNING: Usage is --with-libintl=DIR" >&5 +echo "$as_me: WARNING: Usage is --with-libintl=DIR" >&2;} + else + NLS_LIBS="-L$withval/lib" + NLS_CFLAGS="-I$withval/include" + fi + +fi; + +# Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + USE_NLS=$enableval +else + USE_NLS=yes + +fi; + +if test "$USE_NLS" = "yes"; then + echo "$as_me:2469: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:2489: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:2493: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + +for ac_header in locale.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:2501: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2507 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:2511: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2517: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:2536: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2555 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2586: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2589: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2592: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2595: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:2605: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <conftest.$ac_ext <<_ACEOF +#line 2617 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:2621: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:2627: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + cat >>confdefs.h <<\EOF +#define HAVE_LIBINTL_H 1 +EOF + + echo "$as_me:2642: result: checking for libintl.h... yes" >&5 +echo "${ECHO_T}checking for libintl.h... yes" >&6 +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + { echo "$as_me:2647: WARNING: not found header file: libintl.h !!!" >&5 +echo "$as_me: WARNING: not found header file: libintl.h !!!" >&2;} + USE_NLS=no + +fi +rm -f conftest.err conftest.$ac_ext +fi + +if test "$USE_NLS" = "yes"; then + echo "$as_me:2656: checking for gettext" >&5 +echo $ECHO_N "checking for gettext... $ECHO_C" >&6 +if test "${ac_cv_func_gettext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2662 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gettext (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gettext (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gettext) || defined (__stub___gettext) +choke me +#else +f = gettext; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2693: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2696: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2699: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2702: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gettext=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_gettext=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:2712: result: $ac_cv_func_gettext" >&5 +echo "${ECHO_T}$ac_cv_func_gettext" >&6 +if test $ac_cv_func_gettext = yes; then + cat >>confdefs.h <<\EOF +#define HAVE_LIBINTL 1 +EOF + +else + echo "$as_me:2720: checking for gettext in -lintl" >&5 +echo $ECHO_N "checking for gettext in -lintl... $ECHO_C" >&6 +if test "${ac_cv_lib_intl_gettext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $NLS_LIBS + $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 2729 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gettext (); +int +main () +{ +gettext (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2748: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2751: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2754: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2757: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_intl_gettext=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_intl_gettext=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:2768: result: $ac_cv_lib_intl_gettext" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_gettext" >&6 +if test $ac_cv_lib_intl_gettext = yes; then + NLS_LIBS="$NLS_LIBS -lintl" + cat >>confdefs.h <<\EOF +#define HAVE_LIBINTL 1 +EOF + +else + { echo "$as_me:2777: WARNING: not found library: intl !!!" >&5 +echo "$as_me: WARNING: not found library: intl !!!" >&2;} + USE_NLS=no +fi + +fi + +fi + +if test "$USE_NLS" = "yes"; then + + LOCALEDIR='${prefix}/share/locale' + +# Check whether --with-locale-dir or --without-locale-dir was given. +if test "${with_locale_dir+set}" = set; then + withval="$with_locale_dir" + if test x$withval = xyes; then + { echo "$as_me:2794: WARNING: Usage is: --with-locale-dir=basedir" >&5 +echo "$as_me: WARNING: Usage is: --with-locale-dir=basedir" >&2;} + else + if test x$withval = xno; then + { echo "$as_me:2798: WARNING: Usage is: --with-locale-dir=basedir" >&5 +echo "$as_me: WARNING: Usage is: --with-locale-dir=basedir" >&2;} + else + LOCALEDIR=$withval + fi + fi + +fi; + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo "$as_me:2809: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + echo "$as_me:2826: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="$MSGFMT" + ;; +esac +fi +MSGFMT=$ac_cv_path_MSGFMT + +if test -n "$MSGFMT"; then + echo "$as_me:2838: result: $MSGFMT" >&5 +echo "${ECHO_T}$MSGFMT" >&6 +else + echo "$as_me:2841: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$MSGFMT"; then + +for ac_func in dcgettext +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:2850: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 2856 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:2887: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:2890: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:2893: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:2896: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:2906: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GMSGFMT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GMSGFMT in + [\\/]* | ?:[\\/]*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_GMSGFMT="$ac_dir/$ac_word" + echo "$as_me:2935: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT=$ac_cv_path_GMSGFMT + +if test -n "$GMSGFMT"; then + echo "$as_me:2947: result: $GMSGFMT" >&5 +echo "${ECHO_T}$GMSGFMT" >&6 +else + echo "$as_me:2950: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo "$as_me:2956: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_XGETTEXT+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $XGETTEXT in + [\\/]* | ?:[\\/]*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + echo "$as_me:2973: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT="$XGETTEXT" + ;; +esac +fi +XGETTEXT=$ac_cv_path_XGETTEXT + +if test -n "$XGETTEXT"; then + echo "$as_me:2985: result: $XGETTEXT" >&5 +echo "${ECHO_T}$XGETTEXT" >&6 +else + echo "$as_me:2988: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + # Extract the first word of "msgmerge", so it can be a program name with args. +set dummy msgmerge; ac_word=$2 +echo "$as_me:2994: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_MSGMERGE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $MSGMERGE in + [\\/]* | ?:[\\/]*) + ac_cv_path_MSGMERGE="$MSGMERGE" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_MSGMERGE="$ac_dir/$ac_word" + echo "$as_me:3011: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_MSGMERGE" && ac_cv_path_MSGMERGE="$MSGMERGE" + ;; +esac +fi +MSGMERGE=$ac_cv_path_MSGMERGE + +if test -n "$MSGMERGE"; then + echo "$as_me:3023: result: $MSGMERGE" >&5 +echo "${ECHO_T}$MSGMERGE" >&6 +else + echo "$as_me:3026: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + if test -n "$XGETTEXT"; then + if $XGETTEXT --omit-header /dev/null 2> /dev/null; then + : ; + else + echo "$as_me:3034: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + XGETTEXT="" + fi + fi + + if test -n "$XGETTEXT"; then + if $XGETTEXT --help > /dev/null 2> /dev/null; then + : ; + else + echo "$as_me:3044: result: found xgettext program is not GNU xgettext; ignore it" >&5 +echo "${ECHO_T}found xgettext program is not GNU xgettext; ignore it" >&6 + XGETTEXT="" + fi + fi + + if test -n "$MSGFMT"; then + if $MSGFMT < /dev/null 2> /dev/null; then + echo "$as_me:3052: result: found msgfmt program is not GNU msgfmt; NLS will not be installed" >&5 +echo "${ECHO_T}found msgfmt program is not GNU msgfmt; NLS will not be installed" >&6 + MSGFMT="" + fi + fi + + cat >conftest.$ac_ext <<_ACEOF +#line 3059 "configure" +#include "confdefs.h" + +int +main () +{ + extern int _nl_msg_cat_cntr; + return _nl_msg_cat_cntr + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3072: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3075: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3078: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3081: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + CATOBJEXT=.gmo + DATADIRNAME=share +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + CATOBJEXT=.mo + DATADIRNAME=lib + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + INSTOBJEXT=.mo + fi + + if test -n "$ALL_LINGUAS"; then + for lang in $ALL_LINGUAS; do + CATALOGS="$CATALOGS $lang$CATOBJEXT" + done + fi + +fi + +if test x"$MSGFMT" = x; then + USE_NLS=no +fi + +if test x"$USE_NLS" = xyes; then + cat >>confdefs.h <<\EOF +#define USE_NLS 1 +EOF + +fi + +# Check whether --with-libpthread or --without-libpthread was given. +if test "${with_libpthread+set}" = set; then + withval="$with_libpthread" + if test x$withval = xyes + then + { echo "$as_me:3120: WARNING: Usage is: --with-libpthread=DIR" >&5 +echo "$as_me: WARNING: Usage is: --with-libpthread=DIR" >&2;} + else + PTHREAD_LIBS="-L$withval/lib/" + PTHREAD_CFLAGS="-I$withval/include/" + fi + +fi; + +PTHREAD_LIBS_SAVE="$PTHREAD_LIBS" +PTHREAD_LIBS=error +echo "$as_me:3131: checking for pthread_attr_init in -lpthread" >&5 +echo $ECHO_N "checking for pthread_attr_init in -lpthread... $ECHO_C" >&6 +if test "${ac_cv_lib_pthread_pthread_attr_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpthread $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 3139 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_attr_init (); +int +main () +{ +pthread_attr_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3158: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3161: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3164: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3167: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_pthread_pthread_attr_init=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_pthread_pthread_attr_init=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:3178: result: $ac_cv_lib_pthread_pthread_attr_init" >&5 +echo "${ECHO_T}$ac_cv_lib_pthread_pthread_attr_init" >&6 +if test $ac_cv_lib_pthread_pthread_attr_init = yes; then + + PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_REENTRANT" + PTHREAD_LIBS="$PTHREAD_LIBS_SAVE -lpthread" +fi + +if test "x$PTHREAD_LIBS" = xerror; then + echo "$as_me:3187: checking for pthread_attr_init in -lc_r" >&5 +echo $ECHO_N "checking for pthread_attr_init in -lc_r... $ECHO_C" >&6 +if test "${ac_cv_lib_c_r_pthread_attr_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lc_r $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 3195 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_attr_init (); +int +main () +{ +pthread_attr_init (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3214: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3217: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3220: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3223: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_c_r_pthread_attr_init=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_c_r_pthread_attr_init=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:3234: result: $ac_cv_lib_c_r_pthread_attr_init" >&5 +echo "${ECHO_T}$ac_cv_lib_c_r_pthread_attr_init" >&6 +if test $ac_cv_lib_c_r_pthread_attr_init = yes; then + + PTHREAD_CFLAGS="$PTHREAD_CFLAGS -D_THREAD_SAFE" + PTHREAD_LIBS="-pthread" +fi + +fi + +if test "x$PTHREAD_LIBS" = xerror; then + echo "$as_me:3245: checking for pthread_attr_init" >&5 +echo $ECHO_N "checking for pthread_attr_init... $ECHO_C" >&6 +if test "${ac_cv_func_pthread_attr_init+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3251 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char pthread_attr_init (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_attr_init (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_pthread_attr_init) || defined (__stub___pthread_attr_init) +choke me +#else +f = pthread_attr_init; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3282: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3285: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3288: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3291: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_pthread_attr_init=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_pthread_attr_init=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:3301: result: $ac_cv_func_pthread_attr_init" >&5 +echo "${ECHO_T}$ac_cv_func_pthread_attr_init" >&6 +if test $ac_cv_func_pthread_attr_init = yes; then + PTHREAD_LIBS="" +else + { { echo "$as_me:3306: error: not found library: pthread !!!" >&5 +echo "$as_me: error: not found library: pthread !!!" >&2;} + { (exit 1); exit 1; }; } +fi + +fi + +echo "$as_me:3313: checking for tm_gmtoff in struct tm" >&5 +echo $ECHO_N "checking for tm_gmtoff in struct tm... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line 3316 "configure" +#include "confdefs.h" +#include +int +main () +{ +struct tm t; t.tm_gmtoff = 0 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3328: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3331: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3334: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3337: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:3339: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + cat >>confdefs.h <<\EOF +#define HAVE_TM_GMTON 1 +EOF + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:3348: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +echo "$as_me:3353: checking for timersub" >&5 +echo $ECHO_N "checking for timersub... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line 3356 "configure" +#include "confdefs.h" +#include +int +main () +{ +timersub(NULL, NULL, NULL) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3368: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3371: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3374: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3377: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cat >>confdefs.h <<\EOF +#define HAVE_TIMEOPS 1 +EOF + + cat >>confdefs.h <<\EOF +#define HAVE_TIMEOPS 1 +EOF + + echo "$as_me:3387: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:3392: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +have_termios="no" +echo "$as_me:3398: checking for cfsetspeed in termios.h" >&5 +echo $ECHO_N "checking for cfsetspeed in termios.h... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line 3401 "configure" +#include "confdefs.h" +#include +int +main () +{ +struct termios t; cfsetspeed(&t, B9600); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3413: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3416: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3419: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3422: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cat >>confdefs.h <<\EOF +#define HAVE_CFSETSPEED 1 +EOF + + have_termios="yes" + echo "$as_me:3429: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:3434: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +if test $have_termios = "no"; then + echo "$as_me:3440: checking for cfsetispeed and cfsetospeed in termios.h" >&5 +echo $ECHO_N "checking for cfsetispeed and cfsetospeed in termios.h... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line 3443 "configure" +#include "confdefs.h" +#include +int +main () +{ +struct termios t; cfsetispeed(&t, B9600); cfsetospeed(&t, B9600); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3455: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3458: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3461: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3464: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cat >>confdefs.h <<\EOF +#define HAVE_CFSETISPEED 1 +EOF + + cat >>confdefs.h <<\EOF +#define HAVE_CFSETOSPEED 1 +EOF + + have_termios="yes" + echo "$as_me:3475: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:3480: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + if test $have_termios = "no"; then + echo "$as_me:3486: checking for c_ispeed and c_ospeed in struct termios" >&5 +echo $ECHO_N "checking for c_ispeed and c_ospeed in struct termios... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line 3489 "configure" +#include "confdefs.h" +#include +int +main () +{ +struct termios t; t.c_iflag = B9600; t.c_oflag = B9600; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3501: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3504: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3507: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3510: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cat >>confdefs.h <<\EOF +#define HAVE_TERMIOS_CSPEED 1 +EOF + + echo "$as_me:3516: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:3521: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi +fi + +echo "$as_me:3528: checking for getopt.h" >&5 +echo $ECHO_N "checking for getopt.h... $ECHO_C" >&6 +if test "${ac_cv_header_getopt_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3534 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:3538: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:3544: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_getopt_h=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_getopt_h=no +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:3563: result: $ac_cv_header_getopt_h" >&5 +echo "${ECHO_T}$ac_cv_header_getopt_h" >&6 +if test $ac_cv_header_getopt_h = yes; then + : +else + CFLAGS="$CFLAGS -I../getopt" +fi + +# Check whether --with-gnugetopt or --without-gnugetopt was given. +if test "${with_gnugetopt+set}" = set; then + withval="$with_gnugetopt" + if test x$withval=yes; then + { echo "$as_me:3575: WARNING: Usage is: --with-getopt=DIR" >&5 +echo "$as_me: WARNING: Usage is: --with-getopt=DIR" >&2;} + else + GETOPT_LIBS="-L$withval" + fi + +fi; + +OWN_GETOPT="" +echo "$as_me:3584: checking for getopt_long" >&5 +echo $ECHO_N "checking for getopt_long... $ECHO_C" >&6 +if test "${ac_cv_func_getopt_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3590 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char getopt_long (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char getopt_long (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_getopt_long) || defined (__stub___getopt_long) +choke me +#else +f = getopt_long; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3621: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3624: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3627: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3630: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_getopt_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_getopt_long=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:3640: result: $ac_cv_func_getopt_long" >&5 +echo "${ECHO_T}$ac_cv_func_getopt_long" >&6 +if test $ac_cv_func_getopt_long = yes; then + : +else + + LIBS="$LIBS $GETOPT_LIBS" + echo "$as_me:3647: checking for getopt_long in -lgnugetopt" >&5 +echo $ECHO_N "checking for getopt_long in -lgnugetopt... $ECHO_C" >&6 +if test "${ac_cv_lib_gnugetopt_getopt_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgnugetopt $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 3655 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char getopt_long (); +int +main () +{ +getopt_long (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3674: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3677: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3680: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3683: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gnugetopt_getopt_long=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gnugetopt_getopt_long=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:3694: result: $ac_cv_lib_gnugetopt_getopt_long" >&5 +echo "${ECHO_T}$ac_cv_lib_gnugetopt_getopt_long" >&6 +if test $ac_cv_lib_gnugetopt_getopt_long = yes; then + LIBS="$LIBS -lgnugetopt" +else + OWN_GETOPT="1" +fi + +fi + +if test "$no_x" = yes -o "$with_x" = "no"; then + x_support="no" + XPM_CFLAGS="" + XPM_LIBS="" + GTK_CFLAGS="" + GTK_LIBS="" +else + echo "$as_me:3711: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + +fi; +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -fr conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat >Imakefile <<'EOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +EOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -fr conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Intrinsic.h. + # First, try using that file with no special directory specified. + cat >conftest.$ac_ext <<_ACEOF +#line 3808 "configure" +#include "confdefs.h" +#include +_ACEOF +if { (eval echo "$as_me:3812: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:3818: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Intrinsic.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 3851 "configure" +#include "confdefs.h" +#include +int +main () +{ +XtMalloc (0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:3863: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:3866: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:3869: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:3872: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi + + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + echo "$as_me:3910: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$as_me:3920: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 +fi + + CPPFLAGS="$CPPFLAGS -I$x_includes" + +for ac_header in X11/xpm.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:3929: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 3935 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:3939: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:3945: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:3964: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo "$as_me: WARNING: Cannot find include X11/xpm.h" >&2;} + { echo "$as_me:3984: WARNING: Disabling xgnokii." >&5 +echo "$as_me: WARNING: Disabling xgnokii." >&2;} + elif test "x$x_libraries" = "xNONE"; then + x_support="no" + XPM_CFLAGS="" + XPM_LIBS="" + GTK_CFLAGS="" + GTK_LIBS="" + { echo "$as_me:3992: WARNING: Cannot find library libX11." >&5 +echo "$as_me: WARNING: Cannot find library libX11." >&2;} + { echo "$as_me:3994: WARNING: Disabling xgnokii." >&5 +echo "$as_me: WARNING: Disabling xgnokii." >&2;} + else + echo "$as_me:3997: checking for XpmWriteFileFromXpmImage in -lXpm" >&5 +echo $ECHO_N "checking for XpmWriteFileFromXpmImage in -lXpm... $ECHO_C" >&6 +if test "${ac_cv_lib_Xpm_XpmWriteFileFromXpmImage+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXpm -L$x_libraries -lX11 + $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 4006 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XpmWriteFileFromXpmImage (); +int +main () +{ +XpmWriteFileFromXpmImage (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4025: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4028: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4031: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4034: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xpm_XpmWriteFileFromXpmImage=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_Xpm_XpmWriteFileFromXpmImage=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:4045: result: $ac_cv_lib_Xpm_XpmWriteFileFromXpmImage" >&5 +echo "${ECHO_T}$ac_cv_lib_Xpm_XpmWriteFileFromXpmImage" >&6 +if test $ac_cv_lib_Xpm_XpmWriteFileFromXpmImage = yes; then + XPM_CFLAGS="-I$x_includes" XPM_LIBS="-L$x_libraries -lX11 -lXpm" + cat >>confdefs.h <<\EOF +#define XPM 1 +EOF + +else + { echo "$as_me:4054: WARNING: Cannot found library libXpm - disabling XPM support." >&5 +echo "$as_me: WARNING: Cannot found library libXpm - disabling XPM support." >&2;} +fi + + for ac_prog in gtk-config gtk12-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:4062: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_GTK_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $GTK_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_GTK_CONFIG="$ac_dir/$ac_word" + echo "$as_me:4079: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +GTK_CONFIG=$ac_cv_path_GTK_CONFIG + +if test -n "$GTK_CONFIG"; then + echo "$as_me:4090: result: $GTK_CONFIG" >&5 +echo "${ECHO_T}$GTK_CONFIG" >&6 +else + echo "$as_me:4093: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$GTK_CONFIG" && break +done +test -n "$GTK_CONFIG" || GTK_CONFIG="no" + + if test "$GTK_CONFIG" = no; then + x_support="no" + GTK_CFLAGS="" + GTK_LIBS="" + { echo "$as_me:4105: WARNING: Cannot find gtk-config." >&5 +echo "$as_me: WARNING: Cannot find gtk-config." >&2;} + { echo "$as_me:4107: WARNING: Disabling xgnokii." >&5 +echo "$as_me: WARNING: Disabling xgnokii." >&2;} + else + GTK_CFLAGS=`$GTK_CONFIG --cflags` + GTK_LIBS=`$GTK_CONFIG --libs` + x_support="yes" + + XGNOKIIDIR='${prefix}/share' + XGNOKIIPATH=${prefix}/share + +# Check whether --with-xgnokiidir or --without-xgnokiidir was given. +if test "${with_xgnokiidir+set}" = set; then + withval="$with_xgnokiidir" + if test x$withval = xyes; then + { echo "$as_me:4121: WARNING: Usage is: --with-xgnokiilib=DIR" >&5 +echo "$as_me: WARNING: Usage is: --with-xgnokiilib=DIR" >&2;} + else + XGNOKIIDIR="$withval" + XGNOKIIPATH="$withval" + fi + +fi; + fi + fi +fi + +echo "$as_me:4133: checking for socket in -lsocket" >&5 +echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 4141 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char socket (); +int +main () +{ +socket (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4160: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4163: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4166: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4169: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_socket=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_socket_socket=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:4180: result: $ac_cv_lib_socket_socket" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 +if test $ac_cv_lib_socket_socket = yes; then + cat >>confdefs.h <>confdefs.h <<\EOF +#define SECURITY 1 +EOF + + security="yes" +else + security="no" + +fi; + +# Check whether --enable-win32 or --disable-win32 was given. +if test "${enable_win32+set}" = set; then + enableval="$enable_win32" + cat >>confdefs.h <<\EOF +#define WIN32 1 +EOF + + win32="-DWIN32" +else + win32="" + +fi; + +echo "$as_me:4217: checking for grantpt" >&5 +echo $ECHO_N "checking for grantpt... $ECHO_C" >&6 +if test "${ac_cv_func_grantpt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4223 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char grantpt (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char grantpt (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_grantpt) || defined (__stub___grantpt) +choke me +#else +f = grantpt; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:4254: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4257: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:4260: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4263: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_grantpt=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_grantpt=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:4273: result: $ac_cv_func_grantpt" >&5 +echo "${ECHO_T}$ac_cv_func_grantpt" >&6 +if test $ac_cv_func_grantpt = yes; then + if test "$cross_compiling" = yes; then + { echo "$as_me:4277: WARNING: \"Ensure to disable unix98ptys when crosscompiling\"" >&5 +echo "$as_me: WARNING: \"Ensure to disable unix98ptys when crosscompiling\"" >&2;} +else + cat >conftest.$ac_ext <<_ACEOF +#line 4281 "configure" +#include "confdefs.h" + +#define _XOPEN_SOURCE 500 + +#include +#include +#include +#include +#include +#include + +int main() +{ + char *name = NULL; + int master, err; + + master = open("/dev/ptmx", O_RDWR | O_NOCTTY | O_NONBLOCK); + if (master >= 0) { + err = grantpt(master); + err = err || unlockpt(master); + if (!err) { + name = ptsname(master); + } else { + exit(-1); + } + } else { + exit(-1); + } + close(master); + exit(0); +} + +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4316: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4319: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4321: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4324: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cat >>confdefs.h <<\EOF +#define USE_UNIX98PTYS 1 +EOF + +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ echo "$as_me:4334: WARNING: \"No unix98ptys\"" >&5 +echo "$as_me: WARNING: \"No unix98ptys\"" >&2;} +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + +fi + +echo "$as_me:4342: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4348 "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:4356: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:4362: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line 4384 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line 4402 "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line 4423 "configure" +#include "confdefs.h" +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:4449: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:4452: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:4454: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4457: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:4470: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +echo "$as_me:4480: checking for sys/wait.h that is POSIX.1 compatible" >&5 +echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6 +if test "${ac_cv_header_sys_wait_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4486 "configure" +#include "confdefs.h" +#include +#include +#ifndef WEXITSTATUS +# define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) +#endif +#ifndef WIFEXITED +# define WIFEXITED(stat_val) (((stat_val) & 255) == 0) +#endif + +int +main () +{ + int s; + wait (&s); + s = WIFEXITED (s) ? WEXITSTATUS (s) : 1; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4508: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4511: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4514: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4517: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_sys_wait_h=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_sys_wait_h=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4527: result: $ac_cv_header_sys_wait_h" >&5 +echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6 +if test $ac_cv_header_sys_wait_h = yes; then + +cat >>confdefs.h <<\EOF +#define HAVE_SYS_WAIT_H 1 +EOF + +fi + +for ac_header in fcntl.h sys/ioctl.h sys/time.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:4540: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4546 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:4550: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:4556: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:4575: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_stdc=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF +#line 4593 "configure" +#include "confdefs.h" +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +int +main () +{ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; + return 0; +} +_ACEOF +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:4642: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4645: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4648: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4651: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext +done +rm -f conftest.$ac_ext conftest.$ac_objext +CC=$ac_save_CC + +fi + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:4668: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; + *) + echo "$as_me:4671: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; +esac + +echo "$as_me:4676: checking for an ANSI C-conforming const" >&5 +echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +if test "${ac_cv_c_const+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4682 "configure" +#include "confdefs.h" + +int +main () +{ +/* FIXME: Include the comments suggested by Paul. */ +#ifndef __cplusplus + /* Ultrix mips cc rejects this. */ + typedef int charset[2]; + const charset x; + /* SunOS 4.1.1 cc rejects this. */ + char const *const *ccp; + char **p; + /* NEC SVR4.0.2 mips cc rejects this. */ + struct point {int x, y;}; + static struct point const zero = {0,0}; + /* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in + an arm of an if-expression whose if-part is not a constant + expression */ + const char *g = "string"; + ccp = &g + (g ? g-g : 0); + /* HPUX 7.0 cc rejects these. */ + ++ccp; + p = (char**) ccp; + ccp = (char const *const *) p; + { /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; + } + { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; + } + { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; + } + { /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; + } + { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; + } +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4740: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4743: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4746: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4749: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_const=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_c_const=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4759: result: $ac_cv_c_const" >&5 +echo "${ECHO_T}$ac_cv_c_const" >&6 +if test $ac_cv_c_const = no; then + +cat >>confdefs.h <<\EOF +#define const +EOF + +fi + +echo "$as_me:4769: checking for inline" >&5 +echo $ECHO_N "checking for inline... $ECHO_C" >&6 +if test "${ac_cv_c_inline+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat >conftest.$ac_ext <<_ACEOF +#line 4777 "configure" +#include "confdefs.h" +#ifndef __cplusplus +static $ac_kw int static_foo () {return 0; } +$ac_kw int foo () {return 0; } +#endif + +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4786: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4789: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4792: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4795: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_inline=$ac_kw; break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done + +fi +echo "$as_me:4806: result: $ac_cv_c_inline" >&5 +echo "${ECHO_T}$ac_cv_c_inline" >&6 +case $ac_cv_c_inline in + inline | yes) ;; + no) +cat >>confdefs.h <<\EOF +#define inline +EOF + ;; + *) cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4833 "configure" +#include "confdefs.h" +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4839: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4842: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4845: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4848: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4858: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4874 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4889: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4892: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4895: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4898: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_pid_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4908: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : +else + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for size_t... $ECHO_C" >&6 +if test "${ac_cv_type_size_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4926 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((size_t *) 0) + return 0; +if (sizeof (size_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4941: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4944: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:4947: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:4950: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_size_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_size_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:4960: result: $ac_cv_type_size_t" >&5 +echo "${ECHO_T}$ac_cv_type_size_t" >&6 +if test $ac_cv_type_size_t = yes; then + : +else + +cat >>confdefs.h <&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 4978 "configure" +#include "confdefs.h" +#include +#include +#include + +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:4994: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4997: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5000: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5003: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_time=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5013: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 +EOF + +fi + +echo "$as_me:5023: checking whether struct tm is in sys/time.h or time.h" >&5 +echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6 +if test "${ac_cv_struct_tm+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5029 "configure" +#include "confdefs.h" +#include +#include + +int +main () +{ +struct tm *tp; tp->tm_sec; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5043: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5046: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5049: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5052: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_struct_tm=time.h +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_struct_tm=sys/time.h +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5062: result: $ac_cv_struct_tm" >&5 +echo "${ECHO_T}$ac_cv_struct_tm" >&6 +if test $ac_cv_struct_tm = sys/time.h; then + +cat >>confdefs.h <<\EOF +#define TM_IN_SYS_TIME 1 +EOF + +fi + +if test $ac_cv_c_compiler_gnu = yes; then + echo "$as_me:5073: checking whether $CC needs -traditional" >&5 +echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 +if test "${ac_cv_prog_gcc_traditional+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_pattern="Autoconf.*'x'" + cat >conftest.$ac_ext <<_ACEOF +#line 5080 "configure" +#include "confdefs.h" +#include +Autoconf TIOCGETP +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +else + ac_cv_prog_gcc_traditional=no +fi +rm -f conftest* + + if test $ac_cv_prog_gcc_traditional = no; then + cat >conftest.$ac_ext <<_ACEOF +#line 5095 "configure" +#include "confdefs.h" +#include +Autoconf TCGETA +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "$ac_pattern" >/dev/null 2>&1; then + ac_cv_prog_gcc_traditional=yes +fi +rm -f conftest* + + fi +fi +echo "$as_me:5108: result: $ac_cv_prog_gcc_traditional" >&5 +echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 + if test $ac_cv_prog_gcc_traditional = yes; then + CC="$CC -traditional" + fi +fi + +echo "$as_me:5115: checking for working memcmp" >&5 +echo $ECHO_N "checking for working memcmp... $ECHO_C" >&6 +if test "${ac_cv_func_memcmp_working+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_memcmp_working=no +else + cat >conftest.$ac_ext <<_ACEOF +#line 5124 "configure" +#include "confdefs.h" + +int +main () +{ + + /* Some versions of memcmp are not 8-bit clean. */ + char c0 = 0x40, c1 = 0x80, c2 = 0x81; + if (memcmp(&c0, &c2, 1) >= 0 || memcmp(&c1, &c2, 1) >= 0) + exit (1); + + /* The Next x86 OpenStep bug shows up only when comparing 16 bytes + or more and with at least one buffer not starting on a 4-byte boundary. + William Lewis provided this test program. */ + { + char foo[21]; + char bar[21]; + int i; + for (i = 0; i < 4; i++) + { + char *a = foo + i; + char *b = bar + i; + strcpy (a, "--------01111111"); + strcpy (b, "--------10000000"); + if (memcmp (a, b, 16) >= 0) + exit (1); + } + exit (0); + } + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:5160: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5163: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:5165: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5168: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_memcmp_working=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_memcmp_working=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:5180: result: $ac_cv_func_memcmp_working" >&5 +echo "${ECHO_T}$ac_cv_func_memcmp_working" >&6 +test $ac_cv_func_memcmp_working = no && LIBOBJS="$LIBOBJS memcmp.$ac_objext" + +echo "$as_me:5184: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5190 "configure" +#include "confdefs.h" +#include +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5212: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5215: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5218: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5221: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_signal=void +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_signal=int +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:5231: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5247 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5278: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5281: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5284: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5287: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:5297: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for strftime in -lintl... $ECHO_C" >&6 +if test "${ac_cv_lib_intl_strftime+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lintl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 5314 "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strftime (); +int +main () +{ +strftime (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5333: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5336: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5339: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5342: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_intl_strftime=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_intl_strftime=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:5353: result: $ac_cv_lib_intl_strftime" >&5 +echo "${ECHO_T}$ac_cv_lib_intl_strftime" >&6 +if test $ac_cv_lib_intl_strftime = yes; then + cat >>confdefs.h <<\EOF +#define HAVE_STRFTIME 1 +EOF + +LIBS="-lintl $LIBS" +fi + +fi +done + +for ac_func in mktime select strdup strstr strtol strtok strsep snprintf +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:5369: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 5375 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5406: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5409: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5412: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5415: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:5425: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:5539: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +ac_cs_invocation="\$0 \$@" + +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# Name of the executable. +as_me=`echo "$0" |sed 's,.*[\\/],,'` + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +# NLS nuisances. +$as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } +$as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } +$as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } +$as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } +$as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } +$as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } +$as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } +$as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=:; export CDPATH; } + +exec 6>&1 + +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\EOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +EOF + +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:5715: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:5734: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +exec 5>>config.log +cat >&5 << _ACEOF + +## ----------------------- ## +## Running config.status. ## +## ----------------------- ## + +This file was extended by $as_me 2.52, executed with + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + > $ac_cs_invocation +on `(hostname || uname -n) 2>/dev/null | sed 1q` + +_ACEOF +EOF + +cat >>$CONFIG_STATUS <<\EOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "include/config.h.in" ) CONFIG_FILES="$CONFIG_FILES include/config.h.in" ;; + "Makefile.global" ) CONFIG_FILES="$CONFIG_FILES Makefile.global" ;; + "po/Makefile.in" ) CONFIG_FILES="$CONFIG_FILES po/Makefile.in" ;; + "packaging/RedHat/gnokii.spec" ) CONFIG_FILES="$CONFIG_FILES packaging/RedHat/gnokii.spec" ;; + "packaging/Slackware/SlackBuild" ) CONFIG_FILES="$CONFIG_FILES packaging/Slackware/SlackBuild" ;; + "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; + "include/config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; + *) { { echo "$as_me:5776: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +EOF + +cat >>$CONFIG_STATUS <\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@DEFS@,$DEFS,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@LEX@,$LEX,;t t +s,@LEXLIB@,$LEXLIB,;t t +s,@LEX_OUTPUT_ROOT@,$LEX_OUTPUT_ROOT,;t t +s,@RM@,$RM,;t t +s,@FIND@,$FIND,;t t +s,@MAKE@,$MAKE,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@HAVE_LOCALE_H@,$HAVE_LOCALE_H,;t t +s,@HAVE_LIBINTL_H@,$HAVE_LIBINTL_H,;t t +s,@HAVE_LIBINTL@,$HAVE_LIBINTL,;t t +s,@LOCALEDIR@,$LOCALEDIR,;t t +s,@MSGFMT@,$MSGFMT,;t t +s,@GMSGFMT@,$GMSGFMT,;t t +s,@XGETTEXT@,$XGETTEXT,;t t +s,@MSGMERGE@,$MSGMERGE,;t t +s,@CATALOGS@,$CATALOGS,;t t +s,@CATOBJEXT@,$CATOBJEXT,;t t +s,@INSTOBJEXT@,$INSTOBJEXT,;t t +s,@DATADIRNAME@,$DATADIRNAME,;t t +s,@GTK_CONFIG@,$GTK_CONFIG,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@XVERSION@,$XVERSION,;t t +s,@XPACKAGE@,$XPACKAGE,;t t +s,@XGNOKIIDIR@,$XGNOKIIDIR,;t t +s,@XGNOKIIPATH@,$XGNOKIIPATH,;t t +s,@USE_NLS@,$USE_NLS,;t t +s,@GTK_CFLAGS@,$GTK_CFLAGS,;t t +s,@GTK_LIBS@,$GTK_LIBS,;t t +s,@PTHREAD_CFLAGS@,$PTHREAD_CFLAGS,;t t +s,@PTHREAD_LIBS@,$PTHREAD_LIBS,;t t +s,@XPM_CFLAGS@,$XPM_CFLAGS,;t t +s,@XPM_LIBS@,$XPM_LIBS,;t t +s,@OWN_GETOPT@,$OWN_GETOPT,;t t +s,@USE_UNIX98PTYS@,$USE_UNIX98PTYS,;t t +s,@HAVE_XGNOKII@,$HAVE_XGNOKII,;t t +CEOF + +EOF + + cat >>$CONFIG_STATUS <<\EOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +EOF +cat >>$CONFIG_STATUS <<\EOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + ac_dir_suffix="/`echo $ac_dir|sed 's,^\./,,'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo "$ac_dir_suffix" | sed 's,/[^/]*,../,g'` + else + ac_dir_suffix= ac_dots= + fi + + case $srcdir in + .) ac_srcdir=. + if test -z "$ac_dots"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_dots | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_dots$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_dots$srcdir ;; + esac + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_dots$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:6032: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + configure_input="Generated automatically from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:6050: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:6063: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +EOF +cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:6124: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:6135: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:6148: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +EOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\EOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\(\([^ (][^ (]*\)([^)]*)\)[ ]*\(.*\)$,${ac_dA}\2${ac_dB}\1${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +EOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\EOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +EOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # egrep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\EOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated automatically by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated automatically by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated automatically by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:6265: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || mkdir "$as_incr_dir" + ;; + esac +done; } + + fi + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +EOF +cat >>$CONFIG_STATUS <<\EOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + + case $ac_dest in + default ) sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile + ;; + esac +done +EOF + +cat >>$CONFIG_STATUS <<\EOF + +{ (exit 0); exit 0; } +EOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + +echo " + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Copyright (C) 1999-2000 The Gnokii Development Team. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + See file COPYING for more details. + + Host system: $host_os + Gnokii version: $VERSION + Xgnokii version: $XVERSION + X (GTK) support: $x_support + Debug: $debug + XDebug: $xdebug + RLPDebug: $rlpdebug + NLS: $USE_NLS + Security: $security + Win32: $win32 + Prefix: $prefix + + Type '${MAKE}' for compilation or '${MAKE} makelib' when want to compile + all binaries with one shared library + + After it '${MAKE} install', '${MAKE} install-suid', '${MAKE} install-strip' + or '${MAKE} install-ss' to install gnokii. +" diff --git a/do b/do deleted file mode 100755 index ac17196..0000000 --- a/do +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/sh - -enable_debug=1 - -exec 2>&1 -set -ex -rm -f config.cache -autoconf -# rm -f config.cache -./configure --prefix=/usr --without-x \ - `if [ -n "$enable_debug" ];then echo "--enable-debug --enable-xdebug";fi` -make clean -make diff --git a/getopt/win32/getopt.c b/getopt/win32/getopt.c new file mode 100644 index 0000000..763a245 --- /dev/null +++ b/getopt/win32/getopt.c @@ -0,0 +1,758 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifndef __STDC__ +# ifndef const +# define const +# endif +#endif + +/* This tells Alpha OSF/1 not to define a getopt prototype in . */ +#ifndef _NO_PROTO +#define _NO_PROTO +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +#include +#endif /* GNU C library. */ + +/* If GETOPT_COMPAT is defined, `+' as well as `--' can introduce a + long-named option. Because this is not POSIX.2 compliant, it is + being phased out. */ +/* #define GETOPT_COMPAT */ + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#ifdef VC6 + #include "getopt.h" +#else + #include +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg = 0; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* XXX 1003.2 says this must be 1 before any call. */ +int optind = 0; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +#define BAD_OPTION '\0' +int optopt = BAD_OPTION; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return EOF with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +#include +#define my_index strchr +#define my_strlen strlen +#else + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +#if __STDC__ || defined(PROTO) +extern char *getenv(const char *name); +extern int strcmp (const char *s1, const char *s2); +extern int strncmp(const char *s1, const char *s2, int n); + +static int my_strlen(const char *s); +static char *my_index (const char *str, int chr); +#else +extern char *getenv (); +#endif + +static int +my_strlen (str) + const char *str; +{ + int n = 0; + while (*str++) + n++; + return n; +} + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +#endif /* GNU C library. */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. + + To perform the swap, we first reverse the order of all elements. So + all options now come before all non options, but they are in the + wrong order. So we put back the options and non options in original + order by reversing them again. For example: + original input: a b c -x -y + reverse all: -y -x c b a + reverse options: -x -y c b a + reverse non options: -x -y a b c +*/ + +#if __STDC__ || defined(PROTO) +static void exchange (char **argv); +#endif + +static void +exchange (argv) + char **argv; +{ + char *temp, **first, **last; + + /* Reverse all the elements [first_nonopt, optind) */ + first = &argv[first_nonopt]; + last = &argv[optind-1]; + while (first < last) { + temp = *first; *first = *last; *last = temp; first++; last--; + } + /* Put back the options in order */ + first = &argv[first_nonopt]; + first_nonopt += (optind - last_nonopt); + last = &argv[first_nonopt - 1]; + while (first < last) { + temp = *first; *first = *last; *last = temp; first++; last--; + } + + /* Put back the non options in order */ + first = &argv[first_nonopt]; + last_nonopt = optind; + last = &argv[last_nonopt-1]; + while (first < last) { + temp = *first; *first = *last; *last = temp; first++; last--; + } +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns `EOF'. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return BAD_OPTION after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return BAD_OPTION. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + int option_index; + + optarg = 0; + + /* Initialize the internal data when the first call is made. + Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + if (optind == 0) + { + first_nonopt = last_nonopt = optind = 1; + + nextchar = NULL; + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (getenv ("POSIXLY_CORRECT") != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + } + + if (nextchar == NULL || *nextchar == '\0') + { + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Now skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc + && (argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + optind++; + last_nonopt = optind; + } + + /* Special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return EOF; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if ((argv[optind][0] != '-' || argv[optind][1] == '\0') +#ifdef GETOPT_COMPAT + && (longopts == NULL + || argv[optind][0] != '+' || argv[optind][1] == '\0') +#endif /* GETOPT_COMPAT */ + ) + { + if (ordering == REQUIRE_ORDER) + return EOF; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Start decoding its characters. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + if (longopts != NULL + && ((argv[optind][0] == '-' + && (argv[optind][1] == '-' || long_only)) +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + )) + { + const struct option *p; + char *s = nextchar; + int exact = 0; + int ambig = 0; + const struct option *pfound = NULL; + int indfound = 0; + + while (*s && *s != '=') + s++; + + /* Test all options for either exact match or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; + p++, option_index++) + if (!strncmp (p->name, nextchar, s - nextchar)) + { + if (s - nextchar == my_strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, "%s: option `%s' is ambiguous\n", + argv[0], argv[optind]); + nextchar += my_strlen (nextchar); + optind++; + return BAD_OPTION; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*s) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = s + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + "%s: option `--%s' doesn't allow an argument\n", + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + "%s: option `%c%s' doesn't allow an argument\n", + argv[0], argv[optind - 1][0], pfound->name); + } + nextchar += my_strlen (nextchar); + return BAD_OPTION; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, "%s: option `%s' requires an argument\n", + argv[0], argv[optind - 1]); + nextchar += my_strlen (nextchar); + return optstring[0] == ':' ? ':' : BAD_OPTION; + } + } + nextchar += my_strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' +#ifdef GETOPT_COMPAT + || argv[optind][0] == '+' +#endif /* GETOPT_COMPAT */ + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, "%s: unrecognized option `--%s'\n", + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, "%s: unrecognized option `%c%s'\n", + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + return BAD_OPTION; + } + } + + /* Look at and handle the next option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { +#if 0 + if (c < 040 || c >= 0177) + fprintf (stderr, "%s: unrecognized option, character code 0%o\n", + argv[0], c); + else + fprintf (stderr, "%s: unrecognized option `-%c'\n", argv[0], c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); +#endif + } + optopt = c; + return BAD_OPTION; + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = 0; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { +#if 0 + fprintf (stderr, "%s: option `-%c' requires an argument\n", + argv[0], c); +#else + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: option requires an argument -- %c\n", + argv[0], c); +#endif + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = BAD_OPTION; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == EOF) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case BAD_OPTION: + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/getopt/win32/getopt.h b/getopt/win32/getopt.h new file mode 100644 index 0000000..0abce6e --- /dev/null +++ b/getopt/win32/getopt.h @@ -0,0 +1,127 @@ +/* Declarations for getopt. + Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +#ifndef _GETOPT_H +#define _GETOPT_H 1 + +#ifdef __cplusplus +extern "C" { +#endif + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +extern char *optarg; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +extern int optind; + +/* Callers store zero here to inhibit the error message `getopt' prints + for unrecognized options. */ + +extern int opterr; + +/* Set to an option character which was unrecognized. */ + +extern int optopt; + +/* Describe the long-named options requested by the application. + The LONG_OPTIONS argument to getopt_long or getopt_long_only is a vector + of `struct option' terminated by an element containing a name which is + zero. + + The field `has_arg' is: + no_argument (or 0) if the option does not take an argument, + required_argument (or 1) if the option requires an argument, + optional_argument (or 2) if the option takes an optional argument. + + If the field `flag' is not NULL, it points to a variable that is set + to the value given in the field `val' when the option is found, but + left unchanged if the option is not found. + + To have a long-named option do something other than set an `int' to + a compiled-in constant, such as set a value from `optarg', set the + option's `flag' field to zero and its `val' field to a nonzero + value (the equivalent single-letter option character, if there is + one). For long options that have a zero `flag' field, `getopt' + returns the contents of the `val' field. */ + +struct option +{ +#if __STDC__ + const char *name; +#else + char *name; +#endif + /* has_arg can't be an enum because some compilers complain about + type mismatches in all the code that assumes it is an int. */ + int has_arg; + int *flag; + int val; +}; + +/* Names for the values of the `has_arg' field of `struct option'. */ + +#define no_argument 0 +#define required_argument 1 +#define optional_argument 2 + +#if __STDC__ || defined(PROTO) +#if defined(__GNU_LIBRARY__) +/* Many other libraries have conflicting prototypes for getopt, with + differences in the consts, in stdlib.h. To avoid compilation + errors, only prototype getopt for the GNU C library. */ +extern int getopt (int argc, char *const *argv, const char *shortopts); +#endif /* not __GNU_LIBRARY__ */ +extern int getopt_long (int argc, char *const *argv, const char *shortopts, + const struct option *longopts, int *longind); +extern int getopt_long_only (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind); + +/* Internal only. Users should not call this directly. */ +extern int _getopt_internal (int argc, char *const *argv, + const char *shortopts, + const struct option *longopts, int *longind, + int long_only); +#else /* not __STDC__ */ +extern int getopt (); +extern int getopt_long (); +extern int getopt_long_only (); + +extern int _getopt_internal (); +#endif /* not __STDC__ */ + +#ifdef __cplusplus +} +#endif + +#endif /* _GETOPT_H */ diff --git a/gnokii.spec b/gnokii.spec new file mode 100644 index 0000000..e05f1d1 --- /dev/null +++ b/gnokii.spec @@ -0,0 +1,147 @@ +%define name gnokii +%define version 0.4.0pre3 +%define release 1 + +Summary: Linux/Unix tool suite for Nokia mobile phones +Name: %{name} +Version: %{version} +Release: %{release} +Copyright: GPL +Packager: Pavel Janik ml. , Jan Derfinak +Group: Applications/Communications +Source: ftp://ftp.gnokii.org/pub/gnokii/%{name}-%{version}.tar.gz +BuildRoot: /var/tmp/%{name}-%{version}-root + +%description +Gnokii is a Linux/Unix tool suite and (eventually) modem/fax driver for +Nokia's mobile phones, released under the GPL. + +%package xgnokii +Summary: Graphical Linux/Unix tool suite for Nokia mobile phones. +Group: X11/Applications +%description xgnokii +Xgnokii is graphical Linux/Unix tool suite for Nokia's mobile phones. It +allows you to edit your contacts book, send/read SMS's from/in +computer and more other features. + +%prep + +%setup -q + +%build +./configure --prefix=/usr --with-x --enable-nls #--enable-debug --enable-rlpdebug +make + +%install +rm -rf ${RPM_BUILD_ROOT} + +make prefix=${RPM_BUILD_ROOT}/usr install + +mkdir -p ${RPM_BUILD_ROOT}/etc/ + +sed 's#/usr/local/sbin/#/usr/sbin/#' ${RPM_BUILD_ROOT}/etc/gnokiirc + +%pre +/usr/sbin/groupadd -r -f gnokii >/dev/null 2>&1 + +%postun +/usr/sbin/groupdel gnokii >/dev/null 2>&1 + +%clean +rm -rf ${RPM_BUILD_ROOT} + +%files +%defattr(-,root,root) +%doc Docs/CREDITS Docs/DataCalls-QuickStart Docs/FAQ Docs/README +%doc Docs/README-3810 Docs/README-6110 Docs/README-2110 Docs/README-WIN32 +%doc Docs/gettext-howto Docs/gnokii.nol Docs/gnokii-ir-howto Docs/packaging-howto +%doc Docs/README-dancall Docs/logos.txt Docs/gnokii.xpm Docs/Bugs +%doc Docs/sample/gnokiirc Docs/sample/options Docs/sample/pap-secrets +%doc Docs/sample/ppp-gnokii Docs/sample/ppp-on +%doc Docs/protocol/nk2110.txt Docs/protocol/nk3110.txt Docs/protocol/nk6110.txt Docs/protocol/nk6160.txt +%doc Docs/protocol/nk6185.txt Docs/protocol/nk640.txt Docs/protocol/nk7110.txt Docs/protocol/nokia.txt +%attr(0750, root, gnokii) /usr/bin/gnokii +%attr(0750, root, gnokii) /usr/sbin/gnokiid +%attr(4750, root, gnokii) /usr/sbin/mgnokiidev +%config /etc/gnokiirc + +%files xgnokii +%defattr(-,root,root) +/usr/X11R6/bin/xgnokii +/usr/bin/todologo +/usr/share/xgnokii + +%changelog + +* Fri Sep 28 2001 Pawel Kot +- last minute fixes. + +* Thu Sep 27 2001 Pawel Kot +- updates to 0.3.3 version - new docs, new ftp server + +* Sun Sep 2 2001 Pawel Kot +- removes xlogos + +* Thu Jan 11 2001 Pawel Kot +- misc updates + +* Fri Oct 27 2000 Pavel Janik ml. +- todologo added to the package + +* Mon May 15 2000 Pavel Janik ml. +- proper access rights for gnokiid, gnokii and mgnokiidev + +* Sat May 13 2000 Pavel Janik ml. +- new doc files added + +* Tue Mar 21 2000 Pavel Janik ml. +- permission on /usr/sbin fixed +- correct /etc/gnokiirc file + +* Mon Mar 20 2000 Pavel Janik ml. +- mkdir of directories in install removed +- xgnokii package should contain lib/xgnokii directory + +* Mon Mar 20 2000 Jan Derfinak +- split package into gnokii and xgnokii +- added configure +- correct xgnokii installation +- installation with make install +- fixing paths + +* Thu Aug 5 1999 Pavel Janik ml. +- documentation files changed + +* Thu Aug 5 1999 Pavel Janik ml. +- xkeyb and xlogos added to RPM package + +* Sat Jul 24 1999 Pavel Janik ml. +- stripping of binaries + +* Thu Jul 22 1999 Pavel Janik ml. +- gnokii.nol added - nice example for logo uploading + +* Sun Jul 18 1999 Pavel Janik ml. +- mgnokiidev added to RPM package +- config file in /etc (it is not used now...) + +* Sat Jul 10 1999 Pavel Janik ml. +- use of ~/.gnokiirc so not magic model stuff +- new doc files + +* Mon Jun 28 1999 Pavel Janik ml. +- Nokia auth. protocol is there now +- xgnokii and gnokiid added to RPM + +* Sun May 9 1999 Pavel Janik ml. +- included 6110-patch updated to my prepatches + +* Thu May 6 1999 Pavel Janik ml. +- TODO-6110 file added to documentation files + +* Sun Mar 28 1999 Pavel Janik ml. +- upgraded to gnokii-0.2.4 +- 6110 version of gnokii added + +* Fri Mar 5 1999 Pavel Janik ml. +- the first SPEC file for gnokii diff --git a/gnokii/gnokii.h b/gnokii/gnokii.h new file mode 100644 index 0000000..f4feaa1 --- /dev/null +++ b/gnokii/gnokii.h @@ -0,0 +1,280 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for test utility. + +*/ + +/* Prototypes */ + +int monitormode(int argc, char *argv[]); + +#ifdef SECURITY + int entersecuritycode(char *type); + int getsecuritycodestatus(void); + int getsecuritycode(char *type); +#endif + +#ifdef DEBUG + int sniff(int nargc, char *nargv[]); + int decodefile(int nargc, char *nargv[]); + int getbinringfromfile(int nargc, char *nargv[]); +#endif + +int getmemory(int argc, char *argv[]); +int writephonebook(int argc, char *argv[]); +int getspeeddial(char *number); +int setspeeddial(char *argv[]); +int getsms(int argc, char *argv[]); +int renamesmsc(int argc, char *argv[]); +int deletesms(int argc, char *argv[]); +int sendsms(int argc, char *argv[]); +int savesms(int argc, char *argv[]); +int sendlogo(int argc, char *argv[]); +int savelogo(int argc, char *argv[]); +int sendringtone(int argc, char *argv[]); +int saveringtone(int argc, char *argv[]); +int getsmsc(char *mcn); +int setdatetime(int argc, char *argv[]); +int getdatetime(void); +int setalarm(char *argv[]); +int getalarm(void); +int dialvoice(char *number); +int cancelcall(void); +int getcalendarnote(int argc, char *argv[]); +int writecalendarnote(char *argv[]); +int deletecalendarnote(char *index); +int getdisplaystatus(); +int netmonitor(char *_mode); +int identify(void); +int senddtmf(char *String); +int foogle(char *argv[]); +int pmon(void); +int setlogo(int argc, char *argv[]); +int getlogo(int argc, char *argv[]); +int binringtoneconvert(int argc, char *argv[]); +int setringtone(int argc, char *argv[]); +int getringtone(int argc, char *argv[]); +int reset(int argc, char *argv[]); +int getprofile(int argc, char *argv[]); +int setprofile(int argc, char *argv[]); +int allringtones(); +int displayoutput(); +int presskeysequence(char *argv[]); +int restoresettings(char *argv[]); +int backupsettings(char *argv[]); +int playringtone(int argc, char *argv[]); +int ringtoneconvert(int argc, char *argv[]); +int bitmapconvert(int argc, char *argv[]); +int composer(int argc, char *argv[]); +int getphoneprofile(); +int setphoneprofile(int argc, char *argv[]); +int getoperatorname(); +int setoperatorname(int argc, char *argv[]); +int getvoicemailbox(); +int phonetests(); +int simlockinfo(); +int geteeprom (); +int setsimlock (); +int getsmsfolders (); +int resetphonesettings (); +int sendprofile(int argc, char *argv[]); +int showbitmap(int argc, char *argv[]); +int nm_collect(int argc, char *argv[]); +int netmonitordata(int argc, char *argv[]); +int getwapbookmark(int argc, char *argv[]); +int setwapbookmark(int argc, char *argv[]); +int savewapbookmark(int argc, char *argv[]); +int sendwapbookmark(int argc, char *argv[]); +int getwapsettings(int argc, char *argv[]); +int savewapsettings(int argc, char *argv[]); +int sendwapsettings(int argc, char *argv[]); +int savecalendarnote(int argc, char *argv[]); +int sendcalendarnote(int argc, char *argv[]); +int receivesms(int argc, char *argv[]); +int getsmsstatus(int argc, char *argv[]); +int divert(int argc, char *argv[]); +int savephonebookentry(int argc, char *argv[]); +int sendphonebookentry(int argc, char *argv[]); + +typedef enum { + OPT_HELP, + OPT_VERSION, + OPT_MONITOR, + OPT_ENTERSECURITYCODE, + OPT_GETSECURITYCODESTATUS, + OPT_GETSECURITYCODE, + OPT_SETDATETIME, + OPT_GETDATETIME, + OPT_SETALARM, + OPT_GETALARM, + OPT_DIALVOICE, + OPT_CANCELCALL, + OPT_GETCALENDARNOTE, + OPT_WRITECALENDARNOTE, + OPT_DELCALENDARNOTE, + OPT_GETDISPLAYSTATUS, + OPT_GETMEMORY, + OPT_WRITEPHONEBOOK, + OPT_GETSPEEDDIAL, + OPT_SETSPEEDDIAL, + OPT_GETSMS, + OPT_DELETESMS, + OPT_SENDSMS, + OPT_SAVESMS, + OPT_GETSMSC, + OPT_RENAMESMSC, + OPT_PMON, + OPT_NETMONITOR, + OPT_NM_COLLECT, + OPT_NETMONITORDATA, + OPT_IDENTIFY, + OPT_SENDDTMF, + OPT_RESET, + OPT_SETLOGO, + OPT_GETLOGO, + OPT_SENDLOGO, + OPT_SAVELOGO, + OPT_BITMAPCONVERT, + OPT_SENDRINGTONE, + OPT_SAVERINGTONE, + OPT_SETRINGTONE, + OPT_PLAYRINGTONE, + OPT_RINGTONECONVERT, + OPT_COMPOSER, + OPT_ALLRINGTONES, + OPT_GETRINGTONE, + OPT_SNIFFER, + OPT_GETPROFILE, + OPT_SETPROFILE, + OPT_DISPLAYOUTPUT, + OPT_PRESSKEYSEQUENCE, + OPT_RESTORESETTINGS, + OPT_BACKUPSETTINGS, + OPT_GETPHONEPROFILE, + OPT_SETPHONEPROFILE, + OPT_GETOPERATORNAME, + OPT_SETOPERATORNAME, + OPT_GETVOICEMAILBOX, + OPT_PHONETESTS, + OPT_FOOGLE, + OPT_SIMLOCKINFO, + OPT_SETSIMLOCK, + OPT_GETEEPROM=128, + OPT_GETSMSFOLDERS=129, + OPT_RESETPHONESETTINGS=130, + OPT_SENDPROFILE=131, + OPT_SHOWBITMAP=132, + OPT_BINRINGTONECONVERT=133, + OPT_GETWAPBOOKMARK=134, + OPT_SAVEWAPBOOKMARK=135, + OPT_SENDWAPBOOKMARK=136, + OPT_GETWAPSETTINGS=137, + OPT_SAVEWAPSETTINGS=138, + OPT_SAVECALENDARNOTE=139, + OPT_SENDCALENDARNOTE=140, + OPT_SAVEPHONEBOOKENTRY=141, + OPT_SENDPHONEBOOKENTRY=142, + OPT_DECODEFILE=143, + OPT_RECEIVESMS=144, + OPT_GETSMSSTATUS=145, + OPT_DIVERT=146, + OPT_SENDWAPSETTINGS=147, + OPT_SETWAPBOOKMARK=148, + OPT_GETBINRINGFROMFILE=149 +} opt_index; + +struct gnokii_arg_len { + int gal_opt; + int gal_min; + int gal_max; + int gal_flags; +}; + +/* This is used for checking correct argument count. If it is used then if + the user specifies some argument, their count should be equivalent to the + count the programmer expects. */ + +#define GAL_XOR 0x01 + +/* for --presskeysequence */ +struct keys_table_position { + char whatchar; + int whatcode; +}; + +/* for --presskeysequence */ +struct keys_table_position Keys[] = { +{'m',PHONEKEY_MENU}, +{'M',PHONEKEY_MENU}, +{'n',PHONEKEY_NAMES}, +{'N',PHONEKEY_NAMES}, +{'p',PHONEKEY_POWER}, +{'P',PHONEKEY_POWER}, +{'u',PHONEKEY_UP}, +{'U',PHONEKEY_UP}, +{'d',PHONEKEY_DOWN}, +{'D',PHONEKEY_DOWN}, +{'+',PHONEKEY_INCREASEVOLUME}, +{'-',PHONEKEY_DECREASEVOLUME}, +{'1',PHONEKEY_1}, +{'2',PHONEKEY_2}, +{'3',PHONEKEY_3}, +{'4',PHONEKEY_4}, +{'5',PHONEKEY_5}, +{'6',PHONEKEY_6}, +{'7',PHONEKEY_7}, +{'8',PHONEKEY_8}, +{'9',PHONEKEY_9}, +{'*',PHONEKEY_ASTERISK}, +{'0',PHONEKEY_0}, +{'#',PHONEKEY_HASH}, +{'g',PHONEKEY_GREEN}, +{'G',PHONEKEY_GREEN}, +{'r',PHONEKEY_RED}, +{'R',PHONEKEY_RED}, +{' ',0} +}; + +/* for NETMONITOR */ + +//maximal number of screens for --nm_collect +#define MAX_NM_COLLECT 20 + +/* 255 used internally by functions */ +#define NM_MAX_SCREEN 254 + +/* in 6150 v4.13 effectively used was 296 FIELDS + date + time ... */ +#define NM_MAX_FIELDS 512 + +typedef struct { + char *name; + int x; + int y; + int len; + char *mname; + int s_nr; + char type; + char value[NM_MAX_SCREEN_WIDTH]; + void *next; +} PARAM_INFO_MON; + +// info for make ouput, filled in by parse_process() +typedef struct { + int req_header; + unsigned long req_wait; + int req_n; + char req_fs[11]; + char req_ls[11]; + PARAM_INFO_MON *data[NM_MAX_FIELDS]; + char out_f[NM_MAX_FIELDS]; + unsigned char req_screen[NM_MAX_SCREEN]; +} OUT_INFO_MON; + +int semicolon_pipe_substitution( GSM_PhonebookEntry *pentry, unsigned int direction ); +int str_substch( char *str, const char toric, const char sost ); diff --git a/include/devices/device.h b/include/devices/device.h new file mode 100644 index 0000000..92460be --- /dev/null +++ b/include/devices/device.h @@ -0,0 +1,63 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file device access code. + +*/ + +#ifndef __device_h +#define __device_h + +#include "misc.h" + +/* Maximum length of device name for serial port */ +#define GSM_MAX_DEVICE_NAME_LENGTH (100) + +/* Type of connection. Now we support serial connection with FBUS cable and + IR (only with 61x0 models) and MBUS (61x0, 640, 6160) */ +typedef enum { + GCT_FBUS, /* FBUS connection. */ + GCT_Infrared, /* FBUS over direct infrared connection - 61xx. */ + GCT_Irda, /* FBUS over Irda sockets - 7110, 6210, etc. */ + GCT_MBUS, /* MBUS */ + GCT_DLR3, /* FBUS over DLR3 cable */ + GCT_Tekram, /* FBUS over direct infrared connection (Tekram device) - 61xx. */ + GCT_AT, /* AT commands */ + GCT_FBUS3110 /* FBUS version 1 used in N3110 */ +} GSM_ConnectionType; + +#ifndef WIN32 + #include + #include "misc.h" + + int device_getfd(void); + + int device_open(__const char *__file, int __with_odd_parity); + void device_reset(void); + + size_t device_read(__ptr_t __buf, size_t __nbytes); + size_t device_write(__const __ptr_t __buf, size_t __n); + + #ifdef DEBUG + void device_dumpserial(void); + #endif +#else + size_t device_write(const __ptr_t __buf, size_t __n); +#endif + + void device_close(void); + + void device_setdtrrts(int __dtr, int __rts); + void device_changespeed(int __speed); + + +extern char PortDevice[GSM_MAX_DEVICE_NAME_LENGTH]; + +bool StartConnection (char *port_device, bool with_odd_parity, GSM_ConnectionType con); + +#endif /* __device_h */ diff --git a/include/devices/linuxirda.h b/include/devices/linuxirda.h new file mode 100644 index 0000000..e86fb5b --- /dev/null +++ b/include/devices/linuxirda.h @@ -0,0 +1,211 @@ +/********************************************************************* + * + * Filename: irda.h + * Version: 1.0 + * Description: IrDA header file to be used by IrDA applications + * Status: Experimental. + * Author: Dag Brattli + * Created at: Mon Mar 8 14:06:12 1999 + * Modified at: Sat Dec 25 16:07:54 1999 + * Modified by: Dag Brattli + * + * Copyright (c) 1999 Dag Brattli, All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * Neither Dag Brattli nor University of Tromsø admit liability nor + * provide warranty for any of this software. This material is + * provided "AS-IS" and at no charge. + * + ********************************************************************/ + +/* + * $Id$ + * + */ + +#ifndef IRDA_H +#define IRDA_H + +#include +#include + +/* Hint bit positions for first hint byte */ +#define HINT_PNP 0x01 +#define HINT_PDA 0x02 +#define HINT_COMPUTER 0x04 +#define HINT_PRINTER 0x08 +#define HINT_MODEM 0x10 +#define HINT_FAX 0x20 +#define HINT_LAN 0x40 +#define HINT_EXTENSION 0x80 + +/* Hint bit positions for second hint byte (first extension byte) */ +#define HINT_TELEPHONY 0x01 +#define HINT_FILE_SERVER 0x02 +#define HINT_COMM 0x04 +#define HINT_MESSAGE 0x08 +#define HINT_HTTP 0x10 +#define HINT_OBEX 0x20 + +/* IrLMP character code values */ +#define CS_ASCII 0x00 +#define CS_ISO_8859_1 0x01 +#define CS_ISO_8859_2 0x02 +#define CS_ISO_8859_3 0x03 +#define CS_ISO_8859_4 0x04 +#define CS_ISO_8859_5 0x05 +#define CS_ISO_8859_6 0x06 +#define CS_ISO_8859_7 0x07 +#define CS_ISO_8859_8 0x08 +#define CS_ISO_8859_9 0x09 +#define CS_UNICODE 0xff + +/* These are the currently known dongles */ +typedef enum { + IRDA_TEKRAM_DONGLE = 0, + IRDA_ESI_DONGLE = 1, + IRDA_ACTISYS_DONGLE = 2, + IRDA_ACTISYS_PLUS_DONGLE = 3, + IRDA_GIRBIL_DONGLE = 4, + IRDA_LITELINK_DONGLE = 5, + IRDA_AIRPORT_DONGLE = 6, + IRDA_OLD_BELKIN_DONGLE = 7, +} IRDA_DONGLE; + +/* Protocol types to be used for SOCK_DGRAM */ +enum { + IRDAPROTO_UNITDATA = 0, + IRDAPROTO_ULTRA = 1, + IRDAPROTO_MAX +}; + +#define SOL_IRLMP 266 /* Same as SOL_IRDA for now */ +#define SOL_IRTTP 266 /* Same as SOL_IRDA for now */ + +#define IRLMP_ENUMDEVICES 1 +#define IRLMP_IAS_SET 2 +#define IRLMP_IAS_QUERY 3 +#define IRLMP_HINTS_SET 4 +#define IRLMP_QOS_SET 5 +#define IRLMP_QOS_GET 6 +#define IRLMP_MAX_SDU_SIZE 7 +#define IRLMP_IAS_GET 8 + +#define IRTTP_MAX_SDU_SIZE IRLMP_MAX_SDU_SIZE /* Compatibility */ + +/* LM-IAS Limits */ +#define IAS_MAX_STRING 256 +#define IAS_MAX_OCTET_STRING 1024 +#define IAS_MAX_CLASSNAME 64 +#define IAS_MAX_ATTRIBNAME 256 + +/* LM-IAS Attribute types */ +#define IAS_MISSING 0 +#define IAS_INTEGER 1 +#define IAS_OCT_SEQ 2 +#define IAS_STRING 3 + +#define LSAP_ANY 0xff +#define DEV_ADDR_ANY 0xffffffff + +struct sockaddr_irda { + sa_family_t sir_family; /* AF_IRDA */ + uint8_t sir_lsap_sel; /* LSAP selector */ + uint32_t sir_addr; /* Device address */ + char sir_name[25]; /* Usually :IrDA:TinyTP */ +}; + +struct irda_device_info { + uint32_t saddr; /* Address of local interface */ + uint32_t daddr; /* Address of remote device */ + char info[22]; /* Description */ + uint8_t charset; /* Charset used for description */ + uint8_t hints[2]; /* Hint bits */ +}; + +struct irda_device_list { + uint32_t len; + struct irda_device_info dev[1]; +}; + +struct irda_ias_set { + char irda_class_name[IAS_MAX_CLASSNAME]; + char irda_attrib_name[IAS_MAX_ATTRIBNAME]; + unsigned int irda_attrib_type; + union { + unsigned int irda_attrib_int; + struct { + unsigned short len; + u_char octet_seq[IAS_MAX_OCTET_STRING]; + } irda_attrib_octet_seq; + struct { + unsigned char len; + unsigned char charset; + unsigned char string[IAS_MAX_STRING]; + } irda_attrib_string; + } attribute; + uint32_t daddr; + +}; + +/* Some private IOCTL's (max 16) */ +#define SIOCSDONGLE (SIOCDEVPRIVATE + 0) +#define SIOCGDONGLE (SIOCDEVPRIVATE + 1) +#define SIOCSBANDWIDTH (SIOCDEVPRIVATE + 2) +#define SIOCSMEDIABUSY (SIOCDEVPRIVATE + 3) +#define SIOCGMEDIABUSY (SIOCDEVPRIVATE + 4) +#define SIOCGRECEIVING (SIOCDEVPRIVATE + 5) +#define SIOCSMODE (SIOCDEVPRIVATE + 6) +#define SIOCGMODE (SIOCDEVPRIVATE + 7) +#define SIOCSDTRRTS (SIOCDEVPRIVATE + 8) +#define SIOCGQOS (SIOCDEVPRIVATE + 9) + +/* No reason to include just because of this one ;-) */ +#define IRNAMSIZ 16 + +/* IrDA quality of service information (must not exceed 16 bytes) */ +struct if_irda_qos { + uint32_t baudrate; + uint16_t data_size; + uint16_t window_size; + uint16_t min_turn_time; + uint16_t max_turn_time; + uint8_t add_bofs; + uint8_t link_disc; +}; + +/* For setting RTS and DTR lines of a dongle */ +struct if_irda_line { + unsigned char dtr; + unsigned char rts; +}; + +/* IrDA interface configuration (data part must not exceed 16 bytes) */ +struct if_irda_req { + union { + char ifrn_name[IRNAMSIZ]; /* if name, e.g. "irda0" */ + } ifr_ifrn; + + /* Data part */ + union { + struct if_irda_line ifru_line; + struct if_irda_qos ifru_qos; + unsigned short ifru_flags; + unsigned int ifru_receiving; + unsigned int ifru_mode; + unsigned int ifru_dongle; + } ifr_ifru; +}; + +#define ifr_baudrate ifr_ifru.ifru_qos.baudrate +#define ifr_receiving ifr_ifru.ifru_receiving +#define ifr_dongle ifr_ifru.ifru_dongle +#define ifr_mode ifr_ifru.ifru_mode +#define ifr_dtr ifr_ifru.ifru_line.dtr +#define ifr_rts ifr_ifru.ifru_line.rts + +#endif /* IRDA_H */ diff --git a/include/devices/tcp.h b/include/devices/tcp.h deleted file mode 100644 index 0786ae4..0000000 --- a/include/devices/tcp.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - - $Id$ - - G N O K I I - - A Linux/Unix toolset and driver for Nokia mobile phones. - - Copyright (C) 2002 Jan Kratochvil - - Released under the terms of the GNU GPL, see file COPYING for more details. - -*/ - -#ifndef __devices_tcp_h -#define __devices_tcp_h - -#ifdef WIN32 - #include - /* FIXME: this should be solved in config.h in 0.4.0 */ - #define __const const - typedef void * __ptr_t; -#else - #include -#endif /* WIN32 */ - -#include "misc.h" - -int tcp_open(__const char *__file); -int tcp_close(int __fd); - -int tcp_opendevice(__const char *__file, int __with_async); - -size_t tcp_read(int __fd, __ptr_t __buf, size_t __nbytes); -size_t tcp_write(int __fd, __const __ptr_t __buf, size_t __n); - -int tcp_select(int fd, struct timeval *timeout); - -#endif /* __devices_tcp_h */ diff --git a/include/devices/winserial.h b/include/devices/winserial.h new file mode 100644 index 0000000..675aa73 --- /dev/null +++ b/include/devices/winserial.h @@ -0,0 +1,7 @@ +typedef void (*sigcallback)(char); +typedef void (*keepalive)(); + +int OpenConnection(char *szPort, sigcallback fn, keepalive ka); +int CloseConnection(); +int WriteCommBlock(LPSTR lpByte, DWORD dwBytesToWrite); + diff --git a/include/files/cfgreader.h b/include/files/cfgreader.h new file mode 100644 index 0000000..15513d7 --- /dev/null +++ b/include/files/cfgreader.h @@ -0,0 +1,52 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for config file reader. + +*/ + +#ifndef _CFGREADER_H +#define _CFGREADER_H + +#ifndef WIN32 + #include "config.h" +#endif + +/* Structure definitions */ + +/* A linked list of key/value pairs */ + +struct CFG_Entry { + struct CFG_Entry *next, *prev; + char *key; + char *value; +}; + +struct CFG_Header { + struct CFG_Header *next, *prev; + struct CFG_Entry *entries; + char *section; +}; + +/* Function prototypes */ + +struct CFG_Header *CFG_ReadFile(char *filename); +char *CFG_Get(struct CFG_Header *cfg, char *section, char *key); +char *CFG_Set(struct CFG_Header *cfg, char *section, char *key, + char *value); +int CFG_WriteFile(struct CFG_Header *cfg, char *filename); + +int CFG_ReadConfig(char **model, char **port, char **initlength, + char **connection, char **bindir, char **synchronizetime, + bool isgnokiid); + +struct CFG_Header *CFG_FindGnokiirc(); + +#endif /* _CFGREADER_H */ diff --git a/include/files/gsm-filetypes.h b/include/files/gsm-filetypes.h new file mode 100644 index 0000000..3e998dc --- /dev/null +++ b/include/files/gsm-filetypes.h @@ -0,0 +1,102 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Functions to read and write common file types. + +*/ + +#include "gsm-api.h" +#include "gsm-calendar.h" +#include "gsm-ringtones.h" +#include "gsm-bitmaps.h" + +/* ---------- Calendar file --------- */ + +GSM_Error GSM_ReadVCalendarFile(char *FileName, GSM_CalendarNote *cnote, + int *number); + +int GetvCalTime(GSM_DateTime *dt, char *time); +int FillCalendarNote(GSM_CalendarNote *note, char *type, + char *text, char *time, char *alarm); + +/* ----------- Text files ----------- */ + +int GSM_SaveTextFile(char *FileName, char *text, int mode); + +/* ----------- Ringtones functions and constans ----------- */ + +int GetScale (char *num); +int GetDuration (char *num); + +/* Defines the character that separates fields in rtttl files. */ +#define RTTTL_SEP ":" + +/* ----------- Ringtones files ----------- */ + +GSM_Error GSM_ReadBinRingtoneFile(char *FileName, GSM_BinRingtone *ringtone); +GSM_Error GSM_SaveBinRingtoneFile(char *FileName, GSM_BinRingtone *ringtone); + +GSM_Error GSM_ReadRingtoneFile(char *FileName, GSM_Ringtone *ringtone); +GSM_Error GSM_SaveRingtoneFile(char *FileName, GSM_Ringtone *ringtone); + +void saverttl(FILE *file, GSM_Ringtone *ringtone); +void saveott(FILE *file, GSM_Ringtone *ringtone); +void savemid(FILE* file, GSM_Ringtone *ringtone); + +GSM_Error loadrttl(FILE *file, GSM_Ringtone *ringtone); +GSM_Error loadott(FILE *file, GSM_Ringtone *ringtone); +GSM_Error loadcommunicator(FILE *file, GSM_Ringtone *ringtone); + +/* ----------- Bitmap files ----------- */ + +GSM_Error GSM_ReadBitmapFile(char *FileName, GSM_Bitmap *bitmap); +GSM_Error GSM_SaveBitmapFile(char *FileName, GSM_Bitmap *bitmap); + +void savenol(FILE *file, GSM_Bitmap *bitmap); +void savengg(FILE *file, GSM_Bitmap *bitmap); +void savensl(FILE *file, GSM_Bitmap *bitmap); +void savenlm(FILE *file, GSM_Bitmap *bitmap); +void saveota(FILE *file, GSM_Bitmap *bitmap); +void savebmp(FILE *file, GSM_Bitmap *bitmap); +void savexpm(FILE *file, GSM_Bitmap *bitmap); + +GSM_Error loadngg(FILE *file, GSM_Bitmap *bitmap); +GSM_Error loadnol(FILE *file, GSM_Bitmap *bitmap); +GSM_Error loadnsl(FILE *file, GSM_Bitmap *bitmap); +GSM_Error loadnlm(FILE *file, GSM_Bitmap *bitmap); +GSM_Error loadota(FILE *file, GSM_Bitmap *bitmap); +GSM_Error loadbmp(FILE *file, GSM_Bitmap *bitmap); + +#ifdef XPM + GSM_Error loadxpm(char *filename, GSM_Bitmap *bitmap); +#endif + +/* ----------- Backup files ----------- */ + +GSM_Error GSM_ReadBackupFile(char *FileName, GSM_Backup *backup); +GSM_Error GSM_SaveBackupFile(char *FileName, GSM_Backup *backup); + +void savelmb(FILE *file, GSM_Backup *backup); + +GSM_Error loadlmb(FILE *file, GSM_Backup *backup); + +typedef enum { + None=0, + NOL, + NGG, + NSL, + NLM, + BMP, + OTA, + XPMF, + RTTL, + OTT, + MIDI, + COMMUNICATOR, + LMB +} GSM_Filetypes; diff --git a/include/files/midifile.h b/include/files/midifile.h new file mode 100644 index 0000000..009896f --- /dev/null +++ b/include/files/midifile.h @@ -0,0 +1 @@ +GSM_Error loadmid(char *filename, GSM_Ringtone *ringtone); diff --git a/include/gsm-calendar.h b/include/gsm-calendar.h new file mode 100644 index 0000000..310088a --- /dev/null +++ b/include/gsm-calendar.h @@ -0,0 +1,61 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + +*/ + +#ifndef __gsm_calendar_h +#define __gsm_calendar_h + +#include "gsm-datetime.h" +#include "gsm-sms.h" + +/* Define enums for Calendar Note types */ +typedef enum { + GCN_REMINDER=1, /* Reminder */ + GCN_CALL, /* Call */ + GCN_MEETING, /* Meeting */ + GCN_BIRTHDAY /* Birthday */ +} GSM_CalendarNoteType; + +#define MAX_CALENDAR_TEXT_LENGTH 0x3a /* In 6210 max. 48 chars. 10 more precaution bytes*/ +#define MAX_CALENDAR_PHONE_LENGTH 0x24 + +/* Calendar note type */ + +typedef struct { + int Location; /* The number of the note in the phone memory */ + GSM_CalendarNoteType Type; /* The type of the note */ + GSM_DateTime Time; /* The time of the note */ + GSM_DateTime Alarm; /* The alarm of the note */ + char Text[MAX_CALENDAR_TEXT_LENGTH+1]; /* The text of the note */ + char Phone[MAX_CALENDAR_PHONE_LENGTH+1]; /* For Call only: the phone number */ + + /* the following are only used for N7110/N6210 */ + int Recurrance; /* after how many hours note repeats. 0x0000 = No Repeat */ + int YearOfBirth; /* Only in GCN_BIRTHDAY for 62/71 - The Year of birth of recurrance */ + u8 AlarmType; /* Only in GCN_BIRTHDAY for 62/71 - 0x00 = Tone, 0x01 = Silent */ + + bool ReadNotesInfo; /* Important in 6210/7110 - if we should read notes info or not */ +} GSM_CalendarNote; + +/* NotesInfo type : Nowadays only N6210/7110 */ +#define MAX_NOTES_INFO_ELEMS 1024 + +typedef struct { + u16 HowMany; /* How many notes info used */ + u16 Location[MAX_NOTES_INFO_ELEMS]; /* In N6210/7110 adresses for notes */ +} GSM_NotesInfo; + +char *GSM_GetVCALENDARStart(int version); +char *GSM_GetVCALENDARNote(GSM_CalendarNote *note, int version); +char *GSM_GetVCALENDAREnd(int version); + +int GSM_SaveCalendarNoteToSMS(GSM_MultiSMSMessage *SMS, + GSM_CalendarNote *note); + +#endif /* __gsm_calendar_h */ diff --git a/include/gsm-coding.h b/include/gsm-coding.h new file mode 100644 index 0000000..3414f1f --- /dev/null +++ b/include/gsm-coding.h @@ -0,0 +1,36 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + +*/ + +#ifndef __gsm_coding_h +#define __gsm_coding_h + +extern void EncodeDefault (unsigned char* dest, const unsigned char* src, int len); +extern void DecodeDefault (unsigned char* dest, const unsigned char* src, int len); +extern void EncodeUnicode (unsigned char* dest, const unsigned char* src, int len); +extern void DecodeUnicode (unsigned char* dest, const unsigned char* src, int len); +extern void EncodeUTF8 (unsigned char* dest, const unsigned char* src, int len); +extern void DecodeUTF8 (unsigned char* dest, const unsigned char* src, int len); +extern void DecodeHexBin (unsigned char* dest, const unsigned char* src, int len); +extern void EncodeHexBin (unsigned char* dest, const unsigned char* src, int len); +extern void DecodeBCD (unsigned char* dest, const unsigned char* src, int len); +extern void EncodeBCD (unsigned char* dest, const unsigned char* src, int len, bool fill); + +extern unsigned char EncodeWithDefaultAlphabet(unsigned char); +extern unsigned char DecodeWithDefaultAlphabet(unsigned char); +extern wchar_t EncodeWithUnicodeAlphabet(unsigned char); +extern unsigned char DecodeWithUnicodeAlphabet(wchar_t); +extern void DecodeWithUTF8Alphabet (u8 mychar3, u8 mychar4, u8 *ret); +extern bool EncodeWithUTF8Alphabet (u8 mychar, u8 *ret1, u8 *ret2); +extern int DecodeWithHexBinAlphabet (unsigned char mychar); +extern unsigned char EncodeWithHexBinAlphabet (int digit); +extern unsigned char EncodeWithBCDAlphabet (int value); +extern int DecodeWithBCDAlphabet (unsigned char value); + +#endif diff --git a/include/gsm-datetime.h b/include/gsm-datetime.h new file mode 100644 index 0000000..9dc8b9f --- /dev/null +++ b/include/gsm-datetime.h @@ -0,0 +1,42 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + +*/ + +#ifndef __gsm_datetime_h +#define __gsm_datetime_h + +/* Define enum used to describe what sort of date/time support is + available. */ +typedef enum { + GDT_None, /* The mobile phone doesn't support time and date. */ + GDT_TimeOnly, /* The mobile phone supports only time. */ + GDT_DateOnly, /* The mobile phone supports only date. */ + GDT_DateTime /* Wonderful phone - it supports date and time. */ +} GSM_DateTimeSupport; + +/* Structure used for passing dates/times to date/time functions such as + GSM_GetTime and GSM_GetAlarm etc. */ +typedef struct { + bool IsSet; /* for time=is set and available ? for alarm=is set ? */ + int Year; /* The complete year specification - e.g. 1999. Y2K :-) */ + int Month; /* January = 1 */ + int Day; + int Hour; + int Minute; + int Second; + int Timezone; /* The difference between local time and GMT */ +} GSM_DateTime; + +char *DayOfWeek (int year, int month, int day); +void GetMachineDateTime( char nowdate[], char nowtime[] ); + +void EncodeDateTime(unsigned char* buffer, GSM_DateTime *datetime); +void DecodeDateTime(unsigned char* buffer, GSM_DateTime *datetime); + +#endif diff --git a/include/gsm-phonebook.h b/include/gsm-phonebook.h new file mode 100644 index 0000000..86b2dfa --- /dev/null +++ b/include/gsm-phonebook.h @@ -0,0 +1,103 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + +*/ + +#ifndef __gsm_phonebook_h +#define __gsm_phonebook_h + +#include "gsm-sms.h" + +/* Limits for sizing of array in GSM_PhonebookEntry. Individual handsets may + not support these lengths so they have their own limits set. */ + +#define GSM_MAX_PHONEBOOK_NAME_LENGTH (50) /* For 7110 */ +#define GSM_MAX_PHONEBOOK_NUMBER_LENGTH (48) /* For 7110 */ +#define GSM_MAX_PHONEBOOK_TEXT_LENGTH (60) /* For 7110 */ +#define GSM_MAX_PHONEBOOK_SUB_ENTRIES (8) /* For 7110 */ +#define GSM_MAX_PHONEBOOK_LOGO_LENGTH (126) /* For 7110 */ + /* 7110 is able to in one + * entry 5 numbers and 2 + * texts [email,notice,postal] */ + +/* Here is a macro for models that do not support caller groups. */ + +#define GSM_GROUPS_NOT_SUPPORTED -1 + +/* This data type is used to report the number of used and free positions in + memory (sim or internal). */ + +typedef struct { + GSM_MemoryType MemoryType; /* Type of the memory */ + int Used; /* Number of used positions */ + int Free; /* Number of free positions */ +} GSM_MemoryStatus; + +/* Some phones (in this moment 6210/7110) supports extended phonebook + with additional datas. Here we have structure for them */ +typedef enum +{ + GSM_General = 0x0a, + GSM_Mobile = 0x03, + GSM_Work = 0x06, + GSM_Fax = 0x04, + GSM_Home = 0x02, + GSM_SIM = 0x00 +} GSM_Number_Type; + +typedef enum +{ + GSM_Number = 0x0b, + GSM_Note = 0x0a, + GSM_Postal = 0x09, + GSM_Email = 0x08, + GSM_Name = 0x07, + GSM_RingtoneNo = 0x0C, + GSM_Date = 0x13, /* Date is used for DC,RC,etc (last calls) */ + GSM_LogoOn = 0x1C, + GSM_GroupLogo = 0x1B, + GSM_GroupNo = 0x1E +} GSM_EntryType; + +typedef struct { + char Number[GSM_MAX_PHONEBOOK_TEXT_LENGTH+1]; /* Number */ + GSM_DateTime Date; /* or the last calls list */ +} GSM_SubPhonebookEntrydata; + +typedef struct { + GSM_EntryType EntryType; + GSM_Number_Type NumberType; + GSM_SubPhonebookEntrydata data; + int BlockNumber; +} GSM_SubPhonebookEntry; + +/* Define datatype for phonebook entry, used for getting/writing phonebook + entries. */ + +typedef struct { + bool Empty; /* Is this entry empty? */ + char Name[GSM_MAX_PHONEBOOK_NAME_LENGTH + 1]; /* Plus 1 for + nullterminator. */ + char Number[GSM_MAX_PHONEBOOK_NUMBER_LENGTH + 1]; /* Number */ + GSM_MemoryType MemoryType; /* Type of memory */ + int Group; /* Group */ + int Location; /* Location */ + GSM_SubPhonebookEntry SubEntries[GSM_MAX_PHONEBOOK_SUB_ENTRIES]; + /* For phones with + * additional phonebook + * entries */ + int SubEntriesCount; /* Should be 0, if extended + phonebook is not used */ +} GSM_PhonebookEntry; + +char *GSM_GetVCARD(GSM_PhonebookEntry *entry, int version); + +int GSM_SavePhonebookEntryToSMS(GSM_MultiSMSMessage *SMS, + GSM_PhonebookEntry *entry, int version); + +#endif /* __gsm_phonebook_h */ diff --git a/include/gsm-wap.h b/include/gsm-wap.h new file mode 100644 index 0000000..b47a13b --- /dev/null +++ b/include/gsm-wap.h @@ -0,0 +1,64 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Functions for manipulating WAP Settings and bookmarks + +*/ + +#ifndef __gsm_wap_h +#define __gsm_wap_h + +#include "gsm-sms.h" + +typedef struct { + char address[255+1]; + char title[50+1]; + u16 location; +} GSM_WAPBookmark; + +typedef struct { + u8 location; + char homepage[100+1]; + char title[20+1]; + int bearer; + bool issecurity; + bool iscontinuous; + + /* for data bearer */ + char ipaddress[20+1]; + char dialup[20+1]; + char user[50+1]; //is length OK ? + char password[50+1]; //is length OK ? + bool isspeed14400; + bool isISDNcall; + bool isnormalauthentication; + + /* for sms bearer */ + char server[21+1]; + + /* for sms or ussd bearer */ + char service[20+1]; + bool isIP; + + /* for ussd bearer */ + char code[10+1]; +} GSM_WAPSettings; + +#define WAPSETTINGS_BEARER_SMS 0x00 +#define WAPSETTINGS_BEARER_DATA 0x01 +#define WAPSETTINGS_BEARER_USSD 0x02 + +int GSM_SaveWAPBookmarkToSMS(GSM_MultiSMSMessage *SMS, + GSM_WAPBookmark *bookmark); + +GSM_Error GSM_ReadWAPBookmark(GSM_SMSMessage *message, GSM_WAPBookmark *bookmark); + +int GSM_SaveWAPSettingsToSMS(GSM_MultiSMSMessage *SMS, + GSM_WAPSettings *settings); + +#endif diff --git a/include/links/fbus-3110.h b/include/links/fbus-3110.h new file mode 100644 index 0000000..a0dcdcc --- /dev/null +++ b/include/links/fbus-3110.h @@ -0,0 +1,95 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Copyright (C) 2000 Hugh Blemings & Pavel Janík ml. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides an API for accessing functions via fbus. + See README for more details on supported mobile phones. + + The various routines are called FB3110_(whatever). + + $Log$ + Revision 1.1.1.1 2001/11/25 21:59:22 short + :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 + + Revision 1.1 2001/11/09 12:55:07 pkot + Forgot about fbus support for 3110. FIXME: is it really needed? + + +*/ + +#ifndef __links_fbus_3110_h +#define __links_fbus_3110_h + +#include +#include "gsm-statemachine.h" + +#ifdef WIN32 +#include +#include +#endif + +#define FB3110_MAX_FRAME_LENGTH 256 +#define FB3110_MAX_MESSAGE_TYPES 128 +#define FB3110_MAX_TRANSMIT_LENGTH 256 +#define FB3110_MAX_CONTENT_LENGTH 120 + +/* This byte is at the beginning of all GSM Frames sent over FBUS to Nokia + phones. This may have to become a phone dependant parameter... */ +#define FB3110_FRAME_ID 0x01 + + +/* States for receive code. */ + +enum FB3110_RX_States { + FB3110_RX_Sync, + FB3110_RX_Discarding, + FB3110_RX_GetLength, + FB3110_RX_GetMessage +}; + + +typedef struct{ + int Checksum; + int BufferCount; + enum FB3110_RX_States State; + int FrameType; + int FrameLength; + char Buffer[FB3110_MAX_FRAME_LENGTH]; +} FB3110_IncomingFrame; + +typedef struct { + u16 message_length; + u8 message_type; + u8 *buffer; +} FB3110_OutgoingMessage; + + +typedef struct{ + FB3110_IncomingFrame i; + u8 RequestSequenceNumber; +} FB3110_Link; + +GSM_Error FB3110_Initialise(GSM_Link *newlink, GSM_Statemachine *state); + + + +#ifdef __links_fbus_3110_c /* Prototype functions for fbus-generic.c only */ + +bool FB3110_OpenSerial(void); +void FB3110_RX_StateMachine(unsigned char rx_byte); +GSM_Error FB3110_TX_SendFrame(u8 message_length, u8 message_type, u8 sequence_byte, u8 *buffer); +GSM_Error FB3110_SendMessage(u16 messagesize, u8 messagetype, void *message); +void FB3110_TX_SendAck(u8 *message, int length); +void FB3110_UpdateSequenceNumber(void); + +#endif /* #ifdef __links_fbus_3110_c */ + +#endif /* #ifndef __links_fbus_3110_h */ diff --git a/include/misc_win32.h b/include/misc_win32.h new file mode 100644 index 0000000..8da3c6f --- /dev/null +++ b/include/misc_win32.h @@ -0,0 +1,21 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for miscellaneous defines, typedefs etc. + +*/ + +#ifndef __misc_win32_h +#define __misc_win32_h + +#include + +#define sleep(x) Sleep((x) * 1000) +#define usleep(x) Sleep(((x) < 1000) ? 1 : ((x) / 1000)) + +#endif \ No newline at end of file diff --git a/include/newmodules/n3110.h b/include/newmodules/n3110.h new file mode 100644 index 0000000..0debe2e --- /dev/null +++ b/include/newmodules/n3110.h @@ -0,0 +1,32 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. + +*/ + +#ifndef __n_3110_h +#define __n_3110_h + +#include "gsm-api.h" + +/* Global variables */ +extern bool N3110_LinkOK; +extern GSM_Functions N3110_Functions; +extern GSM_Information N3110_Information; + +/* Prototypes for the functions designed to be used externally. */ +GSM_Error N3110_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +void N3110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, + u8 MessageType); + +#endif /* __n_3110_h */ diff --git a/include/newmodules/n6110.h b/include/newmodules/n6110.h new file mode 100644 index 0000000..ab2c8cb --- /dev/null +++ b/include/newmodules/n6110.h @@ -0,0 +1,218 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. See fbus-6110.c for more details. + +*/ + +#ifndef __n_6110_h +#define __n_6110_h + +#include "gsm-api.h" + +/* Nokia 6110 supports phonebook entries of max. 16 characters and numbers of + max. 30 digits */ +#define N6110_MAX_PHONEBOOK_NAME_LENGTH (16) +#define N6110_MAX_PHONEBOOK_NUMBER_LENGTH (30) + +/* Alternate defines for memory types. Two letter codes follow GSM 07.07 + release 6.2.0, AT+CPBS "Select Phonebook Memory Storage" */ +#define N6110_MEMORY_MT 0x01 /* combined ME and SIM phonebook */ +#define N6110_MEMORY_ME 0x02 /* ME (Mobile Equipment) phonebook */ +#define N6110_MEMORY_SM 0x03 /* SIM phonebook */ +#define N6110_MEMORY_FD 0x04 /* SIM fixdialling-phonebook */ +#define N6110_MEMORY_ON 0x05 /* SIM (or ME) own numbers list */ +#define N6110_MEMORY_EN 0x06 /* SIM (or ME) emergency number */ +#define N6110_MEMORY_DC 0x07 /* ME dialled calls list */ +#define N6110_MEMORY_RC 0x08 /* ME received calls list */ +#define N6110_MEMORY_MC 0x09 /* ME missed (unanswered received) calls list */ +#define N6110_MEMORY_VOICE 0x0b /* Voice Mailbox */ +#define N6110_MEMORY_XX 0xff /* This is used when the memory type is unknown. */ + +/* This byte is used to synchronize FBUS channel over cable or IR. */ +#define N6110_SYNC_BYTE 0x55 + +/* This byte is send after all N6110_SYNC_BYTE bytes when init infrared. */ +#define N6110_IR_END_SYNC_BYTE 0xc1 + +/* Every (well, almost every) frame from the computer starts with this + sequence. */ +#define N6110_FRAME_HEADER 0x00, 0x01, 0x00 + +/* Global variables */ +extern bool N6110_LinkOK; +extern GSM_Functions N6110_Functions; +extern GSM_Information N6110_Information; + +/* Prototypes for the functions designed to be used externally. */ +GSM_Error N6110_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +void N6110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, + u8 MessageType); + +GSM_Error N6110_SendStatusRequest(void); + +int N6110_GetMemoryType(GSM_MemoryType memory_type); + +GSM_Error N6110_GetVoiceMailbox ( GSM_PhonebookEntry *entry); + +GSM_Error N6110_GetOperatorName ( GSM_Network *operator); +GSM_Error N6110_SetOperatorName ( GSM_Network *operator); + +GSM_Error N6110_GetMemoryLocation(GSM_PhonebookEntry *entry); +GSM_Error N6110_WritePhonebookLocation(GSM_PhonebookEntry *entry); + +GSM_Error N6110_GetSpeedDial(GSM_SpeedDial *entry); +GSM_Error N6110_SetSpeedDial(GSM_SpeedDial *entry); + +GSM_Error N6110_GetMemoryStatus(GSM_MemoryStatus *Status); +GSM_Error N6110_GetSMSStatus(GSM_SMSStatus *Status); +GSM_Error N6110_GetSMSCenter(GSM_MessageCenter *MessageCenter); + +GSM_Error N6110_GetSMSMessage(GSM_SMSMessage *Message); +GSM_Error N6110_DeleteSMSMessage(GSM_SMSMessage *Message); +GSM_Error N6110_SendSMSMessage(GSM_SMSMessage *Message); +GSM_Error N6110_SaveSMSMessage(GSM_SMSMessage *Message); + +GSM_Error N6110_GetRFLevel(GSM_RFUnits *units, float *level); +GSM_Error N6110_GetBatteryLevel(GSM_BatteryUnits *units, float *level); +GSM_Error N6110_GetPowerSource(GSM_PowerSource *source); +GSM_Error N6110_GetDisplayStatus(int *Status); + +GSM_Error N6110_EnterSecurityCode(GSM_SecurityCode SecurityCode); +GSM_Error N6110_GetSecurityCodeStatus(int *Status); +GSM_Error N6110_GetSecurityCode(GSM_SecurityCode *SecurityCode); + +GSM_Error N6110_GetSMSCenter(GSM_MessageCenter *MessageCenter); +GSM_Error N6110_SetSMSCenter(GSM_MessageCenter *MessageCenter); + +GSM_Error N6110_GetIMEI(char *imei); +GSM_Error N6110_GetRevision(char *revision); +GSM_Error N6110_GetModel(char *model); +GSM_Error N6110_GetManufacturer(char *manufacturer); + +GSM_Error N6110_GetDateTime(GSM_DateTime *date_time); +GSM_Error N6110_SetDateTime(GSM_DateTime *date_time); + +GSM_Error N6110_PrivGetDateTime(GSM_DateTime *date_time, int msgtype); +GSM_Error N6110_PrivSetDateTime(GSM_DateTime *date_time, int msgtype); + +GSM_Error N6110_GetAlarm(int alarm_number, GSM_DateTime *date_time); +GSM_Error N6110_SetAlarm(int alarm_number, GSM_DateTime *date_time); + +GSM_Error N6110_PrivGetAlarm(int alarm_number, GSM_DateTime *date_time, int msgtype); +GSM_Error N6110_PrivSetAlarm(int alarm_number, GSM_DateTime *date_time, int msgtype); + +GSM_Error N6110_DialVoice(char *Number); +GSM_Error N6110_DialData(char *Number, char type, void (* callpassup)(char c)); +GSM_Error N6110_AnswerCall(char s); + +GSM_Error N6110_GetIncomingCallNr(char *Number); + +GSM_Error N6110_SendBitmap(char *NetworkCode, int width, int height, + unsigned char *bitmap); +GSM_Error N6110_GetNetworkInfo(GSM_NetworkInfo *NetworkInfo); + +GSM_Error N6110_GetCalendarNote(GSM_CalendarNote *CalendarNote); +GSM_Error N6110_WriteCalendarNote(GSM_CalendarNote *CalendarNote); +GSM_Error N6110_DeleteCalendarNote(GSM_CalendarNote *CalendarNote); + +GSM_Error N6110_NetMonitor(unsigned char mode, char *Screen); + +GSM_Error N6110_PlayTone(int Herz, u8 Volume); + +GSM_Error N6110_SetBitmap( GSM_Bitmap *Bitmap ); +GSM_Error N6110_GetBitmap( GSM_Bitmap *Bitmap ); + +GSM_Error N6110_SetRingTone(GSM_Ringtone *ringtone, int *maxlength); +GSM_Error N6110_SetBinRingTone(GSM_BinRingtone *ringtone); +GSM_Error N6110_GetBinRingTone(GSM_BinRingtone *ringtone); + +GSM_Error N6110_EnableDisplayOutput(); +GSM_Error N6110_DisableDisplayOutput(); + +GSM_Error N6110_EnableCellBroadcast (); +GSM_Error N6110_DisableCellBroadcast(void); +GSM_Error N6110_ReadCellBroadcast (GSM_CBMessage *Message); + +GSM_Error N6110_SendDTMF(char *String); + +GSM_Error N6110_Reset(unsigned char type); + +GSM_Error N6110_GetProfile(GSM_Profile *Profile); +GSM_Error N6110_SetProfile(GSM_Profile *Profile); +bool N6110_SendRLPFrame(RLP_F96Frame *frame, bool out_dtx); + +GSM_Error N6110_CancelCall(void); + +GSM_Error N6110_PressKey(int key, int event); + +GSM_Error N6110_GetProductProfileSetting (GSM_PPS *PPS); +GSM_Error N6110_SetProductProfileSetting (GSM_PPS *PPS); + +GSM_Error N6110_CallDivert(GSM_CallDivert *cd); + +void N6110_RX_HandleRLPMessage(u8 *MessageBuffer); + +GSM_Error N6110_SendIMEIFrame(); +GSM_Error N6110_SendIDFrame(); +GSM_Error N6110_SendHWFrame(); + +GSM_Error N6110_EnableExtendedCommands (unsigned char status); + +GSM_Error N6110_Tests(); + +void N6110_DisplayTestsInfo(u8 *MessageBuffer); + +GSM_Error N6110_SimlockInfo(GSM_AllSimlocks *siml); +GSM_Error N6110_GetSMSFolders ( GSM_SMSFolders *folders); + +GSM_Error N6110_ResetPhoneSettings(); + +void N6110_Dispatch0x01Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType); + +void N6110_ReplySendSMSMessage(u16 MessageLength, u8 *MessageBuffer, u8 MessageType); +void N6110_ReplySetSMSCenter (u16 MessageLength, u8 *MessageBuffer, u8 MessageType); +void N6110_ReplyGetSMSCenter (u16 MessageLength, u8 *MessageBuffer, u8 MessageType); +void N6110_Dispatch0x02Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType); +void N6110_ReplySetCellBroadcast (u16 MessageLength, u8 *MessageBuffer, u8 MessageType); +void N6110_ReplyReadCellBroadcast(u16 MessageLength, u8 *MessageBuffer, u8 MessageType); + +void N6110_ReplyCallDivert (u16 MessageLength, u8 *MessageBuffer, u8 MessageType); +void N6110_Dispatch0x06Message(u16 MessageLength, u8 *MessageBuffer, u8 MessageType); + +void N6110_ReplySetDateTime(u16 MessageLength,u8 *MessageBuffer, u8 MessageType); +void N6110_ReplyGetDateTime(u16 MessageLength,u8 *MessageBuffer, u8 MessageType); +void N6110_ReplySetAlarm (u16 MessageLength,u8 *MessageBuffer, u8 MessageType); +void N6110_ReplyGetAlarm (u16 MessageLength,u8 *MessageBuffer, u8 MessageType); + +void N6110_ReplyEnableExtendedCommands (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N6110_ReplyResetPhoneSettings (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N6110_ReplyIMEI (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N6110_ReplyGetProductProfileSetting(u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N6110_ReplySetProductProfileSetting(u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N6110_ReplyNetmonitor (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N6110_ReplySimlockInfo (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N6110_ReplyPlayTone (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N6110_ReplyHW (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N6110_Dispatch0x40Message (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); + +void N6110_DispatchACKMessage (u16 MessageLength, u8 *MessageBuffer, u8 MessageType); +void N6110_ReplyID(u16 MessageLength, u8 *MessageBuffer, u8 MessageType); + +GSM_Error GSM_EncodeNokiaSMSFrame(GSM_SMSMessage *SMS, unsigned char *req, int *length, SMS_MessageType PDU); +GSM_Error GSM_DecodeNokiaSMSFrame(GSM_SMSMessage *SMS, unsigned char *req, int length); + +int N6110_MakeCallerGroupFrame (unsigned char *req,GSM_Bitmap Bitmap); +int N6110_MakeOperatorLogoFrame(unsigned char *req,GSM_Bitmap Bitmap); +int N6110_MakeStartupLogoFrame (unsigned char *req,GSM_Bitmap Bitmap); + +#endif /* __n_6110_h */ diff --git a/include/newmodules/n7110.h b/include/newmodules/n7110.h new file mode 100644 index 0000000..75f79ca --- /dev/null +++ b/include/newmodules/n7110.h @@ -0,0 +1,147 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. See fbus-7110.c for more details. + +*/ + +#ifndef __n_7110_h +#define __n_7110_h + +#include "gsm-api.h" + +/* Entry Types of 7110 for enhanced phonebook */ +#define N7110_ENTRYTYPE_SPEEDDIAL 0x04 /* Speed dial */ +#define N7110_ENTRYTYPE_NAME 0x07 /* Name always the only one */ +#define N7110_ENTRYTYPE_EMAIL 0x08 /* Email Adress (TEXT) */ +#define N7110_ENTRYTYPE_POSTAL 0x09 /* Postal Address (Text) */ +#define N7110_ENTRYTYPE_NOTE 0x0a /* Note (Text) */ +#define N7110_ENTRYTYPE_NUMBER 0x0b /* Phonenumber */ +#define N7110_ENTRYTYPE_RINGTONE 0x0c /* Ringtone number */ +#define N7110_ENTRYTYPE_DATE 0x13 /* Date for a Called List */ +#define N7110_ENTRYTYPE_GROUPLOGO 0x1b /* Caller group logo */ +#define N7110_ENTRYTYPE_LOGOON 0x1c /* Logo On? */ +#define N7110_ENTRYTYPE_GROUP 0x1e /* Group number for phonebook entry */ + +/* Alternate defines for memory types. Two letter codes follow GSM 07.07 + release 6.2.0, AT+CPBS "Select Phonebook Memory Storage" */ +#define N7110_MEMORY_DC 0x01 /* ME dialled calls list */ +#define N7110_MEMORY_MC 0x02 /* ME missed (unanswered received) calls list */ +#define N7110_MEMORY_RC 0x03 /* ME received calls list */ +#define N7110_MEMORY_FD 0x04 /* ?? SIM fixdialling-phonebook */ +#define N7110_MEMORY_ME 0x05 /* ME (Mobile Equipment) phonebook */ +#define N7110_MEMORY_SM 0x06 /* SIM phonebook */ +#define N7110_MEMORY_ON 0x07 /* ?? SIM (or ME) own numbers list */ +#define N7110_MEMORY_EN 0x08 /* ?? SIM (or ME) emergency number */ +#define N7110_MEMORY_VM 0x09 /* voice mailbox */ +#define N7110_MEMORY_SD 0x0e /* speed dials */ +#define N7110_MEMORY_CG 0x10 /* Caller groups */ + +/* Every (well, almost every) frame from the computer starts with this + sequence. */ +#define N7110_FRAME_HEADER 0x00, 0x01, 0x01 + +/* some 6210/7110 folder stuff */ +#define N7110_MAXSMSINFOLDER 160 + +/* Datatype for action in HandleSMSLocation */ +typedef enum { + GSH_GET, /* Get SMS location */ + GSH_SAVE, /* want to save at SMS location */ + GSH_INIT, /* init folder table */ + GSH_DELETE /* Delete SMS location */ +} GSM_SMSHandleAction; + +/* Global variables */ +extern bool N7110_LinkOK; +extern GSM_Functions N7110_Functions; +extern GSM_Information N7110_Information; + +/* Prototypes for the functions designed to be used externally. */ +GSM_Error N7110_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +void N7110_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, + u8 MessageType); + +int N7110_GetMemoryType(GSM_MemoryType memory_type); + +GSM_Error N7110_GetVoiceMailbox ( GSM_PhonebookEntry *entry); + +GSM_Error N7110_GetMemoryStatus(GSM_MemoryStatus *Status); + +GSM_Error N7110_GetProfile(GSM_Profile *Profile); + +GSM_Error N7110_GetCalendarNote(GSM_CalendarNote *CalendarNote); +GSM_Error N7110_WriteCalendarNote(GSM_CalendarNote *CalendarNote); +GSM_Error N7110_DeleteCalendarNote(GSM_CalendarNote *CalendarNote); + +GSM_Error N7110_GetRFLevel(GSM_RFUnits *units, float *level); +GSM_Error N7110_GetBatteryLevel(GSM_BatteryUnits *units, float *level); + +GSM_Error N7110_DialVoice(char *Number); + +GSM_Error N7110_GetSecurityCode(GSM_SecurityCode *SecurityCode); + +GSM_Error N7110_GetDateTime(GSM_DateTime *date_time); +GSM_Error N7110_SetDateTime(GSM_DateTime *date_time); + +GSM_Error N7110_GetAlarm(int alarm_number, GSM_DateTime *date_time); +GSM_Error N7110_SetAlarm(int alarm_number, GSM_DateTime *date_time); + +GSM_Error N7110_GetSMSStatus(GSM_SMSStatus *Status); +GSM_Error N7110_DeleteSMSMessage(GSM_SMSMessage *Message); +GSM_Error N7110_SaveSMSMessage(GSM_SMSMessage *SMS); + +GSM_Error N7110_GetMemoryLocation(GSM_PhonebookEntry *entry); +void N7110_DecodePhonebookFrame(GSM_PhonebookEntry *entry,u8 *MessageBuffer,u16 MessageLength); +GSM_Error N7110_WritePhonebookLocation(GSM_PhonebookEntry *entry); +int N7110_EncodePhonebookFrame(unsigned char *req, GSM_PhonebookEntry entry, int *block); +GSM_Error N7110_DeletePhonebookLocation(GSM_PhonebookEntry *entry); +GSM_Error N7110_WriteGroupDataLocation(GSM_Bitmap *bitmap); + +GSM_Error N7110_SendDTMF(char *String); + +GSM_Error N7110_GetSpeedDial(GSM_SpeedDial *entry); +GSM_Error N7110_SetSpeedDial(GSM_SpeedDial *entry); + +GSM_Error N7110_GetSMSMessage(GSM_SMSMessage *message); + +GSM_Error N7110_SetBitmap(GSM_Bitmap *Bitmap); +GSM_Error N7110_GetBitmap(GSM_Bitmap *Bitmap); + +GSM_Error N7110_SetRingTone(GSM_Ringtone *ringtone, int *maxlength); + +GSM_Error N7110_GetBinRingTone(GSM_BinRingtone *ringtone); +GSM_Error N7110_SetBinRingTone(GSM_BinRingtone *ringtone); + +GSM_Error N7110_GetCalendarNotesInfo(GSM_NotesInfo *NotesInfo); + +GSM_Error N7110_FirstCalendarFreePos(int *FirstFreePos); + +GSM_Error N7110_GetSMSFolders (GSM_SMSFolders *folders); + +GSM_Error N7110_GetWAPBookmark (GSM_WAPBookmark *bookmark); + +GSM_Error N7110_SetWAPBookmark (GSM_WAPBookmark *bookmark); + +GSM_Error N7110_GetWAPSettings (GSM_WAPSettings *settings); + +GSM_Error N7110_HandleSMSLocation (int smsnum, u8 *folderid, int *location, GSM_SMSMessage *message, GSM_SMSHandleAction action); + +void N7110_ReplyEnableWAPCommands(u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N7110_ReplyGetWAPBookmark (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); +void N7110_ReplySetWAPBookmark (u16 MessageLength, u8 *MessageBuffer, u8 MessageType); +void N7110_ReplyGetWAPSettings (u16 MessageLength,u8 *MessageBuffer,u8 MessageType); + +void N7110_Fake2SMSLocation(int smsnum, u8 *folder, int *location); +void N7110_SMS2FakeLocation(int *smsnum, u8 folder, int location); + +#endif /* __n_7110_h */ diff --git a/include/newmodules/newat.h b/include/newmodules/newat.h new file mode 100644 index 0000000..473ffd2 --- /dev/null +++ b/include/newmodules/newat.h @@ -0,0 +1,79 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. See fbus-at.c for more details. + +*/ + +#ifndef __n_at_h +#define __n_at_h + +#include "gsm-api.h" + +/* Global variables */ +extern bool Nat_LinkOK; +extern GSM_Functions Nat_Functions; +extern GSM_Information Nat_Information; + +/* Prototypes for the functions designed to be used externally. */ +GSM_Error Nat_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +void Nat_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, + u8 MessageType); + +GSM_Error Nat_DialVoice(char *Number); +GSM_Error Nat_CancelCall(void); + +GSM_Error Nat_SetDateTime(GSM_DateTime *date_time); +GSM_Error Nat_GetDateTime(GSM_DateTime *date_time); + +GSM_Error Nat_GetAlarm(int alarm_number, GSM_DateTime *date_time); + +GSM_Error Nat_SendDTMF(char *String); + +GSM_Error Nat_GetSMSMessage(GSM_SMSMessage *message); +GSM_Error Nat_SaveSMSMessage(GSM_SMSMessage *message); +GSM_Error Nat_DeleteSMSMessage(GSM_SMSMessage *message); +GSM_Error Nat_GetSMSStatus(GSM_SMSStatus *Status); +GSM_Error Nat_SendSMSMessage(GSM_SMSMessage *message); + +GSM_Error Nat_EnterSecurityCode(GSM_SecurityCode SecurityCode); +GSM_Error Nat_GetSecurityCodeStatus(int *Status); +GSM_Error Nat_GetSecurityCodeStatus(int *Status); + +GSM_Error Nat_GetMemoryLocation(GSM_PhonebookEntry *entry); +GSM_Error Nat_WritePhonebookLocation(GSM_PhonebookEntry * entry); +GSM_Error Nat_GetMemoryStatus(GSM_MemoryStatus *Status); + +GSM_Error Nat_GetBatteryLevel(GSM_BatteryUnits *units, float *level); +GSM_Error Nat_GetRFLevel(GSM_RFUnits *units, float *level); +GSM_Error Nat_GetPowerSource(GSM_PowerSource * source); + +GSM_Error Nat_GetSMSCenter(GSM_MessageCenter *MessageCenter); +GSM_Error Nat_SetSMSCenter(GSM_MessageCenter *MessageCenter); + +GSM_Error Nat_GetNetworkInfo(GSM_NetworkInfo *NetworkInfo); + +GSM_Error Nat_GetManufacturer(char* manufacturer); + +GSM_Error Nat_CallDivert(GSM_CallDivert *cd); + +/* FIXME: not functional or returns errors with tested AT implementation */ +GSM_Error Nat_GetDisplayStatus(int *Status); +GSM_Error Nat_PressKey(int key, int event); +GSM_Error Nat_SetAlarm(int alarm_number, GSM_DateTime *date_time); + +struct AT_OneReply { + char *ReplyString; + void (*ReplyFunction) (u16 message_length, u8 *buffer, u8 message_type); +}; + +#endif /* __n_at_h */ diff --git a/include/newmodules/sniff/sniff.h b/include/newmodules/sniff/sniff.h new file mode 100644 index 0000000..27b979c --- /dev/null +++ b/include/newmodules/sniff/sniff.h @@ -0,0 +1,32 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. See fbus-sniff.c for more details. + +*/ + +#ifndef __n_sniff_h +#define __n_sniff_h + +#include "gsm-api.h" + +/* Global variables */ +extern bool Nsniff_LinkOK; +extern GSM_Functions Nsniff_Functions; +extern GSM_Information Nsniff_Information; + +/* Prototypes for the functions designed to be used externally. */ +GSM_Error Nsniff_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +void Nsniff_DispatchMessage(u16 MessageLength, u8 *MessageBuffer, + u8 MessageType); + +#endif /* __n_sniff_h */ diff --git a/include/phones/ateric.h b/include/phones/ateric.h new file mode 100644 index 0000000..112d54b --- /dev/null +++ b/include/phones/ateric.h @@ -0,0 +1,25 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for mobile phones. + + Copyright 2001 Manfred Jonsson + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides functions specific to at commands on ericsson + phones. See README for more details on supported mobile phones. + + $Log$ + Revision 1.1.1.1 2001/11/25 21:59:22 short + :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 + + Revision 1.1 2001/11/19 13:03:18 pkot + nk3110.c cleanup + +*/ + +void AT_InitEricsson(GSM_Statemachine *state, char* foundmodel, char* setupmodel); diff --git a/include/phones/atgen.h b/include/phones/atgen.h new file mode 100644 index 0000000..aeb7863 --- /dev/null +++ b/include/phones/atgen.h @@ -0,0 +1,45 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for mobile phones. + + Copyright 2001 Manfred Jonsson + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides functions specific to generic at command compatible + phones. See README for more details on supported mobile phones. + + $Log$ + Revision 1.1.1.1 2001/11/25 21:59:22 short + :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 + + Revision 1.1 2001/11/19 13:03:18 pkot + nk3110.c cleanup + + +*/ + +typedef GSM_Error (*GSM_RecvFunctionType)(int type, unsigned char *buffer, int length, GSM_Data *data); +typedef GSM_Error (*AT_SendFunctionType)(GSM_Data *data, GSM_Statemachine *s); + +typedef struct { + char *line1; + char *line2; + char *line3; + int length; +} AT_LineBuffer; + +GSM_RecvFunctionType AT_InsertRecvFunction(int type, GSM_RecvFunctionType func); +AT_SendFunctionType AT_InsertSendFunction(int type, AT_SendFunctionType func); + +GSM_Error AT_SetMemoryType(GSM_MemoryType mt, GSM_Statemachine *state); + +void splitlines(AT_LineBuffer *buf); + +char *skipcrlf(char *str); +char *findcrlf(char *str, int test, int maxlength); + diff --git a/include/phones/atnok.h b/include/phones/atnok.h new file mode 100644 index 0000000..09aba82 --- /dev/null +++ b/include/phones/atnok.h @@ -0,0 +1,25 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for mobile phones. + + Copyright 2001 Manfred Jonsson + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides functions specific to at commands on nokia + phones. See README for more details on supported mobile phones. + + $Log$ + Revision 1.1.1.1 2001/11/25 21:59:22 short + :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 + + Revision 1.1 2001/11/19 13:03:18 pkot + nk3110.c cleanup + +*/ + +void AT_InitNokia(GSM_Statemachine *state, char* foundmodel, char* setupmodel); diff --git a/include/phones/atsie.h b/include/phones/atsie.h new file mode 100644 index 0000000..96245f2 --- /dev/null +++ b/include/phones/atsie.h @@ -0,0 +1,25 @@ +/* + + $Id$ + + G N O K I I + + A Linux/Unix toolset and driver for mobile phones. + + Copyright 2001 Manfred Jonsson + + Released under the terms of the GNU GPL, see file COPYING for more details. + + This file provides functions specific to at commands on siemens + phones. See README for more details on supported mobile phones. + + $Log$ + Revision 1.1.1.1 2001/11/25 21:59:22 short + :pserver:cvs@pserver.samba.org:/cvsroot - gnokii - Sun Nov 25 22:56 CET 2001 + + Revision 1.1 2001/11/19 13:03:18 pkot + nk3110.c cleanup + +*/ + +void AT_InitSiemens(GSM_Statemachine *state, char* foundmodel, char* setupmodel); diff --git a/include/protocol/at.h b/include/protocol/at.h new file mode 100644 index 0000000..054e2ea --- /dev/null +++ b/include/protocol/at.h @@ -0,0 +1,37 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. See AT-6110.c for more details. + +*/ + +#ifndef __AT_h +#define __AT_h + +#include "gsm-api.h" + +#define AT_MAX_RECEIVE_LENGTH 2000 +#define AT_MAX_CONTENT_LENGTH 2000 + +/* Global variables */ +extern GSM_Protocol AT_Functions; + +/* States for receive code. */ + +GSM_Error AT_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +int AT_SendMessage(u16 message_length, u8 message_type, u8 *buffer); +int AT_SendFrame(u16 message_length, u8 message_type, u8 *buffer); +void AT_Terminate(void); +void AT_RX_StateMachine(unsigned char rx_byte); +bool AT_WritePhone (u16 length, u8 *buffer); + +#endif /* __AT_h */ diff --git a/include/protocol/fbus.h b/include/protocol/fbus.h new file mode 100644 index 0000000..1340262 --- /dev/null +++ b/include/protocol/fbus.h @@ -0,0 +1,61 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. See fbus-6110.c for more details. + +*/ + +#ifndef __fbus_h +#define __fbus_h + +#include "gsm-api.h" + +/* This byte is at the beginning of all GSM Frames sent over FBUS to Nokia + 6110 phones. */ +#define FBUS_FRAME_ID 0x1e + +/* This byte is at the beginning of all GSM Frames sent over infrared to Nokia + 6110 phones. */ +#define FBUS_IR_FRAME_ID 0x1c + +#define FBUS_DEVICE_PHONE 0x00 /* Nokia mobile phone. */ +#define FBUS_DEVICE_PC 0x0c /* Our PC (FBUS). */ + +#define FBUS_FRTYPE_ACK 0x7f /* Acknowledge of the received frame. */ + +#define FBUS_MAX_TRANSMIT_LENGTH (256) +#define FBUS_MAX_RECEIVE_LENGTH (512) +#define FBUS_MAX_CONTENT_LENGTH (120) + +/* Global variables */ +extern GSM_Protocol FBUS_Functions; + +/* States for receive code. */ + +enum FBUS_RX_States { + FBUS_RX_Sync, + FBUS_RX_Discarding, + FBUS_RX_GetDestination, + FBUS_RX_GetSource, + FBUS_RX_GetType, + FBUS_RX_GetLength1, + FBUS_RX_GetLength2, + FBUS_RX_GetMessage +}; + +GSM_Error FBUS_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +int FBUS_SendMessage(u16 message_length, u8 message_type, u8 *buffer); +int FBUS_SendFrame(u16 message_length, u8 message_type, u8 *buffer); +void FBUS_Terminate(void); +void FBUS_RX_StateMachine(unsigned char rx_byte); + +#endif /* __fbus_h */ diff --git a/include/protocol/fbus3110.h b/include/protocol/fbus3110.h new file mode 100644 index 0000000..d6dcbec --- /dev/null +++ b/include/protocol/fbus3110.h @@ -0,0 +1,40 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. + +*/ + +#ifndef __fbus3110_h +#define __fbus3110_h + +#include "gsm-api.h" + +#define FBUS3110_FRAME_TO_PHONE 0x01 /* Command from PC to phone */ +#define FBUS3110_DATAFRAME_TO_PHONE 0x02 /* Data call frame from PC to phone */ +#define FBUS3110_FRAME_TO_PC 0x03 /* Command from phone to PC */ +#define FBUS3110_DATAFRAME_TO_PC 0x04 /* Data call frame from phone to PC */ + +#define FBUS3110_MAX_TRANSMIT_LENGTH (256) +#define FBUS3110_MAX_RECEIVE_LENGTH (512) +#define FBUS3110_MAX_CONTENT_LENGTH (120) + +/* Global variables */ +extern GSM_Protocol FBUS3110_Functions; + +GSM_Error FBUS3110_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +int FBUS3110_SendMessage(u16 message_length, u8 message_type, u8 *buffer); +int FBUS3110_SendFrame(u16 message_length, u8 message_type, u8 *buffer); +void FBUS3110_Terminate(void); +void FBUS3110_RX_StateMachine(unsigned char rx_byte); + +#endif /* __FBUS3110_h */ diff --git a/include/protocol/fbusirda.h b/include/protocol/fbusirda.h new file mode 100644 index 0000000..6372fa6 --- /dev/null +++ b/include/protocol/fbusirda.h @@ -0,0 +1,40 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. See mbus-6110.c for more details. + +*/ + +#ifndef __fbusirda_h +#define __fbusirda_h + +#include "gsm-api.h" + +/* This byte is at the beginning of all GSM Frames sent over MBUS to Nokia + 6110 phones. */ +#define FBUSIRDA_FRAME_ID 0x14 + +#define FBUSIRDA_MAX_TRANSMIT_LENGTH (1000) +#define FBUSIRDA_MAX_RECEIVE_LENGTH (1000) +#define FBUSIRDA_MAX_CONTENT_LENGTH (1000) + +/* Global variables */ +extern GSM_Protocol FBUSIRDA_Functions; + +GSM_Error FBUSIRDA_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +int FBUSIRDA_SendMessage(u16 message_length, u8 message_type, u8 *buffer); +int FBUSIRDA_SendFrame(u16 message_length, u8 message_type, u8 *buffer); +void FBUSIRDA_Terminate(void); +bool FBUSIRDA_WritePhone (u16 length, u8 *buffer); +void FBUSIRDA_RX_StateMachine(unsigned char rx_byte); + +#endif /* __fbus_h */ diff --git a/include/protocol/mbus.h b/include/protocol/mbus.h new file mode 100644 index 0000000..65eaa82 --- /dev/null +++ b/include/protocol/mbus.h @@ -0,0 +1,44 @@ +/* + + G N O K I I + + A Linux/Unix toolset and driver for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + + Header file for the various functions, definitions etc. used to implement + the handset interface. See mbus-6110.c for more details. + +*/ + +#ifndef __mbus_h +#define __mbus_h + +#include "gsm-api.h" + +/* This byte is at the beginning of all GSM Frames sent over MBUS to Nokia + 6110 phones. */ +#define MBUS_FRAME_ID 0x1f + +/* Our PC (MBUS). */ +#define MBUS_DEVICE_PC1 0x10 +#define MBUS_DEVICE_PC2 0x1d + +#define MBUS_MAX_TRANSMIT_LENGTH (1000) +#define MBUS_MAX_RECEIVE_LENGTH (1000) +#define MBUS_MAX_CONTENT_LENGTH (1000) + +/* Global variables */ +extern GSM_Protocol MBUS_Functions; + +GSM_Error MBUS_Initialise(char *port_device, char *initlength, + GSM_ConnectionType connection, + void (*rlp_callback)(RLP_F96Frame *frame)); + +int MBUS_SendMessage(u16 message_length, u8 message_type, u8 *buffer); +int MBUS_SendFrame(u16 message_length, u8 message_type, u8 *buffer); +void MBUS_Terminate(void); +bool MBUS_WritePhone (u16 length, u8 *buffer); +void MBUS_RX_StateMachine(unsigned char rx_byte); + +#endif /* __fbus_h */ diff --git a/mgnetd/Makefile b/mgnetd/Makefile new file mode 100644 index 0000000..da31e1b --- /dev/null +++ b/mgnetd/Makefile @@ -0,0 +1,69 @@ + +# +# Makefile for the GNOKII tool suite. +# +# Copyright (C) 1999 Hugh Blemings & Pavel Janík ml. +# 2000 Karel Zak +# + +TOPDIR=.. +include $(TOPDIR)/Makefile.global + +CFLAGS += $(PTHREAD_CFLAGS) +LDFLAGS += $(PTHREAD_LIBS) + +OBJS = mgnetd.o + +all: mgnetd + +mgnetd: $(OBJS) $(TOPDIR)/common/COMMON.o + +$(TOPDIR)/common/COMMON.o: + $(MAKE) -C $(TOPDIR)/common COMMON.o + +$(TOPDIR)/common/libmygnokii.so: + $(MAKE) -C $(TOPDIR)/common makelib + +makelib: $(OBJS) $(TOPDIR)/common/libmygnokii.so + $(CC) $(LDFLAGS) -L$(TOPDIR)/common -lmygnokii $(OBJS) -o mgnetdlib + +clean: + $(RM) $(OBJS) *~ depend mgnetd mgnetdlib *.exe core *.bak + +install: all + $(INSTALL) -d $(sbindir) + $(INSTALL) mgnetd $(sbindir) + $(INSTALL) mgnetdlib $(sbindir)/mgnetd + +install-strip: all + $(INSTALL) -d $(sbindir) + $(INSTALL) -s mgnetd $(sbindir) + $(INSTALL) -s mgnetdlib $(sbindir)/mgnetd + @echo "done" + +install-suid: all + @if [ -z "/bin/grep -e '^gnokii:' /etc/group" ]; then \ + /usr/sbin/groupadd gnokii; \ + fi + $(INSTALL) -d $(sbindir) + $(INSTALL) -o root -g gnokii -m 0750 mgnetd $(sbindir) + $(INSTALL) -o root -g gnokii -m 0750 mgnetdlib $(sbindir)/mgnetd + @echo + +install-ss: all + @if [ -z "/bin/grep -e '^gnokii:' /etc/group" ]; then \ + /usr/sbin/groupadd gnokii; \ + fi + $(INSTALL) -d $(sbindir) + $(INSTALL) -o root -g gnokii -m 0750 -s mgnetd $(sbindir) + $(INSTALL) -o root -g gnokii -m 0750 -s mgnetdlib $(sbindir)/mgnetd + @echo + +depend dep: + $(CC) $(CFLAGS) -MM *.c >depend + +ifeq (depend,$(wildcard depend)) +include depend +endif + +.PHONY: all install clean dep depend diff --git a/mgnetd/mg_demo_client/Makefile b/mgnetd/mg_demo_client/Makefile new file mode 100644 index 0000000..e3d8a32 --- /dev/null +++ b/mgnetd/mg_demo_client/Makefile @@ -0,0 +1,57 @@ + +# +# Makefile for the GNOKII tool suite. +# +# Copyright (C) 1999 Hugh Blemings & Pavel Janík ml. +# 2000 Karel Zak +# + +TOPDIR=../.. +include $(TOPDIR)/Makefile.global + +OBJS = mg_demo_client.o \ + mg_net_api.o + +all: mg_demo_client + +mg_demo_client: $(OBJS) + +makelib: mg_demo_client + @echo + +clean: + $(RM) $(OBJS) *~ depend mg_demo_client *.exe core *.bak + +install: all + $(INSTALL) -d $(sbindir) + $(INSTALL) mg_demo_client $(sbindir) + +install-strip: all + $(INSTALL) -d $(sbindir) + $(INSTALL) -s mg_demo_client $(sbindir) + @echo "done" + +install-suid: all + @if [ -z "/bin/grep -e '^gnokii:' /etc/group" ]; then \ + /usr/sbin/groupadd gnokii; \ + fi + $(INSTALL) -d $(sbindir) + $(INSTALL) -o root -g gnokii -m 0750 mg_demo_client $(sbindir) + @echo + +install-ss: all + @if [ -z "/bin/grep -e '^gnokii:' /etc/group" ]; then \ + /usr/sbin/groupadd gnokii; \ + fi + $(INSTALL) -d $(sbindir) + $(INSTALL) -o root -g gnokii -m 0750 -s mg_demo_client $(sbindir) + @echo + +depend dep: + $(CC) $(CFLAGS) -MM *.c >depend + +ifeq (depend,$(wildcard depend)) +include depend +endif + +.PHONY: all install clean dep depend diff --git a/mgnetd/mg_demo_client/mg_demo_client.c b/mgnetd/mg_demo_client/mg_demo_client.c new file mode 100644 index 0000000..daa1996 --- /dev/null +++ b/mgnetd/mg_demo_client/mg_demo_client.c @@ -0,0 +1,186 @@ +/* + Demo/test prg for MYGNOKII net_api + Ralf Thelen 20.01.2002 + */ + +#include +#include +#include +#include "mg_net_api.h" + +/* usage */ +void usage(void) +{ + fprintf(stderr, "\n\nUsage: mg_demo_client

",accelGroup); + gtk_item_factory_create_items(itemFactory,nMenuItems,ringtonesMenuItems,NULL); + menuBar = gtk_item_factory_get_widget(itemFactory,"
"); + + gtk_box_pack_start(GTK_BOX(vbox),menuBar,FALSE,FALSE,0); + gtk_widget_show(menuBar); + + /* toolbar */ + toolBar = gtk_toolbar_new(GTK_ORIENTATION_HORIZONTAL,GTK_TOOLBAR_ICONS); + gtk_toolbar_set_button_relief(GTK_TOOLBAR(toolBar),GTK_RELIEF_NORMAL); + gtk_toolbar_set_style(GTK_TOOLBAR(toolBar),GTK_TOOLBAR_ICONS); + + gtk_toolbar_append_item(GTK_TOOLBAR(toolBar),NULL,"Set ringtone",NULL, + NewPixmap(Send_xpm,GUI_RingtonesWindow->window, + &GUI_RingtonesWindow->style->bg[GTK_STATE_NORMAL]), + (GtkSignalFunc)NULL,toolBar); + + gtk_box_pack_start(GTK_BOX(vbox),toolBar,FALSE,FALSE,0); + gtk_widget_show(toolBar); + + /* vertical separator */ + separator = gtk_hseparator_new(); + gtk_box_pack_start(GTK_BOX(vbox),GTK_WIDGET(separator),FALSE,FALSE,0); + + /* Melody drawing area */ + melody = gtk_drawing_area_new(); + gtk_drawing_area_size(GTK_DRAWING_AREA(melody), 20,100); + + gtk_box_pack_start(GTK_BOX(vbox),melody,FALSE,FALSE,0); + gtk_widget_show(melody); + + /* create horizontal box for keyboard and buttons area */ + hbox = gtk_hbox_new(FALSE,5); + gtk_box_pack_start(GTK_BOX(vbox),hbox,FALSE,FALSE,0); + gtk_widget_show(hbox); + + /* Box for buttons */ + hbox2 = gtk_hbox_new(FALSE,5); + gtk_box_pack_start(GTK_BOX(hbox),hbox2,FALSE,FALSE,0); + gtk_widget_set_usize( hbox2, 120, 160 ); + gtk_widget_show(hbox2); + + /* Buttons with notes length */ + buttons = gtk_vbox_new(FALSE,3); + gtk_box_pack_start(GTK_BOX(hbox2),buttons,FALSE,FALSE,0); + + label = gtk_label_new (_("Length")); + gtk_box_pack_start (GTK_BOX(buttons), label, FALSE, FALSE, 3); + + note1 = gtk_radio_button_new_with_label (NULL, _("1")); + gtk_box_pack_end (GTK_BOX (buttons), note1, TRUE, FALSE, 2); + gtk_widget_show (note1); + + note2 = gtk_radio_button_new_with_label (NULL, _("1/2")); + gtk_box_pack_end (GTK_BOX (buttons), note2, TRUE, FALSE, 2); + gtk_widget_show (note2); + + note3 = gtk_radio_button_new_with_label (NULL, _("1/4")); + gtk_box_pack_end (GTK_BOX (buttons), note3, TRUE, FALSE, 2); + gtk_widget_show (note3); + gtk_widget_show(buttons); + + note4 = gtk_radio_button_new_with_label (NULL, _("1/16")); + gtk_box_pack_end (GTK_BOX (buttons), note4, TRUE, FALSE, 2); + gtk_widget_show (note4); + + note5 = gtk_radio_button_new_with_label (NULL, _("1/32")); + gtk_box_pack_end (GTK_BOX (buttons), note5, TRUE, FALSE, 2); + gtk_widget_show (note5); + + gtk_widget_show (buttons); + + /* Buttons with notes length */ + buttons2 = gtk_vbox_new(FALSE,3); + gtk_box_pack_start(GTK_BOX(hbox2),buttons2,FALSE,FALSE,0); + + label2 = gtk_label_new (_("Note")); + gtk_box_pack_start (GTK_BOX(buttons2), label2, FALSE, FALSE, 3); + + button = gtk_button_new_with_label (_("C")); + gtk_box_pack_start (GTK_BOX (buttons2), button, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button); + + button3 = gtk_button_new_with_label (_("D")); + gtk_box_pack_start (GTK_BOX (buttons2), button3, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button3); + gtk_widget_show (button); + + button5 = gtk_button_new_with_label (_("E")); + gtk_box_pack_start (GTK_BOX (buttons2), button5, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button5); + + button6 = gtk_button_new_with_label (_("F")); + gtk_box_pack_start (GTK_BOX (buttons2), button6, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button6); + + button8 = gtk_button_new_with_label (_("G")); + gtk_box_pack_start (GTK_BOX (buttons2), button8, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button8); + + button10 = gtk_button_new_with_label (_("A")); + gtk_box_pack_start (GTK_BOX (buttons2), button10, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button10); + + button12 = gtk_button_new_with_label (_("H")); + gtk_box_pack_start (GTK_BOX (buttons2), button12, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button12); + + gtk_widget_show (label2); + + button2 = gtk_button_new_with_label (_("Cis")); + gtk_box_pack_start (GTK_BOX (buttons2), button2, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button2); + + button4 = gtk_button_new_with_label (_("Dis")); + gtk_box_pack_start (GTK_BOX (buttons2), button4, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button4); + + button7 = gtk_button_new_with_label (_("Fis")); + gtk_box_pack_start (GTK_BOX (buttons2), button7, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button7); + + button9 = gtk_button_new_with_label (_("Gis")); + gtk_box_pack_start (GTK_BOX (buttons2), button9, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button9); + + button11 = gtk_button_new_with_label (_("Ais")); + gtk_box_pack_start (GTK_BOX (buttons2), button11, TRUE, FALSE, 0); +// gtk_signal_connect (GTK_OBJECT (button), "clicked", +// GTK_SIGNAL_FUNC (HideCallDialog), (gpointer) inCallDialog.dialog); +// GTK_WIDGET_SET_FLAGS (button, GTK_CAN_DEFAULT); +// gtk_widget_grab_default (button); + gtk_widget_show (button11); + + gtk_widget_show (buttons2); + + /* Keyboard */ + keyboard = gtk_fixed_new(); + gtk_widget_set_usize( keyboard, 504, 160 ); + gtk_box_pack_start(GTK_BOX(hbox),keyboard,FALSE,FALSE,0); + + gtk_signal_connect(GTK_OBJECT (keyboard), "button_press_event", + GTK_SIGNAL_FUNC (KeyboardButtonPress), &hbox); + gtk_signal_connect(GTK_OBJECT (keyboard), "button_release_event", + GTK_SIGNAL_FUNC (KeyboardButtonRelease), &hbox); + + gtk_widget_add_events(keyboard, GDK_FOCUS_CHANGE_MASK| + GDK_BUTTON_PRESS_MASK|GDK_BUTTON_RELEASE_MASK); + + KeyboardCreateBlackPixmap(hbox, &pam[KIE_BLACK], "333333", "666666", "999999"); + KeyboardCreateBlackPixmap(hbox, &pam[KIE_BLACKSEL], "000000", "333333", "666666"); + + for (i = 0; i < 6; i += 2) + { + KeyboardCreateWhitePixmap(hbox, &pam[KIE_WHITEL + i], + whitestarts[i / 2], "FFFFFF", "999999", "CCCCCC"); + KeyboardCreateWhitePixmap(hbox, &pam[KIE_WHITELSEL + i], + whitestarts[i / 2], "CCCCCC", "666666", "999999"); + } + + for (i = 0; i < WHITE_COUNT - 1; i++) + { + PixmapAndMask * b = &pam[KIE_BLACK]; + if (xwhi[i % 7] == 2) continue; + blacks[i] = gtk_pixmap_new( b->pixmap, b->mask ); + gtk_fixed_put( GTK_FIXED(keyboard), blacks[i], 16 + 24 * i, 0 ); + } + + for (i = 0; i < WHITE_COUNT; i++) + { + int j = xwhi[i % 7]; + whites[i] = gtk_pixmap_new( pam[j].pixmap, pam[j].mask ); + gtk_fixed_put( GTK_FIXED(keyboard), whites[i], 24 * i, 0 ); + } + + gtk_widget_show(keyboard); +} + +void GUI_ShowRingtonesWindow (void) +{ + gtk_widget_show_all(GUI_RingtonesWindow); +} diff --git a/xgnokii/xgnokii_xring.h b/xgnokii/xgnokii_xring.h new file mode 100644 index 0000000..fd450c6 --- /dev/null +++ b/xgnokii/xgnokii_xring.h @@ -0,0 +1,38 @@ +/* + + X G N O K I I + + A Linux/Unix GUI for Nokia mobile phones. + + Released under the terms of the GNU GPL, see file COPYING for more details. + +*/ + +#ifndef XGNOKII_XRING_H +#define XGNOKII_XRING_H + +#include + +enum { + KIE_BLACK, KIE_BLACKSEL, + KIE_WHITEL, KIE_WHITELSEL, + KIE_WHITEM, KIE_WHITEMSEL, + KIE_WHITER, KIE_WHITERSEL, + KIE_COUNT +}; + +#define WHITE_COUNT 21 /* how many keys on the keyboard */ + +#define BLACK_PRESSED 64 +#define WHITE_PRESSED 128 + +typedef struct +{ + GdkPixmap * pixmap; + GdkBitmap * mask; +} PixmapAndMask; + +extern void GUI_ShowRingtonesWindow (); +extern void GUI_CreateRingtonesWindow (); + +#endif