Skip to content

Commit

Permalink
同步至iLop AT MX1290_0000.ILOP.A220,增加站点配置指令
Browse files Browse the repository at this point in the history
  • Loading branch information
miaogs committed Oct 25, 2018
1 parent 54c0621 commit 2082895
Show file tree
Hide file tree
Showing 7 changed files with 68 additions and 5 deletions.
24 changes: 23 additions & 1 deletion examples/ilopicaapp/ilopmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include "mx_cli.h"
#include "mx_hal.h"

#ifdef USE_DOMAIN_GLOBAL
const char thing[] = "{\"schema\":\"https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json\",\"profile\":{\"productKey\":\"a1MeLuIJPYL\"},\"services\":[{\"outputData\":[],\"identifier\":\"set\",\"inputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"method\":\"thing.service.property.set\",\"name\":\"set\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性设置\"},{\"outputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"identifier\":\"get\",\"inputData\":[\"LightSwitch\",\"ColorTemperature\",\"NightLightSwitch\",\"WorkMode\",\"RGBColor\"],\"method\":\"thing.service.property.get\",\"name\":\"get\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性获取\"},{\"outputData\":[],\"identifier\":\"TimeReset\",\"inputData\":[{\"identifier\":\"TimeReset\",\"dataType\":{\"specs\":{\"length\":\"255\"},\"type\":\"text\"},\"name\":\"TimeReset\"}],\"method\":\"thing.service.TimeReset\",\"name\":\"设备校时服务\",\"required\":false,\"callType\":\"async\"}],\"properties\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\",\"accessMode\":\"rw\",\"required\":true},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\",\"accessMode\":\"rw\",\"required\":false}],\"events\":[{\"outputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"identifier\":\"post\",\"method\":\"thing.event.property.post\",\"name\":\"post\",\"type\":\"info\",\"required\":true,\"desc\":\"属性上报\"},{\"outputData\":[{\"identifier\":\"ErrorCode\",\"dataType\":{\"specs\":{\"0\":\"恢复正常\"},\"type\":\"enum\"},\"name\":\"故障代码\"}],\"identifier\":\"Error\",\"method\":\"thing.event.Error.post\",\"name\":\"故障上报\",\"type\":\"error\",\"required\":true}]}";

static int awss_start = 0;
Expand All @@ -43,6 +44,27 @@ const emh_ilop_config_t ilop_config = {
.tsl_thing = thing,
.tsl_len = strlen(thing),
.dm = EMH_ARG_ILOP_DM_ICA_BY_LOCAL,
.domain = EMH_ARG_ILOP_DOMAIN_SINGAPORE,
};

