SerialLinkMgr.h
declares the serial link manager API. For more information on the serial link manager, see the chapter "Serial Communication" in the Palm OS Programmer's Companion.
Err SlkClose (void)
Err SlkCloseSocket (UInt16 socket)
SlkCloseSocket
frees system resources the serial link manager allocated for the socket. It does not free resources allocated and passed by the client, such as the buffers passed to SlkSetSocketListener; this is the client's responsibility. The caller is also responsible for closing the communications library used by this socket.
Err SlkFlushSocket (UInt16 socket, Int32 timeout)
Err SlkOpen (void)
Err SlkOpenSocket (UInt16 portID, UInt16 *socketP, Boolean staticSocket)
  |
|
Comm library reference number for socket. |
  |
|
Pointer to location for returning the socket ID. |
  |
|
If TRUE , *socketP contains the desired static socket number to open. If FALSE , any free socket number is assigned dynamically and opened. |
Err SlkReceivePacket (UInt16 socket, Boolean andOtherSockets, SlkPktHeaderPtr headerP, void* bodyP, UInt16 bodySize, Int32 timeout)
  |
-> |
The socket ID. |
  |
-> |
If TRUE , ignore destination in packet header. |
  |
<-> |
Pointer to the packet header buffer (size of SlkPktHeaderType). |
  |
<-> |
Pointer to the packet client data buffer. |
  |
-> |
Size of the client data buffer (maximum client data size which can be accommodated). |
  |
-> |
Maximum number of system ticks to wait for beginning of a packet; -1 means wait forever. |
  |
0 |
No error. |
  |
|
The socket was not open. |
  |
|
Timed out waiting for a packet. |
  |
|
The packet being received had an unexpected destination. |
  |
|
Invalid header checksum or packet CRC-16. |
  |
|
Client data buffer was too small for packet's client data. |
andOtherSockets
is FALSE
, this routine returns with an error code unless it gets a packet for the specific socket.
andOtherSockets
is TRUE
, this routine returns successfully if it sees any incoming packet from the communications library used by socket
.
bodySize
field.
Err SlkSendPacket (SlkPktHeaderPtr headerP, SlkWriteDataPtr writeList)
  |
<-> |
Pointer to the packet header structure with client information filled in (see Comments). |
  |
-> |
List of packet client data blocks (see Comments). |
  |
0 |
No error. |
  |
slkErrSocketNotOpen |
The socket was not open. |
  |
slkErrTimeOut |
Handshake timeout. |
size
field set to 0 (zero). This call blocks until the entire packet is sent out or until an error occurs.
Err SlkSetSocketListener (UInt16 socket, SlkSocketListenPtr socketP)
  |
0 |
No error. |
  |
|
Invalid parameter. |
  |
|
The socket was not open. |
SlkSocketListenType
structure, but instead saves the passed pointer to it, the structure
SlkSocketListenType
structure specifies pointers to the socket listener procedure and the data buffers for dispatching packets destined for this socket. Pointers to two buffers must be specified: the packet header buffer (size of SlkPktHeaderType
), and the packet body (client data) buffer. The packet body buffer must be large enough for the largest expected client data size. Both buffers may be application global variables or locked chunks allocated from the dynamic heap.
NOTE:  The application is responsible for freeing theSlkSocketListenType
structure or the allocated buffers when the socket is closed. The serial link manager doesn't do it.
Err SlkSocketPortID (UInt16 socket, UInt16 * portIDP)
  |
-> |
The socket ID. |
  |
<-> |
Pointer to location for returning the port ID. |
Err SlkSocketSetTimeout (UInt16 socket, Int32 timeout)
  |   |