BBC BASIC for Windows
« CONNECT TO homeLAN DEVICEs W. MAC/IP »

Welcome Guest. Please Login or Register.
Apr 5th, 2018, 10:13pm



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: CONNECT TO homeLAN DEVICEs W. MAC/IP  (Read 600 times)
dynamic35
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 34
xx CONNECT TO homeLAN DEVICEs W. MAC/IP
« Thread started on: Oct 25th, 2011, 5:32pm »

I have a device with a MAC address and , in my home network it has got a fixed IP 10.11.12.2. I know -according to device manual - that a command like "READTIME" into that device should activate it such that it responses like"25-OCT-2011, 20.32" now

I have searched discussions and bbc materials and have not found examples on that kind of programs.

Is there some BBC library routine that can be used here to extablish a connection to LAN addresses like 10.11.12.2 -and then allow a sending of a command like above text message to that device and even wait for the answer.

Thank you very much on any example or link on this area of lan socket programming




User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: CONNECT TO homeLAN DEVICEs W. MAC/IP
« Reply #1 on: Oct 25th, 2011, 9:13pm »

on Oct 25th, 2011, 5:32pm, dynamic35 wrote:
Is there some BBC library routine that can be used here to extablish a connection to LAN addresses like 10.11.12.2 -and then allow a sending of a command like above text message to that device and even wait for the answer.

Yes, the SOCKLIB library should allow you to do that:

http://www.bbcbasic.co.uk/bbcwin/manual/bbcwing.html#socklib

Richard.
User IP Logged

dynamic35
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 34
xx Re: CONNECT TO homeLAN DEVICEs W. MAC/IP
« Reply #2 on: Oct 26th, 2011, 11:05pm »

Thank You Richard!!

So it was like this with socklib initiated

host$="10.11.12.2"
port$="32102"
maxt%=300
PROC_initsockets
sok%= FN_tcpconnect(host$,port$)
startcmd$="READTIME"
i%=FN_writelinesocket(sok%,startcmd$)

j%=FN_readlinesocket(sok%,maxt%,yrtime$)
PROC_closesocket(sok%)

PRINT "LAN timer display= "; yrtime$
END
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls