caramoan tour package

caramoan tour package

Author Topic: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL  (Read 21610 times)

Offline jordandino

  • CR2032 Battery
  • **
  • Posts: 9
  • Pogi/Ganda Points: 0
  • Gender: Male
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #140 on: August 10, 2010, 05:20:33 AM »
pahingi din ms tambay_7 :D

Philippine Electronics Forum

Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #140 on: August 10, 2010, 05:20:33 AM »

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #141 on: August 10, 2010, 10:10:25 AM »
ok no prob... ;) ill upload it pag-uwi ko :)
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Philippine Electronics Forum

Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #141 on: August 10, 2010, 10:10:25 AM »

Offline madzie71

  • CR2032 Battery
  • **
  • Posts: 15
  • Pogi/Ganda Points: 2
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #142 on: August 10, 2010, 09:22:49 PM »
Pahingi din po...

Philippine Electronics Forum

Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #142 on: August 10, 2010, 09:22:49 PM »

Offline carlsfootprints

  • Lead Acid Battery
  • *******
  • Posts: 629
  • Pogi/Ganda Points: 25
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #143 on: August 14, 2010, 03:29:59 AM »
ang ganda mo mother7..

up for the link.. hehe ;D
never saturate..

Philippine Electronics Forum

Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #143 on: August 14, 2010, 03:29:59 AM »

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #144 on: August 14, 2010, 05:17:57 AM »
eto na po :)

http://www.badongo.com/file/23873988
8KB na zip file... two files ang naanjan, yung application at yung sample script file



nilagyan ko ng show ASCII hex para makita yung mga line feed...

post nyo lang dito kung may suggestions/comments kayo for the improvement of the app. :)

this app is currently tested with USB HSDPA Globe Tattoo Modem...
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Philippine Electronics Forum

Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #144 on: August 14, 2010, 05:17:57 AM »

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #145 on: August 14, 2010, 05:48:46 AM »
quick update:

naglagay ako ng handshaking option,

http://www.badongo.com/file/23874165



E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline maldihtah13

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4669
  • Pogi/Ganda Points: 120
  • Gender: Female
  • Everyday is a learning process so try to learn ;D
    • Blogspot
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #146 on: August 14, 2010, 06:50:11 AM »
Ang ganda mo talaga sis. Baka naman pwede pakisend na rin source code mo.

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1585
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #147 on: August 14, 2010, 09:26:39 AM »
quick update:

naglagay ako ng handshaking option,

http://www.badongo.com/file/23874165





Ang galing po ninyo master.. +1. Nag try po ako mag send ng msg gamit nyan pero hindi ko kaya. Heto po yung resulta.

Code: [Select]
Sending Command: AT
Delay: 100msec
Received Reply:

OK

===========================
Sending Command: AT+CMGF=1
Delay: 100msec
Received Reply:

OK

===========================
Sending Command: +CMSS: 4
Delay: 100msec
Received Reply:

===========================
===========================
===========END===========

yung msg ko po na save na sa sim memory #4. Ang msg ay nag check lang ng balance ng load ko. Para di ma bawasan ang load ko, hehe. Paano ba ito gawin master? Sorry for being so noob.
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #148 on: August 14, 2010, 11:22:34 AM »
Ang galing po ninyo master.. +1. Nag try po ako mag send ng msg gamit nyan pero hindi ko kaya. Heto po yung resulta.

Code: [Select]
Sending Command: AT
Delay: 100msec
Received Reply:

OK

===========================
Sending Command: AT+CMGF=1
Delay: 100msec
Received Reply:

OK

===========================
Sending Command: +CMSS: 4
Delay: 100msec
Received Reply:

===========================
===========================
===========END===========

yung msg ko po na save na sa sim memory #4. Ang msg ay nag check lang ng balance ng load ko. Para di ma bawasan ang load ko, hehe. Paano ba ito gawin master? Sorry for being so noob.


baka bitin lang sis yung delay mo... gumana naman siya sa akin...

