+ipd
Re: +ipd
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.
short, you run with this in 2 problems:
a) comes from a lib
b) can not expand
longer:
+ipd is from AT LIB
and no, we have -incomprehensibly- no * CB for this.
edit:
if this helps: like #xcguang said, you could parse "+IPD" in at_port_write_data
best wishes
rudi
( * i am sure, you do not want hear this )
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: +ipd
you have more possibles on thisfritch wrote:any way to print the just the ipd at uart0 instead 1 ?
a) set the Uart in menuconfig
b) change in code the uart for this if "IPD+" parsed ( or any thing like you want )
c) init a second UART for this and write your own "print" function if "IPD+" parsed
.. and so on
hope this helps
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: +ipd
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.
In code i dont find any reference for ipd, must be in the libat_core.a but dont know how edit this file.
In code i dont find any reference for ipd, must be in the libat_core.a but dont know how edit this file.
Re: +ipd
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.
do you only send or do you need a receive ISR on this uart too?
receive ISR is, if there comes a response on this "IPD+" message
and you want read it in the second UART, then you need a own ISR for this uart.
( i think you want only send this "IPD+" messages over a second UART , but if you want this too, look up in the simple event examle here )
you need general a second uart for "IPD+" messages, right?
so you need to do initialize a second UART simply
if you did this
you parse in the AT Firmware function each message that would send the standard UART for "IPD+"
if you have your data packet picked ( "strcmp" or like you want to this ) , then you know how long it is
then simple send it by the second uart
here is an example of a simple UART
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;
}
the "IPD+" is then in the "*data" and is "len" long
you have then uart0 and uart1
you want use uart1 for "IPD+" outgoings so send it then by uart1 and not by uart0
Code: Select all
uart_write_bytes(UART_NUM_1, (const char *) data, len);
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: +ipd
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.
which editor you use for edit the file libat_core.a ?
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;
}
Re: +ipd
libat_core.afritch wrote: which editor you use for edit the file libat_core.a ?
this file is an archive file with more files.
you can expand it example by 7z or with your favority zipper.
in this archive file there are the +IPD is example in at_ipCMD.o
you can view the file example with an HEX editor
.o files are precompiled files and no source files
and this files goes usually in an archive and you can then use it as library, like the at lib.a
you can patch but you can't edit like a source file
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;
}
i think it is now deeply explained.
You have to write your code yourself, nobody will take care of your homework
So let's code yourself - just trust you, it's all here now.
edit: not sure you know, the red words in text are linked - click on it and you surf to the right things
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Re: +ipd
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)
you say, uart0 already activated for log?
and cmd still print in uart1?
and this is run for you? and you want only the +IPD packet in the uart0?
so you can try to print the +IPD simple over the LOG to uart0 like this:
first be sure, you have include esp_log in the at_task.c file
and add a TAG for your's as Info
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";
like this:
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);
so you will get all data what are in the data buf is,
this is your homework to change the code like you need,
an exmaple ( commented ) with your own UART Port is with data len,
so you get only the data, what was send.
example change code :
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;
}
}
best wishes
rudi
-------------------------------------
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
love it, change it or leave it.
-------------------------------------
問候飛出去的朋友遍全球魯迪
Who is online
Users browsing this forum: Bing [Bot] and 76 guests