"AT + CSQ" Vb.net 2003
"AT + CSQ" Vb.net 2003
"AT + CSQ" Vb.net 2003
"AT + CSQ" Vb.net 2003
"AT + CSQ" Vb.net 2003
"AT + CSQ" Vb.net 2003 "AT + CSQ" Vb.net 2003 "AT + CSQ" Vb.net 2003 "AT + CSQ" Vb.net 2003 "AT + CSQ" Vb.net 2003 "AT + CSQ" Vb.net 2003 "AT + CSQ" Vb.net 2003 "AT + CSQ" Vb.net 2003
"AT + CSQ" Vb.net 2003 "AT + CSQ" Vb.net 2003
"AT + CSQ" Vb.net 2003
Go Back  Xtreme Visual Basic Talk > > > "AT + CSQ" Vb.net 2003


Reply
 
Thread Tools Display Modes
  #1  
Old 01-13-2006, 06:23 AM
nicolacolacicco nicolacolacicco is offline
Newcomer
 
Join Date: Oct 2005
Posts: 8
Default "AT + CSQ" Vb.net 2003


Hi,
I'm trying in exsasperate way to make use AT controls for modem gprs running by vb.net 2003. At first I am interested to signal network’s measure and so I utilize AT+CSQ controls and this are my little program’s steps:
1)through APi CreateFile I achieve com1‘s handle and GPRS modem correspond it;
2)through APi WriteFile I send "AT+CSQ" & vbcr controls;
3)through APi ReadFile I read, I convert from byte to stringa what the modem should send me, all closed in a cycle while, since ReadFile doesn’t do back reading signal.
Only positive answer that I achieve to the program is the com1’s Handle because in a textbox I succeed to write only the Handle’s numerical value but at the end the program doesn’t give me back nothing. Moreover I don’t succeed to make the debugger because when I connect the pocket to pc, the com1 don’t answer anymore. Someone can give me some suggestions, please? I am desperate!
I prefer not to use the OPENETCF's class

Sorry for my little English

TanKs By Nick and Dany
Reply With Quote
  #2  
Old 01-13-2006, 07:03 AM
PrOpHeT's Avatar
PrOpHeT"AT + CSQ" Vb.net 2003 PrOpHeT is offline
Hopelessly confused...

* Expert *
 
Join Date: Mar 2001
Location: Tyler, Tx.
Posts: 3,055
Default

Have a look at

http://ourworld.compuserve.com/homep...opSerialIO.htm

easiest way I have found yet for serial io in .net
__________________
When you earnestly believe you can compensate for a lack of skill by doubling your efforts, there's no end to what you can't do ;)

For the love of Gold...
Reply With Quote
  #3  
Old 01-13-2006, 09:17 AM
nicolacolacicco nicolacolacicco is offline
Newcomer
 
Join Date: Oct 2005
Posts: 8
Default

Hi,
I can't use Desktopserial because it is not compatible in .NetCompact
Reply With Quote
  #4  
Old 01-13-2006, 10:08 AM
Sonreir's Avatar
Sonreir Sonreir is offline
Contributor
 
Join Date: Jul 2004
Location: Hampshire, England
Posts: 540
Default

I'm not sure how much of this works in compact editions, but here's the sub I use to write to my serial modem:

Code:
Private Overloads Sub Write(ByVal Buffer As Byte()) If mbooFailure Then Exit Sub If Not IsOpen Then Open() lastCommand = Buffer Dim iBytesWritten, iRc As Integer If mhRS = -1 Then 'Throw New ApplicationException("Please initialize and open port before using this method") Debug.WriteLine("Please initialize and open port before using this method") mbooFailure = True Else ' Transmit data to COM Port Try If meMode = Mode.Overlapped Then ' Overlapped write If pHandleOverlappedWrite(Buffer) Then Throw New ApplicationException("Error in overlapped write") End If Else ' Clears IO buffers PurgeComm(mhRS, PURGE_RXCLEAR Or PURGE_TXCLEAR) iRc = WriteFile(mhRS, Buffer, Buffer.Length, iBytesWritten, Nothing) 'WriteFile is the API function If iRc = 0 Then Throw New ApplicationException("Write Error - Bytes Written " & iBytesWritten.ToString & " of " & Buffer.Length.ToString) End If End If Catch Ex As Exception 'ignore exceptions End Try End If End Sub

Then to read:
Code:
Private Function Read(ByVal Bytes2Read As Integer) As Integer Dim iReadChars, iRc As Integer ' If Bytes2Read not specified uses Buffersize If Bytes2Read = 0 Then Bytes2Read = miBufferSize If mhRS = -1 Then Throw New ApplicationException("Please initialize and open port before using this method") Else ' Get bytes from port Try ' Purge buffers 'PurgeComm(mhRS, PURGE_RXCLEAR Or PURGE_TXCLEAR) ' Creates an event for overlapped operations If meMode = Mode.Overlapped Then pHandleOverlappedRead(Bytes2Read) Else ' Non overlapped mode ReDim mabtRxBuf(Bytes2Read - 1) iRc = ReadFile(mhRS, mabtRxBuf, Bytes2Read, iReadChars, Nothing) If iRc = 0 Then ' Read Error Throw New ApplicationException("ReadFile error " & iRc.ToString) Else ' Handles timeout or returns input chars If iReadChars < Bytes2Read Then Throw New IOTimeoutException("Timeout error") Else mbWaitOnRead = True Return (iReadChars) End If End If End If Catch Ex As Exception ' Others generic errors Throw New ApplicationException("Read Error: " & Ex.Message, Ex) End Try End If End Function

I'm doing the reading with a timer tick event, so I am pretty much always trying to read the serial port. The byte(s) that are read will be in the mabtRxBuf variable. I realize that this may be kind of confusing and if I could explain it better I would, but I found this code a long time ago and never spent much time on figuring it out because it worked and I didn't need to mess with it very much.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
&quot;AT + CSQ&quot; Vb.net 2003
&quot;AT + CSQ&quot; Vb.net 2003
&quot;AT + CSQ&quot; Vb.net 2003 &quot;AT + CSQ&quot; Vb.net 2003
&quot;AT + CSQ&quot; Vb.net 2003
&quot;AT + CSQ&quot; Vb.net 2003
&quot;AT + CSQ&quot; Vb.net 2003 &quot;AT + CSQ&quot; Vb.net 2003 &quot;AT + CSQ&quot; Vb.net 2003 &quot;AT + CSQ&quot; Vb.net 2003 &quot;AT + CSQ&quot; Vb.net 2003 &quot;AT + CSQ&quot; Vb.net 2003 &quot;AT + CSQ&quot; Vb.net 2003
&quot;AT + CSQ&quot; Vb.net 2003
&quot;AT + CSQ&quot; Vb.net 2003
 
&quot;AT + CSQ&quot; Vb.net 2003
&quot;AT + CSQ&quot; Vb.net 2003
 
-->