PostFrontal Forum
PostFrontal Forum
LK8000_Support_Forum | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 LK8000 International Support
 Developers
 Accessing comport from code

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
sundancer Posted - 17/03/2015 : 12:58:12
Helo
I got stucked on IO problem. The task I am trying to do is to make a special build for my home made instrument (KOBO + arduino board). I want to implement special sound alarms. My idea is to modify PlayResource function in sound.cpp to send special string code to Kobo com port (this is already in device setup). The external device will then play the sound.

Can anyone give me some hint about this?

I read that there is IRC chanel, but there is noone. Is there also a skype channel? Are there some developers active?
15   L A T E S T    R E P L I E S    (Newest First)
jaaaaf Posted - 14/04/2015 : 20:33:39
I actually work on it.
But weather was good this week end and I flew instead of working on it, sorry...
Hope to do it soon, but plenty of thing to do.
sundancer Posted - 14/04/2015 : 20:16:59
OK. Its nice to say that we need it. But who and when will implement it? I have to say that I am not able to do it now during the season :/ sorry. But it would be still nice to have sound alarms in e-reader based instruments...
brunotl Posted - 31/03/2015 : 00:22:35
I totaly agree, we need solutions for all device, not only one, in any case it's the goal ...
Jaros Posted - 30/03/2015 : 21:09:19
quote:
Originally posted by jaaaaf
Still not working for now on my GoFly, but nmea strings are sent.


Hi,
Sorry for my absence, but I am back. I already sent email to jaaaaf pointing out possible issue.
I would like to stay away from custom drivers and things like that.
Today it is goflyv4, tomorrow it might be goflyv5, or bluearduinofly v39.
I am not proud of my solution which was done dirty way in my xcsoar build, just to fulfill multiple requests from pilots who needed this asap for competition.
Idea that should work for everybody who loves LK8000 and want to make external devices and not just for my projects is to create "generic notification output protocol". We are wasting time for another custom protocol, which sooner or later might be obsolete.
I sent email before, to use already existing sound files name convention. As we know, there is multiple WAV sound files used by LK8000 and I do not think that this will change anytime soon.
We could use the same file names for string outputs, to play similar sounds on external device.
For example, if lk8000 has to play LK_LANDING.WAV file, let's send at the same moment string with file name over serial output with checksum,for example:
$LK_LANDING.WAV*71

This method will allow to have diversity in external devices, and everybody can handle them anyway they want, but everything will be based on the same notification source.

my two cents
regards
Jarek
Coolwind Posted - 29/03/2015 : 17:29:13
understand. yes conversion table is an idea
jaaaaf Posted - 29/03/2015 : 11:44:45
Coolwind, it's easy, like I said before, just implement the method DevGoFlyV4::SendAlarm(PDeviceDescriptor_t d, int alarmId )
You can make a conversion table, or you can just send the alarm id you receive, if your sending device know how to interpret it.
With the conversion table, you can make a conversion for sound you really want to be different, and default sounds for others.

This method has also the advantage to have only one build for different devices receiving NMEA sentences. You just have to change the device used on LK config, on your device.
Coolwind Posted - 28/03/2015 : 16:33:58
Exactly. And I am quite curious to know how you are going to make different sound in the source code without changing it.
I have already told what was the correct approach to do this, and not to create a device in LK for a simple playsound, so I wait to see what comes next.
jaaaaf Posted - 28/03/2015 : 15:19:47
It's not a good idea to take it now like this.
For now it doesn't work on my device, and it's not finished! Actually all sounds will be the same (if there is any sounds).
parapenT1sta Posted - 28/03/2015 : 15:17:29
Bruno, can you merge the Jaaaf code to your branch? I think a lot pilots with V4 would like to test it.
brunotl Posted - 28/03/2015 : 15:12:54
i think way used by jaaaf, is the best for avoid side effect.
Coolwind Posted - 27/03/2015 : 22:51:29
you too have to change the code if you want to use more than 1 sound (GFPALARM,1) .
For me it is a complicated way of doing a simple work, but for fun anything is possible of course.
jaaaaf Posted - 27/03/2015 : 22:17:38
Yes, you can do like Coolwind said. But you need to put your code everywhere you want to write sounds.

If you want to do it in my way, I update my code in a most complete commit here: https://github.com/jaaaaf/LK8000/commit/86cdb5b2a0741ccdbab9f02b0fb9e5367a3488aa
(come modifications was missing to works in the last commit I made)

Still not working for now on my GoFly, but nmea strings are sent.
Coolwind Posted - 26/03/2015 : 17:32:19
Can you provide an example of what you need to send to the device through the com port?
Because if it is something short, you dont need to do anything special through com ports, you simply access the device itself from the code.

If I am not wrong, all you want is to write something like GPFALARM,1 to the device.
The easy way: open the device and write to it, then close it.
To make it async, write to a named pipe, or to a message queue, and have a separate standalone (out of LK) little program that read the pipe or message queue and writes to device.

The most complicated way: create a device in LK for a simple operation like that..
The device name can be a link to the real one, so even if you change real device, the link is always available.

Where is the problem to do so?
jaaaaf Posted - 26/03/2015 : 13:37:34
Check this commit: https://github.com/jaaaaf/LK8000/commit/638c0fe9742ecbaac0257ee5565c66a6e0b6a73c
Hope it works, I'm not very strong with git...

You just have to do the same thing as devGoFlyV4.cpp and devGoFlyV4.h, and implement as you want the method : DevGoFlyV4::SendAlarm(PDeviceDescriptor_t d, int alarmId )
jaaaaf Posted - 26/03/2015 : 12:51:20
Yes you can make another device for you, based on the gofly one. There will be very few code to make.
I will check if my code is still usable, and I will share it.

I tell you here when it's done. Hope I can do it today.

PostFrontal Forum © PostFrontal - La community del Volo a Vela Go To Top Of Page
This page was generated in 0.16 seconds. Snitz Forums 2000

Since 2006, owned and maintained by PostFrontal S.A.S. di Giuliano Golfieri & c. - VAT ID: IT05264240960
THIS WEBSITE ONLY USES FUNCTIONAL COOKIES
Privacy & Cookie Policy