Skip to content

Commit 484f667

Browse files
authored
Merge pull request #134 from SmartThingsCommunity/_update_version_1_8_12
Update version 1 8 12
2 parents 47a049a + b3315d8 commit 484f667

File tree

15 files changed

+18
-206
lines changed

15 files changed

+18
-206
lines changed

example/esp32/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
2. Setup ESP32 build environment according to [guide](https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/get-started/index.html)
1414

15+
> **_NOTE:_** You can also setup other esp32 series like ESP32-S series, ESP32-C series according to their setup guide.
16+
1517
3. Acquire SmartThings Device SDK workflow reading [Getting Started](../../doc/getting_started.md) Document
1618

1719
## How to build example
@@ -23,6 +25,19 @@
2325
$ idf.py build
2426
$ idf.py flash
2527
```
28+
> **_NOTE:_** The examples's default sdkconfig is for esp32 board. To run the example on other esp32 series, change `CONFIG_IDF_TARGET` in sdkconfig with desired target board before build.
29+
>
30+
> For example, to run the example on esp32s3 board, change `CONFIG_IDF_TARGET` in sdkconfig file like below.
31+
>```vim
32+
>... (Skip) ...
33+
>CONFIG_IDF_TARGET="esp32s3"
34+
>... (Skip) ...
35+
>```
36+
>You may need to run fullclean to remove previous target board build configuration before building different target.
37+
>```sh
38+
>$ idf.py fullclean
39+
>```
40+
2641
2. Run and monitor esp32. (Please refer [espressif guide](https://docs.espressif.com/projects/esp-idf/en/release-v5.0/esp32/get-started/linux-macos-setup.html#monitor-the-output))
2742
2843
```sh

src/include/bsp/iot_bsp_system.h

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,18 +83,6 @@ iot_error_t iot_bsp_system_get_time_in_sec(char* buf, unsigned int buf_len);
8383
*/
8484
iot_error_t iot_bsp_system_set_time_in_sec(const char* time_in_sec);
8585

86-
/**
87-
* @brief Get device unique value
88-
* @details The source of unique value
89-
* @param[out] uid a pointer of pointer to a unique id buffer
90-
* @param[out] olen the bytes written to unique id buffer
91-
* @return iot_error_t
92-
* @retval IOT_ERROR_NONE success
93-
* @retval IOT_ERROR_MEM_ALLOC alloc failed for unique id buffer
94-
* @retval IOT_ERROR_NOT_IMPLEMENTED no way to make unique id
95-
*/
96-
iot_error_t iot_bsp_system_get_uniqueid(unsigned char **uid, size_t *olen);
97-
9886
#ifdef __cplusplus
9987
}
10088
#endif

src/include/st_dev_version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
#define VER_MINOR 8
2727

2828
/* patch: bug fix */
29-
#define VER_PATCH 11
29+
#define VER_PATCH 12
3030

3131
#define _STDK_STR(s) #s
3232
#define _STDK_VERSION_STR(a, b, c) _STDK_STR(a) "." _STDK_STR(b) "." _STDK_STR(c)

src/iot_api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ iot_error_t iot_get_time_in_sec(char *buf, size_t buf_len)
669669
}
670670

671671
gettimeofday(&tv_now, NULL);
672-
snprintf(buf, buf_len, "%lld", tv_now.tv_sec);
672+
snprintf(buf, buf_len, "%lld", (long long)tv_now.tv_sec);
673673

674674
return IOT_ERROR_NONE;
675675
}
@@ -700,7 +700,7 @@ iot_error_t iot_get_time_in_ms(char *buf, size_t buf_len)
700700

701701
gettimeofday(&tv_now, NULL);
702702
snprintf(buf, buf_len, "%lld%03ld",
703-
tv_now.tv_sec, (tv_now.tv_usec / 1000));
703+
(long long)tv_now.tv_sec, (tv_now.tv_usec / 1000));
704704

705705
return IOT_ERROR_NONE;
706706
}

src/port/bsp/esp32/iot_bsp_system_esp32.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,3 @@ iot_error_t iot_bsp_system_set_time_in_sec(const char* time_in_sec)
6868

6969
return IOT_ERROR_NONE;
7070
}
71-
72-
iot_error_t iot_bsp_system_get_uniqueid(unsigned char **uid, size_t *olen)
73-
{
74-
unsigned int *buf;
75-
unsigned int chipid_reg = EFUSE_BLK0_RDATA1_REG; /* CRC of MAC */
76-
size_t chipid_len = 2 * sizeof(unsigned int);
77-
78-
buf = (unsigned int *)malloc(chipid_len);
79-
if (buf == NULL) {
80-
IOT_ERROR("malloc failed for uid");
81-
return IOT_ERROR_MEM_ALLOC;
82-
}
83-
84-
buf[0] = REG_READ(chipid_reg + 0x0);
85-
buf[1] = REG_READ(chipid_reg + 0x4);
86-
87-
*uid = (unsigned char *)buf;
88-
*olen = chipid_len;
89-
90-
return IOT_ERROR_NONE;
91-
}

src/port/bsp/esp32/iot_bsp_wifi_esp32.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@
2323
#include "freertos/event_groups.h"
2424

2525
#include "esp_idf_version.h"
26-
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4,0,0))
27-
#include "esp32/rom/ets_sys.h"
28-
#else
29-
#include "rom/ets_sys.h"
30-
#endif
3126
#include "esp_wifi.h"
3227
#include "esp_event.h"
3328
#include "esp_log.h"
@@ -520,11 +515,9 @@ uint16_t iot_bsp_wifi_get_scan_result(iot_wifi_scan_result_t *scan_result)
520515
iot_wifi_auth_mode_t conv_auth_mode;
521516

