-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32 derive not working #94
Comments
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 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! |
Shouldn't this parse?
This is the buffer after the digest:
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:
|
Hmm, not quite. The parsed values will only be the parameters after the #[derive(Clone, Debug, PartialEq, AtatResp)]
pub struct DNSResponse {
pub some_flag: u8,
pub dns_1: String<64>,
pub dns_2: String<64>,
} Where That should work.. If you want to improve it a little further, you could use Just make sure to enable the One further, the first parameter could of course be changed into an enum, being a lot more descriptive than a u8 flag. |
The ESP32 returns the sent request as an echo thus i cannot simply derive the AtatResp but have to manually parse the response.
Here is an example.
This is the request i send:
This is the raw response as returned from the esp32:
It would be nice if the above response could be parsed with the following AtatResp derive.
The text was updated successfully, but these errors were encountered: