Start Back Next End
  
ZBasic System Library
ZBasic Microcontrollers
36
Net.SetCallback
Type
Function returning Integer
Invocation
Net.SendStr(handle, callback)
Parameter
Method
Type
Description
handle
ByVal
anyIntegral
The handle, previously returned by Net.Open(), to use.
callback
ByVal
UnsignedLong
The address of the callback procedure.
Discussion
This function associates a callback routine with the network handle.  The callback will be invoked for each
of several different events related to the network handle.  The callback routine must be defined thus:
Sub netCallback(ByVal cbtype as Byte, ByVal handle as Integer, _
    ByRef data() as Byte, ByVal cnt as UnsignedInteger)
End Sub
In all cases, the handle parameter gives the network handle associated with the event.  The cbtype
parameter indicates the type of event that evoked the callback as described in the table below.  The data
and cnt parameters are valid only for certain callback types.
Callback Type Designators
Value
Meaning
0
A connection occurred.
1
A disconnect occurred.
2
Data was received, the data and cnt parameters are valid.
3
A send data function was instigated.
4
The send data request was completed.
5
A reconnection occurred.
 
Previous page Top Next page