c语言程序命名规范:函数、变量、数组、文件名
函数:
//send or recv data task void send_recv_data(void *pvParameters); //get socket error code. return: error code int get_socket_error_code(int socket); //show socket error code. return: error code int show_socket_error_reason(int socket);
define变量:
/*AP info and tcp_server info*/ #define TD_STA_WIFI_SSID "tdssid" #define TD_STA_WIFI_PWD "tdpwd" #define TD_AP_WIFI_SSID "tdssid" #define TD_AP_WIFI_PWD "tdpwd" #define TD_UDP_SERVER_PORT "8011"
结构体:
static esp_ble_adv_data_t test_adv_data = { .set_scan_rsp = false, .include_name = true, .include_txpower = true, .min_interval = 0x20, .max_interval = 0x40, .appearance = 0x00, .manufacturer_len = 0, //TEST_MANUFACTURER_DATA_LEN, .p_manufacturer_data = NULL, //&test_manufacturer[0], .service_data_len = 0, .p_service_data = NULL, .service_uuid_len = 32, .p_service_uuid = test_service_uuid128, .flag = (ESP_BLE_ADV_FLAG_GEN_DISC | ESP_BLE_ADV_FLAG_BREDR_NOT_SPT), };
下划线很重要