Class Lib_siemens

java.lang.Object
  extended byLib_siemens

public class Lib_siemens
extends java.lang.Object

Lib_siemens for MIDletPascal. To compile this class, you also need MIDP 1.0 and Siemens extension APIs. And to use, of course, MIDletPascal (http://www.midletpascal.com) The listed functions are available on all java-able Siemens phones. web: http://inf.nyme.hu/~kusicsk/ e-mail: znos@freemail.hu


Constructor Summary
Lib_siemens()
           
 
Method Summary
static void dial(java.lang.String number)
          Starts a phone call.
static void playmiditone(int note, int duration, int volume)
          Play back a tone as specified by a note and its duration.
static void playtone(int tone_freq, int tone_time)
          Plays a tone.
static int sendsms(java.lang.String number, java.lang.String data)
          Sends an sms to the specified number.
static void setlightoff()
          Deactivates LCD backlight.
static void setlighton()
          Activates the LCD backlight.
static void startvibrator()
          Activates vibrator.
static void stopvibrator()
          Deactivates vibrator.
static void triggervibrator(int duration)
          Activates the vibrator for a given time in milliseconds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Lib_siemens

public Lib_siemens()
Method Detail

startvibrator

public static void startvibrator()
Activates vibrator.


stopvibrator

public static void stopvibrator()
Deactivates vibrator.


triggervibrator

public static void triggervibrator(int duration)
Activates the vibrator for a given time in milliseconds.

Parameters:
duration - duration of the vibrator activation period, in milliseconds.

playtone

public static void playtone(int tone_freq,
                            int tone_time)
Plays a tone.

Parameters:
tone_freq - the frequency of this tone [Hz]
tone_time - the duration of this tone [ms]

playmiditone

public static void playmiditone(int note,
                                int duration,
                                int volume)
Play back a tone as specified by a note and its duration. A note is given in the range of 0 to 127. The frequency of the note can be calculated from the following formula: SEMITONE_CONST = 17.31234049066755 = 1/(ln(2^(1/12))) note = ln(freq/8.176)*SEMITONE_CONST The musical note A = MIDI note 69 (0x45) = 440 Hz. This call is a non-blocking call. Notice that this method may utilize CPU resources significantly on devices that don't have hardware support for tone generation.

Parameters:
note - Defines the tone of the note as specified by the above formula.
duration - The duration of the tone in milli-seconds. Duration must be non-negative.
volume - Audio volume range from 0 to 100. 100 represents the maximum volume at the current hardware level. Setting the volume to a value less than 0 will set the volume to 0. Setting the volume to greater than 100 will set the volume to 100.

setlighton

public static void setlighton()
Activates the LCD backlight.


setlightoff

public static void setlightoff()
Deactivates LCD backlight.


dial

public static void dial(java.lang.String number)
Starts a phone call. IMPORTANT NOTE: The java application will terminate upon performing this method call.

Parameters:
number - a phone number to dial. (International format)

sendsms

public static int sendsms(java.lang.String number,
                          java.lang.String data)
Sends an sms to the specified number. The user will be prompted whether an SMS is allowed to be send each time the method is called. For further information regarding the mapping of Unicode into standard GSM char (7 bit) see the ETSI mapping specifications.

Parameters:
number - phone number to send SMS to. (International format)
data - SMS text
Returns:
number of characters actually send