Giter Club home page Giter Club logo

Comments (3)

MathiasKoch avatar MathiasKoch commented on August 22, 2024 1

The problem is not actually that the device returns the echo, this is actually a requirement currently due to #82 .

The problem in this case, is that the ATAT parser expects parameters of the response to be separated by a ,, where in this case they are separated by \r\n

I will have a look when i get time, to see if it would be possible to extend the derive capabilities with a separator option.

Thanks for reporting!

from atat.

MathiasKoch avatar MathiasKoch commented on August 22, 2024 1

Hmm, not quite.

The parsed values will only be the parameters after the :, meaning that what you would probably want for this case would be:

#[derive(Clone, Debug, PartialEq, AtatResp)]
pub struct DNSResponse {
    pub some_flag: u8,
    pub dns_1: String<64>,
    pub dns_2: String<64>,
}

Where some_flag is the first parameter (value 1), that i have no idea what is without context :)

That should work.. If you want to improve it a little further, you could use no_std_net::IpAddr for the IP's (or no_std_net::Ipv4Addr if only v4 is supported)

Just make sure to enable the serde feature of no_std_net

One further, the first parameter could of course be changed into an enum, being a lot more descriptive than a u8 flag.

from atat.

Heusini avatar Heusini commented on August 22, 2024

Shouldn't this parse?
This is the full raw response:

AT+CIPDNS?
+CIPDNS:1,"42.2.129.13","8.8.8.8"

OK

This is the buffer after the digest:

+CIPDNS?
+CIPDNS:1,"42.2.129.13","8.8.8.8"

This is the struct i use to parse:

#[derive(Clone, Debug, PartialEq, AtatResp)]
pub struct DNSResponse {
    pub dns: String<64>,
    pub dns_1: String<64>,
    pub dns_2: String<64>,
}

I get a parse error but shouldn't the DNSResponse look like this:

dns = +CIPDNS?\r\n+CIPDNS:1
dns_1 = 42.2.129.13
dns_2 = 8.8.8.8

from atat.

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.