Brew advanced and proficient-3G mobile value-added business operation, customization and development-serialization 92-perl interface use in brew

Source: Internet
Author: User

Brew provides a Perl interface library. developers can write scripts through the Perl interface to automate the execution of batch processing commands. The API list includes:

• Connect and control the target mobile phone

U connecttodevice (char * portname, char * dllname)

U putdeviceoffline (INT)

U resetdevice ()

• Copy files and directories

U copyfiletodevice (char * SRC, char * DEST, bool overwrite)

U copyfilefromdevice (char * SRC, char * DEST)

U copydirdevice (const char * ppcdirname, const char * pdevicedirname)

• Record mobile phone log information

U setlogmask (char * logmask)

U setlogduration (unsigned long X)

U startlogger ()

• Simulate mobile phone button events

U startgrinder (char * targetname)

U seteventinterval (long leventsinterval)

U sendkeys (INT count, char ** eventcodes)

The following is a script example used by grinder and btil.

Use grinderpl;

Use Enum QW (avk_asterisk = 1000 avk_number_sign avk_select avk_up avk_down avk_left avk_right avk_send avk_clr avk_end );

Use Enum QW (normal = 0 no_voice_call after_voice_call config_screen = 4 hidden_config = 8 force_unique = 32 scr_saver = 64 background = 160 );

#

# A grinder Perl application to configure shaker on the phone.

#

#1) It initializes the Perl module.

#2) loads the default settings.

#3) initializes the phone.

#4) starts the brew applet with flag to start it in background.

#5) releases the Perl module.

#

# Initialize the Perl module. This shoshould be the first function to be called.

Grinderpl: initperlmodule ();

 

# Load the default settings.

Grinderpl: loadsettings (0 );

If (grinderpl: initdeviceex ("COM1", "btiloem. dll ")){

$ I = 0x12345678; # ID of Applet to be started

Grinderpl: btilstartapplet ($ I, background );

}

Grinderpl: releaseperlmodule ();

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.