The remote configuration tool is used to generate a device configuration header file and upload device configuration information to Device Cloud. It allows you to define all device configuration data and information that can be accessed through Device Cloud using Cloud Connector. You must include the generated header file and provide callback functions to handle all device configuration within an application.
java -jar ConfigGenerator.jar [-help] [-verbose] [-nodesc] [-vendor] [-path] [-url] <"username"[:"password"]> <device_type> <firmware_version> <input_config_file>
Generates and uploads configuration information (descriptors) to Device Cloud and also generates ANSI C header files (remote_config.h) from the input Cloud Connector configuration file. This header file must be included in the application.
NOTE: username, password,vendor_id, device_type and firmware_version are used for accessing your Device Cloud account and uploading device configuration information (descriptors) for your device.
java -jar ConfigGenerator.jar username:password "Linux Application" 1.0.0.0 config.rci
ConfigGenerator.jar is located within the [Etherios_Cloud_Connector_Installation_Path]\Tools\ folder.
You must define all device configuration data and system information that is accessed through Device Cloud, and run the tool to generate the remote_config.h file. When doing so you must include the remote_config.h header file and provide callbacks to handle all device configuration data and system information.
The following keywords should be used to define device configuration data and system information:
A globalerror is used to define the text in Device Cloud when an error condition occurs. Globalerrors define errors common to all configurations.
globalerror <name> <description>
<name> with connector_global_error_ prefix enumeration value for each error. This error enumeration value will be used by the application-defined callback to return an error which is sent along to Device Cloud.globalerror load_fail "Unable to load configuration"
globalerror save_fail "Unable to save configuration"
globalerror memory_fail "Insufficient memory"
The enumeration values:
connector_global_error_load_fail
connector_global_error_save_fail
connector_global_error_memory_fail
A group is used to define device configuration data and information about the current state of the device. It contains metadata about the element named in the element keyword.
group <type> <name> [count] <description> [help_description]
<name> with connector_<type>_ prefix enumeration value to identify the group. Cloud Connector passes this enumeration value to the application-defined callback for accessing the group.group setting serial 2 "Serial Port"
group state system_info "System Information"
The enumeration values:
connector_setting_serial
connector_state_system_info
An error is used to define the text in Device Cloud when an error condition occurs. It is used to specify an error for an individual group.
error <name> <description>
<name> with connector_<group_type>_<group_name>_error_ prefix enumeration value for each error. This error enumeration value will be used by the application-defined callback to return an error which is sent along to Device Cloud.error invalid_databits "invalid data bits rate"
The enumeration values:
connector_setting_serial_error_invalid_data
An element is used to describe valid fields in a group. It describes an element under the group that has a type and contains a value.
element <name> <description> [help_description] type <type_value> [min <min_value>] [max <max_value>] [access <access_value>] [units <units_description>]
<name> with connector_<group_type>_ prefix enumeration value to identify the element. Cloud Connector passes this enumeration value to the application-defined callback for accessing the element.element ip_addr "Static IP Address" type ipv4 access read_write
The enumeration values:
connector_setting_ethernet_ip_addr
"type" is used to indicate the value type of an element's value named in the element keyword. Type is use to indicate to the descriptor user which restrictions to place on a value and how to interpret a value received from Cloud Connector.
type <value>
"2002-05-30T09:30:10-0600" "2002-05-30T15:30:10Z"element ip_addr "Static IP Address" type ipv4 access read_write
"value" is used to define a set of values for an element named in the element keyword with enum type (type keyword).
value <name> [description] [help_description]
<name> with connector_<group_type>_<group_name>_<element_name>_ prefix enumeration value for each values. Cloud Connector and the application-defined callback use this enumeration value to set and retrieve the value of an element.element baud "Baud rate" type enum access read_write
value auto "Automatic"
value 1200
value 2400
value 9600
value 19200
The enumeration values:
connector_setting_serial_baud_auto
connector_setting_serial_baud_300
connector_setting_serial_baud_2400
connector_setting_serial_baud_9600
connector_setting_serial_baud_19200
"min" is used to specify minimum value or length of an element.
min <value>
element setting sys_password type password min 8 max 31
"max" is used to specify maximum value or length of an element.
max <value>
element setting sys_password type password min 8 max 31
"access" is used to define accessibility of an element named in the element keyword; default is read_write. This tells Cloud Connector and Device Cloud whether an element is settable or not. It's grayed out if read_only is specified.
access <value>
element setting sys_password type password access read_only min 8 max 31
"units" is used to define the displayed text in Device Cloud. It's used as the units for the element.
units <description>
element sys_up_time "System up time" type uint32 access read_only units "seconds"
The # symbol is used for comments. Any sequence of characters after # will be treated as a comment and will not be processed.
# State configuration for GPS
# Must setup the following group in order for GPS shown in Device Cloud.
globalerror load_fail "Load fail"
globalerror save_fail "Save fail"
globalerror memory_fail "Insufficient memory"
group setting serial 2 "Serial Port" "Port 1 is used for printf"
element baud "Baud rate" type enum access read_write
value 2400
value 4800
value 9600
value 19200
value 38400
value 57600
value 115200
value 230400
element parity "Parity" type enum access read_write
value none
value odd
value even
element databits "Data bits" type uint32 access read_write min 5 max 8
element xbreak "Tx Break" type on_off access read_write
element txbytes "Tx bytes" type uint32 access read_only
error invalid_baud "Invalid baud rate "
error invalid_databits "Invalid data bits"
error invalid_parity " Invalid parity"
error invalid_xbreak "Invalid xbreak setting"
error invalid_databits_parity "Invalid combination of data bits and parity"
group setting device_info "Device info"
element product "Product" type string access read_write min 1 max 64
element model "Model" type string access read_write min 0 max 32
element company "Company" type string access read_write
element desc "Description" type multiline_string access read_write
element syspwd "System password" type password access read_write max 64
error invalid_length "invalid length"
group state debug_info "Debug info on Cloud Connector thread"
element version "Version" type string access read_only
element stacktop "Stack begin" type 0x_hex32 access read_only
element stacksize "Stack size" type hex32 access read_only
element stackbottom "Stack end" type 0xhex access read_only
element usedmem "Allocated memory used" type uint32 access read_only
# State configuration for GPS
# Must setup the following group in order for GPS shown in Device Cloud.
group state gps_stats "GPS"
element latitude "Latitude" type float access read_only
element longitude "Longitude" type float access read_only