Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ All notable changes to this project are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

- iot-client — US region renamed to AZ(#7).
- The IoT DNS region string and token prefix for the US West (Oregon) data
center is `AZ`, not `US`. The enum member `US` is renamed to `AZ`,
`iot_region_to_string()` now returns `"AZ"`, and the host macros
`IOT_US_HOST` / `IOT_US_PRE_HOST` are renamed to `IOT_AZ_HOST` /
`IOT_AZ_PRE_HOST` (values unchanged). NVS-stored region integers are
unaffected (enum ordinal 1 is preserved).

## [0.3.0] - 2026-07-13

### Added
Expand Down
2 changes: 1 addition & 1 deletion docs-site/docs/reference/iot-client.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ sidebar_position: 3
| 值 | 名称 | 说明 |
|----|------|------|
| 0 | `AY` | 中国(上海)|
| 1 | `US` | 美国西部(俄勒冈) |
| 1 | `AZ` | 美国西部(俄勒冈) |
| 2 | `UEAZ` | 美国东部(佛吉尼亚) |
| 3 | `EU` | 欧洲(法兰克福) |
| 4 | `WEAZ` | 欧洲西部(荷兰埃姆斯哈文) |
Expand Down
2 changes: 1 addition & 1 deletion examples/esp-idf/ota-demo/main/app_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#define DEFAULT_SECRET_KEY "xxxxxxxxxxxxxxxx"
#define DEFAULT_LOCAL_KEY "xxxxxxxxxxxxxxxx"

/* Device region: AY, US, EU, UEAZ, WEAZ, IN, SG */
/* Device region: AY, AZ, EU, UEAZ, WEAZ, IN, SG */
#define DEFAULT_REGION AY
#define DEFAULT_ENV PROD

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ static void print_usage(const char *prog)
printf(" %s <token> Token pairing (activate directly)\n", prog);
printf("\n");
printf("Token format: [region:2][activation_token][secret:4]\n");
printf(" region : AY, US, UE, EU, WE, IN, SG\n");
printf(" region : AY, AZ, UE, EU, WE, IN, SG\n");
printf(" Example : AYabcdef12340000\n");
}

Expand Down
4 changes: 2 additions & 2 deletions modules/iot-client/include/iot_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

typedef enum {
AY = 0,
US,
AZ,
UEAZ,
EU,
WEAZ,
Expand Down Expand Up @@ -148,7 +148,7 @@ struct iot_dp_context;
char mqtt_url[64]; // MQTT broker URL (inline, mqtt://|mqtts://; "" = unresolved)
char *schema; // Device schema JSON (dynamically allocated)

iot_region_t region; // Server region (CN, US, EU, IN)
iot_region_t region; // Server region (CN, AZ, EU, IN)
iot_env_t env; // Environment (PROD or PRE)
bool mqtt_disable_tls; // false = mqtts (TLS), true = mqtt (TCP)
const pal_t *pal; // PAL adapter
Expand Down
2 changes: 1 addition & 1 deletion modules/iot-client/src/iot_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static const char *iot_region_to_string(iot_region_t region)
{
switch (region) {
case AY: return "AY";
case US: return "US";
case AZ: return "AZ";
case UEAZ: return "UEAZ";
case EU: return "EU";
case WEAZ: return "WEAZ";
Expand Down
4 changes: 2 additions & 2 deletions modules/iot-client/src/iot_config_defaults.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#define IOT_DEFAULT_PRE_HOST "a1-cn.wgine.com"
#define IOT_CN_HOST "a1.tuyacn.com"
#define IOT_CN_PRE_HOST "a1-cn.wgine.com"
#define IOT_US_HOST "a1.tuyaus.com"
#define IOT_US_PRE_HOST "a1-us.wgine.com"
#define IOT_AZ_HOST "a1.tuyaus.com"
#define IOT_AZ_PRE_HOST "a1-us.wgine.com"
#define IOT_UEAZ_HOST "a1-ueaz.tuyaeu.com"
#define IOT_UEAZ_PRE_HOST "a1-ueaz.wgine.com"
#define IOT_EU_HOST "a1.tuyaeu.com"
Expand Down
8 changes: 4 additions & 4 deletions modules/iot-client/src/iot_dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,8 +352,8 @@ char *iot_region_to_host(iot_region_t region, iot_env_t env)
switch (region) {
case AY:
return IOT_CN_PRE_HOST;
case US:
return IOT_US_PRE_HOST;
case AZ:
return IOT_AZ_PRE_HOST;
case UEAZ:
return IOT_UEAZ_PRE_HOST;
case EU:
Expand All @@ -369,8 +369,8 @@ char *iot_region_to_host(iot_region_t region, iot_env_t env)
switch (region) {
case AY:
return IOT_CN_HOST;
case US:
return IOT_US_HOST;
case AZ:
return IOT_AZ_HOST;
case UEAZ:
return IOT_UEAZ_HOST;
case EU:
Expand Down
8 changes: 4 additions & 4 deletions modules/iot-client/src/iot_on_boarding.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ static void parse_activation_message(const pal_t *pal, const char *json_str, act
const char *r = region->valuestring;
if (strcmp(r, "AY") == 0) {
message->region = AY;
} else if (strcmp(r, "US") == 0) {
message->region = US;
} else if (strcmp(r, "AZ") == 0) {
message->region = AZ;
} else if (strcmp(r, "EU") == 0) {
message->region = EU;
} else if (strcmp(r, "IN") == 0) {
Expand Down Expand Up @@ -380,8 +380,8 @@ static int __token_to_region(const char *token, iot_region_t *region)

if (strcmp(prefix, "AY") == 0) {
*region = AY;
} else if (strcmp(prefix, "US") == 0) {
*region = US;
} else if (strcmp(prefix, "AZ") == 0) {
*region = AZ;
} else if (strcmp(prefix, "UE") == 0) {
*region = UEAZ;
} else if (strcmp(prefix, "EU") == 0) {
Expand Down
Loading