522517
switch (ap_list[i].authmode) {
523-
#if (ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4,3,0))
524518
case WIFI_AUTH_WAPI_PSK:
525519
conv_auth_mode = IOT_WIFI_AUTH_UNKNOWN;
526520
break;
527-
#endif
528521
case WIFI_AUTH_WPA2_WPA3_PSK:
529522
case WIFI_AUTH_WPA3_PSK:
530523
conv_auth_mode = IOT_WIFI_AUTH_WPA3_PERSONAL;

src/port/bsp/esp32c3/iot_bsp_system_esp32c3.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,24 +68,3 @@ iot_error_t iot_bsp_system_set_time_in_sec(const char* time_in_sec)
6868

6969
return IOT_ERROR_NONE;
7070
}
71-
72-
iot_error_t iot_bsp_system_get_uniqueid(unsigned char **uid, size_t *olen)
73-
{
74-
unsigned int *buf;
75-
unsigned int chipid_reg = EFUSE_RD_MAC_SPI_SYS_0_REG; /* FACTORY MAC */
76-
size_t chipid_len = 2 * sizeof(unsigned int);
77-
78-
buf = (unsigned int *)malloc(chipid_len);
79-
if (buf == NULL) {
80-
IOT_ERROR("malloc failed for uid");
81-
return IOT_ERROR_MEM_ALLOC;
82-
}
83-
84-
buf[0] = REG_READ(chipid_reg + 0x0);
85-
buf[1] = REG_READ(chipid_reg + 0x4);
86-
87-
*uid = (unsigned char *)buf;
88-
*olen = chipid_len;
89-
90-
return IOT_ERROR_NONE;
91-
}

src/port/bsp/esp32s2/iot_bsp_system_esp32s2.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,3 @@ iot_error_t iot_bsp_system_set_time_in_sec(const char* time_in_sec)
6868

6969
return IOT_ERROR_NONE;
7070
}
71-
72-
iot_error_t iot_bsp_system_get_uniqueid(unsigned char **uid, size_t *olen)
73-
{
74-
/* TODO : Neet to be reviewed */
75-
#if 0
76-
unsigned int *buf;
77-
unsigned int chipid_reg = EFUSE_BLK0_RDATA1_REG; /* CRC of MAC */
78-
size_t chipid_len = 2 * sizeof(unsigned int);
79-
80-
buf = (unsigned int *)malloc(chipid_len);
81-
if (buf == NULL) {
82-
IOT_ERROR("malloc failed for uid");
83-
return IOT_ERROR_MEM_ALLOC;
84-
}
85-
86-
buf[0] = REG_READ(chipid_reg + 0x0);
87-
buf[1] = REG_READ(chipid_reg + 0x4);
88-
89-
*uid = (unsigned char *)buf;
90-
*olen = chipid_len;
91-
#endif
92-
93-
return IOT_ERROR_BAD_REQ;
94-
}

src/port/bsp/esp8266/iot_bsp_system_esp8266.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -69,26 +69,3 @@ iot_error_t iot_bsp_system_set_time_in_sec(const char* time_in_sec)
6969

7070
return IOT_ERROR_NONE;
7171
}
72-
73-
iot_error_t iot_bsp_system_get_uniqueid(unsigned char **uid, size_t *olen)
74-
{
75-
unsigned int *buf;
76-
unsigned int *chipid_reg = (unsigned int *)EFUSE_DATA0_REG;
77-
size_t chipid_len = 4 * sizeof(unsigned int);
78-
79-
buf = (unsigned int *)malloc(chipid_len);
80-
if (buf == NULL) {
81-
IOT_ERROR("malloc failed for uid");
82-
return IOT_ERROR_MEM_ALLOC;
83-
}
84-
85-
buf[0] = REG_READ(chipid_reg++);
86-
buf[2] = REG_READ(chipid_reg++);
87-
buf[1] = REG_READ(chipid_reg++);
88-
buf[3] = REG_READ(chipid_reg++);
89-
90-
*uid = (unsigned char *)buf;
91-
*olen = chipid_len;
92-
93-
return IOT_ERROR_NONE;
94-
}

src/port/bsp/linux/iot_bsp_system_linux.c

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -74,29 +74,3 @@ iot_error_t iot_bsp_system_set_time_in_sec(const char* time_in_sec)
7474

7575
return IOT_ERROR_NONE;
7676
}
77-
78-
iot_error_t iot_bsp_system_get_uniqueid(unsigned char **uid, size_t *olen)
79-
{
80-
FILE *fp = NULL;
81-
unsigned char *machine_id;
82-
int pos;
83-
84-
machine_id = (unsigned char*)malloc(MACHINE_ID_LEN_BYTES);
85-
if (!machine_id)
86-
return IOT_ERROR_MEM_ALLOC;
87-
88-
fp = fopen(MACHINE_ID_FILE, "r");
89-
if (!fp) {
90-
printf("could not open the file: %s", MACHINE_ID_FILE);
91-
return IOT_ERROR_READ_FAIL;
92-
}
93-
94-
for (pos = 0; pos < MACHINE_ID_LEN_BYTES && !feof(fp); pos++)
95-
fscanf(fp, "%2hhx", &machine_id[pos]);
96-
97-
fclose(fp);
98-
*uid = machine_id;
99-
*olen = MACHINE_ID_LEN_BYTES;
100-
101-
return IOT_ERROR_NONE;
102-
}

0 commit comments

Comments
 (0)