嗨对话框。
我们要控制每个特征的加密设置。
我们能控制每个特征的加密设置吗?
如果可能,它能动态切换吗?-例如,每次按键时切换设置。-
谢谢。
Hi,
I am now looking on the app_easy_timer api in SDK5. This is a very great tool - no need to think of messages, just pass a callback that you want to be called when the timer expires (Are there any javascript developers here?).
In our app we are using GAPM_USE_ENC_BLOCK_CMD and GAPM_USER_ENC_BLOCK_IND directly to encrypt some user data.
A similar api could be implemented for encrypting blocks. Unlike the timers, two encryption requests cannot run in parallel. Therefore, there should be a queue of encryption requests & callbacks (with push, pop and peek).
The function can be called:
app_easy_encrypt_block(const uint8_t *operand_1, const uint8_t *operand_2, void(*fn)(const uint8_t*))
It can either return a boolean or a uint8_t, containing an error in case of failure (for example, if the queue is full).
When the function is called, it should create a struct-element of operand_1, operand_2 and fn, and try to push it to the queue.
If the queue was empty right before this push, it means there are no parallel encryptions - the function should send a new GAPM_USER_ENC_BLOCK_CMD with operand_1 and operand_2 that were just inserted.
When a GAPM_USER_ENC_BLOCK_IND arrives, we should pop an element from the queue and save it aside in a temporary variable (an assertion should make sure that the queue was not empty).
Then, if the queue is still not empty, we should peek its head and send a new GAPM_USER_ENC_BLOCK_CMD in order to continue the encryption process.
At last, we should call the fn callback from the element that was saved aside, with the result field from the GAPM_USER_ENC_BLOCK_IND.
Let me know what you think about it,
Oren Zomer
Hi Dialog Team,
I'm afraid I haven't fully understood the BLE encryption process yet, so this might be a bit of a silly question.
I've been working off the SDK5 peripheral template, and I'm wondering whether the AES encryption is activated or not. I found the #define CFG_APP_SECURITY in the header file "da1458x_config_basic.h".
Is this the #define used to activate and deactive AES encryption?? Couldn't find anything about this in the user manuals...
Thanks for your help!