Amulets & Armor  v1.02
Open Source Game
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
Functions
PACKET

Packet Communications. More...

Functions

T_sword16 PacketGet (T_packetLong *p_packet)
 
T_void PacketReceiveData (T_void *p_data, T_word16 size)
 
T_sword16 PacketSend (T_packetEitherShortOrLong *p_packet)
 
T_sword16 PacketSendAnyLength (T_packetEitherShortOrLong *p_anyPacket)
 
T_sword16 PacketSendLong (T_packetLong *p_longPacket)
 
T_sword16 PacketSendShort (T_packetShort *p_shortPacket)
 
T_void PacketSetId (T_packetEitherShortOrLong *p_packet, T_word32 packetID)
 

Detailed Description

Packet Communications.

The low level "packets" in the networking are sent and received here. They are classified into two sizes: Short or Long. This old packet layer interfaces to the raw serial communications. This code is DEPRECATED!

See Also
http://www.amuletsandarmor.com/AALicense.txt

The low level "packets" in the networking are sent and received here. They are classified into two sizes: Short or Long. This packet layer interfaces to the Direct Talk communications layer.

See Also
http://www.amuletsandarmor.com/AALicense.txt

Function Documentation

T_sword16 PacketGet ( T_packetLong p_packet)

PacketGet is the routine called to retrieve a packet from the currently active communications port. If no packet is found, a -1 is returned. If a packet is found, a 0 is returned.

Parameters
p_packet– Packet location to receive data. Note that you must have room allocated for a long packet in case either a long or a short packet is received. You will want to check the packet type if you do receive data.
Returns
Resultant flag. A -1 means no packet was received. A 0 means a packet was found.
T_void PacketReceiveData ( T_void p_data,
T_word16  size 
)
T_sword16 PacketSend ( T_packetEitherShortOrLong p_packet)

PacketSend sends either a short or a long packet out the current communications port.

Parameters
p_packet– packet to send.
T_sword16 PacketSendAnyLength ( T_packetEitherShortOrLong p_anyPacket)

PacketSendAnyLength sends a packet of any size up to a long packet size out the active communications port.

Parameters
p_anyPacket– packet to send.
Returns
0 if packet sent, -1 if not sent
T_sword16 PacketSendLong ( T_packetLong p_longPacket)

PacketSendLong sends a long packet of 80 characters out the currently active communications port.

Parameters
p_longPacket– Packet with data entry filled. The rest of the fields will be filled out.
Returns
0 if packet sent, -1 if not sent
T_sword16 PacketSendShort ( T_packetShort p_shortPacket)

PacketSendShort is called to small (about 16 byte) packets out the currently active communications port.

Parameters
p_shortPacket– Packet with data entry filled. The rest of the fields will be filled out.
Returns
0 if packet sent, -1 if not sent
T_void PacketSetId ( T_packetEitherShortOrLong p_packet,
T_word32  packetID 
)

PacketSetId sets the packet Id. THIS SHOULD ONLY BE CALLED FROM WITHIN CMDQUEUE.

Parameters
p_packet– Pointer to packet whose ID must be p_packet changed.
packetID– New ID to assign to the packet.