Send string or char array and compare it on other side using Arduinoble

Hi all,

Im wanting to add some code to my central device that some what resembles security.

On both central and peripheral will be a stored string say "password"

Id like to send this to my security characteristic and then compare it with the stored value.

Is this possible? Or is there a better way?

Basically my peripheral controls a relay, but i only want that to happen if the security has been passed.

Thanks in advance

Sure it is possible. Examples exist out in the ether:

For strings:
arduino compare strings from serial - Google Search

For character arrays:
arduino compare char array - Google Search

What is the "central device"?
The "peripheral devices"?

How is the message sent? UART, I2C, SPI, ... ? wireless, wired? What comm protocol?

That depends on whether your communication channel and peripheral devices are secure. Otherwise you might want to use encryption techniques for authentication and/or communication.

Oh man, how could i leave that out.

For my project im using nano 33 ble devices.

Apologies id left out a big part of my problem,
Im using the arduinoble library and the comms between the two devices uses this.

From what ive read the nano ble doesnt support secure ble pairing so i thought using the characteristics to help authenticate.

In the real world, passwords are not stored on computers; they are stored as a hash. E.g when you login on a server, the hash of the password that was received is calculated and compared with the stored hash.

When the central connects to the peripheral you can test for the central address and if its not the correct address, you can block the relay functionality.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.