Home Forums Support Trying SendReceiveObject to get a message from a device

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #786
    Anonymous
    Inactive

    I snagged the library to try and quickly mock up a proof of concept program where I need to query a network-connected device (and not a very smart device). I need to send it a byte sequence to query various parameters, and I get back a byte sequence that contains the info I want in it.

    I’m completely bombing out.

    I tried something like this:

    byte [] deviceCmd = {.. set up the outgoing command sequence here … };

    var response = NetworkComms.SendReceiveObject<byte[]>(“Message”, ipAddress, port, “byte[]”, 2000, deviceCmd);

    Admittedly, a lot of this is “by guess and by golly” based on the tutorial samples. Is there an easy way to do what I want, or is this library too high a level for some basic socket interfacing to a device?

    Thanks.

    #787
    Anonymous
    Inactive

    Heya GuyWithDogs,

    Welcome to our forum and many thanks for your interest in our library.

    Could you show me how you are configuring the server side? You mention the tutorial samples but just to check have you also seen this article on synchronous send and receive.

    Regards,

    Marc

    #788
    Anonymous
    Inactive

    There is no server side. There’s a device on the network at 192.168.4.5 (i.e. an IP address that I know) and a known port (e.g. 5000).

    So in my example,

    var response = NetworkComms.SendReceiveObject<byte[]>(“Message”, ipAddress, port, “byte[]“, 2000, deviceCmd);

    ipAddress would be “192.168.4.5” and port would be 5000.

    Based on what I’d looked at, I thought that the underlying “stuff” would make the connection, do the transfer, and return some type of result.

    #789
    Anonymous
    Inactive

    If only all networking were that simple. You were correct in your earlier post in that networkcomms.net is a too high level communications library for that. What you are after is much more barebones and you will most likely have to code all of the socket level functionality yourself.

    Sorry I couldn’t be more help.

    Regards,

    Marc

    #790
    Anonymous
    Inactive

    Thanks for getting back to me and confirming my suspicions/fears. Part of my hope was that if I had issues with a third-party program, it would substantiate my growing feeling that there’s a problem in the server implementation in the device. My code’s always the first suspect when there’s a problem. Which is not necessarily an unfair assumption, but you have to remove pieces to get to the truth…

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.