eto yung exact script
Code: [Select]
AT+CMGF=1|TRUE|500|None
AT+CMGL="REC UNREAD"|TRUE|3000|Just to show wala pang unread messages
AT+CMSS=18|TRUE|5000|None
AT+CMGL="REC UNREAD"|TRUE|3000|None

eto yung result

Quote
Sending Command: AT+CMGF=1
Delay: 500msec
Received Reply:

OK

===========================
Sending Command: AT+CMGL="REC UNREAD"
Delay: 3000msec
Received Reply:

OK

===========================
Sending Command: AT+CMSS=18
Delay: 5000msec
Received Reply:

+CMSS: 0

OK

+CMTI: "SM",28

===========================
Sending Command: AT+CMGL="REC UNREAD"
Delay: 3000msec
Received Reply:

+CMGL: 28,"REC UNREAD","7176796669",,"10/08/14,11:20:08+32"
Your Account Balance as of 08/14/2010 11:20 is 0.00 You also have 0 remaining FREE texts.

OK

===========================
===========================
===========END===========


heheheh... nakakahiya man ... wala akong load ngayon :D :D :D ;D ;D ;D

maybe in the future version tanggalin ko na yung delay sa script file at antayin na lang yung ERROR or OK string, tapos may customizable timeout kung sakaling di sumagot ang GSM mode.
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #149 on: August 14, 2010, 11:27:00 AM »
Ang ganda mo talaga sis. Baka naman pwede pakisend na rin source code mo.

written in C#:

Code: [Select]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
using System.IO;

namespace AT_Command_Script_Processor
{
    public partial class frmATScriptProcessor : Form
    {
        const string FRM_TITLE="AT Command Script Processor 00.08.01";

        public frmATScriptProcessor()
        {
            InitializeComponent();
        }

        private void frmATScriptProcessor_Load(object sender, EventArgs e)
        {
        this.Text=FRM_TITLE;
        tssStatusScrFile.Text="";
        cmbSerial.Items.Clear();
        cmbSerial.Items.AddRange(SerialPort.GetPortNames());
        if(cmbSerial.Items.Count!=0)
            cmbSerial.SelectedIndex=0;

        cmbBaud.Items.Clear();
        cmbBaud.Items.AddRange(new string[]{"9600","19200","115200"});
        cmbBaud.SelectedIndex=0;

        cmbHandShaking.Items.Clear();
        cmbHandShaking.Items.AddRange(new string[]{"None","RequestToSend","RequestToSendXOnXOff","XOnXOff"});
        cmbHandShaking.SelectedIndex=0;
           

        }

        private void btnOpenFile_Click(object sender, EventArgs e)
        {
        if(ofdScriptFile.ShowDialog()==DialogResult.OK)
            {
            //txtScriptFile.Text=ofdScriptFile.FileName;
            tssStatusScrFile.Text=ofdScriptFile.FileName;
            }
        }

