Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB to Aspect - Handset keystroke emulation 1

Status
Not open for further replies.

AquaTek

Technical User
Oct 22, 2004
5
CA
Trying to convert these VB cmds to Aspect.
I'm sending cmds to a mobile phone's Ctrl Port to emulate handset keystrokes via the PC's direct-connect com port.

Extracts of a VB code:
'****constants for the data byte representation of
keystrokes****
'****to duplicate handset actions, a button depression
must be sent and then followed by a button release
message, along with the associated authentication
messages****

Public Const keyRelease As Byte = &H0
Public Const keyOne As Byte = &H1
Public Const keyTwo As Byte = &H2,&H3,&H4, etc...
Public Const keySend As Byte = &HD
Public Const keyEnd As Byte = &HE
Public Const keyClr As Byte = &H11
Public Const keySto As Byte = &H12
Public Const keyRcl As Byte = &H13
Public Const keyDown As Byte = &H14
Public Const keyUp As Byte = &H15
Public Const keyMenu As Byte = &H16, etc....

Also, would I use the 'Transmit' or the 'Comwrite'?
I am a novice at Aspect scripts, so go easy on me, pls.

Thanks in advance !!

AquaTek
 
I'm not familiar with VB, but does for example &H14 mean a hexadecimal value of 14? If so, you could use transmit "`x014" to send this value, "`x001" for &H1 and so forth.


aspect@aspectscripting.com
 
Thanks for your prompt reply Knob !
Yes, Visual Basic is using the format mentioned.
VB code that I am trying to decypher for my ProCom script.
The &H14 does mean 14Hex, etc...
I tried using >transmit "`x014" to send this value and I could not yet get a response from the mobile phone, as yet.
I need to write a routine to retrieve messages from the phone, ie. >ComgetC.... This would tell me if the >transmit value was successful. Any suggestions ??
Much appreciated!
AquaTek
 
How does the system return a result, with one byte or a string? If it's a single byte you are expecting, then comgetc is usually the way to go. Otherwise, I would recommend either using waitfor or when target (if the messages are constant in nature), or you can use rget if the messages vary.

When you run your current script with the transmit command, are you seeing a response from the system on the screen? You might try using Procomm's Monitor Window in case the returned data is non-printable. Here is some more information on how to use this feature:

Procomm's Monitor Window can be used to view the incoming and outgoing data, in both hex and ASCII format. To activate this window, select the Data | Monitor Window menu item. Resize the Monitor Window so that you can view the entire width of the window, then click back in the Procomm Plus window so that the Monitor Window does not have focus. Incoming text is displayed in red, while text you send is colored blue. The Monitor Window can be handy for viewing incoming escape sequences (to determine if Procomm Plus is responding properly to them) or to verify that the program is sending the data you think it should be.

aspect@aspectscripting.com
 
Appreciate your feedback knob!
The Monitor Window ! really didn't know it existed! Awesome.

As for the 'Return of results': one byte or string: Still don't know, but I believe it is a string.
Haven't had much time to work on this project, but all the help you can provide is much appreciated !!!!!
Below, I included the Control Port Mode Message Response.
I hope you can figure this out:
It says: The system responds with the following message in response to the keystroke message:
Byte Message Fields
0 Type = Echo of Received Message
1 Message ID = Echo of Received Message
2 Size = 1
3 ACK/NACK = 0
4 CCITT CRC Bits (15:08)
5 CCITT CRC Bits (07:00)

And for KeyStroke Messages:
It says: To duplicate the handset actions, a button depression must be sent, and then followed by a button release message along with the associated authentication messages.
Byte Message Fields
0 Type = A0(hex)
1 Message ID = 01
2 Size = 2
3 00
4 KeyHit (see below)
5 CCITT CRC Bits (15:08)
6 CCITT CRC Bits (07:00)

Useable keystrokes(KeyHits)
Data Byte Equivalent Keystrokes
00(hex) Key Release
01 1 key
02 2 key
03 3 key
etc..
0A 0 key
0D Send key
0E End key
11 Clr key
12 Store key
13 Rcl key
etc..

thanks for your time !
AquaTek
 
knob
Website: Not that I know of, but I will look into it tonight and let you know.
I will also verify my cable connection to this phone terminal, maybe there is an issue with it.
Thanks
AquaTek
 
knob: No online info available.
I could always bring the 30 pages or so home tomorrow and scan to PDF file.
Do you have an email address I could send it to ?
My 'cts' light is not ON. I may have to use the SIG GND (1,8 or11) on my DB9 & DB15 connection, to get my Clear-to-Send to light up.
Soon & Thanks!
A.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top