Analysis and Solution to common problems of porting GPS applications in Linux
OS: Linux 1. directly provide functions for third parties
Cause: the design of the main chip and the change of the GPS chip often make the GPS driver updated.
Evolution:Provide the. So Dynamic Link Library and. h header file to third parties
2. Write the GPS parameter to the program.
GPS parameters include: path of the serial port device, the port number of the gpio device, the baud rate, the gpio port number, the gpio Port Number of the reset, the path of the power management tool, and the file path saved by the Quick Start GPS (cold start and hot start) points );
The development boards include Lily, Bali, Apollo 1. 0, and Apollo 1. 1;
Evolution:Provides configuration files for GPS parameters, such as atgps. CNF and navione. CNF.
3. directly provide the software interface for driver development to a third party
Cause:
1. software interfaces for driver development will change frequently and the interfaces are unstable;
2. The software interface for driver development is not the interface that the third party really needs, and cannot fully meet the user's needs;
3. software interfaces developed based on drivers should be further expanded and improved to meet the needs of third parties;
Evolution:It is encapsulated based on the interfaces provided by developers to meet customers' needs.
4. The third party did not call the at_close_gps function, and the standby time was significantly shortened.
Consequence: The current is too large, the current cannot fall down, and the standby time is too short;
Solution:Make sure that the third party calls the at_close_gps function to disable the gps device.
5. The program and data are not separated, resulting in a directory that often cannot store all programs and data
Data: map data and sound data
Linux partitioned directories are usually 400-500 m, while GPS requires 900 m of storage space.
Evolution: program and data separation
6. The current directory is confused with the running program path
The current directory is often changed. The current directory is not necessarily the path of the running program.
Therefore, be sure to differentiate clearly.
7. Use the C ++ class to encapsulate data and hide information
1. Data and information are associated with specific operations;
2. Provide operations to third parties;
3. Information and property hiding;
8. Two sets of GPS codes are required for different versions of a Development Board, namely, Apollo and Apollo.
Development Board: the Apollo Development Board has at least two hardware versions: Apollo and Apollo. After all, the hardware remains a little different;
Solution:A set of codes can be suitable for multiple development boards. A single development board can have multiple different versions.
9. Write a third-party interface to verify its correctness. The tool is gpstool.