Exception at runtime on MacOS 10.11.5

4 views
Skip to first unread message

Gil THOMAS

unread,
Jul 8, 2016, 3:13:58 AM7/8/16
to SerialPundit
Hi Rishi,

Thanks for your scm library, great job. It works like a charm on Windows 10 computer.

I put my project in a Mac. I update the path for pre built jar sp-core and sp-tty.

I built the project with problems. But when I want to run I have this error : 
Can not get shared library spcommacx64.dylib resource as stream from sp-tty.jar

I read the post of Lupo Dhaarkael with your clear answer. I use Netbeans with the same configuration on both computers.

Any idea ?

Many Thanks

Gil

Rishi Gupta

unread,
Jul 8, 2016, 5:38:55 AM7/8/16
to SerialPundit
Hi Thomas, Thanks for using the library.

Please use latest sp-core.jar and sp-tty.jar from https://github.com/RishiGupta12/SerialPundit/tree/master/prebuilt-release

I have updated them just now.

Gil THOMAS

unread,
Jul 8, 2016, 6:08:00 AM7/8/16
to SerialPundit
Many thanks for your quick reply...

It's working fine now on the Mac....

The difficulties are only beginning  -:) I want to use it for dowloading tracks from a GPS

Rishi Gupta

unread,
Jul 8, 2016, 6:31:55 AM7/8/16
to SerialPundit
This folder contains many examples that you can use quickly for GPS https://github.com/RishiGupta12/SerialPundit/tree/master/applications

Gil THOMAS

unread,
Jul 8, 2016, 8:19:26 AM7/8/16
to SerialPundit
Hi Rishi,

In advance we thank you for your help. It seems, largely, to be working. 

I'm going to rewrite a big visual basic program of paragliding flights GPS tracks in Java. I'm actually not very good in Java  and I hope to progress further :-)

To download a track from the GPS, we send only one sentence ("$PFMDNL...") to the serial port. After this, the GPS send all data bytes to the serial port. The difficulty is to get all bytes of the track. 

I work with your test ss.test43-OC-Datalistener. Everything looks so good but can you validate the process ?

In DataListener, I put a buffer of bytes...

class DataListener extends Serial implements ISerialComDataListener {

        static  byte[] BufferRead = new byte[1048576];
        static int Lenarg = 0;
int y = 0;
       

@Override
public void onNewSerialDataAvailable(byte[] arg0) {

                System.arraycopy(arg0, 0, BufferRead, Lenarg, arg0.length);
                Lenarg += arg0.length;              
y = y + arg0.length;
if(y >= 1) {
exit.set(true);
}              
}
In the main method, I put this :

if(scm.writeString(handle, "$PFMDNL,160703144207,2\n", 0) == true) {
                        System.out.println("$PFMDNL,160703144207,2 envoyé \n");
                }
                                               
                // wait till data listener has received all the data
                while(exit.get() == false) {
                        Thread.sleep(600);
                }
                exit.set(false);
                
In your opinion, is 600ms a good value ?

Many thanks for your assistance, and your great work.

rishi gupta

unread,
Jul 9, 2016, 3:13:29 AM7/9/16
to Gil THOMAS, SerialPundit

1. Use wait notify mechanism of java instead of thread.sleep.
2. No need of y. If the required number of bytes have been received notify main thread.
3. Use examples from application folder not from tests folder in repository.

--
You received this message because you are subscribed to the Google Groups "SerialPundit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to SerialPundit...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/SerialPundit/7f156eeb-65c4-4e63-aeb8-6cbf50286a30%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gil THOMAS

unread,
Jul 9, 2016, 4:03:54 AM7/9/16
to SerialPundit, gilth...@gmail.com
Hi Rishi,

...If the required number of bytes have been received notify main thread...

The problem is that we don't know the number of expected bytes... It may vary between  1000 bytes and 1 0000 000 bytes depending on flight time and recording points interval.

Thank you a lot for your valued assistance and your fantastic work. If I can implement this big project, you will be credited in the program and a big link in our web site.
Reply all
Reply to author
Forward
0 new messages