Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of contents

...

Table of Contents
minLevel1
maxLevel4

Overview

...

A schematic diagram is shown below.

...

How to Manage Parameters

...

Application parameter setting sequence

...

Application stopping state

...

Application running state

...

Data type of parameters

...

Boolean: logical data type
Description
Represented by either “TRUE” or “FALSE”
Example
TRUE, FALSE

Integer: integral data type
Description
Signed 64-bit integral data
The range of value is from -9223372036854775808 to 9223372036854775807
Example
0, 12345, -9876543

String: character data type
Description
Less than 1023 characters
UTF-8 characters
Escape character is available(however, you must insert ‘¥’ before escape characters)
Example
“ABC xyz 012”, “¥/123456¥”abcd”

Enumeration: enumerated data type
Description
Consists of a set of named values
Available named values are same as String data type
The value needs more than one character
The character must not be duplicated
Example
definition:[“Item0”, “Item1”, “Item2”, “Item3”], value:“Item0”, “Item1”
definition:[“¥/123456¥”abcd”, “ABC xyz 123”, “”], value:“¥/123456¥”abcd”

Binary: Binary data type
Description
String data of Base64 encoded binary data
Size limit is 32KB.(Exceeded data will be discarded)
Example
Bitmap Image, feature vector

Access Permission of Parameters

...

Restricting access for each parameter

appApiAccess:access permit setting from AdamApp API
ReadWrite
Able to Read/Write parameters from AdamApp API
Read
Only able to Read parameters from AdamApp API (unable to write parameters)

webApiAccess:access permit setting from WebAPI
ReadWrite
Able to Read/Write parameters from WEBAPI
Read
Only able to Read parameters from WEB API ( unable to write parameters )
None
Unable to either Read nor Write parameters from WEBAPI

Parameter File Format

...

Parameter definition file (PrefDefFile:appPrefs.json)

{
"preferenceVersion" :{"major":"1", "minor":"1"},

"preference": [ {"prefName" :"Pref0",
"prefType" :"Boolean",
"appApiAccess" :"ReadWrite",
"webApiAccess" :"ReadWrite",
"defaultValue" :"TRUE" },


{"prefName" :"Pref1",
"prefType" :"Integer",
"appApiAccess" :"Read",
"webApiAccess" :"None",
"defaultValue" :"0"} ,


{"prefName" :"Pref2",
"prefType" :"String",
"defaultValue" :"This is a ¥"String¥"."} ,


{"prefName" :"Pref3",
"prefType" :"Enumeration",
"enumerationList" : ["Item0", "Item1", "Item2"],
"defaultValue" :"Item0"} ,


{"prefName" :"Pref4",
"prefType" :"Binary",
"defaultValue" :" YWJjZGVmZWZn"}
]
}

...

Explain parameter definition file.

...

Size Limitation of Parameter Files

...

Maximum Parameter Definition File(PrefDefFile:appPrefs.json) size is 64KB.
※the file size is checked when Application Package is installed. (it returns preference error if the definition file size exceeds 64KB)

...

Boolean type:size of prefName + 154 + size of value(true(4)/false(5))+ size of defaultValue(true(4)/false(5))+ size of webApiAccess(ReadWrite(9)/Read(4)/None(4)) + size of appApiAccess(ReadWrite(9)/Read(4))

Integer type:size of prefName + 154 + size of value + size of defaultValue+ size of webApiAccess(ReadWrite(9)/Read(4)/None(4)) + size of appApiAccess(ReadWrite(9)/Read(4))

String type:size of prefName + 153 + size of value + size of defaultValue+ size of webApiAccess(ReadWrite(9)/Read(4)/None(4)) + size of appApiAccess(ReadWrite(9)/Read(4))

Enumeration型:size of prefName + 193 + size of value + size of defaultValue+ (size of named Value + 17) * Number of Enumeration List+ size of webApiAccess(ReadWrite(9)/Read(4)/None(4)) + size of appApiAccess(ReadWrite(9)/Read(4))

Binary type:size of prefNam + 153 + size of value + size of defaultValue+ size of webApiAccess(ReadWrite(9)/Read(4)/None(4)) + size of appApiAccess(ReadWrite(9)/Read(4))

Size of Parameter Saved File: each parameter size + 109 + size of majorVersion + size of minorVersion+ number of escape characters

How to Update Application Parameters

...

Compare preferenceVersion of Installed Application(A) and that of update package(B)

...

preferenceVersion is replaced by (B) when updated.

How to Restore Parameters

...

Making a comparison between The preferenceVersion of Installed Application(A) and the preferenceVersion of restore file(B)

...

preferenceVersion does not change after the restoration

API Specification

...

For the WebAPI specification, please refer to AdamWebAPI(AdamWebAPI_Specification_Vx_xx.pdf).

For the AppAPI specification, please refer to AdamAppAPI(AdamAppAPI_Specification_Vx_xx.pdf).

API List for AdamApp

...

Parameter Getting API

E_ADAM_ERR ADAM_AppPref_GetBoolean(const char* pPrefName, bool* pValue);
E_ADAM_ERR ADAM_AppPref_GetInteger(const char* pPrefName, int64_t* pValue);
E_ADAM_ERR ADAM_AppPref_GetString(const char* pPrefName, char* pValue, unsigned int size);
E_ADAM_ERR ADAM_AppPref_GetEnumeration(const char* pPrefName, unsigned int* pValue);
E_ADAM_ERR ADAM_AppPref_GetBinary(const char* pPrefName, unsigned char* pValue,
unsigned int size);

...

typedef void (T_ADAM_NOTIFY_APP_PREF_UPDATE_HANDLER)(char const pPrefName[], const
unsigned int prefSize);
typedef struct ST_ADAM_SYSTEM_HANDLERS {
T_ADAM_STOP_HANDLER m_stopHandler;
T_ADAM_NOTIFY_APP_PREF_UPDATE_HANDLER m_notifyAppPrefUpdateHandler;
T_ADAM_SERVER_REQUEST_RECEIVE_HANDLER m_serverRequestReceiveHandler;
} ST_ADAM_SYSTEM_HANDLERS;

Parameter File Format

...

Parameter Definition File(PrefDefFile : appPrefs.json)

{
"preferenceVersion": {"major":"1", "minor":"1"},
"preference":[{"prefName" :"Pref0",
"prefType" :"Boolean",
"appApiAccess" :"ReadWrite",
"webApiAccess" :"ReadWrite",
"defaultValue" :"TRUE" },

{"prefName" :"Pref1",
"prefType" :"Integer",
"appApiAccess" :"Read",
"webApiAccess" :"None",
"defaultValue" :"0"} ,

{"prefName" :"Pref2",
"prefType" :"String",
"appApiAccess" :"Read",
"webApiAccess" :"Read",
"defaultValue" :"ABC"} ,

{"prefName" :"Pref3",
"prefType" :"Enumeration",
"enumerationList" :
["Item0", "Item1", "Item2"]
"defaultValue" :"Item0"} ,
}

...