NimBLE: Fix compilation warnings and errors

1. Remove networking macros from endian.h. They are not used in NimBLE (only used in socket transport, which our port does not use)

2. nvs_handle => nvs_handle_t

3. rom/queue.h => sys/queue.h
This commit is contained in:
Hrishikesh Dhayagude
2024-02-14 12:33:28 +05:30
committed by Abhinav Kudnar
parent 630443511e
commit 895623861d
3 changed files with 8 additions and 5 deletions
+3 -3
View File
@@ -96,7 +96,7 @@ get_nvs_db_value(int obj_type, char *key_string, union ble_store_value *val)
{ {
esp_err_t err; esp_err_t err;
size_t required_size = 0; size_t required_size = 0;
nvs_handle nimble_handle; nvs_handle_t nimble_handle;
err = nvs_open(NIMBLE_NVS_NAMESPACE, NVS_READWRITE, &nimble_handle); err = nvs_open(NIMBLE_NVS_NAMESPACE, NVS_READWRITE, &nimble_handle);
if (err != ESP_OK) { if (err != ESP_OK) {
@@ -191,7 +191,7 @@ static int
ble_nvs_delete_value(int obj_type, int8_t index) ble_nvs_delete_value(int obj_type, int8_t index)
{ {
esp_err_t err; esp_err_t err;
nvs_handle nimble_handle; nvs_handle_t nimble_handle;
char key_string[NIMBLE_NVS_STR_NAME_MAX_LEN]; char key_string[NIMBLE_NVS_STR_NAME_MAX_LEN];
if (index > get_nvs_max_bonds(obj_type)) { if (index > get_nvs_max_bonds(obj_type)) {
@@ -227,7 +227,7 @@ error:
static int static int
ble_nvs_write_key_value(char *key, const void *value, size_t required_size) ble_nvs_write_key_value(char *key, const void *value, size_t required_size)
{ {
nvs_handle nimble_handle; nvs_handle_t nimble_handle;
esp_err_t err; esp_err_t err;
err = nvs_open(NIMBLE_NVS_NAMESPACE, NVS_READWRITE, &nimble_handle); err = nvs_open(NIMBLE_NVS_NAMESPACE, NVS_READWRITE, &nimble_handle);
+3
View File
@@ -137,6 +137,8 @@ extern "C" {
#define htonll ntohll #define htonll ntohll
#endif #endif
/* These are not used in NimBLE and ESP-IDF uses them from LwIP */
#if 0
#ifndef ntohl #ifndef ntohl
#define ntohl(x) os_bswap_32(x) #define ntohl(x) os_bswap_32(x)
#endif #endif
@@ -152,6 +154,7 @@ extern "C" {
#ifndef ntohs #ifndef ntohs
#define ntohs htons #define ntohs htons
#endif #endif
#endif
#ifndef htobe16 #ifndef htobe16
#define htobe16(x) os_bswap_16(x) #define htobe16(x) os_bswap_16(x)
+2 -2
View File
@@ -34,7 +34,7 @@
#define _QUEUE_H_ #define _QUEUE_H_
/* The common BSD linked list queue macros are already defined here for ESP-IDF */ /* The common BSD linked list queue macros are already defined here for ESP-IDF */
#include <rom/queue.h> #include <sys/queue.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
@@ -43,7 +43,7 @@ extern "C" {
/* /*
* This file defines circular queues. The other types of data structures: * This file defines circular queues. The other types of data structures:
* singly-linked lists, singly-linked tail queues, lists and tail queues * singly-linked lists, singly-linked tail queues, lists and tail queues
* are used from rom/queue.h * are used from sys/queue.h
* *
* A singly-linked list is headed by a single forward pointer. The elements * A singly-linked list is headed by a single forward pointer. The elements
* are singly linked for minimum space and pointer manipulation overhead at * are singly linked for minimum space and pointer manipulation overhead at