        private void btnRun_Click(object sender, EventArgs e)
        {
        string SCRFile=tssStatusScrFile.Text.Trim();
        txtResult.Clear();
        Application.DoEvents();
        if(File.Exists(SCRFile)==true)
            {
       
            SerialPort mySer=new SerialPort(cmbSerial.SelectedItem.ToString(),int.Parse(cmbBaud.SelectedItem.ToString()));
            mySer.Handshake=(Handshake)Enum.Parse( typeof(Handshake),cmbHandShaking.SelectedItem.ToString());
            mySer.WriteTimeout=1000;
            try
                {
                string [] FileAllLines=File.ReadAllLines(SCRFile);
               
                try
                    {mySer.Open();}
                catch
                    {
                    MessageBox.Show("Error Opening Serial Port!");
                    return;
                    }
                btnRun.Enabled=false;
                foreach(string x in FileAllLines)
                    {
                    string temp=x.Trim();
                    if(temp.StartsWith(@"//"))
                        continue;
                   
                    string [] spliString=temp.Split(new char[]{'|'},StringSplitOptions.RemoveEmptyEntries);
                    if(spliString.Length!=4)
                        continue;

                    int delay=0;   
                    bool boolReadRx=false;
                    string ATcmd="";

                    try
                        {
                        delay=int.Parse(spliString[2].Trim());   
                        boolReadRx=Convert.ToBoolean(spliString[1].Trim());
                        ATcmd=spliString[0].Trim();
                        }
                    catch
                        {
                        MessageBox.Show("Error Parsing Data, Please Recheck AT Script File: " + temp,FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
                        return;
                        }

                    mySer.DiscardInBuffer();

                    txtResult.AppendText("Sending Command: " + ATcmd);
                    txtResult.AppendText("\r\n");



                    try
                        {
                        mySer.Write(ATcmd);
                        mySer.Write(new byte[]{0x0D},0,1);
                        }
                    catch
                        {
                        MessageBox.Show("Error Sending Data to GSM Modem!",FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
                        return;
                        }

                    txtResult.AppendText("Delay: " + delay + "msec");
                    txtResult.AppendText("\r\n");
                    System.Threading.Thread.Sleep(delay);
                    if(boolReadRx)
                        {
                        string readSer=mySer.ReadExisting();
                        if(chkShowEndHex.Checked)
                            {
                            for(int ctr=0;ctr<0x20;ctr++)
                                {
                                readSer =readSer.Replace(String.Format("{0}",(char)ctr),String.Format("<0x{0:X2}>",ctr));
                                }
                            }
                        txtResult.AppendText("Received Reply:\r\n");
                        txtResult.AppendText(readSer);
                        txtResult.AppendText("\r\n");
                        }
                    txtResult.AppendText("===========================\r\n");
                    }
                }
            finally
                {
                btnRun.Enabled=true;
                mySer.Dispose();
                System.GC.Collect();
                }
            txtResult.AppendText("===========================\r\n");
            txtResult.AppendText("===========END===========\r\n");
            }
        else
            {
            if(SCRFile==String.Empty)
                MessageBox.Show("Choose file first!",FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
            else
                MessageBox.Show("File does not exist!",FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
            }   
           
        }

        private void btnCopyToClipBoard_Click(object sender, EventArgs e)
        {
        if(txtResult.Text.Length!=0)
            {
            Clipboard.Clear();
            Clipboard.SetText(txtResult.Text);
            }
        }
    }
}

medyo magulo pa yung code... I will optimize it pag may time :) ;)
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline dummy_c

  • Diesel Generator
  • *
  • Posts: 1585
  • Pogi/Ganda Points: 162
  • Gender: Male
  • If I die 2nyt, 8's bcoz maimai is not at my side!
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #150 on: August 15, 2010, 08:28:27 AM »
Ahh right sa delay lang pala. Marami pong salamat boss master manay 7.+1. Ginamit ko na yung application mo to send, read and delete messages.


written in C#:

Code: [Select]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
using System.IO;

namespace AT_Command_Script_Processor
{
    public partial class frmATScriptProcessor : Form
    {
        const string FRM_TITLE="AT Command Script Processor 00.08.01";

        public frmATScriptProcessor()
        {
            InitializeComponent();
        }

        private void frmATScriptProcessor_Load(object sender, EventArgs e)
        {
        this.Text=FRM_TITLE;
        tssStatusScrFile.Text="";
        cmbSerial.Items.Clear();
        cmbSerial.Items.AddRange(SerialPort.GetPortNames());
        if(cmbSerial.Items.Count!=0)
            cmbSerial.SelectedIndex=0;

        cmbBaud.Items.Clear();
        cmbBaud.Items.AddRange(new string[]{"9600","19200","115200"});
        cmbBaud.SelectedIndex=0;

        cmbHandShaking.Items.Clear();
        cmbHandShaking.Items.AddRange(new string[]{"None","RequestToSend","RequestToSendXOnXOff","XOnXOff"});
        cmbHandShaking.SelectedIndex=0;
            

        }

        private void btnOpenFile_Click(object sender, EventArgs e)
        {
        if(ofdScriptFile.ShowDialog()==DialogResult.OK)
            {
            //txtScriptFile.Text=ofdScriptFile.FileName;
            tssStatusScrFile.Text=ofdScriptFile.FileName;
            }
        }

