MiraOS provisioning application.
More...
Go to the source code of this file.
|
enum | MiraProvisionState { MIRA_PROV_UNKOWN = 0,
MIRA_PROV_PROVISIONED = 1,
MIRA_PROV_PRE_PROVISIONED = 2,
MIRA_PROV_TEMP_PRE_PROVISIONED = 3
} |
| Provisioning States. More...
|
|
enum | MiraProvisionDeviceSelectedState { MIRA_PROV_DEVICE_NOT_SELECTED = 0,
MIRA_PROV_DEVICE_SELECTED = 1
} |
| Device selection states. More...
|
|
enum | MiraConfigDataError {
MIRA_CONFIG_DATA_SUCCESS = 0,
MIRA_CONFIG_DATA_UNKNOWN_PAGE = 1,
MIRA_CONFIG_DATA_EMPTY = 2,
MIRA_CONFIG_DATA_WRITE_IN_PROGRESS = 3,
MIRA_CONFIG_DATA_WRITE_NOT_IN_PROGRESS = 4,
MIRA_CONFIG_DATA_WRITE_PROTECTED = 5
} |
| Result codes for provisioning configuration data. More...
|
|
enum | MiraConfigWriteProtection { MIRA_CONFIG_WRITE_PROTECTION_WRITE_ONCE = 0,
MIRA_CONFIG_WRITE_PROTECTION_NONE = 1
} |
| Write protection configuration options. More...
|
|
MiraOS provisioning application.
- Author
- LumenRadio AB
- Date
- 17 Jan 2016 The MiraOS library provides functions for controlling the Mira radio module, sending/receiving messages, controlling peripherals, etc.
- See also
- http://docs.lumenrad.io/mira
◆ MiraConfigWrittenCallback
typedef void(* MiraConfigWrittenCallback) (uint8_t id) |
Function pointer to provisioning data written callback. Called when configuration data block has been written.
- Parameters
-
id | the configuration block ID that was written |
- Returns
- void
◆ MiraProvisioningCallback
Function pointer to provisioning state change callback. Called when provisioning state changes or if device gets selected/deselected.
- Parameters
-
selected_state | the device selected state |
provisioning_state | the new provisioning state |
- Returns
- void
◆ MiraConfigDataError
Result codes for provisioning configuration data.
Enumerator |
---|
MIRA_CONFIG_DATA_SUCCESS | Success
|
MIRA_CONFIG_DATA_UNKNOWN_PAGE | Configuration block or page number is unknown
|
MIRA_CONFIG_DATA_EMPTY | Configuration block is empty
|
MIRA_CONFIG_DATA_WRITE_IN_PROGRESS | A write is currently in progress
|
MIRA_CONFIG_DATA_WRITE_NOT_IN_PROGRESS | Writing has not been started
|
MIRA_CONFIG_DATA_WRITE_PROTECTED | Data block is write protected
|
◆ MiraConfigWriteProtection
Write protection configuration options.
Enumerator |
---|
MIRA_CONFIG_WRITE_PROTECTION_WRITE_ONCE | Write once
|
MIRA_CONFIG_WRITE_PROTECTION_NONE | Write/erase enabled
|
◆ MiraProvisionDeviceSelectedState
Device selection states.
Enumerator |
---|
MIRA_PROV_DEVICE_NOT_SELECTED | Not selected
|
MIRA_PROV_DEVICE_SELECTED | Device selected
|
◆ MiraProvisionState
Provisioning States.
Enumerator |
---|
MIRA_PROV_UNKOWN | Unprovisioned or otherwise unknown state
|
MIRA_PROV_PROVISIONED | Provisioned state
|
MIRA_PROV_PRE_PROVISIONED | Pre-provisioned state
|
MIRA_PROV_TEMP_PRE_PROVISIONED | Temporary pre-provisioned state
|
◆ mira_provisioning_announce()
void mira_provisioning_announce |
( |
void |
| ) |
|
Makes the node announce itself by sending out a NetworkNeighborCustom message.
- Returns
- void
◆ mira_provisioning_config_data_read()
MiraConfigDataError mira_provisioning_config_data_read |
( |
uint8_t |
id, |
|
|
uint8_t |
page_number, |
|
|
uint8_t * |
data_ptr |
|
) |
| |
Get a page of configuration data.
- Parameters
-
id | configuration data block ID |
page_number | page number within the data block |
data_ptr | pointer to where data should be written. Buffer MUST be at least 32 bytes. |
- Returns
- Result code
◆ mira_provisioning_config_data_write()
MiraConfigDataError mira_provisioning_config_data_write |
( |
uint8_t |
page_number, |
|
|
uint8_t * |
data_ptr |
|
) |
| |
Write a page to a configuration block.
- Parameters
-
page_number | page number within the data block |
data_ptr | pointer to where data should be written. Data length is always 32 bytes. |
- Returns
- Result code
◆ mira_provisioning_config_data_write_cancel()
Cancel a configuration block write.
If this function is called, any data written to this page will be discarded and the old data kept.
- Returns
- Result code
◆ mira_provisioning_config_data_write_done()
Finish a configuration block write.
- Returns
- Result code
◆ mira_provisioning_config_data_write_start()
Start a configuration block write.
- Parameters
-
id | configuration data block ID |
write_protect | write protection flag |
- Returns
- Result code
◆ mira_provisioning_config_register_data_written_callback()
Register the configuration write callback.
The callback will be called whenever the configuration flash is written via radio.
- Parameters
-
callback | a function pointer to the callback function |
- Returns
- void
◆ mira_provisioning_disable_led()
void mira_provisioning_disable_led |
( |
void |
| ) |
|
Disable provisioning status LED output. Should be called before going to deep sleep to preserve battery.
- Returns
- void
◆ mira_provisioning_enable_led()
void mira_provisioning_enable_led |
( |
void |
| ) |
|
Re-enable provisioning status LED output.
- Returns
- void
◆ mira_provisioning_get_state()
Get the provisioning state.
- Returns
- The current state of the device provisioning application
◆ mira_provisioning_init()
void mira_provisioning_init |
( |
MiraGpioPorts |
provisioning_led_port, |
|
|
uint8_t |
provisioning_led_pin |
|
) |
| |
Initialize provisioning application.
- Returns
- void
◆ mira_provisioning_override_led_set_off()
void mira_provisioning_override_led_set_off |
( |
void |
| ) |
|
Override the provisioning status LED output. Force the LED to off.
- Returns
- void
◆ mira_provisioning_override_led_set_on()
void mira_provisioning_override_led_set_on |
( |
void |
| ) |
|
Override the provisioning status LED output. Force the LED to on.
- Returns
- void
◆ mira_provisioning_register_callback()
Register the provisioning state change callback.
The callback will be called every time the device is selected, deselected, or if the provisioning state changes.
- Parameters
-
callback | a function pointer to the callback function |
- Returns
- void
◆ mira_provisioning_release_overridden_led()
void mira_provisioning_release_overridden_led |
( |
void |
| ) |
|
Release control of the provisioning status LED. Used to release the LED after its state has been overridden.
- Returns
- void
◆ mira_provisioning_set_custom_data_pointer()
void mira_provisioning_set_custom_data_pointer |
( |
void * |
pointer | ) |
|
Set pointer to data block that will be return in custom neighbor responses.
The data pointed to will be returned automatically as a response to GetNeighborCustom messages.
- Parameters
-
pointer | pointer to a 42 byte data block that will be returned as response to GetNEighborCustom messages. |
- Returns
- void
◆ mira_provisioning_set_state()
Set device into a specific provisioning state.
After a state change the device will be reset for all states but MIRA_PROV_TEMP_PRE_PROVISIONED. The callback registered with mira_provisioning_register_callback will be called.
- Parameters
-
state | which state to set (MIRA_PROV_PRE_PROVISIONED is not a valid state). |
- Returns
- void
◆ mira_provisioning_set_state_temppreprovisioned()
void mira_provisioning_set_state_temppreprovisioned |
( |
| ) |
|
Sets the node into preprovisioned state.
- Returns
- void