GithubHelp home page GithubHelp logo

samuelvlopes / thehandyforunity_apiv2 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from limitlessmanmlb/thehandyforunity_apiv2

0.0 0.0 0.0 250 KB

Unity package to send HTTP request to TheHandy

License: MIT License

thehandyforunity_apiv2's Introduction

TheHandyForUnity_APIv2

It's a SDK to control TheHandy by HTTP request in a Unity project by using API v2 of Handyfeeling. (API Support will be at least through 2024)

I based my work on https://github.com/defucilis/TheHandyUnity

What Is TheHandy

TheHandy is a male masturbator than can be controlled by remote commands (HTTP or Bluetooth) : https://www.thehandy.com/

For blutooth, see : https://buttplug.io/

HTTP Requests

That Swagger show all HTTP request that can be send to TheHandy (API v2) : https://staging.handyfeeling.com/api/handy/v2/docs/#/

All request are in my SDK but maintenance. I think it's really a better idea to make firmware update directly on TheHandy site : https://www.handyfeeling.com/local-video

See also Handyfeeling Developer Documentation : https://sweettech.notion.site/Get-started-1704d1c1d205408999a3c005e0c06d8f

All commands are first send to https://www.handyfeeling.com/api/handy/v2/ then send to TheHandy.

If a set of data are send to / receive from TheHandy, I made an enum or a struct for it.

Modes And Commands

API v2 give 5 modes with there specific command and some general command.

HAMP, HDSP and HSSP mode must be set prior to send their commands. Otherwise, an error will by throw by the server.

There is the listing as given in my class HandyHTTPConnection.cs :

  • Handy Alternate Motion Protocol (HAMP) operations :

    • HAMP_Start
    • HAMP_Stop
    • HAMP_GetVelocity
    • HAMP_SetVelocity
    • HAMP_GetState
  • Handy Direct Streaming Protocol (HDSP) operations :

    • HDSP_Set_xava (absolute position (xa), and the absolute velocity (va))
    • HDSP_Set_xpva (percent position (xp), and the absolute velocity (va))
    • HDSP_Set_xpvp (percent position (xp), and the percent velocity (vp))
    • HDSP_Set_xat (absolute position (xa), and duration (t))
    • HDSP_Set_xpt (percent position (xp), and duration (t))
  • Handy Synced Stream Protocol (HSSP) operations : It's with that mode that you can play script (See HSSP, All the details below)

    • HSSP_Play
    • HSSP_Stop
    • HSSP_Setup
    • HSSP_GetLoop
    • HSSP_SetLoop
    • HSSP_GetState
  • Handy Buffered Streaming Protocal (HBSP) (Not yet implemented - 2023-01)

  • Handy Simple Timing Protocol (HSTP) : Available in all mode, it's mainly for HSSP uses. (See HSSP, All the details below)

    • HSTP_GetDeviceTime
    • HSTP_GetOffset
    • HSTP_SetOffset
    • HSTP_GetRtd
    • HSTP_GetSync (Could be just Sync)
  • General commands

    • GetServerTime
    • GetMode
    • SetMode
    • GetConnected (This is the fastest way to check device connectivity)
    • GetInfos
    • GetSettings (2022-01 : Swagger said that include offset and velocity but TheHandy return only slideMin and slideMax)
    • GetStatus
    • GetSlide (Min/Max stroke)
    • SetSlide (Min/Max stroke)
  • Special commands

    • PowerDown (Send Stop if HSSP/HAMP playing)

HSSP, All the details

To use the handy on HSSP mode, some command must be send to work properly:

  1. Send HSTP_GetSync to made TheDandy synchronize his clock with the server.
  2. Upload a File to the server and get the returned url.
  3. Send HSSP_Setup with url to make TheHandy download the script.
  4. calcul the EstimatedLatency like explained in the swagger : https://staging.handyfeeling.com/api/handy/v2/docs/#/
  5. Send HSSP_Play with the EstimatedLatency to make TheHandy play the downloaded script.

Upload File To The Server

That Swagger that show how to upload/download script on handyfeeling server : https://scripts01.handyfeeling.com/api/script/hosting/v0/docs/#/

File are uploaded on a different address : https://scripts01.handyfeeling.com/api/script/hosting/v0/

  • Commands
    • UploadScript (Can upload .csv, .Funscript and .Json)
    • DownloadScript

Install This SDK in Your Unity Project

That realy simple, install the TheHandyForUnity_APIv2.unitypackage on your project.

There all you realy need :

  • SimpleJSON (Exept AsLong, it's a copy from https://github.com/defucilis/TheHandyUnity)
  • HandyConnectionAPIv2 : (I keeped some basic function but almost all are new or modified)
  • StructsAndEnums (Exept LogMode, all is new)

To run the UI Example You will need to install Text Mesh Pro.

thehandyforunity_apiv2's People

Contributors

limitlessmanmlb avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.