Kii Thing SDK Embedded
 All Classes Files Functions Variables Typedefs
Kii Thing SDK Embedded Documentation

Standard Build

```sh make ```

Standard build with default variables.

Debug Build

```sh make DEBUG=1 ```

Standard build for debugging.

Configure KII_PUSH_KEEP_ALIVE_INTERVAL_SECONDS

KII_PUSH_KEEP_ALIVE_INTERVAL_SECONDS macro is used to manage the Keep Alive Time Interval in MQTT. By default it is set to 300 seconds in the Makefile. To override the value, we provides KEEP_ALIVE_INTERVAL variable.

``` make KEEP_ALIVE_INTERVAL=600 ```

If 0 is specified, turn off the keep alive mechanism defined in MQTT. Setting short period will increase the load of MQTT broker when there is a lot of connected devices. For details, please refer to the MQTT spec.

Configure KII_JSON_FIXED_TOKEN_NUM

KII_JSON_FIXED_TOKEN_NUM macro is used to manage amount memory used to parse JSON when received it from server. Memory is allocated on stack. By default it is set to 128 in the Makefile. To override the value, we provides FIXED_JSON_TOKEN_NUM variable.

``` make FIXED_JSON_TOKEN_NUM=256 ```

Size of memory allocated by this can be calculated as following. ```c sizeof(kii_json_token_t) * KII_JSON_FIXED_TOKEN_NUM ```

Dynamic memory allocation for JSON parsing

If you prefer to dynamica allocation than fixed memory allocation by KII_JSON_FIXED_TOKEN_NUM, You will build sdk with FLEXIBLE_JSON_TOKEN variable.

``` make FLEXIBLE_JSON_TOKEN=1 ```

In this case, you need to implement KII_JSON_RESOURCE_CB function and set the pointer in kii_t struct.

If both KII_JSON_FIXED_TOKEN_NUM and FLEXIBLE_JSON_TOKEN are specified, KII_JSON_FIXED_TOKEN_NUM is ignored.

Connect MQTT server using non-secure connection.

By default SDK connect to a MQTT broker using secure connection(tls). If you need to use non-secure connection(tcp) , please set KII_MQTT_USE_PORT_TCP macro.

``` make KII_MQTT_USE_PORT_TCP=1 ```

Combination of variables

Only KII_JSON_FIXED_TOKEN_NUM and FLEXIBLE_JSON_TOKEN is exclusive. DEBUG, KEEP_ALIVE_INTERVAL, KII_MQTT_USE_PORT_TCP and either KII_JSON_FIXED_TOKEN_NUM or FLEXIBLE_JSON_TOKEN can be combined.

ex.)

``` make DEBUG=1 KEEP_ALIVE_INTERVAL=3600 KII_MQTT_USE_PORT_TCP=1 FLEXIBLE_JSON_TOKEN=1 ```