CALL gm.freeze.msg (reply, hd[], $data[], end.marker, status)

 

Function

Submit a message to the communication service task for transmission to the host.

Input Parameters
reply TRUE if a reply is desired; otherwise, FALSE.
hd[ ]

An array representing the header for the message, with the uc.hd.stream, uc.hd.function, and uc.hd.sys.# elements filled. The routine gm.new.head (stream, function, hd[]) is the most appropriate way to create this header.

$data[ ]

The stream of bytes, fully PACK'ed, representing the message. "s2.pack.*" subprograms can be used to create this $data[ ] array.

end.marker

The total length, in bytes, of the message. Or, equivalently, the byte number (starting at 1) of the first byte in the data stream to NOT send; hence an "end" location.

Output Parameter

status

0 if the message was successfully frozen, or 1 if not (meaning that the queue is FULL).

Details

This subroutine provides an alternative to gm.usersend (reply, hd[], length, $data[], timer, status). Instead of sending a message to the host immediately and waiting (an arbitrary period of time) for a reply (if any), this routine allows you to "freeze", or queue, a message, which will be sent later by the service task. The calling program can then continue without delay.

The size of the queue is controlled by the global variable gm.fz.size, which defaults to 10. The size specified is a count of the number of messages that can be held, not the total message size.

File: GEMENG.SQU

Related Routines

gm.com.test (status)
gm.estcom (control, status)
gm.new.head (stream, function, hd[])
gm.usersend (reply, hd[], length, $data[], timer, status)