Jump to content




[Util] Full Peripheral Detection: Hardwaredetector()

peripheral utility

6 replies to this topic

#1 Sharidan

  • Members
  • 33 posts

Posted 24 July 2013 - 04:13 PM

Greetings ComputerCraftians

I recently posted a small tutorial for a code snippet, for automatic side detection of an attached peripheral. My post got some serious and constructive feedback, which inspired me to write a piece of code, than can do full peripheral detection. The result is now called:

hardwareDetector()

Quote

I would like to extend a huge thank you! to theoriginalbit, both for inspiring me to write this and for helping me test and fine-tune this project.
Thank you theoriginalbit!

I have done all the testing I could on my lagtop for now and with theoriginalbit's help further testing has been done against his setup of misc. peripherals on a wired network. Final results of our combined testing effords, has lead me to beleive this is now ready for release.

hardwareDetector() will search for any and all available peripherals, both directly attached to the computer running hardwareDetector() and on any wired network connected to the computer.

Pastebins:

hardwareDetector() function only:

pastebin get 6G91GVEn hwdetect

http://pastebin.com/6G91GVEn

There is also a full test environment available, that also documents usage and shows you in code how to use this function:

pastebin get DAYhYyz4 hwtest

http://pastebin.com/DAYhYyz4

NOTE: Now updated to: "Beta test release 3".
There might still be some bugs in there that I havnt been able to find, so please report them back if you find any. See "Fixes" for change notes

Screenshots! Screenshots! Everyone wants screenshots...
Spoiler

Documentation ...
Spoiler

Running the test application...
Spoiler

Found a bug? Please let me know about it
Spoiler

Fixes:
Spoiler


Enjoy and let me know what you think.</parameters>

#2 Zudo

  • Members
  • 800 posts
  • LocationUK

Posted 25 July 2013 - 10:15 AM

peripheral.getNames() does this...

#3 theoriginalbit

    Semi-Professional ComputerCrafter

  • Moderators
  • 7,332 posts
  • LocationAustralia

Posted 25 July 2013 - 10:58 AM

Nice to see such a quick release.

View PostZudoHackz, on 25 July 2013 - 10:15 AM, said:

peripheral.getNames() does this...
I suggest that you read and/or use the program before stating something that already exists to do it..... this is an extension upon getNames and provides MUCH more functionality than the default peripheral API does!

#4 CoderPuppy

  • Members
  • 121 posts

Posted 25 July 2013 - 11:31 AM

Suggestion:
Check all the wired modems instead of only the first one.
Or is there a reason why it only checks the first?

#5 Sharidan

  • Members
  • 33 posts

Posted 25 July 2013 - 12:20 PM

View PostCoderPuppy, on 25 July 2013 - 11:31 AM, said:

Suggestion:
Check all the wired modems instead of only the first one.
Or is there a reason why it only checks the first?

Well, as you know assumption is the mother ...
Honestly I assumed that most would throw all their remote stuff on the same wire from the same computer. But you are correct: it should check all of them if there are more than one.

I'll get this oversight fixed. Thanks for bringing it to my attention.

#6 Sharidan

  • Members
  • 33 posts

Posted 25 July 2013 - 12:54 PM

Beta test release 3 is now out:
hardwareDetector() now correctly examines any and all wired modems attached to the computer and scans all of them for remote peripherals.

#7 Cutecurtain

  • Members
  • 31 posts
  • LocationBodafors, Sweden

Posted 10 August 2013 - 11:54 AM

I really do like this! :)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users