Jump to content




SimpleAdore - wireless made easy

wireless api

4 replies to this topic

#1 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 21 August 2017 - 02: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

Current issues:
  • No check for if you actually setup the modem by running WrapModem
  • Automatic modem discovery thingy is touchy/doesn't work

Edited by Haddock, 23 August 2017 - 09:49 PM.


#2 Dave-ee Jones

  • Members
  • 456 posts
  • LocationVan Diemen's Land

Posted 22 August 2017 - 01:10 AM

You may find that this is basically the exact same as the modem API, which you knew because you are using it to create this.
<modem>.open(channel)
<modem>.close(channel)
<modem>.transmit(channelToBroadcastOn, channelToReceiveBroadcastOn, message)

And to receive messages you deal with the "modem_message" API.

However you did make it easier for people to receive a message on a channel. Where you have '_1' that is the side that the message came in on, and '_2' is the channel you are asked to reply on, so that would be the channel the sender would have open so it can catch your reply.

It's a good start though, and it certainly makes it a bit easier for people to use for simple purposes, so I would say you achieved your goal.

#3 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

Posted 22 August 2017 - 10:09 AM

View PostDave-ee Jones, on 22 August 2017 - 01:10 AM, said:

And to receive messages you deal with the "modem_message" API event.

fixed it for you

#4 Dave-ee Jones

  • Members
  • 456 posts
  • LocationVan Diemen's Land

Posted 23 August 2017 - 03:35 AM

View PostLupus590, on 22 August 2017 - 10:09 AM, said:

View PostDave-ee Jones, on 22 August 2017 - 01:10 AM, said:

And to receive messages you deal with the "modem_message" API event.

fixed it for you

Ah thanks..Little bit on the tired side :P

#5 HaddockDev

  • Members
  • 61 posts
  • LocationSomewhere, deep down under a rainbow.

Posted 23 August 2017 - 09:55 PM

View PostDave-ee Jones, on 22 August 2017 - 01:10 AM, said:

--snip
However you did make it easier for people to receive a message on a channel. Where you have '_1' that is the side that the message came in on, and '_2' is the channel you are asked to reply on, so that would be the channel the sender would have open so it can catch your reply.

It's a good start though, and it certainly makes it a bit easier for people to use for simple purposes, so I would say you achieved your goal.
Yep, you got it right. I made this to make it easier for prototyping (and doors) but it could be used for simple modem projects.
The side and the reply channel aren't used because of my standards of modem thingys (throwaway the side, and assume reply channel is sender channel + 1) but in a way it kinda makes it easier, I guess.

Edited by Haddock, 23 August 2017 - 09:57 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users