Posted 21 August 2017 - 03:48 AM
adore the not so amazing
SimpleAdore
wireless made kinda simple, i guess
So… what is this again?
This is a rapid prototyping wireless library thingy that makes wireless easier.
You only need to call about 3 or so functions to get on the air, plus transmitting and receiving is a lot easier, considering you just call the Recieve function or the Transmit function and it does all the work for you.
Why is SimpleAdore named SimpleAdore?
tl;dr recycling code
I was developing a Door Lock API named Adore, and nothing worked so I rewrote it but 90% of it was non-door-lock code stuff so I took that out, cleaned it up a bit and here we are.
What can this be used for?
Anything that uses modems/rednet. For testing, I used this to make a what-you-see-is-what-you-get wireless door lock (which will be released soon).
And guess what? It is 78 lines smaller than my door lock without the library on the server side, and it is 61 lines smaller on the client side.
Also, for the license: this is under a GPLv3 license.
You may use this in your program, just attribute me and you're in the clear.
Where can I download this?
From PasteBin - pastebin get mXGfG7Kw SimpleAdore
Docs
WrapModem(side) - Sets up a modem for use. The auto detection feature is a little touchy, so you should give it a side.AddChannel(name, channel) - Adds a channel for use, and opens it on the modem. You don't really need to do this but it might be useful for organization.
GetChannels() - Returns a list of channels available.
Transmit(channel, data) - Transmits data on channel. If you pass it a table, it automatically serializes it.
Recieve(channel) - Returns the message, and distance of the first message recieved when sender channel is channel.
Current issues:
- No check for if you actually setup the modem by running WrapModem
- Automatic modem discovery thingy is touchy/doesn't work
Edited on 23 August 2017 - 08:49 PM