Hello,
I have an arduino mega device with ethernet shield, user may send commands through USB or Ethernet connection then direct these commands to command handler, the problem is i want to direct results from command handler to its source(SendStreamMessage sub), for example how can I send this to both USB and ethernet.
Thanks
I have an arduino mega device with ethernet shield, user may send commands through USB or Ethernet connection then direct these commands to command handler, the problem is i want to direct results from command handler to its source(SendStreamMessage sub), for example how can I send this to both USB and ethernet.
Thanks
B4X:
Log(0x02,CMD_READ,REG_DATE_TIME,0x0C,Years - 2000,Months,DayOfMonth,DayOfWeek,Hours,Minutes,Seconds,0x04)
B4X:
private Sub GetUSBstream(Buffer() As Byte)
CommandHandler(Buffer,SYS_STREAM_SOURCE_USB)
End Sub
Private Sub GetEthernetStream (Buffer() As Byte)
CommandHandler(Buffer,SYS_STREAM_SOURCE_ETHERNET)
End Sub
private Sub CommandHandler(Buffer () As Byte, StreamSource As Byte)
'execute command and send result to SendStreamMessage
End Sub
private Sub SendStreamMessage(Message As String, StreamSource As Byte)
Select StreamSource
Case SYS_STREAM_SOURCE_USB
Case SYS_STREAM_SOURCE_ETHERNET '????
End Select
End Sub