qqqabbc123 / mavlinkjava

Automatically exported from code.google.com/p/mavlinkjava
0 stars 0 forks source link

Newbie Question. Trying to get Parameter List #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Guillaume,

This is the first time I'm trying to interface into the Mavlink libraries and 
I'm running into some road blocks.  The first thing I want to try to do is read 
the parameter list.  Below is a code snippet.  I am always getting null 
messages when I try to getNextMessage.  Any thoughts?

            //open the port
            CommPort cPort = CommPortIdentifier.getPortIdentifier("COM4")
                    .open("testApp", 5000);
            DataInputStream dis = new DataInputStream(cPort.getInputStream());

            MAVLinkReader reader = new MAVLinkReader(dis, IMAVLinkMessage.MAVPROT_PACKET_START_V10);
            MAVLinkMessage msg;

            requestParameterList(cPort);
            while (true) {
                msg = getNextMessage(reader);
                if (msg != null) {
                    // Do your stuff

                }
            }

private static void requestParameterList(CommPort cPort) throws IOException {
        msg_param_request_list pr = new msg_param_request_list(1, 1);
        byte[] result = pr.encode();
        DataOutputStream dos = new DataOutputStream(cPort.getOutputStream());

        dos.write(result);
    }

Original issue reported on code.google.com by christop...@yahoo.com on 25 Apr 2014 at 5:52

GoogleCodeExporter commented 8 years ago
Hello ,
I am trying to use mavlink to build my own uav android controller and i am also 
having trouble integrating with mavlink.
Please let me Kwon if you manage to get the parameter list.
That is what I'am trying to do and i will let you know of  my progress, if i 
get it to work i will provide a sample code for the integration.

Best Regards,

Alan Costa 

Original comment by alan.co...@stormsec.com.br on 27 Apr 2014 at 3:53

GoogleCodeExporter commented 8 years ago
Hello,

the project has moved here :
https://github.com/ghelle/MAVLinkJava 

Have a look to TestMavlinkReader.java in org.mavlink.library to read Mavlink 
messages.

ghelle31@gmail.com

Original comment by ghell...@gmail.com on 19 May 2015 at 9:55