Chengdu Ebyte Electronic Technology Co., Ltd.
E32-900MBL-1 User Manual
Copyright © 2012–20 21 , Chengdu Ebyte Electronic Technology Co., Ltd.
8
2. 3 Main function
The main function entry is in main.c. The demo function process is simplified as follows:
Matter
Explanation
1
Key Function
If a button is pressed, the command data is sent wirelessly. In essence, it means
sending a specific string "ping" and expecting to receive a response "pong".
2
Serial data to wireless
transmission
After the serial port receives the data, it automatically starts wireless transparent
transmission of data. Of course, it contains some special command responses, which
are mainly used for special tests and can be ignored by users. After the sending is
completed, the user function will be automatically called back to process the sending
logic by itself.
3
Receive data wirelessly Generally, the internal status flag of the module is read to determine whether there is
data, and the underlying driver will copy the data and pass it to the user's callback
function, so as to process the receiving logic by itself.
The software process is simplified as shown in the figure below:
2. 4 Transceiver timing
The wireless module has multiple operating states, and can only perform specific functions in the corresponding
state. From the simplest way of sending and receiving data, only the sending mode and the receiving mode are
considered.
Matter
Explanation
1
Receive mode
After the default initialization is completed, it automatically enters the receiving mode.
In essence, the receiving function is called in the initialization to enter the receiving
mode. If you need to consider entering other modes after initialization, such as sleep,
you can directly replace it with the same type of function Go_xxxxx().
2
Send mode
When calling the send function, the underlying driver actually switches the module
into standby mode first, and usually completes the modulation parameter configuration