Code Monkey home page Code Monkey logo

Comments (7)

xcguang avatar xcguang commented on August 25, 2024

Hi @JPast ,
If the message is printed in transparent transmission mode, It confuses message with data.
Maybe we can post an event in at_status_callback, then you add code to check it, and print a message or control a gpio.

from esp-at.

JPast avatar JPast commented on August 25, 2024

Hi @xcguang ,

thank you for your answer.
This would be a solution for my problem. It would be nice to have two events to handle in at_status_callback . One for a lost WiFi-Connection and another one for a lost TCP-Connection.
How long would it take to implement this events in libat_core.a?

from esp-at.

xcguang avatar xcguang commented on August 25, 2024

Hi @JPast ,
We will think about it after the New Year's day. If there is any update, we will reply here.

from esp-at.

xcguang avatar xcguang commented on August 25, 2024

Hi @JPast ,
We have added some cb for connection, please try it if possible. The attachment is the at lib for test.
And now, you have to define esp_at_custom_net_ops_struct by yourself.

typedef struct {
    int32_t (*recv_data)(uint8_t*data,int32_t len);
    void (*connect_cb)(void);
    void (*disconnect_cb)(void);
} esp_at_custom_net_ops_struct;

bool esp_at_custom_net_ops_regist (int32_t link_id,esp_at_custom_net_ops_struct* ops);

void test_connect_cb(void)
{
    printf("test_connect_cb\r\n");
}

void test_disconnect_cb(void)
{
    printf("test_disconnect_cb\r\n");
}
void at_task_init(void)
{
    ......
    esp_at_custom_net_ops_struct custom_net_ops = {
        .recv_data = NULL,
        .connect_cb = test_connect_cb,
        .disconnect_cb = test_disconnect_cb
    };

    ......
    esp_at_module_init (CONFIG_LWIP_MAX_SOCKETS - 1, version);  // reserved one for server
    free(version);

    esp_at_custom_net_ops_regist(0,&custom_net_ops); // MUST after esp_at_module_init
    ......
}

at_lib_test.zip

from esp-at.

JPast avatar JPast commented on August 25, 2024

Hi @xcguang,

I implemented this code and the at_lib_test_core in the newest AT-Command-Core-Version. The compilation and flashing worked without failure.
Unfortunately this solution approach doesn`t fit well. When I start TCP-Connection with AT+CIPSTART="TCP","192.168.101.110",1000,5 and build up a transparent transmission test_connect_cb is printed out. But when I shut up the WIFI-AP or stop the TCP-Server-Socket, nothing happens. The text test_disconnected_cb is first printed out when I trigger to stop transparent transmission by sending “+++”. I want to detect an missing connection without leaving transparent transmission mode. Is it possible to print out test_disconnected_cd when TCP-Connection is lost while transparent transmission mode is enabled?

Thank you for your help.

JPast

from esp-at.

xcguang avatar xcguang commented on August 25, 2024

Hi @JPast ,
Sorry for inconvenient.
You are right, it should print disconnect and connect message whether transparent transmission or normal mode.Please try again using the attachment.
libat_core.a.zip

from esp-at.

JPast avatar JPast commented on August 25, 2024

Hi @xcguang,
thank you for your help. This libat_core.a is working fine.

from esp-at.

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.