const ilop_device_key_t device_key = {
.product_key = "a1JjSehcuht",
.product_secret = "K2l3CXzeiRgaaCEt",
.device_name = "light_g",
.device_secret = "gCk4yIDdXce7mdSrhJbpZyC9z3PiqjfB",
};
#else
const char thing[] = "{\"schema\":\"https://iotx-tsl.oss-ap-southeast-1.aliyuncs.com/schema.json\",\"profile\":{\"productKey\":\"a1MeLuIJPYL\"},\"services\":[{\"outputData\":[],\"identifier\":\"set\",\"inputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"method\":\"thing.service.property.set\",\"name\":\"set\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性设置\"},{\"outputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"identifier\":\"get\",\"inputData\":[\"LightSwitch\",\"ColorTemperature\",\"NightLightSwitch\",\"WorkMode\",\"RGBColor\"],\"method\":\"thing.service.property.get\",\"name\":\"get\",\"required\":true,\"callType\":\"async\",\"desc\":\"属性获取\"},{\"outputData\":[],\"identifier\":\"TimeReset\",\"inputData\":[{\"identifier\":\"TimeReset\",\"dataType\":{\"specs\":{\"length\":\"255\"},\"type\":\"text\"},\"name\":\"TimeReset\"}],\"method\":\"thing.service.TimeReset\",\"name\":\"设备校时服务\",\"required\":false,\"callType\":\"async\"}],\"properties\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\",\"accessMode\":\"rw\",\"required\":true},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\",\"accessMode\":\"rw\",\"required\":false},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\",\"accessMode\":\"rw\",\"required\":false}],\"events\":[{\"outputData\":[{\"identifier\":\"LightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"主灯开关\"},{\"identifier\":\"ColorTemperature\",\"dataType\":{\"specs\":{\"unit\":\"K\",\"min\":\"2700\",\"unitName\":\"开尔文\",\"max\":\"6500\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"冷暖色温\"},{\"identifier\":\"NightLightSwitch\",\"dataType\":{\"specs\":{\"0\":\"关闭\",\"1\":\"开启\"},\"type\":\"bool\"},\"name\":\"夜灯开关\"},{\"identifier\":\"WorkMode\",\"dataType\":{\"specs\":{\"0\":\"手动\",\"1\":\"阅读\",\"2\":\"影院\",\"3\":\"夜灯\",\"4\":\"生活\",\"5\":\"柔和\"},\"type\":\"enum\"},\"name\":\"工作模式\"},{\"identifier\":\"RGBColor\",\"dataType\":{\"specs\":[{\"identifier\":\"Red\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"红色\"},{\"identifier\":\"Green\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"绿色\"},{\"identifier\":\"Blue\",\"dataType\":{\"specs\":{\"min\":\"0\",\"unitName\":\"无\",\"max\":\"255\",\"step\":\"1\"},\"type\":\"int\"},\"name\":\"蓝色\"}],\"type\":\"struct\"},\"name\":\"RGB调色\"}],\"identifier\":\"post\",\"method\":\"thing.event.property.post\",\"name\":\"post\",\"type\":\"info\",\"required\":true,\"desc\":\"属性上报\"},{\"outputData\":[{\"identifier\":\"ErrorCode\",\"dataType\":{\"specs\":{\"0\":\"恢复正常\"},\"type\":\"enum\"},\"name\":\"故障代码\"}],\"identifier\":\"Error\",\"method\":\"thing.event.Error.post\",\"name\":\"故障上报\",\"type\":\"error\",\"required\":true}]}";

static int awss_start = 0;
static int awss_press = 0;
static int reset = 0;

const emh_ilop_config_t ilop_config = {
.tsl_thing = thing,
.tsl_len = strlen(thing),
.dm = EMH_ARG_ILOP_DM_ICA_BY_LOCAL,
.domain = EMH_ARG_ILOP_DOMAIN_SHANGHAI,
};

