<STG_STD>
BEHAVIOR for Interactve settings mode
<STG_STD> is a configuration BEHAVIOR with minimal configuration items.
This BEHAVIOR hooks the input/output of the Serial object and performs screen input/output in Interactive settings mode. There is no need to explicitly describe input processing in the application. Screen output from the application is suppressed during Interactive settings mode.
Enter the M key to access auxiliary functions. See the Extra Menu item at the end of this section.
Usage
Registration
Add #include <STG_STD>
as above.
Reading with setup()
In most cases, settings are read out early in the setup()
process.
The above example first registers the settings behavior with the_twelite.settings.use<STG_STD>()
.
Immediately after registration, you can make changes to the configuration behavior, such as changing the default Application ID, which is described later.
Next, call set.reload()
to actually read the data from the EEPROM and interpret it. Note that it does not read the data automatically.
set.u32appid()
, set.u8ch()
, and set.u8devid()
get the set values of Application ID, CHANNEL, and logical device ID, respectively. Here, each set value is stored in a variable.
Since the internal data structure storing the setting values is relatively complex, it is necessary to search the data in the design array until the desired setting is obtained. If you are concerned about computational complexity, store the configuration values in a separate variable.
Then, use the setting values to reflect the values of Application ID, CHANNEL, etc.
List of settings
The following is the list of setting IDs (enum class E_STGSTD_SETID
) definition.
Setting ID | Contents |
---|---|
| Application ID |
| Logical device ID (8bit) |
| CHANNEL |
| Channel (up to 3 channels) |
| Outputs and retry counts |
| Option 1 |
| Option 2 |
| Output and Retry Count |
| Option 3 |
| Encryption Mode |
| Encryption key (string input) |
In <STG_STD>
, four typical settings and four freely available 32-bit values are defined. These are freely available to the user.
Settings are not reflected by simply reading them from STG_STD>.
Unnecessary items can be hidden.
You can change the item name and item details.
Customizing a setting behavior
Customize all items of the configuration BEHAVIOR before .reload()
.
application_name
The application name appears on the first line of the Interactive settings mode.
Specify a string pointer. Local variables cannot be specified because we do not make copies internally.
Default value.
アプリケーションID、チャネル、論理ID(LID)については、デフォルト値を変更できます。
Multiple CHANNEL setting menu
When SETTINGS::ch_multi()
is specified, multiple CHANNEL settings are specified. When multiple settings are made, .u32chmask()
is used to read the setting values.
Display the setup screen immediately
Default values can be changed for Application ID, CHANNEL, and Logical ID.
Change of item name and description of details
You can change the item name to something else. In the above example, the Japanese name is set to UTF-8, but it will not be displayed properly unless the conditions, such as terminal display, are met.
In the case of TWELITE STAGE, if the number of characters in the registered font is reduced, some characters may not be displayed. Rebuild to include the necessary strings.
This array is terminated with { 0xFF }
at the end.
The first entry is the setting ID, the second is the item name, and the third is the description to be displayed when entering the setting. You can use \r
to start a new line.
Determine if you are currently in the settings screen
Output to serial while the setup screen is being output can cause screen corruption. To confirm that it is not the setup screen, use .is_screen_opened()
.
Deleting Items
Removes unwanted items. .hide_items
hides unnecessary items with the item ID as a parameter (multiple parameters can be specified as variable arguments). You can check whether an item is hidden or not by .is_hidden()
.
Application ID, CHANNEL, and Logical ID (LID) cannot be deleted.
The hide setting uses internal work memory. Since the minimum memory size (32 bytes) is set, if many hidden items are set, they may not be hidden due to insufficient memory. The capacity of work memory can be specified as a compile argument like -DSIZE_SETSTD_CUST_COMMON=48
.
Methods
reload()
設定を読み込みます。すべてのカスタマイズが終わってから実行します。
Methods (Reading data)
The following method is called to read data.
Be sure to call .reload()
before reading.
method | content |
---|---|
| Application ID |
| logical device ID |
| configuration channel (11..26) |
| CHANNEL setting mask (specified by bitmask, if 13, set bit to 1UL << 13) |
| output setting (0..3) |
| Number of retries. |
| Option 1 |
| option2 |
Option1 | Option2 |
Option3 |
|
| encryption mode (0: none 1: enable 2: enable, also display plaintext packets) |
| get encryption key |
Internally, a linear search of the structure array is performed to find the setting structure matching the setting ID, which has an overhead. Frequently referenced configuration values should be copied once to another variable for use.
Reflecting settings
You can use this object to directly reflect settings on the_twelite
and <NWK_SIMPLE>
objects.
The setting values to be reflected are as follows. Items hidden by .hide_items()
are not reflected.
Target | Item ID | Contents |
---|---|---|
|
| reflected in |
|
| |
|
| |
| Setting by Note: The retry settings with | |
|
| Set by |
| Set by |
Item ID
You may specify item IDs with .hide_items()
and so on. This item ID is defined in enum class E_STGSTD_SETID
.
E_STGSTD_SETID:: | Contents |
---|---|
| Application ID |
| Logical ID (0..100) |
| CHANNEL |
| CHANNEL(specify multiple) |
| output and retry settings |
| option bits |
| Baud rate setting for UART |
| Option bits 2 |
| Optional bits 2 |
| Option bit 4 |
| Encryption Mode |
| encryption key |
Extra Menu
Enter the M key to access additional menus.
CONFIG : returns to the setup screen
EEPROM UTIL : This menu is used to perform EEPROM maintenance
H/W UTIL: This menu allows you to check hardware status
EEPROM UTIL
Reads or deletes a sector. To read all or delete all, enter the three letters "YES" in uppercase.
h/w util
最終更新