Suggestions on implementing a gethostbyname() function...
Farmer Scott
Posts: 30
So, I'm working on 'dns.spin', well, actually just the gethostbyname() function.· Before I get too far along, I've got some question about object interaction.· I'm wondering if what I have in mind will work...
Here's the code and object relationship...
main.spin
··· |- dns.spin
··· |- api_telnet_serial.spin
··········· |- driver_socket.spin
··················· |- driver_enc28j60.spin
The big question is, if I call the api_telnet_serial.start() function from main.spin, which will of course call the same function in driver_socket and driver_enc28j60, can I still call the api_telnet_serial.connect() function from dns.spin?
Sorry, I realize this is probably a little confusing, at least I am certainly confusing myself, but not exactly sure how to proceed.· I can usually get by with SPIN, but this is one conundrum that's got me perplexed...
Or, does anyone have any suggestions on a good way to implement this function?
Thanks,
Scott
Here's the code and object relationship...
main.spin
··· |- dns.spin
··· |- api_telnet_serial.spin
··········· |- driver_socket.spin
··················· |- driver_enc28j60.spin
The big question is, if I call the api_telnet_serial.start() function from main.spin, which will of course call the same function in driver_socket and driver_enc28j60, can I still call the api_telnet_serial.connect() function from dns.spin?
Sorry, I realize this is probably a little confusing, at least I am certainly confusing myself, but not exactly sure how to proceed.· I can usually get by with SPIN, but this is one conundrum that's got me perplexed...
Or, does anyone have any suggestions on a good way to implement this function?
Thanks,
Scott
Comments
Do keep in mind that the object structure in Spin is not really designed for this kind of use, but people have done it using DAT sections. Look in the ObEx for a version of FullDuplexSerial that was designed for shared use for debugging. That'll give you an idea of what's involved. It's pretty straightforward.