demo.bas 762 Bytes
Newer Older
Franz's avatar
Franz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
Attribute VB_Name = "Module1"
Public Function callback1(ByVal con As Long, ByRef pkt As xbee_pkt) As Long
    ' Check the returned status, if it isnt 0 then an error occured
    If pkt.status <> 0 Then
        Form1.tb.Text = Form1.tb.Text & vbNewLine & "An error occured (" & pkt.status & ")"
        Exit Function
    End If
    
    ' Display the Node Identifier
    Form1.tb.Text = Form1.tb.Text & vbNewLine & "Node Identifier:" & StrConv(pkt.data, vbUnicode)
    Form1.tb.SelStart = Len(Form1.tb.Text)
End Function

Public Function callback2(ByVal con As Long, ByRef pkt As xbee_pkt) As Long
    ' Display the data
    Form1.tb.Text = Form1.tb.Text & vbNewLine & "Rx:" & StrConv(pkt.data, vbUnicode)
    Form1.tb.SelStart = Len(Form1.tb.Text)
End Function