c語言程序命名規範:函數、變量、數組、文件名

函數:app

//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變量:socket

/*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"

結構體:tcp

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),
};

下劃線很重要函數

相關文章
相關標籤/搜索