Template project main file.
More...
Template project main file.
This file contains a template for creating a new application. It has the code necessary to wakeup from button, advertise, get a connection, restart advertising on disconnect, and if no new connection created go back to system-off mode. It can easily be used as a starting point for creating a new application, the comments identified with 'YOUR_JOB' indicates where and how you can customize.
◆ advertising_start()
void advertising_start |
( |
bool |
erase_bonds | ) |
|
Function for starting advertising.
◆ assert_nrf_callback()
void assert_nrf_callback |
( |
uint16_t |
line_num, |
|
|
const uint8_t * |
p_file_name |
|
) |
| |
Callback function for asserts in the SoftDevice.
This function will be called in case of an assert in the SoftDevice.
- Warning
- This handler is an example only and does not fit a final product. You need to analyze how your product is supposed to react in case of Assert.
-
On assert from the SoftDevice, the system can only recover on reset.
- Parameters
-
[in] | line_num | Line number of the failing ASSERT call. |
[in] | file_name | File name of the failing ASSERT call. |
◆ BLE_ADVERTISING_DEF()
BLE_ADVERTISING_DEF |
( |
m_advertising |
| ) |
|
Advertising module instance.
◆ BLE_NUS_DEF()
BLE NUS service instance.
◆ BLEconnected()
bool BLEconnected |
( |
void |
| ) |
|
◆ BLEdisconnect()
void BLEdisconnect |
( |
void |
| ) |
|
◆ disableAdvOnDisconnect()
void disableAdvOnDisconnect |
( |
void |
| ) |
|
◆ enableAdvOnDisconnect()
void enableAdvOnDisconnect |
( |
void |
| ) |
|
◆ gatt_evt_handler()
void gatt_evt_handler |
( |
nrf_ble_gatt_t * |
p_gatt, |
|
|
nrf_ble_gatt_evt_t const * |
p_evt |
|
) |
| |
Function for handling events from the GATT library.
◆ gatt_init()
Function for initializing the GATT library.
◆ hallEffectInterrupt_handler()
void hallEffectInterrupt_handler |
( |
void |
| ) |
|
< Hall Effect Interrupt handler
limitSwitchBottom Interrupt handler
◆ HFCLKstart()
◆ idle_state_handle()
void idle_state_handle |
( |
void |
| ) |
|
Function for handling the idle state (main loop).
If there is no pending log operation, then sleep until next the next event occurs.
◆ limitSwitchBottom_handler()
void limitSwitchBottom_handler |
( |
void |
| ) |
|
limitSwitchTop Interrupt handler
◆ limitSwitchTop_handler()
void limitSwitchTop_handler |
( |
void |
| ) |
|
TMP117 Alert Interrupt handler.
◆ main()
Function for application main entry.
◆ menu_handler()
void menu_handler |
( |
ble_evt_t const * |
p_evt | ) |
|
Function for handling data received to the application.
◆ motionSensorInterrupt_handler()
void motionSensorInterrupt_handler |
( |
void |
| ) |
|
◆ NRF_BLE_GATT_DEF()
NRF_BLE_GATT_DEF |
( |
m_gatt |
| ) |
|
◆ NRF_BLE_QWR_DEF()
NRF_BLE_QWR_DEF |
( |
m_qwr |
| ) |
|
Context for the Queued Write module.
◆ nus_send()
< End of array
< Set dataPkg to 0
◆ pm_evt_handler()
void pm_evt_handler |
( |
pm_evt_t const * |
p_evt | ) |
|
Function for handling Peer Manager events.
- Parameters
-
[in] | p_evt | Peer Manager event. |
◆ readTMP117()
<Temperature register within TMP117
◆ sleep_mode_enter()
void sleep_mode_enter |
( |
void |
| ) |
|
Function for putting the chip into sleep mode.
- Note
- This function will not return.
◆ stopAdvertising()
void stopAdvertising |
( |
void |
| ) |
|
◆ TMP_temp_Alert_Interrupt_handler()
void TMP_temp_Alert_Interrupt_handler |
( |
void |
| ) |
|
MotionSensor Interrupt handler.
◆ uart_event_handle()
void uart_event_handle |
( |
app_uart_evt_t * |
p_event | ) |
|
Function for handling app_uart events.
This function will receive a single character from the app_uart module and append it to a string. The string will be be sent over BLE when the last character received was a 'new line' '
' (hex 0x0A) or if the string has reached the maximum data length.
< Go to failure state to change LED to RED and 'float to surface'
< Go to failure state to change LED to RED and 'float to surface'
◆ currentMenu
◆ fsm
◆ getValue
Menu is waiting for value from BLE application.
◆ mission
◆ motorStopped
bool motorStopped = false |
Flag to signal if motor is stopped or need to be stopped.
◆ sendNUS
Flag to signal Nordic UART Service to send data.
◆ transferDataFlag
bool transferDataFlag = false |
Menu is in the process of transfering data to BLE application.
◆ updateFSM
Init to true in order to access state machine.