Author |
Topic: Linking applications over wifi (Read 182 times) |
|
flotulopex
Junior Member
member is offline
Gender:
Posts: 94
|
|
Linking applications over wifi
« Thread started 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?
|
|
Logged
|
Roger
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Linking applications over wifi
« Reply #1 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.
|
|
Logged
|
|
|
|
flotulopex
Junior Member
member is offline
Gender:
Posts: 94
|
|
Re: Linking applications over wifi
« Reply #2 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
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?
Dreaming, oh oh oh dreaming.....
|
|
Logged
|
Roger
|
|
|
Richard Russell
Administrator
member is offline
Posts: 1348
|
|
Re: Linking applications over wifi
« Reply #3 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.
|
|
Logged
|
|
|
|
|