It is composed mainly of the following folders:
- app: user app folder
- demo: examples
- include: header files
- init: initilize code, do not edit
- platform: lib files
You can find API in
include folder, and examples in
All the event and it's parameters description from lower system can be find in
A unified code style and convenient reading is very important for any code, each person's code style is different, but many people must have a unified style when developing the same project, and a simple and clean code will make the code more smooth and easy.
CSDK uses a unified code style to briefly summarize the following points:
Module API uses a
"upper case function module name"+"_"+"Upper Camel Case"," such as
SSL_Init; the ordinary function is named with
Upper-Camel-Case, such as
entry function is special, use the folder name _Main
, for example,imei_Main`.
Lower camel case, e.g.:
Upper case with"
#define BUFFER_MAX_LENGTH 10
UTF-8 with no BOM format
Use 4 space instead of tab
use acronyms for some well-known words in the industry, such as
in addition to this, in order to ensure the readability of the code, be sure to use the full name, especially some professional terms, to make the person without contact with the word search the meaning of the word through the search engine.
NetworkLocation, if abbreviated to
NetLo, believe that even people who are very familiar with the word have to look at the context of the code to get the meaning of it slowly! If you search these abbreviations on the Internet, you never get
so, in order to make the code more concise and easy to read, it is not necessarily to make the code words abbreviated to a simpler form, but the opposite is that the full-name words are often more readable.
In addition, some words need to be interpreted and appropriate comments should be made.
annotations can be used with / / \ "or / / \" to annotate, and invalid code should be used as / ( / \ "notes) as far as possible.
//to comment code, and invalid code should be comment with
/**/as far as possible.
If we want some comment added to auto generated documentation, use:
////////////// ///comment here //////////////
/** *comment here * */
- And add some infomation to file or function, e.g. file:
/** *@file header.h *@author nick name */
/** *@brief brief, @brief can be omitted *@param a parameter a *@param b parameter b *@return return sum */