        private void btnRun_Click(object sender, EventArgs e)
        {
        string SCRFile=tssStatusScrFile.Text.Trim();
        txtResult.Clear();
        Application.DoEvents();
        if(File.Exists(SCRFile)==true)
            {
        
            SerialPort mySer=new SerialPort(cmbSerial.SelectedItem.ToString(),int.Parse(cmbBaud.SelectedItem.ToString()));
            mySer.Handshake=(Handshake)Enum.Parse( typeof(Handshake),cmbHandShaking.SelectedItem.ToString());
            mySer.WriteTimeout=1000;
            try
                {
                string [] FileAllLines=File.ReadAllLines(SCRFile);
                
                try
                    {mySer.Open();}
                catch
                    {
                    MessageBox.Show("Error Opening Serial Port!");
                    return;
                    }
                btnRun.Enabled=false;
                foreach(string x in FileAllLines)
                    {
                    string temp=x.Trim();
                    if(temp.StartsWith(@"//"))
                        continue;
                    
                    string [] spliString=temp.Split(new char[]{'|'},StringSplitOptions.RemoveEmptyEntries);
                    if(spliString.Length!=4)
                        continue;

                    int delay=0;    
                    bool boolReadRx=false;
                    string ATcmd="";

                    try
                        {
                        delay=int.Parse(spliString[2].Trim());    
                        boolReadRx=Convert.ToBoolean(spliString[1].Trim());
                        ATcmd=spliString[0].Trim();
                        }
                    catch
                        {
                        MessageBox.Show("Error Parsing Data, Please Recheck AT Script File: " + temp,FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
                        return;
                        }

                    mySer.DiscardInBuffer();

                    txtResult.AppendText("Sending Command: " + ATcmd);
                    txtResult.AppendText("\r\n");



                    try
                        {
                        mySer.Write(ATcmd);
                        mySer.Write(new byte[]{0x0D},0,1);
                        }
                    catch
                        {
                        MessageBox.Show("Error Sending Data to GSM Modem!",FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
                        return;
                        }

                    txtResult.AppendText("Delay: " + delay + "msec");
                    txtResult.AppendText("\r\n");
                    System.Threading.Thread.Sleep(delay);
                    if(boolReadRx)
                        {
                        string readSer=mySer.ReadExisting();
                        if(chkShowEndHex.Checked)
                            {
                            for(int ctr=0;ctr<0x20;ctr++)
                                {
                                readSer =readSer.Replace(String.Format("{0}",(char)ctr),String.Format("<0x{0:X2}>",ctr));
                                }
                            }
                        txtResult.AppendText("Received Reply:\r\n");
                        txtResult.AppendText(readSer);
                        txtResult.AppendText("\r\n");
                        }
                    txtResult.AppendText("===========================\r\n");
                    }
                }
            finally
                {
                btnRun.Enabled=true;
                mySer.Dispose();
                System.GC.Collect();
                }
            txtResult.AppendText("===========================\r\n");
            txtResult.AppendText("===========END===========\r\n");
            }
        else
            {
            if(SCRFile==String.Empty)
                MessageBox.Show("Choose file first!",FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
            else
                MessageBox.Show("File does not exist!",FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
            }  
            
        }

        private void btnCopyToClipBoard_Click(object sender, EventArgs e)
        {
        if(txtResult.Text.Length!=0)
            {
            Clipboard.Clear();
            Clipboard.SetText(txtResult.Text);
            }
        }
    }
}

medyo magulo pa yung code... I will optimize it pag may time :) ;)
Kailangan ko talagang matuto ng C...  :'(
The world's technology is always changing, no doubt about it, and I hope it’s a while yet before it impacts my ability to tinker.

Offline maldihtah13

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4669
  • Pogi/Ganda Points: 120
  • Gender: Female
  • Everyday is a learning process so try to learn ;D
    • Blogspot
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #151 on: August 15, 2010, 09:51:29 AM »
Ako rin nose bleed  sa C#. C# dot net ba ginamit mo sis?

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #152 on: August 15, 2010, 12:07:47 PM »
yup... Visual C# 2010 Express Edition ang ginamit ko. nakatarget yang app sa .NET Framework 2.0
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #153 on: August 19, 2010, 05:27:37 AM »
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline maldihtah13

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4669
  • Pogi/Ganda Points: 120
  • Gender: Female
  • Everyday is a learning process so try to learn ;D
    • Blogspot
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #154 on: August 19, 2010, 08:53:21 AM »
Sir sa VB 2010 paano ko iseset sa .net framework 2?

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #155 on: August 19, 2010, 01:35:06 PM »
di ako sure sa VB, pero sa project properties lang yun...
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline maldihtah13

