how to found DLE(0x10) ETX(0x03) via re.search

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
skylin008
Posts: 88
Joined: Wed Mar 11, 2015 6:21 am

how to found DLE(0x10) ETX(0x03) via re.search

Post by skylin008 » Mon Jul 18, 2016 3:49 am

In dataframe ,how to search the escape char" DLE ETX" via the re.search. How to write the regulator.Best Regard.TKS!

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: how to found DLE(0x10) ETX(0x03) via re.search

Post by Roberthh » Mon Jul 18, 2016 3:45 pm

You do not need re.search. You can use find. For example

Code: Select all

DLE="\x10"
ETX="\x03"

pos = dataframe.find(DLE)
If pos is different from -1, it tells the position of DLE in dataframe.

skylin008
Posts: 88
Joined: Wed Mar 11, 2015 6:21 am

Re: how to found DLE(0x10) ETX(0x03) via re.search

Post by skylin008 » Tue Jul 19, 2016 3:15 am

Thank you Roberthh,I will be try.

skylin008
Posts: 88
Joined: Wed Mar 11, 2015 6:21 am

Re: how to found DLE(0x10) ETX(0x03) via re.search

Post by skylin008 » Tue Jul 19, 2016 3:58 am

Hello @ Roberthh,
The fax modem connected the pyboard via uart, pyboard received fax data stream and at the end of the data to the DLE ETX sign .How to use UART.read (1) or UART.readinfo () function availabe, and judge the end of data, how to write this function, thank you!

Post Reply