const ilop_device_key_t device_key = {
Expand All @@ -51,7 +73,7 @@ const ilop_device_key_t device_key = {
.device_name = "aQI0eEM5g2nlSr2njD0x",
.device_secret = "o7EZShzl6z8F3xq8qF3vN9P7HFGslRAV",
};

#endif
static void user_tast_loop(void)
{
if (awss_start == 1) {
Expand Down
5 changes: 3 additions & 2 deletions examples/iloprawapp/ilopmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ static int awss_press = 0;
static int reset = 0;

const emh_ilop_config_t ilop_config = {
.tls_thing = NULL,
.tls_len = 0,
.tsl_thing = NULL,
.tsl_len = 0,
.dm = EMH_ARG_ILOP_DM_RAW,
.domain = EMH_ARG_ILOP_DOMAIN_SHANGHAI,
};

const ilop_device_key_t device_key = {
Expand Down
4 changes: 2 additions & 2 deletions src/alicloud_ilop/raw_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ static mx_status protocol_payloa_handler(uint8_t* data, uint16_t length)
break;

default:
ilop_wlog("Method(%d) not support\n", payload->method);
ilop_log("Method(%d) not support\n", payload->method);
return kParamErr;
}

Expand All @@ -324,7 +324,7 @@ mx_status raw_protocol_format_handler(uint8_t* data, uint32_t length)
break;

default:
ilop_wlog("Cmd %02x not support\n", cmd);
ilop_log("Cmd %02x not support\n", cmd);
break;
}

Expand Down
1 change: 1 addition & 0 deletions src/helper/emhost/emh_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ typedef struct {
const char* tsl_thing; /**< TSL model defined by Alibaba cloud platform(json string). if dm=EMH_ARG_ILOP_DM_RAW, tls_thing=NULL */
uint32_t tsl_len; /**< The JSON string length of the TSL model. if dm=EMH_ARG_ILOP_DM_RAW, tls_len=0 */
emh_arg_ilop_dm_t dm; /**< The method to access the TLS, raw , local, cloud.*/
emh_arg_ilop_domain_t domain; /**< specify the could server domain */
} emh_ilop_config_t;

/**
Expand Down
10 changes: 10 additions & 0 deletions src/helper/emhost/emh_arg.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,16 @@ const char* EMH_ARG_ILOP_DM[] =
[EMH_ARG_ILOP_DM_MAX] = "\0",
};

const char* EMH_ARG_ILOP_DOMAIN[] =
{
[EMH_ARG_ILOP_DOMAIN_SHANGHAI] = "0",
[EMH_ARG_ILOP_DOMAIN_SINGAPORE] = "1",
[EMH_ARG_ILOP_DOMAIN_JAPAN] = "2",
[EMH_ARG_ILOP_DOMAIN_AMERICA] = "3",
[EMH_ARG_ILOP_DOMAIN_GERMANY] = "4",
[EMH_ARG_ILOP_DOMAIN_MAX] = "\0",
};

const char* EMH_ARG_ILOP_CONFIG[] =
{
[EMH_ARG_ILOP_CONFIG_NONE] = "NONE",
Expand Down
11 changes: 11 additions & 0 deletions src/helper/emhost/emh_arg.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,17 @@ enum{
typedef uint8_t emh_arg_ilop_dm_t;
extern const char* EMH_ARG_ILOP_DM[];

enum{
EMH_ARG_ILOP_DOMAIN_SHANGHAI,
EMH_ARG_ILOP_DOMAIN_SINGAPORE,
EMH_ARG_ILOP_DOMAIN_JAPAN,
EMH_ARG_ILOP_DOMAIN_AMERICA,
EMH_ARG_ILOP_DOMAIN_GERMANY,
EMH_ARG_ILOP_DOMAIN_MAX,
};
typedef uint8_t emh_arg_ilop_domain_t;
extern const char* EMH_ARG_ILOP_DOMAIN[];

enum{
EMH_ARG_ILOP_CONFIG_NONE,
EMH_ARG_ILOP_CONFIG_TLS,
Expand Down
18 changes: 18 additions & 0 deletions src/helper/emhost/emh_ilop.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,24 @@ mx_status emh_ilop_config( emh_ilop_config_t *config, bool force )
return kParamErr;
}


//check domain
if (!(ATCmdParser_send("AT+ILOPDOMAIN?")
&& ATCmdParser_recv("+ILOPDOMAIN:%10[^\r]\r\n",arg)
&& ATCmdParser_recv("OK\r\n"))) {
return kReadErr;
}

//if dm value different, we need to be set
if( emh_arg_for_arg( EMH_ARG_ILOP_DOMAIN, arg) != config->domain )
{
if ( !(ATCmdParser_send("AT+ILOPDOMAIN=%s", emh_arg_for_type(EMH_ARG_ILOP_DOMAIN, config->domain))
&& ATCmdParser_recv("OK\r\n"))) {
return kReadErr;
}
}


//check data format
if (!(ATCmdParser_send("AT+ILOPDM?")
&& ATCmdParser_recv("+ILOPDM:%10[^\r]\r\n",arg)
Expand Down

0 comments on commit 2082895

Please sign in to comment.