  • Technical People
  • Nuclear Reactor
  • *****
  • Posts: 4669
  • Pogi/Ganda Points: 120
  • Gender: Female
  • Everyday is a learning process so try to learn ;D
    • Blogspot
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #156 on: August 20, 2010, 05:45:09 PM »
Ok sige I'll try that.

Offline 0b00000111

  • Technical People
  • Solar Power Satellite
  • *****
  • Posts: 6129
  • Pogi/Ganda Points: 398
  • There is no delight in owning anything unshared.
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #157 on: August 21, 2010, 02:39:38 PM »
AT Command Script Processor Version 00.08.02



Revision:
- Added Option to adjust RX Buffer Size
- TX Buffer Size set to 1000
- Special Command for sending hex number: __@HEX   Usage: __@HEX=AA|TRUE|100|None 
E-Gizmo Mechatronix Central: www.e-gizmo.com

Tel #: (63)(2) 536-3378
Globe +63915-973-7691
Smart +63921-779-0748

Location Map

YM: julie.egizmo  aka Born2BeWired  ;D

Offline cool_Taurus

  • Size AAA Battery
  • ***
  • Posts: 78
  • Pogi/Ganda Points: 0
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #158 on: August 21, 2010, 04:20:13 PM »
Hi,

In my system, I need to use this modem in this two mode : Data and Voice.
For the Data part, no problems.
But for the voice part, I have no sound.
To call someone, I use AT commands in a VB.NET application.
The communication are OK. I receive or i can send a call, but no sound pass beetween the two parts.
Of course, with AT commands, I change the sound and don't put in HP mode :
AT+CMUT = 0
AT+CLVL = 4
If I use Mobile Partner application, The voice are up. If I compare the AT log with mine, the two applications send the same commands.
I think the voice data are not transmit to the audio systems(HP, microphone)

Excuse me for my bad english.

Thanks to help me !

Offline jordandino

  • CR2032 Battery
  • **
  • Posts: 9
  • Pogi/Ganda Points: 0
  • Gender: Male
Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #159 on: August 22, 2010, 09:01:02 PM »
written in C#:

Code: [Select]
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
using System.IO;

namespace AT_Command_Script_Processor
{
    public partial class frmATScriptProcessor : Form
    {
        const string FRM_TITLE="AT Command Script Processor 00.08.01";

        public frmATScriptProcessor()
        {
            InitializeComponent();
        }

        private void frmATScriptProcessor_Load(object sender, EventArgs e)
        {
        this.Text=FRM_TITLE;
        tssStatusScrFile.Text="";
        cmbSerial.Items.Clear();
        cmbSerial.Items.AddRange(SerialPort.GetPortNames());
        if(cmbSerial.Items.Count!=0)
            cmbSerial.SelectedIndex=0;

        cmbBaud.Items.Clear();
        cmbBaud.Items.AddRange(new string[]{"9600","19200","115200"});
        cmbBaud.SelectedIndex=0;

        cmbHandShaking.Items.Clear();
        cmbHandShaking.Items.AddRange(new string[]{"None","RequestToSend","RequestToSendXOnXOff","XOnXOff"});
        cmbHandShaking.SelectedIndex=0;
           

        }

        private void btnOpenFile_Click(object sender, EventArgs e)
        {
        if(ofdScriptFile.ShowDialog()==DialogResult.OK)
            {
            //txtScriptFile.Text=ofdScriptFile.FileName;
            tssStatusScrFile.Text=ofdScriptFile.FileName;
            }
        }

