I am developing an Android app and I want to be able to control my lightbulbs in there. Since the SDK is not supported anymore, I am trying to connect to each bulbs through LAN.
I am currently at this point, and I alway get a SocketTimeoutException:
My problem comes from the sendDiscoveryRequest(), I don’t what to put as “data” value …
How can I do to integrate the GetService methode in Java ? Considering the followed documentation:
I believe that the getBytes() method on the string object returns the ascii data from the string. So in this case you are sending that exact string as ascii encoded bytes.
What you really want to be sending is the binary data that that string represents. So something along the lines of this Stack Overflow post.
That makes a good starting point of course, but for a full implementation it’d be much better to assemble the packets manually from scratch, rather than strings.
unfortunately I didn’t succeed to implement the LAN discovery … I don’t know what’s wrong with my packet data… I someone know or have an example in java it could definitely help me !
I am not familiar with packets so i’m kind of stuck here.
So I use for now the sdk provide by @lars.senic but I’ve got some probs. Maybe Lars could help
I lost the connection regularly
For the intensity, I have play with the “brightness” value, is there a more efficient way to deal with it ? Because currently it is not smooth at all and I would like to have something very responsive like in the LIFX default app for instance