Sub Process_Globals
Type MqttData (topic As String,value As String,status As String,happen As Long) <<---
End Sub
Private Sub client_MessageArrived (Topic As String, Payload() As Byte)
Dim receivedObject As Object = serializator.ConvertBytesToObject(Payload) <<------ Exception
If Topic = "all/connect" Or Topic = "all/disconnect" Then
'new client has connected or disconnected
Dim newUser As String = receivedObject
Else if Topic = "all/users" Then
Dim newUsers As List = receivedObject
CallSubDelayed2(Chat, "NewUsers", newUsers) 'this will start the chat activity if it wasn't started yet.
Else if Topic.IndexOf("iot/plc1/")>0 Then
Dim m As MqttData = receivedObject
Log("topic" & Topic & "," & m)
CallSubDelayed2(Chat, "NewMessage",m)
End If
End Sub