No reply on comm port (IR port)


Thread Starter

Sandeep Shroff

Dear List Members
I am trying to develop an EVB application which would read specific information from mobile phone on IR port using AT command set.

The hardware setup for testing is HP jornada HPC and a nokia 8250.

I have developed a test code thru which I am sending the AT command and awaiting for response.

On transmission of the command the IR indication on the mobile is becoming steady.
But my problem is ---- I am unable to get a receive response from the mobile I have tried using OnComm event as well as continous polling. But with no success.

I have tried the same setup using Easy SMS application. I am able to send a message thru HP jornada. I also get an acknowledgement on the same.

Is there any specific Mscomm setting required or where am I going wrong?
Any pointers or suggestion would be of great help.

--- Sandeep

My comm settings are ------------
CommPort = 3
Settings = "9600,N,8,1"
InputLen = 0
InputMode = 0
NullDiscard = 0 'False
ParityReplace = "?"
RThreshold = 1
SThreshold = 0
Handshaking = 0
DTREnable = -1 'True
RTSEnable = -1 'True
Attached is the code which I am using -----------------

Option Explicit
Public setting As String
Public baudrate As String
Public Count As Integer

Private Sub CmdSend_Click()
Dim s As String
Dim InString As String
s = TxtSend.Text + vbCr
MsgBox s
Comm1.Output = s
' InString = Comm1.Input
' MsgBox InString
'Loop Until Len(InString) > 0
End Sub

Private Sub CmdStart_Click()
Dim i
Comm1.CommPort = TxtComport.Text

Comm1.Settings = TxtBaudrate.Text & "," & TxtDatabits.Text _
& "," & TxtParity.Text & "," & TxtStopbit.Text
MsgBox Comm1.Settings & " , COMM =" & Comm1.CommPort
Comm1.PortOpen = True
CmdStart.Enabled = False
CmdStop.Enabled = True
End Sub

Private Sub CmdStop_Click()
Comm1.PortOpen = False
CmdStop.Enabled = False
CmdStart.Enabled = True
End Sub

Private Sub Comm1_OnComm()
'On Error Resume Next
Dim InString
Dim MyString
If Comm1.CommEvent = comEvReceive Then
MsgBox "in comEvReceive"
'Incoming data
'Received Rthreshold number of characters.
'This event is generated continuously until
'you use the Input property to remove the
'data from the receive buffer.
ShowErr 'Show errors, if there are any.
'Clear receive buffer and assign to a variable
InString = Comm1.Input
ShowErr 'Show errors, if there are any.
'Assign "previously received" string to a variable
TxtRecv = InString
ShowErr 'Show errors, if there are any.
End If
End Sub

Private Sub Form_Load()
Dim temp As String
setting = Comm1.Settings
TxtComport.Text = Comm1.CommPort
Count = InStr(1, setting, ",", 1)
'MsgBox Count
'baudrate = Left(setting, Count)
'TxtBaudrate.Text = Left(setting, Count)

'TxtDatabits.Text = Left(temp, 1)
TxtBaudrate.Text = "9600"
TxtDatabits.Text = "8"
TxtParity.Text = "N"
TxtStopbit.Text = "1"
CmdStart.Enabled = True
CmdStop.Enabled = False

End Sub