I have a application which can enable and disable the softdevice.
I need the softdevice only to send some informations, after the sending the stack will be disabled.
The thing is, when I re-enable the softdevice, all informations are 0x00.
static void triggerbox_links(ble_TRIGGERBOX_t *p_TRIGGERBOX, uint8_t byte_1, uint8_t byte_2, uint8_t byte_3, uint8_t byte_4, uint8_t byte_5,
uint8_t byte_6, uint8_t byte_7, uint8_t byte_8, uint8_t byte_9, uint8_t byte_10,
uint8_t byte_11, uint8_t byte_12, uint8_t byte_13, uint8_t byte_14, uint8_t byte_15,
uint8_t byte_16)
{
byte1L = byte_16;
byte2L = byte_15 << 8;
byte3L = byte_14 << 16;
byte5L = byte_12;
byte6L = byte_11 << 8;
byte7L = byte_10 << 16;
byte9L = byte_8;
byte10L = byte_7 << 8;
byte11L = byte_6 << 16;
byte13L = byte_4;
byte14L = byte_3 << 8;
byte15L = byte_2 << 16;
running_mode = 0; //turn ble stack of
}
So I did a function which will update my information and this function will be called after the ble stack is disabled:
static void update_values(void)
{
first_trigger_links = byte1L+byte2L+byte3L;
second_trigger_links = byte5L+byte6L+byte7L;
third_trigger_links = byte9L+byte10L+byte11L;
fourth_trigger_links = byte13L+byte14L+byte15L;
}
But first_trigger_links will still be cleaned when I re-initialize the ble stack.
How is that possible? Because this function will only be called when the ble stack is not active.
And the data is available when the softdevice is disabled.
How can the data be cleaned when I initialize the ble stack??