        private void btnRun_Click(object sender, EventArgs e)
        {
        string SCRFile=tssStatusScrFile.Text.Trim();
        txtResult.Clear();
        Application.DoEvents();
        if(File.Exists(SCRFile)==true)
            {
       
            SerialPort mySer=new SerialPort(cmbSerial.SelectedItem.ToString(),int.Parse(cmbBaud.SelectedItem.ToString()));
            mySer.Handshake=(Handshake)Enum.Parse( typeof(Handshake),cmbHandShaking.SelectedItem.ToString());
            mySer.WriteTimeout=1000;
            try
                {
                string [] FileAllLines=File.ReadAllLines(SCRFile);
               
                try
                    {mySer.Open();}
                catch
                    {
                    MessageBox.Show("Error Opening Serial Port!");
                    return;
                    }
                btnRun.Enabled=false;
                foreach(string x in FileAllLines)
                    {
                    string temp=x.Trim();
                    if(temp.StartsWith(@"//"))
                        continue;
                   
                    string [] spliString=temp.Split(new char[]{'|'},StringSplitOptions.RemoveEmptyEntries);
                    if(spliString.Length!=4)
                        continue;

                    int delay=0;   
                    bool boolReadRx=false;
                    string ATcmd="";

                    try
                        {
                        delay=int.Parse(spliString[2].Trim());   
                        boolReadRx=Convert.ToBoolean(spliString[1].Trim());
                        ATcmd=spliString[0].Trim();
                        }
                    catch
                        {
                        MessageBox.Show("Error Parsing Data, Please Recheck AT Script File: " + temp,FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
                        return;
                        }

                    mySer.DiscardInBuffer();

                    txtResult.AppendText("Sending Command: " + ATcmd);
                    txtResult.AppendText("\r\n");



                    try
                        {
                        mySer.Write(ATcmd);
                        mySer.Write(new byte[]{0x0D},0,1);
                        }
                    catch
                        {
                        MessageBox.Show("Error Sending Data to GSM Modem!",FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
                        return;
                        }

                    txtResult.AppendText("Delay: " + delay + "msec");
                    txtResult.AppendText("\r\n");
                    System.Threading.Thread.Sleep(delay);
                    if(boolReadRx)
                        {
                        string readSer=mySer.ReadExisting();
                        if(chkShowEndHex.Checked)
                            {
                            for(int ctr=0;ctr<0x20;ctr++)
                                {
                                readSer =readSer.Replace(String.Format("{0}",(char)ctr),String.Format("<0x{0:X2}>",ctr));
                                }
                            }
                        txtResult.AppendText("Received Reply:\r\n");
                        txtResult.AppendText(readSer);
                        txtResult.AppendText("\r\n");
                        }
                    txtResult.AppendText("===========================\r\n");
                    }
                }
            finally
                {
                btnRun.Enabled=true;
                mySer.Dispose();
                System.GC.Collect();
                }
            txtResult.AppendText("===========================\r\n");
            txtResult.AppendText("===========END===========\r\n");
            }
        else
            {
            if(SCRFile==String.Empty)
                MessageBox.Show("Choose file first!",FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
            else
                MessageBox.Show("File does not exist!",FRM_TITLE,MessageBoxButtons.OK,MessageBoxIcon.Stop);
            }   
           
        }

        private void btnCopyToClipBoard_Click(object sender, EventArgs e)
        {
        if(txtResult.Text.Length!=0)
            {
            Clipboard.Clear();
            Clipboard.SetText(txtResult.Text);
            }
        }
    }
}
medyo magulo pa yung code... I will optimize it pag may time :) ;)

tnx sa pagshare sir seven!

Philippine Electronics Forum

Re: Globe Tattoo's USB HSDPA Modem:Interfacing to Hyperterminal and PL
« Reply #159 on: August 22, 2010, 09:01:02 PM »

 

Privacy Policy

Contact Us: elabph@yahoo.com