+ipd
Posted: Tue Dec 05, 2017 2:05 pm
hello , i like to know in which file of source-files are called the +ipd for incoming received packet ?
i do i search but cant find it.
i do i search but cant find it.
hi,fritch wrote:hello , i like to know in which file of source-files are called the +ipd for incoming received packet ?
i do i search but cant find it.
you have more possibles on thisfritch wrote:any way to print the just the ipd at uart0 instead 1 ?
ok. so you need a second uart for your "IPD+" right?fritch wrote:Hi, setting the uart in menuconfig will put whole at cmds too is same uart, i just need receive the ipd packet in a diferente uart form other at cmd.
yes - like it was sayed from begin, it's in the AT Core lib and the "IPD+" comes overfritch wrote: In code i dont find any reference for ipd, must be in the libat_core.a but dont know how edit this file.
Code: Select all
static int32_t at_port_write_data(uint8_t*data,int32_t len)
{
uint32_t length = 0;
length = uart_write_bytes(CONFIG_AT_UART_PORT,(char*)data,len);
return length;
}
Code: Select all
uart_write_bytes(UART_NUM_1, (const char *) data, len);
Code: Select all
static int32_t at_port_write_data(uint8_t*data,int32_t len)
{
uint32_t length = 0;
length = uart_write_bytes(CONFIG_AT_UART_PORT,(char*)data,len);
return length;
}
libat_core.afritch wrote: which editor you use for edit the file libat_core.a ?
yep, and this code you must change like thisfritch wrote:
I just need to print the +ipd packect in the uart0 (uart0 already actived for log, rest of at cmds still print in uart1)
no need interrupt isr.
this code will print all at cmd at same uart.Code: Select all
static int32_t at_port_write_data(uint8_t*data,int32_t len) { uint32_t length = 0; length = uart_write_bytes(CONFIG_AT_UART_PORT,(char*)data,len); return length; }
Code: Select all
static int32_t at_port_write_data(uint8_t*data,int32_t len)
{
uint32_t length = 0;
// if no string found in *data packet like "+IPD" then
// standard outgoing
length = uart_write_bytes(CONFIG_AT_UART_PORT,(char*)data,len);
return length;
// if string found in *data packet like "+IPD" then
// my own routine for this
// here comes your own UART routine
// you must first init a second UART like the example i give you
// then you send what you want send to your second uart
// length = uart_write_bytes(CONFIG_AT_MY_OWN_UART_PORT,(char*)data,len);
// return length;
}
Ok, one try for you:fritch wrote: I just need to print the +ipd packect in the uart0 (uart0 already actived for log, rest of at cmds still print in uart1)
Code: Select all
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "string.h"
#include "esp_at.h"
#include "nvs.h"
#include "nvs_flash.h"
#include "esp_system.h"
#include "at_upgrade.h"
// fritch
#include "esp_log.h"
static const char *TAG = "MyOwnIPDLOG";
Code: Select all
uint8_t searchStr[] = "+IPD";
if( strstr((char *) data, (char *) searchStr) != NULL)
Code: Select all
ESP_LOGI(TAG,"+IPD was: %s\n", (char*) data);
Code: Select all
static int32_t at_port_write_data(uint8_t*data,int32_t len)
{
uint32_t length = 0;
uint8_t msg[] = "+IPD was here yeah\n";
int32_t msg_len = 0;
uint8_t searchStr[] = "+IPD";
msg_len=strlen( (char*) msg);
if( strstr((char *) data, (char *) searchStr) != NULL){
// uart_write_bytes(CONFIG_MY_UART_PORT,(char*)msg, msg_len);
ESP_LOGI(TAG,(char *) msg);
// not defined how long the data so you will get after data other garbage too.
ESP_LOGI(TAG,"+IPD was: %s\n", (char*) data);
}
length = uart_write_bytes(CONFIG_AT_UART_PORT,(char*)data,len);
return length;
}
Code: Select all
static int32_t at_port_write_data(uint8_t*data,int32_t len)
{
uint32_t length = 0;
uint8_t msg[] = "+IPD was here yeah\n";
int32_t msg_len = 0;
uint8_t searchStr[] = "+IPD";
msg_len=strlen( (char*) msg);
if( strstr((char *) data, (char *) searchStr) != NULL){
// uart_write_bytes(CONFIG_MY_UART_PORT,(char*)msg, msg_len);
ESP_LOGI(TAG,(char *) msg);
// not defined how long the data so you will get after data other garbage too.
ESP_LOGI(TAG,"+IPD was: %s\n", (char*) data);
} else {
length = uart_write_bytes(CONFIG_AT_UART_PORT,(char*)data,len);
return length;
}
}