Giter Club home page Giter Club logo

Comments (3)

louis49 avatar louis49 commented on August 15, 2024 1

No.
You need to analyse the frame - read this doc to understand : https://developers.google.com/protocol-buffers/docs/encoding
1rst byte is the length of the frame
2nd byte is the composition of field number and wire type
This second byte is by definition composed of 8 bits 0 or 1 : 10101010
You need to take 5th first bits and convert it to int : it’s your field number => 8 is the ping field number
The last 3 bits represent the wire type (2 it’s a embedded messages)

from androidtv-remote.

louis49 avatar louis49 commented on August 15, 2024

Ping request is formed by two varint, you need to resend only first :

Receive : 9,66,7,8,1,16,148,250,150,55 09420708011094fa9637
Receive : {"remotePingRequest":{"val1":1,"val2":115719444}}

Sending 4,74,2,8,1 044a020801
Sending {"remotePingResponse":{"val1":1}}

proto form is here simple :

RemotePingRequest remote_ping_request = 8;
RemotePingResponse remote_ping_response = 9;

message RemotePingResponse {
int32 val1 = 1;
}

message RemotePingRequest {
int32 val1 = 1;
int32 val2 = 2;
}

You can deduce ping request from https://protogen.marcgravell.com/decode by tapping hex form without length of your buffer : 420708011094fa9637

Field #8: 42 String Length = 7, Hex = 07, UTF8 = "������7"
As sub-object :
Field #1: 42 Varint Value = 1, Hex = 07
Field #2: 08 Varint Value = 115719444, Hex = 01-10-94-FA

from androidtv-remote.

Ganime422 avatar Ganime422 commented on August 15, 2024

I am not sure I understand your answer.
when I get a message from the tv, how can I identify that message as a ping request?
I need to parse the bytes into a hex string, and then if the length of the hex string is 7, it means it's a ping request?

from androidtv-remote.

Related Issues (20)

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.