
|

ASTA Pocket
Studio Support
Palm Side
The Complete ASTA Handheld Architecure
is explained On Line at the ASTA Wireless Site.The following files are
included in the ASTA Pocket Studio Evaluation
| Files Included |
Description |
Comment |
| AstaLib.prc |
Shared Library that contains the implementation of the ASTA Palm Library that must be loaded on the Palm or in
POSE. |
Currently needs to reside in the directory of your Pocket Studio Project. |
| AstaLib.pas |
Pocket studio interface library for AstaLib.prc. |
Currently needs to reside in the directory of your Pocket Studio Project. |
| AstaStart.ppr |
Template ASTA client that shows how to connect to a server. |
Also shows how to save the Ipaddress and Port in the palm preferences. |
| PalmSQL.ppr |
Pocket Studio sample project showing how to query a remote ASTA Server
|
Shows how to use the AstaNestedParamList DataType that provides a string only Row/Column DataStructure similar
to a TDataSet so that multiple rows can be fetched from a remote server. |
| AstaFileTest.ppr |
Sample application that can fetch a text file from the AstaSkyWireDebug Server |
shows how to use blob calls with AstaParamLists and to write the text file to a palm memo |
| AstaSkyWireServer |
An Asta SkyWire Debug Server that doesn't use a database and logs all messages from remote PDA clients. See the
screen shot below of the debug server running. |
Allows the server to be secured so that username/passwords can v be defined and tested. |
Download the latest ASTA Pocket Studio Evaluation
Zip file
Getting Started Tips
| Make sure AstaLib.pas and AstaLib.prc are in the directory where your project is. |
Current versions of Pocket Studio require a copy of AstaLib.prc and AstaLib.pas in the directory of any project
using AstaLib.prc. In future versions of PocketStudio this will not be required. |
| Make sure that AstaLib.prc is loaded in POSE or on the Palm. |
|
| Set POSE to be tcp/ip enabled |
Right click on the Palm Emulator and then go to Settings/Properties and make sure that the checkbox Redirect NetLib
calls to TCP/IP is checked. |
Server Side
The TAstaPDAServerSocket, which descends from the TAstaServerSocket, provides support for Palm, WinCE and Linux
PDA Clients. Below is a description of the additional events available for the TAstaPDAServerSocket.
There are several additional events coded on the AstaPDAServerSocket in order to support remote PDA Clients
OnPdaParamList
This is the most important event as all the SendParamList calls from PDA clients will flow through this event.
The MsgToken comes from the remote Client call and if there is any kind of Error on the server just send a non-zero
value back in PdaSendParamList.
procedure TForm1.AstaServerSocket1PDAParamList(Sender: TObject;
ClientSocket: TCustomWinSocket; PDAid, MsgID, MsgToken: Integer;
P: TAstaParamList);
var
Error:Integer;
begin
Error:=0;
case MsgToken of
1001: Error:=DoPDAServerTime(ClientSocket, P);
1003: Error:=DoPalmSQLSelect(ClientSocket, P);
1004: Error:=DoPDATables(ClientSocket, P);
1005: Error:=DoPalmExecSQL(Clientsocket,p);
1006: Error:=DoPDAFields(ClientSocket, P);
1010: Error:=DoPalmMultiSQLSelect(ClientSocket, P);
1011: Error:=DoPDASelect(ClientSocket, P);
1012: Error:=0DoPalmExecSQLParamList(ClientSocket,p);
else Error:=DoPDAServerTime(ClientSocket, P);
end;
AstaServerSocket1.PDASendParamList(Error, ClientSocket, P);
end;
|
Client Side Example
Below is a small code example of creating an AstaConnection and connecting to a remote Asta SkyWire server just
to see if it is available. Note the UserName and Password is being set.
Var
Conversation : Pointer;
OK : boolean;
BoolRes : boolean;
begin
OK := false;
AstaConnCreate(RefLib, Conversation);
AstaConnSetTimeout(RefLib,Conversation,1000); AstaConnSetAuthorizationOn(RefLib,Conversation,'Asta','Password',False);
AstaConnOpen(RefLib, Conversation, Connection.IPAddr, Connection.Port, BoolRes);
//try the server and see if it is available
if BoolRes then
begin
AstaConnClose(RefLib, Conversation, BoolRes);
Ok := true;
end; |
|