LB Booster
Programming >> Liberty BASIC language >> Linking applications over wifi
http://lbb.conforums.com/index.cgi?board=lblang&action=display&num=1512973905

Linking applications over wifi
Post by flotulopex on Dec 11th, 2017, 05:31am

Hi All,

I have made an application that uses a "master" and a "slave" program. It's a Windows based Tablet that acts as a remote for a program running on a PC. Currently, the programs communicate over a serial RF link (home made).

Is there a way in LB/LBB to have this serial RF link working over à local wifi instead?
Re: Linking applications over wifi
Post by Richard Russell on Dec 11th, 2017, 08:24am

on Dec 11th, 2017, 05:31am, flotulopex wrote:
Is there a way in LB/LBB to have this serial RF link working over à local wifi instead?

If you adapt the programs to communicate using sockets, it will work whatever the connection medium. For testing you can run the 'master' and 'slave' program on the same PC, but they should then work equally well if connected over a Local Area Network (e.g. WiFi) or even on opposite sides of the world via the internet!

The only likely modification needed, compared with when the programs are running on the same PC, is to ensure that any timeouts are long enough to allow for potential connection and communication delays.

There's a good resource of example programs for socket programming in Liberty BASIC at the Bay Six forum.

Richard.

Re: Linking applications over wifi
Post by flotulopex on Dec 11th, 2017, 3:33pm

Thanks Richard.

Do you refer to, i.e., this thread: http://www.b6sw.com/forum/viewtopic.php?t=623&highlight=wifi+socket

If "yes", .......looks scary shocked

May I kindly suggest you (this is part of my "british like" humor) to create two simple commands in LBB called "SendWifi" and "ReceiveWiFi" to avoid tons of programming? grin

Dreaming, oh oh oh dreaming..... wink
Re: Linking applications over wifi
Post by Richard Russell on Dec 11th, 2017, 5:13pm

on Dec 11th, 2017, 3:33pm, flotulopex wrote:
May I kindly suggest you (this is part of my "british like" humor) to create two simple commands in LBB called "SendWifi" and "ReceiveWiFi"

The 'right' way to tackle this is to create a library. One of the advantages of LBB is built-in support for the 'include directive (LB Workshop provides something similar for LB 4) which allows you to 'pull in' a set of pre-written and pre-tested functions. This gives you the best of both worlds: the ease of not having to write the code yourself but without the necessity of the 'core' language having to be modified.

Of course if a suitable library does not yet exist (as in this case, probably) then somebody has to write it. Unfortunately that's not going to be me, because I'm too busy (and anyway there's already such a library for BBC BASIC so I'd use that in preference). But once you, or somebody else, has done the work it can be made available for others to use.

Richard.